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

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

bug#44365: 27.1; intern-soft given a symbol never returns nil


From: Robert Weiner
Subject: bug#44365: 27.1; intern-soft given a symbol never returns nil
Date: Sun, 1 Nov 2020 08:55:57 -0500

Hi Lars:

I would have only sent intern-soft a string if it were not for the doc string which says it takes a string or a symbol.

"Return the canonical symbol named NAME, or nil if none exists.
NAME may be a string or a symbol.  If it is a symbol, that exact
symbol is searched for."

So, the doc string must need changing if your view is correct.

Bob

On Sun, Nov 1, 2020 at 8:19 AM Lars Ingebrigtsen <larsi@gnus.org> wrote:
Robert Weiner <rsw@gnu.org> writes:

> If I first call intern-soft with the symbol-name of an unbound symbol,
> then it returns nil properly.  But if I instead give intern-soft the
> symbol, it always returns the symbol rather than nil.  Maybe it
> is because the internal call to symbol-name interns the symbol before it can test
> whether it is bound.  Isn't this a bug?

So your test case is

(intern-soft 'does-not-exist)

?

That's not a valid use case for the function -- the reader will intern
`does-not-exist', and so the `intern-soft' call will just return the
interned symbol.  The function is meant to be used like:

(intern-soft "does-not-exist")

So I'm closing this bug reprt.

--
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no

reply via email to

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