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

Taoufik Dachraoui dachraoui.taoufik at gmail.com
Wed Aug 1 12:41:26 PDT 2012


But what to do then? I want to generate *fresh* symbols and in the same time
I need to compare the symbol names

Kind regards
Taoufik


On Wed, Aug 1, 2012 at 9:31 PM, Joshua TAYLOR <joshuaaaron at gmail.com> wrote:

> 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/
> _______________________________________________
> 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/5eff4799/attachment.htm>


More information about the Openmcl-devel mailing list