On Sun, Aug 24, 2014 at 7:47 AM, Alexander Burger <a...@software-lab.de> wrote:
>> <pelletier.mic...@gmail.com> wrote:
>> > If NIL doesn't exist at all, then why do you need to expose it? If
>> > you language exposes lists or strings then empty ones carry the same
>> > meaning.
>> I don't want to expose it.
>> Sorry, maybe I wasn't clear enough.
>> In particular, I'd like my users to type in a REPL "",
>> and see the result "", not NIL.
> Well, as Michel said, then it is easy, isn't it? You just change the
> print routine to output '""' instead of 'NIL'.
Now I understand this answer. Thanks Michel.
BTW, are you the author of the book Delphi5?
> Concerning your original question:
> NIL representing the empty string seems so natural to me, that I never
> thought much about it, and have difficulties to imagine a life without
> it ;)
> A few points about the background come to mind, though:
> * It wouldn't work smoothly in conditionals any longer ('cond', 'if',
> 'and', 'or' etc.)
> * It would take up space in property-lists and in the database
> * If the empty string were a transient symbol, it would no longer be
> uniqe, and '==', 'memq', 'asoq', 'throw' etc. cannot be used on it
> What type of object would '""' be? Not an internal symbol, as the double
> quotes point to a transient symbol. Transient symbols without name are
> anonymous symbols, however, which are created with 'new' and 'box', and
> which print as something like '$177702023320760'. If you print them all
> as '""', anynymous symbols cannot be distinguished any longer, e.g.
> during debugging, and some tools like 'edit' would not be able to handle
Thanks, this is the kind of info I was asking for.
http://profgra.org/lycee/ (site pro)
http://delicious.com/profgraorg (liens, favoris)