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

Ron Garret ron at flownet.com
Wed Aug 1 12:28:21 PDT 2012


On Aug 1, 2012, at 12:22 PM, Taoufik Dachraoui wrote:

> Ok thanks
> 
> I solved the problem by doing using (intern (symbol-name (gensym))) instead of (gensym)
> 
> I did not know that the generated symbols do not belong to any package:
> 
> (symbol-package '#:G34159)
> > NIL

RTFM.

http://clhs.lisp.se/Body/f_gensym.htm

You might also want to take a look at GENTEMP.

> 
> Is there any reason for this? because usually a symbol is interned in the current package

Not when you make it with GENSYM (which uses MAKE-SYMBOL)  The Lisp reader interns symbols in the current package, but MAKE-SYMBOL doesn't.

You really should read the paper I pointed you to.  All of it.

rg




More information about the Openmcl-devel mailing list