unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Robert Weiner <rsw@gnu.org>
To: Lars Ingebrigtsen <larsi@gnus.org>
Cc: 44365@debbugs.gnu.org
Subject: bug#44365: 27.1; intern-soft given a symbol never returns nil
Date: Sun, 1 Nov 2020 08:55:57 -0500	[thread overview]
Message-ID: <CA+OMD9go2+nFe=DfrNDKwEm9SRY46od8d-rj9C7YBwWjp3vpLQ@mail.gmail.com> (raw)
In-Reply-To: <87blghcizx.fsf@gnus.org>

[-- Attachment #1: Type: text/plain, Size: 1269 bytes --]

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
>

[-- Attachment #2: Type: text/html, Size: 2678 bytes --]

  reply	other threads:[~2020-11-01 13:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-01  5:04 bug#44365: 27.1; intern-soft given a symbol never returns nil Robert Weiner
2020-11-01 13:19 ` Lars Ingebrigtsen
2020-11-01 13:55   ` Robert Weiner [this message]
2020-11-01 14:09     ` Lars Ingebrigtsen
2020-11-01 14:27       ` Philipp Stephani
2020-11-01 14:31       ` Philipp Stephani
2020-11-01 14:20     ` Andreas Schwab

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CA+OMD9go2+nFe=DfrNDKwEm9SRY46od8d-rj9C7YBwWjp3vpLQ@mail.gmail.com' \
    --to=rsw@gnu.org \
    --cc=44365@debbugs.gnu.org \
    --cc=larsi@gnus.org \
    --cc=rswgnu@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).