Eclector icon indicating copy to clipboard operation
Eclector copied to clipboard

QUASIQUOTE can't handle circular lists

Open Bike opened this issue 6 years ago • 2 comments

Macroexpansion of (quasiquote #1=(#1#)) dies. This is because expand immediately calls itself on the car and cdr of its argument if given a cons.

I suppose it's debatable whether quasiquote should be able to handle this, but we ran into it due to some code in the Alexandria tests: https://github.com/keithj/alexandria/blob/0426bd2fae19ae0492d44407f17ac1005196c9c3/tests.lisp#L677 (i mean, maybe. The path from that code to the crash is not totally clear yet, and there's no obvious backquoting there.)

Clasp issue: https://github.com/clasp-developers/clasp/issues/885

Bike avatar Dec 09 '19 23:12 Bike

The alexandria test is probably hitting a problem in CST.

But yes, (quasiquote #1=(#1#)) could work since it is basically just '#1=(#1#). Introducing unqoute within the circular part would be too hard to understand for me.

scymtym avatar Dec 10 '19 13:12 scymtym