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

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

Re: intern vs. make-symbol


From: tom . capey
Subject: Re: intern vs. make-symbol
Date: Sun, 10 Feb 2013 12:46:06 -0800 (PST)
User-agent: G2/1.0

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 via email to

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