Create type(class) dynamically

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Create type(class) dynamically

Khrystyna Mykhailiuk
CONTENTS DELETED
The author has deleted this message.
Reply | Threaded
Open this post in threaded view
|

Re: Create type(class) dynamically

Julien Delplanque
Hi,

You can create a class programatically using:

ParentClass subclass: #ClassName
     instanceVariableNames: 'instVar1 instVar2'
     classVariableNames: ''
     category: 'APackage'

Then you can add method using:

ClassName compile: 'helloWorld
     ^''Hello world!'''

for example.

I don't know if this answer you question?

Julien

On 03/02/16 20:48, Khrystyna Mykhailiuk wrote:

> Hi, all!
>
> Is it possible in Pharo to create a type (class) dynamically?
> Not using special space for it, but create type by running method of another
> class.
>
> Thanks,
> Khrystyna.
>
>
>
> --
> View this message in context: http://forum.world.st/Create-type-class-dynamically-tp4875651.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>


Reply | Threaded
Open this post in threaded view
|

Re: Create type(class) dynamically

Khrystyna Mykhailiuk
CONTENTS DELETED
The author has deleted this message.