[Newbies] Collection in Smalltalk
herbertkoenig at gmx.net
Thu Sep 25 15:33:28 UTC 2008
Herbert>> mySeparators := Array new: 13
Herbert>> mySeparators at: 1 put: $- ; at: 2 put: $( .....
Herbert>> and so on.
RLS> You can just write that as a literal:
RLS> mySeparators := #($- $().
actually yes but I really have 13 separators (ugly) and I may have
done it that way if it were numbers.
The first line even reads:
mySeparators at: 1 put: ' ' asCharacter;
so I understand the whole thing when I read it later. $. and $; makes
me stumble and $ is on the verge of unreadable to me.
Btw I just changed that to .. put: Character space.
' ' asCharacter is clear but it itches me to count the blanks anyway.
Details, details :-))
More information about the Beginners