Page 1 of 1
macro / backquote notation
Posted: Sun Jul 07, 2013 5:52 am
by filfil
Hi,
I've found an expression like this
that is seems, evaluating, the same of
I've never seen or read about [,.]: is that anything different with [,@]?
Thanks
filfil
Re: macro / backquote notation
Posted: Sun Jul 07, 2013 6:30 am
by Goheeca
Yes, comma-dot operates
destructively with the form which is unquoted by that. Look at this SBCL session:
Code: Select all
* (defvar *a* (list 'a 'b 'c))
*A*
* `(1 2 3 ,@*a* 4 5 6)
(1 2 3 A B C 4 5 6)
* *a*
(A B C)
* `(1 2 3 ,.*a* 4 5 6)
(1 2 3 A B C 4 5 6)
* *a*
(A B C 4 5 6)
*
Re: macro / backquote notation
Posted: Sun Jul 07, 2013 6:39 am
by filfil
Thank you very much!
Re: macro / backquote notation
Posted: Mon Jul 08, 2013 7:54 pm
by findinglisp
filfil, was the usage you found in performance critical code, or just a macro expander? If the latter, it seems like a false economy. Better to use ,@ and avoid the possibility of bugs caused by destructively modifying the following form, IMO. Generally, if your macro expander runs incrementally slower, you simply won't notice or care.
Re: macro / backquote notation
Posted: Mon Jul 08, 2013 11:20 pm
by filfil
It's a macroexpander.Thank you for the warning!