Open
Description
Here's a simplified example in Common Lisp of what I'm trying to do.
* (let ((foo 2)) (eval `(let ((foo 1)) (eval `(print ,foo)))))
1
1
* (let ((foo 2)) (eval `(let ((foo 1)) (eval `(print ,,foo)))))
2
2
The equivalent in mal:
user> (let* [foo 2] (eval `(let* [foo 1] (eval `(prn ~foo)))))
2
nil
user> (let* [foo 2] (eval `(let* [foo 1] (eval `(prn ~~foo)))))
[long traceback omitted]
Exception: 'unquote' not found
The first case gets the wrong value at the wrong time. And the second case just fails altogether. Nested quasiquotes are not unusual in macros, but I can't seem to make them work in mal. Is there a different syntax for this I'm not seeing?
I've tested this in the python implementation, but since the code seems to follow the guide, I have to assume it's broken in the other implementations too.
Metadata
Metadata
Assignees
Labels
No labels