[Openmcl-devel] (equal '#:G34159 '#:G34159) -> NIL

Joshua TAYLOR joshuaaaron at gmail.com
Wed Aug 1 12:31:24 PDT 2012


On Wed, Aug 1, 2012 at 3:22 PM, Taoufik Dachraoui
<dachraoui.taoufik at gmail.com> wrote:
> Ok thanks
>
> I solved the problem by doing using (intern (symbol-name (gensym))) instead
> of (gensym)

The purpose of gensym is to produce *fresh* symbols. If you do
something like what you've proposed though, though, you're not
guaranteed to get fresh (not eq to any existing symbol) symbols (this
example is under SBCL, but similar things will work in other lisps):

* (gensym)
#:G737

* (let ((x 'g738))
    (eq x (intern (symbol-name (gensym)))))
T

//JT
-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/



More information about the Openmcl-devel mailing list