Newsgroups: comp.lang.smalltalk
Path: cantaloupe.srv.cs.cmu.edu!das-news2.harvard.edu!fas-news.harvard.edu!newspump.wustl.edu!news.ecn.bgu.edu!vixen.cso.uiuc.edu!howland.reston.ans.net!torn!nott!cunews!dbuck
From: dbuck@superior.carleton.ca (Dave Buck)
Subject: Re: SmallInteger Puzzle
X-Nntp-Posting-Host: superior.carleton.ca
Message-ID: <DJKsu7.Bq2@cunews.carleton.ca>
Sender: news@cunews.carleton.ca (News Administrator)
Organization: Carleton University, Ottawa, Canada
References: <TOMB.95Dec13095636@khan.aisys.com> <4ao8r5$90@newsbf02.news.aol.com>
Date: Thu, 14 Dec 1995 12:18:07 GMT
Lines: 30

In article <4ao8r5$90@newsbf02.news.aol.com>,
Bytesmiths <bytesmiths@aol.com> wrote:
>Tom Burns worries about optimizing the number of #bitShifts while ignoring
>the number of ByteArray copies. For integers > 24 bits, his code
>creates/copies 3 extra ByteArrays -- one four-byte copy in #contents, and
>a two-byte and one-byte copy when the byte array grows!

Hey!! We could do this:

((Array with: valueToConvert)
    setClassToThatOf: ByteArray) do: [:byte | ...]

;-) :-)

No, no, not the rotten tomatoes!!! :-)

(P.S., in case it's not clear, anybody who actually tries this sort of
thing should be shot.  This is orders of magnitude worse than any
other solution yet posted.  And watch out for those tag bits when you
do this...)


David Buck
dbuck@ccs.carleton.ca

_________________________________
| David K. Buck                 |
| dbuck@ccs.carleton.ca         |
| The Object People             |
|_______________________________|
