About single quote, and double parentheses
Posted: Sat Nov 17, 2018 7:13 pm
I'm reading "Common Lisp Recipes", within the book, there is an example as below:
Please explain to me:
- why do we need a single quote before (let ...), as in : '(let ((temp, var-1)) )
- and, why do we need double Parentheses after let, as in: let ((temp,var-1))
- and, why there is a single comma after setf, as in: setf ,var-1, var-2
I had read document online about usage of single quote, and parentheses but the information they provided could not help me to explain the usage in this situation.
Below is the code:
Please explain to me:
- why do we need a single quote before (let ...), as in : '(let ((temp, var-1)) )
- and, why do we need double Parentheses after let, as in: let ((temp,var-1))
- and, why there is a single comma after setf, as in: setf ,var-1, var-2
I had read document online about usage of single quote, and parentheses but the information they provided could not help me to explain the usage in this situation.
Below is the code:
Code: Select all
(defmacro swap (var-1 var-2)
'(let ((temp, var-1))
(setf ,var-1, var-2
,var-2 temp)
(values) ))