[Newbies] selectors for an array of classes
Jonathan Wright
j.c at jondw.com
Sun Jul 3 17:48:51 UTC 2011
On Sun, 3 Jul 2011 18:47:09 +0200
Bert Freudenberg <bert at 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 at 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
More information about the Beginners
mailing list