[Cuis] VM Bug

Juan Vuletich juan at jvuletich.org
Fri Feb 22 21:59:10 CST 2013


Hi Ken,

On 2/22/2013 12:56 PM, Ken Dickey wrote:
> 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.

I added new protocol to ShortIntegerArray and enhanced comments in this 
and related classes. Update is at GitHub.

> 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.

Sounds reasonable. Didn't implement this, though.

> Number implementations are way too complex and should be explained better for beginners.
>
> Thanks for the digging,
> -KenD

Cheers,
Juan Vuletich




More information about the Cuis mailing list