Is there a difference between ,. and ,@?
Thanx!
Thanx!
Discuss and learn Lisp programming of all dialects
This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.
3 posts · 3449 views
? '`(foo ,@bar)
(LIST* 'FOO BAR)
? '`(foo ,.bar)
(LIST* 'FOO BAR)
? '`(foo ,@bar ,baz)
(LIST* 'FOO (APPEND BAR (LIST BAZ)))
? '`(foo ,.bar ,baz)
(LIST* 'FOO (NCONC BAR (LIST BAZ)))
In the first two forms, ",." versus ",@" makes no difference because the BAR is in the tail position. But in the latter two forms, ",@" uses APPEND and ",." uses NCONC. The destructive version would be okay if you knew the list being spliced was safe to modify—i.e. without trampling on somebody else's data.