Re: Why not a setf-able NIL ?
- From: Pascal Costanza <pc@xxxxxxxxx>
- Date: Wed, 01 Oct 2008 15:26:04 +0200
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/
.
- Follow-Ups:
- Re: Why not a setf-able NIL ?
- From: kodifik
- Re: Why not a setf-able NIL ?
- References:
- Why not a setf-able NIL ?
- From: kodifik
- Why not a setf-able NIL ?
- Prev by Date: Re: Lisp Design Patterns
- Next by Date: Re: Why not a setf-able NIL ?
- Previous by thread: Re: Why not a setf-able NIL ?
- Next by thread: Re: Why not a setf-able NIL ?
- Index(es):
Relevant Pages
|