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

Bill St. Clair wws at clozure.com
Wed Aug 1 12:25:35 PDT 2012


GENSYM is used in macros, where you want a guaranteed unique new
symbol. The name is useful for debugging, but very rarely matters. You
apparently are using gensym'd symbols for some other purpose than new
variables in a macro.

-Bill

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)
>
> I did not know that the generated symbols do not belong to any package:
>
> (symbol-package '#:G34159)
>> NIL
>
> Is there any reason for this? because usually a symbol is interned in the
> current package
>
> Kind regards
> Taoufik
>
>
> On Wed, Aug 1, 2012 at 9:07 PM, Ron Garret <ron at flownet.com> wrote:
>>
>> You should read this:
>>
>> http://www.flownet.com/ron/packages.pdf
>>
>> Particularly section 2.
>>
>> rg
>>
>> On Aug 1, 2012, at 12:03 PM, Taoufik Dachraoui wrote:
>>
>> > Hi
>> >
>> > I am having a problem with the following:
>> >
>> > ? (equal '#:G34159 '#:G34159)
>> > NIL
>> >
>> >
>> > In the program I use gensym to generate new symbols and in another
>> > function
>> > I compare the symbols for equality
>> >
>> > How do I fix this? I do not understand how come this 2 generated symbols
>> > are not equal,
>> > is this special rule for generated symbols?
>> >
>> > Kind regards
>> > Taoufik
>> >
>> > _______________________________________________
>> > 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