Hi,

 

The parentheses are not useful here: the unary message send (asSymbol) is made before the keyword one (subclass:instanceVariableNames:classVariableNames:packageJ

 

I tried :      

Object  subclass: 'Foo' asSymbol instanceVariableNames: '' classVariableNames: '' package: 'AAA' asString

On a fresh Pharo5.0 image and it works nice.

 

Vincent

 

De : Pharo-users [mailto:pharo-users-bounces@lists.pharo.org] De la part de Mark Bratcher
Envoy�� : vendredi 29 juillet 2016 17:00
�� : Any question about pharo is welcome
Objet : Re: [Pharo-users] Programmatic generation of new class

 

Try putting parentheses around `aDescriptorSystemClassName asSymbol`:

 

        descriptorSystem :=
        DynamicDescriptorSystem subclass: (aDescriptorSystemClassName asSymbol)
                        instanceVariableNames: ''
                        classVariableNames: ''
                        package: packageName asString

 

On Fri, Jul 29, 2016 at 10:50 AM Brad Selfridge <bsselfridge@gmail.com> wrote:

I'm trying to programmatically generate a new class, but am getting the
following error:

DynamicDescriptorSystem class(Object)>>doesNotUnderstand:
#subclass:instanceVariableNames:classVariableNames:package:

This is the method that I'm trying to execute:

buildNewDescriptorSystemUsing: aDescriptorSystemClassName

        descriptorSystem :=
        DynamicDescriptorSystem subclass: aDescriptorSystemClassName asSymbol
                        instanceVariableNames: ''
                        classVariableNames: ''
                        package: packageName asString

I see examples of this all over Pharo and I copied this code almost
verbatim.

What am I doing wrong?



-----
Brad Selfridge
--
View this message in context: http://forum.world.st/Programmatic-generation-of-new-class-tp4908659.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.


!!!*************************************************************************************
"Ce message et les pi��ces jointes sont confidentiels et r��serv��s �� l'usage exclusif de ses destinataires. Il peut ��galement ��tre prot��g�� par le secret professionnel. Si vous recevez ce message par erreur, merci d'en avertir imm��diatement l'exp��diteur et de le d��truire. L'int��grit�� du message ne pouvant ��tre assur��e sur Internet, la responsabilit�� de Worldline ne pourra ��tre recherch��e quant au contenu de ce message. Bien que les meilleurs efforts soient faits pour maintenir cette transmission exempte de tout virus, l'exp��diteur ne donne aucune garantie �� cet ��gard et sa responsabilit�� ne saurait ��tre recherch��e pour tout dommage r��sultant d'un virus transmis.

This e-mail and the documents attached are confidential and intended solely for the addressee; it may also be privileged. If you receive this e-mail in error, please notify the sender immediately and destroy it. As its integrity cannot be secured on the Internet, the Worldline liability cannot be triggered for the message content. Although the sender endeavours to maintain a computer virus-free network, the sender does not warrant that this transmission is virus-free and will not be liable for any damages resulting from any virus transmitted.!!!"