emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: proposal to make null string handling more emacs-y


From: PJ Weisberg
Subject: Re: proposal to make null string handling more emacs-y
Date: Sun, 29 Apr 2012 12:51:26 -0700

On Sunday, April 29, 2012, Andreas Röhler <address@hidden> wrote:
> Am 29.04.2012 19:08, schrieb Drew Adams:
>>>>
>>>> (string= nil "")
>>>
>>> (if ""
>>>      (message "%s" "empty string proved true")
>>>        (message "%s" "empty string proved false"))
>>> ==>  "empty string proved true"
>>
>> "" is not equal or eq or eql to nil.
>> But "" is string= to nil.
>>
>>
>
> in other words said:
>
> if the empty list is nil, why the empty string should yield true?
>
> for me
>
> (equal nil "")==> t
>
> would be plausible

Think of it as converting nil to a string when necessary.  `string=' requires strings, so nil is treated as "".  `equal' doesn't require strings, so nil is treated as nil.

--
-PJ

Gehm's Corollary to Clark's Law: Any technology distinguishable from
magic is insufficiently advanced.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]