help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Elisp string function question


From: Michael Heerdegen
Subject: Re: Elisp string function question
Date: Sat, 19 Jun 2021 02:24:28 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Ergus <spacibba@aol.com> writes:

> 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? 

BTW, I'm just curious: If this was changed to return non-nil and
somebody in the future would ask

> I just tried and this:
>
> (string-empty-p nil) returns t. But nil is not an empty
> string.

what would you respond?  This is not a trick question, because the
predicate can be used to test for an empty as well as for an non-empty
string.

And if `string-empty-p' would be changed to error for symbol arguments,
this would still require extra tests to avoid that error.  So how would
you change things for the better?

Michael.




reply via email to

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