asArray method in Sets (please ignore previous draft if you receive it)

Jason Rogers jacaetevha at gmail.com
Tue Oct 18 13:26:45 UTC 2005


Well, I never claimed that it was the best thing since sliced bread...
I was just trying to start the creative juices flowing.  I guess the
submitted code was not that creative... my apologies.

On 10/17/05, tim Rowledge <tim at rowledge.org> wrote:
>
> 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
>
>
>
>


--
Jason Rogers

"I am crucified with Christ: nevertheless I live; yet not I,
but Christ liveth in me: and the life which I now live in
the flesh I live by the faith of the Son of God, who loved
me, and gave himself for me."
    Galatians 2:20



More information about the Squeak-dev mailing list