Hi,
Please can someone explain the behaviour described below?
I wish to create a subclass of FloatArray for a dynamic system simulation. When creating the class with #subclass: the method is automatically changed to #variableWordSubclass: as follows
FloatArray variableWordSubclass: #DynamicVariable
That is fine. But when I wish to create an instance
dv2 _ DynamicVariable new: 2
I get an error telling me that #new: is not understood. However #new: is understood by the superclass #FloatArray. Why?
And, by the way, the method #variableWordSubclass cannot be found with Method Finder. Why?
Many thanks in advance.
Joaquin
Dr. Joaquin Sitte, Associate Professor. School of Software Engineering and Data Communication Faculty of Information Technology Queensland University of Technology GPO Box 2434, Brisbane, Q 4001 Australia Phone +61 7 3864 2755 Fax +61 7 3864 1801 e-mail: j.sitte@qut.edu.au homepage http://www.fit.qut.edu.au/~sitte http://www.fit.qut.edu.au/~sitte
Joaquin Sitte a écrit :
Please can someone explain the behaviour described below? I wish to create a subclass of FloatArray for a dynamic system simulation. When creating the class with #subclass: the method is automatically changed to #variableWordSubclass: as follows [...]
In my opinion, this is the kind of questions you will more likely find answers in squeak-dev.
Joaquin,
I wish to create a subclass of FloatArray for a dynamic system simulation. When creating the class with #subclass: the method is automatically changed to #variableWordSubclass: as follows
FloatArray variableWordSubclass: #DynamicVariable
That is fine. But when I wish to create an instance
dv2 _ DynamicVariable new: 2
I get an error telling me that #new: is not understood. However #new: is understood by the superclass #FloatArray. Why?
I tried this and didn't get any error. I managed to create an instance of DynamicVariable with two slots.
And, by the way, the method #variableWordSubclass cannot be found with Method Finder. Why?
I'm not sure how you did this, but if you select from the "v" to "s" above and press Ctrl-w (or Alt-Shift-w), you'll see the selectors that contains the selected string as a part.
-- Yoshiki
Many thanks to all who replied with advice.
Here is an update on the matter for those interested.
DynamicVariable is a subclass (variableWordSubclass) of FloatArray. FloatArray new: 2 works! Therefore because DynamicVariable is a subclass of FloatArray DynamicVariable new: 2 should work, but id didnt for me.
A partial solution to my problem was provided by Yoshiki Ohshima who reported getting no error when executing
dv2 _ DynamicVariable new: 2
with DynamicVariable variable defined as a subclass of FloatArray.
That means I am doing something wrong. I tried to define another class DynamicVariable2 in the same way, and do not get an error message when doing
dv2 _ DynamicVariable new: 2
Great!
But still my identically defined DynamicVariable still does not understand #new: (tried both Squeak 3.7 and 3.8 with identical results)
Obviously something is wrong somewhere in my system. Dont know yet what.
Thanks again
Joaquin
Dr. Joaquin Sitte, Associate Professor. School of Software Engineering and Data Communication Faculty of Information Technology Queensland University of Technology GPO Box 2434, Brisbane, Q 4001 Australia Phone +61 7 3864 2755 Fax +61 7 3864 1801 e-mail: j.sitte@qut.edu.au homepage http://www.fit.qut.edu.au/~sitte
-----Original Message----- From: beginners-bounces@lists.squeakfoundation.org [mailto:beginners- bounces@lists.squeakfoundation.org] On Behalf Of Yoshiki Ohshima Sent: Tuesday, 27 June 2006 03:34 To: A friendly place to get answers to even the most basic questionsabout Squeak. Subject: Re: [Newbies] variableWordSubclass:
Joaquin,
I wish to create a subclass of FloatArray for a dynamic system
simulation. When creating the class with #subclass: the
method is automatically changed to #variableWordSubclass: as follows
FloatArray variableWordSubclass: #DynamicVariable
That is fine. But when I wish to create an instance
dv2 _ DynamicVariable new: 2
I get an error telling me that #new: is not understood. However #new: is
understood by the superclass #FloatArray. Why?
I tried this and didn't get any error. I managed to create an instance of DynamicVariable with two slots.
And, by the way, the method #variableWordSubclass cannot be found with
Method Finder. Why?
I'm not sure how you did this, but if you select from the "v" to "s" above and press Ctrl-w (or Alt-Shift-w), you'll see the selectors that contains the selected string as a part.
-- Yoshiki _______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
G'day Joaquin,
on Sun, 02 Jul 2006 14:39:07 +0200, wrote: ...
But still my identically defined DynamicVariable still does not understand #new: (tried both Squeak 3.7 and 3.8 with identical results)
Obviously something is wrong somewhere in my system. Don’t know yet what.
...
We can find out for you: just after you encounter the error, Squeak writes a file named SqueakDebug.log into its current directory. Feel free to post the contents of the file here and I'll see that I find you the bug.
/Klaus
beginners@lists.squeakfoundation.org