all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: tom.capey@gmail.com
To: gnu.emacs.help@googlegroups.com
Cc: help-gnu-emacs@gnu.org
Subject: Re: intern vs. make-symbol
Date: Sun, 10 Feb 2013 12:46:06 -0800 (PST)	[thread overview]
Message-ID: <79e0cbc4-0e3b-427e-8a44-b7e98bd34e20@googlegroups.com> (raw)
In-Reply-To: <mailman.19532.1360525339.855.help-gnu-emacs@gnu.org>

On Sunday, February 10, 2013 7:42:01 PM UTC, Thorsten Jolitz wrote:
> Hi List,

> assume org-babel-load-languages is similar to:

> ,-------------------------------
>
> | ((emacs-lisp . t) (python . t))
>
> `-------------------------------

> Shouldn't this

> ,------------------------------------------------------
>
> | (assq (intern "emacs-lisp") org-babel-load-languages)
>
> | (emacs-lisp . t)
>
> `------------------------------------------------------

> and this

> ,--------------------------------------------------
>
> | (assq (eval `(quote ,(make-symbol "emacs-lisp")))
>
> |       org-babel-load-languages)
>
> | nil
>
> `--------------------------------------------------

> give the same results - and why isn't this so?


  They do different things.  Try these:

(eql (make-symbol "emacs-lisp")
     (make-symbol "emacs-lisp"))

=> nil

(eql (intern "emacs-lisp")
     (intern "emacs-lisp"))

=> t

`make-symbol' "[r]eturn[s] a newly allocated uninterned symbol whose name is NAME.
Its value and function definition are void, and its property list is nil."

`intern' "[r]eturn[s] the canonical symbol whose name is STRING.
If there is none, one is created by this function and returned.
A second optional argument specifies the obarray to use;
it defaults to the value of `obarray'."

/Tom
-- 



       reply	other threads:[~2013-02-10 20:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.19532.1360525339.855.help-gnu-emacs@gnu.org>
2013-02-10 20:46 ` tom.capey [this message]
2013-02-10 19:42 intern vs. make-symbol Thorsten Jolitz
2013-02-11  1:33 ` Stefan Monnier
2013-02-11  1:42   ` Thorsten Jolitz

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

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

  git send-email \
    --in-reply-to=79e0cbc4-0e3b-427e-8a44-b7e98bd34e20@googlegroups.com \
    --to=tom.capey@gmail.com \
    --cc=gnu.emacs.help@googlegroups.com \
    --cc=help-gnu-emacs@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.