|I'm trying to use unquote-splicing to turn the list '(1 (2 3)) into '(1 2 3). This works:|
But this doesn't:
arc> `(1 ,@'(2 3))
(1 2 3)
Can anyone shed light on this?
arc> (list 1 `,@'( 2 3))
Error: "unquote-splicing: invalid context within quasiquote
at: (unquote-splicing (ar-nil-terminate (quote (2 3 . nil))))
in: (quasiquote (unquote-splicing (ar-nil-terminate (quote
(2 3 . nil)))))"
Update: I thought about this more and can sort of see the sense in it. quasiquote needs to be on an outer list so that unquote-splicing has something to splice into. Otherwise you could do:
Which seems problematic, although I'm not exactly sure why. Does this have to do with it?
not-arc> `,@'(a b c)
a b c