check for identifier (fixes #15)

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

@ -23,9 +23,11 @@
(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])
(when (and bound-id (not (identifier? bound-id)))
(raise-argument-error 'generate-bound-and-unbound-literals "identifier" bound-id))
(define literals (for/list ([literal (in-list (generate-literals pats))] (define literals (for/list ([literal (in-list (generate-literals pats))]
; the bound-id should not appear in any literal list ; the bound-id should not appear in any literal list
#:unless (bound-identifier=? literal bound-id)) #:unless (and bound-id (bound-identifier=? literal bound-id)))
literal)) 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)

Loading…
Cancel
Save