3 ms·
It doesn't. Common lisp is a lisp-2, which means that there are 2 namespaces: one for functions and one for variables. (Technically there are quite a bit more
by moonchild 6y ago
It doesn't. Common lisp is a lisp-2, which means that there are 2 namespaces: one for functions and one for variables. (Technically there are quite a bit more, but that's beside the point.)
Which means that you can do this:
(let ((- 5)) ; bind the '-' variable to 5
(- ; call the '-' function
- ; on the '-' variable
17)) ; and the number 17
; this evaluates to -12
- ScottBurson 6y agoYou can. But you shouldn't :-)
- lispm 6y agothis is also possible... CL-USER 5 > (- 1 2 3 4 (third -)) -10
- kazinator 6y agoThis is a non-issue for all Lisps, not all of which are Lisp-2. Your code doesn't seem like a very good idea, even though it is legal.
- moonchild 6y ago> Your code doesn't seem like a very good idea Why not? I usually use an 'anaphoric if' macro that binds - to the given value. It seems more clearly 'special' than a name like 'it'—which seems like the canonical name—closer to the perl/raku $_.