[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Elisp string function question
From: |
Robert Pluim |
Subject: |
Re: Elisp string function question |
Date: |
Fri, 18 Jun 2021 15:32:19 +0200 |
>>>>> On Fri, 18 Jun 2021 15:36:25 +0300, Eli Zaretskii <eliz@gnu.org> said:
>> Date: Fri, 18 Jun 2021 14:18:07 +0200
>> From: Ergus <spacibba@aol.com>
>>
>> I just tried and this:
>>
>> (string-empty-p nil)
>>
>> returns nil. But nil is not an non-empty string. This forces to add some
>> extra checks when using this function.
>>
>> Is this intended?
Eli> Not clear. string-empty-p follows the examples of string=, which
Eli> allows symbols as arguments (and uses their name).
Then itʼs buggy:
(let ((s (make-symbol "")))
(string-empty-p s))
=> t
Eli> I suggest to report a bug about this, because at the very least the
Eli> doc string should mention this.
(stringp nil) => nil
so the answer to the question "is this the empty string" is no.
Robert
--
Re: Elisp string function question, Stefan Monnier, 2021/06/18
Re: Elisp string function question, Michael Heerdegen, 2021/06/18
Re: Elisp string function question, Emanuel Berg, 2021/06/18