Metaclass fun

sqrmax at cvtci.com.ar sqrmax at cvtci.com.ar
Tue Apr 21 19:42:26 UTC 1998


Hi.

>Having run across this before, I said "to heck with it, let's
>solve this problem once and for all". The fix took five minutes to
>implement and test, resulting in 3 methods. I did it in VW becuase that
>was running at the time. I then fired up Squeak and had it running there
>in a minute.

Hehehhehehe... I love it when it happens! I was checking the performance of 
the LargeInteger bitShift:, and hey, I had already coded similar stuff for a 
class named BitStream... so I needed BitStreams over LargeIntegers just to 
test their efficiency... well, I rewrote these three methods in a subclass:

contentsAt: anInteger
	^self contents digitAt: anInteger

contentsAt: anInteger put: aByte
	self contents digitAt: anInteger put: aByte

contents
	^self collection copy


And that was it! I was thrilled... have you noticed how things tend to 
happen in waves of similar events?

Andres.





More information about the Squeak-dev mailing list