I'm trying to use unquote-splicing to turn the list '(1 (2 3)) into '(1 2 3). This works: arc> `(1 ,@'(2 3))
(1 2 3)
But this doesn't: 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)))))"
Can anyone shed light on this?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: not-arc> `,@'(a b c)
a b c
Which seems problematic, although I'm not exactly sure why. Does this have to do with it? |