hy
hy copied to clipboard
Trouble with `defreader` inside other forms
Consider
(do
(defreader r 5)
(print #r))
The result is LexException: reader macro '#r' is not defined
. Perhaps defreader
shouldn't be legal here in the first place, but what's checked in defreader
is whether we're in the global scope, which we clearly are. What's more, that check doesn't seem to work, because the same error message as above is produced when you use a defn
instead of do
.