On Sun, 3 Jul 2011 18:47:09 +0200 Bert Freudenberg bert@freudenbergs.de wrote:
On 03.07.2011, at 18:35, Jonathan Wright wrote:
Hello,
I am trying to read the methods of several classes. I am getting a messagenotunderstood for the following code:
TempObject := #(OrderedCollection Integer). TempObject do: [ :iClass | iClass selectorsDo: [ :item | item.]].
I can run a iClass name successfully.
Try iClass class, that should be enlightening ;)
But it doesn't seem to recognize iClass selectors.
The "name" message works on any (see Object>>name). iClass is not actually a class in your example.
Hint 1: #() creates a literal array.
Hint 2: Classes are not literals.
Hint 3: {} creates a non-literal array.
Nitpick: temps should have lowercase-names.
- Bert -
Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners
Awesome, thanks for the hints! It works now!
In finding information about non-literal arrays, it seems you put periods in between the array contents.
I'm not sure I understand iClass class. It just seems to add class at the end. I suppose I would now have extra methods to work with in doing that?
Regarding TempObject, yeah I've been using it as a global variable for a while now, so it should be capitalized in my case. :-) I read all about the capitalization guidelines for smalltalk and it all makes sense to me.
Again, thanks for the help!
Kind Regards, Jonathan