duplicate labels only forbidden for definition, not referencing

This commit is contained in:
Alex Shinn 2016-05-16 23:25:52 +09:00
parent 1e76e39b9a
commit c1e7e1f23a

View file

@ -322,10 +322,10 @@
(n (string->number str))) (n (string->number str)))
(if (not n) (if (not n)
(read-error "read error: invalid reference" str)) (read-error "read error: invalid reference" str))
(if (assv n shared)
(read-error "read error: duplicate label" str))
(cond (cond
((eqv? #\= (peek-char in)) ((eqv? #\= (peek-char in))
(if (assv n shared)
(read-error "read error: duplicate label" str))
(read-char in) (read-char in)
(let* ((cell (list #f)) (let* ((cell (list #f))
(thunk (lambda () (car cell)))) (thunk (lambda () (car cell))))