asArray method in Sets (please ignore previous draft if you
receive it)
tim Rowledge
tim at rowledge.org
Mon Oct 17 16:15:09 UTC 2005
On 17-Oct-05, at 6:51 AM, Jason Rogers wrote:
> What about this:
>
> ========
> Set>#asArray
>
> ^self class = Set
> ifTrue: [self alternativeAsArray]
> ifFalse: [super asArray]
> ========
a) it's unbelievably ugly
b) you've added more message sends (well, strictly speaking a couple
of bytecoded sends, a faked send and a literal reference, assumingthe
compiler hasn't changedhugely since last time I looked)
c) improper use of explicit class names and checking them is an
offence against the Smalltalk Acceptable Style and Techniques Act of
1978, section 2 part q subsection ii and carries a maximum term of
thirty-six months of penal servitude coding in an inferior language
of the Chief Justice (Programming)'s choice. Guess who is currently
the aforementioned Chief Justice :-)
tim
--
tim Rowledge; tim at rowledge.org; http://www.rowledge.org/tim
More information about the Squeak-dev
mailing list
|