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

Jason Aeschliman j.aeschliman at gmail.com
Wed Aug 1 12:32:07 PDT 2012


this may help:

(defun compare (x y)
  (list x y (eq x y) (equal x y) (equalp x y)))

(let* ((x (gensym))
       (y (read-from-string (prin1-to-string x))))
  (list   (compare x x)
  (compare x y)))


On Wed, Aug 1, 2012 at 3:28 PM, Ron Garret <ron at flownet.com> wrote:

>
> 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
>
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.clozure.com/pipermail/openmcl-devel/attachments/20120801/9a56b9ea/attachment.htm>


More information about the Openmcl-devel mailing list