[Cuis] VM Bug
Ken Dickey
Ken.Dickey at whidbey.com
Fri Feb 22 09:56:51 CST 2013
On Fri, 22 Feb 2013 09:20:54 -0300
Juan Vuletich <juan at jvuletich.org> wrote:
> Note that WordArray stores unsigned numbers, but the primitives handle
> signed. If you want unsigned 16 bit, I'd rather add #unsignedAt: and
> #unsignedAt:put: to ShortIntegerArray, doing a conversion like WordArray
> does.
Yes. I want to store all 16 bits. Do whatever is the sensible thing.
The comment in #at:put: is definitely at odds with what the primitives do.
My personal preference is for unsigned byte, word, and long storage to have better naming (e.g. U8Array, U16Array, U32Array with #at:put: storing unsigned integers to 16rFF*) and have these subclassed for (S8Array, S16Array, S32Array) with #at:put: expecting signed integers of the proper size.
Number implementations are way too complex and should be explained better for beginners.
Thanks for the digging,
-KenD
--
Ken [dot] Dickey [at] whidbey [dot] com
More information about the Cuis
mailing list