[Top][All Lists]

[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 <> said:

    >> Date: Fri, 18 Jun 2021 14:18:07 +0200
    >> From: Ergus <>
    >> 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.


reply via email to

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