2 ms·
the whole point of the "code is data" mantra is that it is both - the list `(1 2 3)` and the lisp code that evaluates to said list when parsed and interpreted.
by zem 1y ago
the whole point of the "code is data" mantra is that it is both - the list `(1 2 3)` and the lisp code that evaluates to said list when parsed and interpreted.
- beanjuiceII 1y agowouldn't the data version be '(1 2 3) ? sorry I am just trying to understand
- spauldo 1y agoYou're basically asking if literals are code. I imagine you'll get varied opinions about that. (And yes, that can be used unquoted in a few different contexts in Lisp, such as a special form or macro, or if you've managed to convince the reader that 1 is a function.)
- Xmd5a 1y agoUsually yes. To distinguish between lists and function calls. However if we are to pass code literals to eval, we need to quote them: =>(eval '(1 2 3)) Cannot call 1 as a function. =>(eval ''(1 2 3)) (1 2 3)