Skip to content

Duplicate identifier in expansion #203

@samdphillips

Description

@samdphillips

This program expands to a duplicate identifier error. Removing qi/list from the requires expands successfully.

#lang racket

(require qi qi/list)

(define ((get-ith v) i)
  (vector-ref v i))

(define-qi-syntax-rule (sum)
  (~> (-< (~> get-ith (as ref))
          (~> vector-length (as nrows)))
      (range 0 nrows)
      (map ref)
      (foldl + 0)))

(define x (for/vector ([i (in-range 10)]) (random)))
(~> (x) (sum))
let: duplicate identifier
  at: nrows
  in: (let ((nrows undefined) (ref undefined) (nrows undefined) (ref undefined) (nrows undefined) (ref undefined) (nrows undefined) (ref undefined)) (qi0->racket (thread (tee (thread (esc (#%host-expression get-ith)) (thread (esc (λ (ref2) (set! ref ref...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions