Subject: Re: gensym vs make-symbol [was: Re: newbie: please don't smash my case ]
From: Erik Naggum <erik@naggum.net>
Date: 2000/07/12
Newsgroups: comp.lang.lisp
Message-ID: <3172397911664803@naggum.net>

* lnp@healy.washington.dc.us
| Though I could get away with make-symbol in some spots, gensym is
| necessary for reasons elaborated previously in this thread.

  Huh?  To code, there is no difference between using make-symbol and
  gensym.  And if you compare uninterned symbols with string=, you're
  doing it the wrong way, anyway.  You have to do the same thing the
  cirularity detector in the printer is doing it, except you get away
  with a single pass.

| What I've come up with is using *gensym-counter*.  Prior to each
| top-level expansion, bind this to the same fixed value.  Each
| expansion should produce the same thing, no?

  No, the gensym'ed symbols are still unique to each invocation.
  That's the whole point.

| Are there any flaws in my reasoning?

  Yes, you have not understood what an uninterned symbol is.  They are
  symbols, and as such eq if you have more of the same, but they are
  _not_ the same symbol just because they print the same.

(eq '#:foo '#:foo)
=> nil

(eq 'foo 'foo)
=> t

(string= '#:foo '#:foo)
=> t

(eq (symbol-name '#:foo) (symbol-name '#:foo))
=> <unspecified>

(eq '#1=#:foo '#1#)
=> t

#:Erik
-- 
  If this is not what you expected, please alter your expectations.