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

Ron Garret ron at flownet.com
Wed Aug 1 12:49:26 PDT 2012


Try STRING= or STRING-EQUAL.  (They work on symbols too, not just strings.)

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

> 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
> 
> _______________________________________________
> Openmcl-devel mailing list
> Openmcl-devel at clozure.com
> http://clozure.com/mailman/listinfo/openmcl-devel




More information about the Openmcl-devel mailing list