You all know the story: programmer reads other people's code, programmer sees symbol they don't understand, Google fails them because it's difficult to search for non-alphanumeric symbols.
This time it's the @
symbol, which seems to be used to inject the contents of one list into the middle of another. For instance:
`(5 6 7 ,@'(8 9) 10 11)
;=> (5 6 7 8 9 10 11)
I'm comfortable with this usage, but I'm wondering whether I understand the behavior of @
correctly? Does it have other uses? And what causes the error in the following transcript (from CLISP)?
[1]> (list 1 2 3 4 @'(5 6 7))
*** - SYSTEM::READ-EVAL-PRINT: variable @ has no value
Lastly, what exactly is @
? It doesn't seem to be a function:
[3]> (print #'@)
*** - FUNCTION: undefined function @
I'm guessing it's a fundamental syntax like the backquote (`
), or comma (,
). Is this correct? Sorry if this is a duplicate, but once again, as far as I know it's impossible to search for @
.
Lisp "at sign"
. – Conversationalist