How to? DoubleArray
Andreas Raab
andreas.raab at gmx.de
Fri Feb 10 03:05:41 UTC 2006
Yoshiki Ohshima wrote:
>> A better place to look at is
>> ShortIntegerArray and friends (see the class-side methods, in particular
>> #startUp) since they have to implement endianness conversion manually
>> for lack of VM support.
>
> Good explanation.
>
> The "," after the word "ShortIntegerArray" meant that "look at
> ShortIntegerArray", and then look at other classes with some endian
> related issues^^;
I know. It just read a lot like "look at these methods for how to do it"
and it's almost exactly how not to do it ;-)
> Still, if you really like to have DoubleArray, perhaps for the
> reason to communicate with external libraries or for some other
> reasons such as writing your own performance primitives on numbers
> with better precision, you could do it, I think.
Oh, sure, you absolutely could. My main point was that the naive
intuition is wrong for both of the reasons cited (problems with host
order and problems with alignment) - if that is not an issue (either
because space is the primary concern or because cross-platform behavior
isn't terribly relevant) it can make a ton of sense to use it.
Cheers,
- Andreas
More information about the Squeak-dev
mailing list
|