don't allow redefining reader labels

Fixes issue #337.
This commit is contained in:
Alex Shinn 2016-05-16 22:56:51 +09:00
parent 8a8705693e
commit 1e76e39b9a

View file

@ -320,7 +320,10 @@
((#\0 #\1 #\2 #\3 #\4 #\5 #\6 #\7 #\8 #\9)
(let* ((str (read-label '()))
(n (string->number str)))
(if (not n) (read-error "read error: invalid reference" str))
(if (not n)
(read-error "read error: invalid reference" str))
(if (assv n shared)
(read-error "read error: duplicate label" str))
(cond
((eqv? #\= (peek-char in))
(read-char in)