Collecting Smalltalk idioms
arning at charm.net
Tue Aug 10 14:15:57 UTC 1999
On Tue, 10 Aug 1999 09:09:08 -0400 "Andrew C. Greenberg" <werdna at gate.net> wrote:
>On the theory that there are no dumb questions -- and given my
>experience that you men and women frequently take my breath with the
>elegance of your solutions to my dumb questions:
>In the silly Smalltalk tricks category, is there a "least ugly" way
>to generate a comma separated list out of a collection?
>Of course, I can bury any ugliness, if necessary, just by adding a
>#do:inbetween: method or the like to the Collection protocol. Is
>that reason enough to change a core system class?
It is in my book. If you are going to have this need in more than one or two places, go ahead. You will have less code and less gnarly code in the end.
>Am I too shy about
>that sort of thing?
Too shy gets my vote, although you really haven't described the domain of the change you are envisioning. Is it:
1. In your own image for your own entertainment?
2. Something you will offer as a filein to other test pilots?
3. Something you will lobby Squeak Central for inclusion in the base release?
The more of these you answer "yes", the more I would think about compatibility with other Smalltalks, but, in short, go for it. I seem to remember one Smalltalk having
do: aBlock andBetweenDo: anotherBlock
which seems reasonable to me.
More information about the Squeak-dev