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

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

Re: comparing symbols coming from gensym?


From: N. Raghavendra
Subject: Re: comparing symbols coming from gensym?
Date: 24 Aug 2005 14:30:26 +0530
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3

At 2005-08-23T23:50:46-05:00, Joe Corneli wrote:

> Why is it that
> 
> (setq a (gensym)) ;=> G2007
> a                 ;=> G2007
> (equal a 'G2007)  ;=> nil

Perhaps this is because `a' is an uninterned symbol --- see
`(elisp)Creating Symbols' --- while `G2007' is an interned symbol.
(`gensym' creates an uninterned symbol.)

ELISP> (intern-soft a)
nil
ELISP> (intern-soft 'G55817)
G55817

> while 
> 
> (setq a 'foo)    ;=> foo
> a                ;=> foo
> (equal a 'foo)   ;=> t

In this case, both `a' and `foo' are interned.

ELISP> (intern-soft a)
foo
ELISP> (intern-soft 'foo)
foo

Raghavendra.

-- 
N. Raghavendra <raghu@mri.ernet.in> | See message headers for contact
Harish-Chandra Research Institute   | and OpenPGP details.


reply via email to

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