variableSubclass:, variableWordSubclass:

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

variableSubclass:, variableWordSubclass:

Ang BeePeng
I try to write a class, Matrix, elements in the matrix will be store as an array. As I need the array to be dynamic in size, I need an instance variable to store the size of the array. But, it seems to be if the class is variableWordSubclass: of another class, say ArrayCollection; no instance variable can be create for that class.

I tried to use variableSubclass: as well. When I debug it, I get MessageNotUnderstood: UndefinedObject.

Can anyone tell me what is the different between the two messages variableSubclass: and variableWordSubclass:? Especially in term of instance creation, initialize.

Reply | Threaded
Open this post in threaded view
|

Re: [squeak-dev] variableSubclass:, variableWordSubclass:

Boris.Gaertner
 
Attached you find an example that shows how a variable subclass is used. Note that an instance if a variable subclass is created with new: <number>



MyMatrix.st (2K) Download Attachment