Larry Wall <[EMAIL PROTECTED]> wrote:
> On Sun, Apr 17, 2005 at 09:50:28AM +0200, Leopold Toetsch wrote:
>: Larry Wall <[EMAIL PROTECTED]> wrote:
>: > Is there a bitarray lookup by native int?
>:
>: Yes. All array lookups support a native int index.

> Good, good.  Speaking of bitarrays (uint1 in the Perl panoply of
> types), is there any built-in support for arrays of tiny integers
> like uint2 or uint4?  It'd be nice to have uint24 in there too.

I can see two ways to do it:

a) a general n-bit array

  Px = new NBitArray, 2   # or 4, 24 or 128, ...

which would mean that this is just one type, i.e. no MM dispatch
difference between C<@a of int2> and C<@a of int4>.

b) implement it as distinct array types.

The former is probably slightly slower with the said dispatch problem,
the latter uses more resources, more code, bigger type registry, bigger
MMD caches and so on. An C<@a of uint8> is definitely such a distinct
type RSN.

c) a mixture of a) and some commonly used sizes for b)

Ehem three ways.

>: A Parrot Integer PMC (32bit for a 32bit sytem), which has a different
>: type number then a BigInt PMC.

> For simplicity Perl is probably just going to make a two-way
> distinction between int/Int, where the latter is assumed to have
> BigInt properties as necessary.

Yep. The distinction between BigInt and Integer PMC is almost invisble
to Perl6, except in something like:

  $i.isa          # ["Int"]
  $i.__isa        # ["Integer"] or ["BigInt"]

> ... We can probably use Parrot Integer
> PMCs for boxing native ints when we need to do that, but that's
> hopefully transparent to the user.

Should be, yes.

> Thanks for all the info.  Nice to know we're pushing the state of the
> art in spots.  We'll just keep on pushing it till it falls over.

> Larry

Welcome,
leo

Reply via email to