-
-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unexpected behaviour with nested backquotes #362
Comments
Thanks for the report. I didn't check quasiquote for quite a while, I was sure it was correct. I based the implementation on the paper "Quasiquotation in Lisp" by Alan Bawden. I need to investigate what is happening. |
There are two issues here, second call to eval throws exception in REPL and stuff after splice-splice are ignored. |
LIPS returns: ``(,@,@l ,@,@l)
(quasiquote ((unquote-splicing x y))) It should be: (quasiquote ((unquote-splicing x y) (unquote-splicing x y))) |
And there is also another bug the (define x '(1 2 3))
(define y '(11 22 33))
(define l '(x y))
(eval ``(,@,@l))
; => (1 2 3 11 22 33)
x
(1 2 3 11 22 33) |
So the actual error is StackOverflow because it creates a weird cycle. But there is also an error in (print x)
(1 2 3 . #0=(11 22 33 . #0#)) |
The issue is fixed on devel branch. It will be released in next beta version |
When experimenting with nested backquote edgecases the following forms entered into the REPL at https://lips.js.org/ seem to give wrong results:
The "should be" results were verified using Gauche v0.9.10 at https://www.tutorialspoint.com/execute_scheme_online.php
The text was updated successfully, but these errors were encountered: