3 ms·
> (1 2 3) is syntactic sugar for (cons 1 (cons 2 (cons 3 nil))) Not really. (1 2 3) is a list in Lisp. (cons 1 (cons 2 (cons 3 nil))) is code to produce a l
by lispm 7y ago
> (1 2 3) is syntactic sugar for (cons 1 (cons 2 (cons 3 nil)))
Not really.
(1 2 3) is a list in Lisp.
(cons 1 (cons 2 (cons 3 nil))) is code to produce a list.
if we have
(append '(1 2 3)
(cond 1 (cons 2 (cons 3 nil))))
The first is a literal list and the second one is code, which produces a list at some point in time - maybe at runtime.