Why not a setf-able NIL ?
- From: kodifik@xxxxxxxxxxxxx
- Date: Wed, 1 Oct 2008 02:35:15 -0700 (PDT)
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.
.
- Follow-Ups:
- Re: Why not a setf-able NIL ?
- From: André Thieme
- Re: Why not a setf-able NIL ?
- From: Tayssir John Gabbour
- Re: Why not a setf-able NIL ?
- From: Pascal Costanza
- Re: Why not a setf-able NIL ?
- From: Joshua Taylor
- Re: Why not a setf-able NIL ?
- From: Matthias Buelow
- Re: Why not a setf-able NIL ?
- From: Alex Mizrahi
- Re: Why not a setf-able NIL ?
- From: Rainer Joswig
- Re: Why not a setf-able NIL ?
- From: John Thingstad
- Re: Why not a setf-able NIL ?
- Prev by Date: Re: compiling a Lisp source to exe
- Next by Date: Re: Why not a setf-able NIL ?
- Previous by thread: Roadmap: cl-net-snmp 5.x and 6.0
- Next by thread: Re: Why not a setf-able NIL ?
- Index(es):
Relevant Pages
|