omit bound id from generated literals (fixes #14)

v6.3-exception
Matthew Butterick 7 years ago
parent 4bea7423b1
commit 33acb10b31

@ -23,7 +23,10 @@
(define (generate-bound-and-unbound-literals pats #:treat-as-bound [bound-id #f]) (define (generate-bound-and-unbound-literals pats #:treat-as-bound [bound-id #f])
(define literals (generate-literals pats)) (define literals (for/list ([literal (in-list (generate-literals pats))]
; the bound-id should not appear in any literal list
#:unless (bound-identifier=? literal bound-id))
literal))
(define-values (bound-literals unbound-literals) (define-values (bound-literals unbound-literals)
(partition (λ (i) (or (identifier-binding i) (partition (λ (i) (or (identifier-binding i)
(and bound-id (bound-identifier=? i bound-id)))) literals)) (and bound-id (bound-identifier=? i bound-id)))) literals))

Loading…
Cancel
Save