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: Drew Adams
Subject: RE: comparing symbols coming from gensym?
Date: Wed, 24 Aug 2005 08:48:12 -0700

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

Perhaps because gensym, like make-symbol, doesn't intern the symbol it
creates? The reader interns `foo' in (setq a 'foo). So, they are different
symbols: one is interned in obarray; the other is an uninterned symbol.





reply via email to

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