[armedbear-devel] Support for specialized arrays?

Erik Huelsmann ehuels at gmail.com
Wed Oct 26 10:22:03 UTC 2011


Hi Stas, Blake,

On Wed, Oct 26, 2011 at 11:54 AM, Stas Boukarev <stassats at gmail.com> wrote:
> Blake McBride <blake at mcbride.name> writes:
>
>> Figured it out:
>>
>> (array-element-type (make-array '(2 2) :element-type 'fixnum
>> :initial-contents '((1 2)(3 4))))
>>
>> T
> You could check that with
> (upgraded-array-element-type 'fixnum) => T
>
> And to check all types
> (loop for symbol being the symbols in :cl
>      when (not (eql t (or (ignore-errors (upgraded-array-element-type symbol)) t)))
>      collect symbol)
> =>
> (BIT STANDARD-CHAR BASE-CHAR CHARACTER)

Seems we need to be better at detecting specializer types:

We have types for vectors and arrays of higher rank with elements of:

 * UNSIGNED-BYTE 8
 * UNSIGNED-BYTE 16
 * UNSIGNED-BYTE 32

But it seems that the upgraded type of FIXNUM doesn't fit in
UNSIGNED-BYTE 32; I'd say we need specialized arrays for SIGNED-BYTE
8, SIGNED-BYTE 32 (aka fixnum) and maybe SIGNED-BYTE 64 (aka
JAVA-LONG) as well.

It's easy to implement. Nobody did it yet, that's all.

BTW: I answered this mail by looking at
src/org/armedbear/lisp/make_array.java -- for those interested.

Hope that helps.


Bye,

Erik.




More information about the armedbear-devel mailing list