From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: John Mastro Newsgroups: gmane.emacs.help Subject: Re: Applying intern-soft to a symbol Date: Mon, 24 Apr 2017 10:41:43 -0700 Message-ID: References: <87fugxkfns.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1493055752 7405 195.159.176.226 (24 Apr 2017 17:42:32 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 24 Apr 2017 17:42:32 +0000 (UTC) Cc: "N. Raghavendra" To: "help-gnu-emacs@gnu.org" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 24 19:42:28 2017 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d2i0J-0001oT-9P for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 19:42:27 +0200 Original-Received: from localhost ([::1]:45271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2i0O-0002k7-PM for geh-help-gnu-emacs@m.gmane.org; Mon, 24 Apr 2017 13:42:32 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53634) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d2hzx-0002k1-Qc for help-gnu-emacs@gnu.org; Mon, 24 Apr 2017 13:42:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d2hzx-0006pl-0U for help-gnu-emacs@gnu.org; Mon, 24 Apr 2017 13:42:05 -0400 Original-Received: from mail-qt0-x22d.google.com ([2607:f8b0:400d:c0d::22d]:33307) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d2hzw-0006p7-SP for help-gnu-emacs@gnu.org; Mon, 24 Apr 2017 13:42:04 -0400 Original-Received: by mail-qt0-x22d.google.com with SMTP id m36so120082414qtb.0 for ; Mon, 24 Apr 2017 10:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=1fmbhPhx5H8u/4/DNoD4DE2oYR79N9EUz1OQnEXpM5c=; b=NscQEmIGFtoNg/0fOWAZpHNuAtup8EqYQiaWUYHCG5vAwNvE9zN/wWnsDPMG72WnWk B2kjfQdvCXNDiFWdZxsevg1i8WQ3938mx2TJ19LP5/yLNt//cBm401kLkSb8USVB+Sty c6+9VmCZnQxNBBBC5LMxxNn96LITy8CO9HRHBvKz9Y0xP43ziopGBTtAZEI7qhMBwhSE J26DgG2GUisvhSjKTs4GehDIv6uj7+cDb5z2+TcMhALle7YEPofBiiLDzLsGEtEP+dtV KAZYnvFH3ZnHhl4HQm1zRuIxuddHd6w0SZ+KhzYvU3ITCgjrB7hPQ6thIE7YBgO2j75t XDsg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=1fmbhPhx5H8u/4/DNoD4DE2oYR79N9EUz1OQnEXpM5c=; b=FyHMgzhQ3GlD4vl4Ap6F2csMaORPWqx0RuroECABf4WWj0SRM0G2T864/2gEn0NAvQ +nzGa3k/I7mE3IcOJMHxWnyZThkV8R8Jnzc9fg4Zpn3k66DvVOLC4hBNgHS9yMIqWgpe QL/awjqaBtz+sa5P5maRc1q2M/uF8rm7NBjjgQxUvoaMK6racYwl6zuTyvvAlzy+GV9r WZsaqbmKq4mtlnDoD1+xdpYTHUC+UE4GjzmbGK3cOhfoxPOk7LXkQuCkVWRYtA5AnJYT hh56CHPXcJdNuken+SgwWFC2awZTeL4O3QBFiyVsHoqLX/1ZqFkd0vdUawYvzQV/FtxK kLDA== X-Gm-Message-State: AN3rC/7nN7K1F2x/cuJ3R6WoegNMkqycUFE5s4/iPLfpIRMbAqs9IiiK Q3VDWq6QcADVISEZvXdMMMykD11I3A== X-Received: by 10.237.38.102 with SMTP id z93mr29508967qtc.292.1493055724070; Mon, 24 Apr 2017 10:42:04 -0700 (PDT) Original-Received: by 10.237.32.9 with HTTP; Mon, 24 Apr 2017 10:41:43 -0700 (PDT) In-Reply-To: <87fugxkfns.fsf@gmail.com> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c0d::22d X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:112874 Archived-At: N. Raghavendra wrote: > I am confused about the following Emacs Lisp interaction, where I've > numbered the prompts for ease of reference. > > *** Welcome to IELM *** Type (describe-mode) for help. > ELISP1> (intern-soft "quux") > nil > ELISP2> (intern-soft 'quux) > quux > ELISP3> (intern-soft "quux") > quux > ELISP4> > > As I understand, the value of ELISP1 indicates that `quux' is not an > interned symbol in the default obarray. The value of ELISP2 indicates > that `quux' is now an interned symbol in the default obarray, and the > value of ELISP3 confirms this. > > Now, the Emacs Lisp manual says the following about intern-soft: > > ---------------------------------------------------------------------- > Function: intern-soft name &optional obarray > This function returns the symbol in OBARRAY whose name is NAME, or > =E2=80=98nil=E2=80=99 if OBARRAY has no symbol with that name. Therefo= re, you can > use =E2=80=98intern-soft=E2=80=99 to test whether a symbol with a given= name is > already interned. If OBARRAY is omitted, the value of the global > variable =E2=80=98obarray=E2=80=99 is used. > > The argument NAME may also be a symbol; in that case, the function > returns NAME if NAME is interned in the specified obarray, and > otherwise =E2=80=98nil=E2=80=99. > ---------------------------------------------------------------------- > > According to the second paragraph of this description, ELISP2 should > have returned nil, because the symbol `quux' was then not interned in > the default obarray. Can someone please explain why ELISP2 returns > `quux' instead of nil? The reader interned the symbol `quux' into the default obarray while reading the expression (intern-soft 'quux). Reading occurs before evaluation, so `quux' had been interned before the actual call to `intern-soft' occurred. John