From: Jack Unrue
Subject: generating unique class names that are dumpable
Date: 
Message-ID: <5dqs02hiva7mic4ukmont78nb3m0mu7f95@4ax.com>
Hello all,

I'm computing class names in order to generate classes
via ENSURE-CLASS and my first attempt naively used
GENSYM with a prefix. When I compile code that instantiates
said classes, LispWorks 4.4.6 complains:

  Do not know how to fasl-dump #<#:EDCLASS9058 2068CC94>.
  No user-defined "make-load-form" method.

and CLISP 2.38 says:

*** - PRINT: Despite *PRINT-READABLY*, #<#:EDCLASS30185 #x19F967DD>
      cannot be printed readably.

To fix this, I am considering using my own name generator
and creating a separate package (in my library's namespace)
for those symbols to live in, but this seems like a hack.

I know about *PRINT-GENSYM* but I think I would still
need a separate package for symbols created with that
set to nil if I truly want to avoid collisions.

So I wanted to check first whether there is an
existing standard practice for generating unique
symbols that are compatible with *PRINT-READABLY*  ?

Thanks for your thoughts.

-- 
Jack Unrue

From: Pascal Bourguignon
Subject: Re: generating unique class names that are dumpable
Date: 
Message-ID: <87veuplarg.fsf@thalassa.informatimago.com>
Jack Unrue <·······@example.tld> writes:
> I'm computing class names in order to generate classes
> via ENSURE-CLASS and my first attempt naively used
> GENSYM with a prefix. When I compile code that instantiates
> said classes, LispWorks 4.4.6 complains:
> [...]
> To fix this, I am considering using my own name generator
> and creating a separate package (in my library's namespace)
> for those symbols to live in, but this seems like a hack.

There's GENTEMP, but it'd probably be better to write your own generator.

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

"Logiciels libres : nourris au code source sans farine animale."
From: Jack Unrue
Subject: Re: generating unique class names that are dumpable
Date: 
Message-ID: <t02t02prkl7g2l8ei2bsm3spc0ojd2fo3i@4ax.com>
On Wed, 08 Mar 2006 07:18:43 +0100, Pascal Bourguignon <······@informatimago.com> wrote:
>
>There's GENTEMP, but it'd probably be better to write your own generator.

Thanks, Pascal. I had somehow missed GENTEMP but I think
you're right -- I see that the CLHS says it is deprecated
(and CLISP warns that symbols created with it can't be GC'd).

-- 
Jack Unrue
From: Pascal Bourguignon
Subject: Re: generating unique class names that are dumpable
Date: 
Message-ID: <8764mps3op.fsf@thalassa.informatimago.com>
Jack Unrue <·······@example.tld> writes:

> On Wed, 08 Mar 2006 07:18:43 +0100, Pascal Bourguignon <······@informatimago.com> wrote:
>>
>>There's GENTEMP, but it'd probably be better to write your own generator.
>
> Thanks, Pascal. I had somehow missed GENTEMP but I think
> you're right -- I see that the CLHS says it is deprecated
> (and CLISP warns that symbols created with it can't be GC'd).

Class names can't be GC'ed either.  For your usage, GENTEMP would be perfect.
(Mind the package argument to GENTEMP).

-- 
__Pascal Bourguignon__                     http://www.informatimago.com/

THIS IS A 100% MATTER PRODUCT: In the unlikely event that this
merchandise should contact antimatter in any form, a catastrophic
explosion will result.