[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 16:02:07 +0200 |
>>>>> On Fri, 18 Jun 2021 16:48:18 +0300, Eli Zaretskii <eliz@gnu.org> said:
>> From: Robert Pluim <rpluim@gmail.com>
>> Cc: help-gnu-emacs@gnu.org
>> Gmane-Reply-To-List: yes
>> Date: Fri, 18 Jun 2021 15:32:19 +0200
>>
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> Is it? What is the name of the symbol created there?
The name is "", but the symbol itself has no value, so string-empty-p
should not say t
(let ((s (make-symbol "")))
(message s))
=>
Debugger entered--Lisp error: (wrong-type-argument stringp ##)
message(##)
(let ((s (make-symbol ""))) (message s))
(progn (let ((s (make-symbol ""))) (message s)))
eval((progn (let ((s (make-symbol ""))) (message s))) t)
Compare this with:
(let ((s ""))
(string-empty-p s) => t
(message "string '%s'" s)) => no complaints from 'message'
If youʼre saying this is expected, then it should *definitely* be
documented, because for me the argument to 'string-empty-p' should be
a string.
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
Re: Elisp string function question, Michael Heerdegen, 2021/06/18