Re: Why not a setf-able NIL ?



kodifik@xxxxxxxxxxxxx wrote:
As we all know, in Common Lisp logical falsehood is represented by the
non-symbolic atom NIL, which in turn happens to be also the empty list
'().
Everything not nil is true, so in lisp 0 is true.
If -however- NIL were a symbol, one could program things like (let
((nil 0)(number iterations)) (loop while number..) which would
simplify code very often, as the C dudes quickly noticed.
1- I wonder whether there is some really important (theoretical)
reason for not making NIL setf-able, aside implementation simplicity
or speed considerations (practical reasons).
Of course, the programmer would have then to keep in mind that (cons a
nil) could no longer yield (a), and things like that. In other words:
the language would be much more powerful with a redefinable falsehood,
but with greater power comes greater responsibility.
2- Actually, the very fact that the reserved word NIL exists seems to
suggest that this possibility was once regarded.


(loop until (zerop number) ...)


Pascal

--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
.



Relevant Pages

  • Re: Implementing custom containers in Lisp
    ... CMU Common Lisp 18b, running on shell.xxx.com ... distinguish between immediate values and handles to heap objects, ... *all* integers are in fact BIGNUMs or equivalent, immutable objects on ... NIL ...
    (comp.lang.lisp)
  • Re: Advice for a new lisper
    ... This is my first experience with lisp, ... (defun simplify-card (card) ... unless return nil) ...
    (comp.lang.lisp)
  • Re: can someone explain this quote by Tim Daly?
    ... What's so special about nil and in the context of being a Lisp? ... Language design based on ... nothing contrived about saying that language designers do, in fact, ...
    (comp.lang.lisp)
  • Re: Why forth is not popular
    ... >> it would be very surprising if a production-quality Lisp system ... > (cdr nil), for example. ... SEGV trap handler can be an issue again. ... Douglas Johnson, Trap Architectures for Lisp Systems, pages 79-86, ...
    (comp.lang.forth)
  • Re: Python and STL efficiency
    ... I tested in Common Lisp and compared the result with python. ... (b nil)) ... (vector-push "chicken crosses road" a) ... (vector-push "fool" a))) ...
    (comp.lang.python)