Autrijus Tang <[EMAIL PROTECTED]> wrote:

>     my sub get_book () of Hash of Array of Recipe {...}
>     my num @nums = Array of;3;3));

> Does Parrot's MMD carry this type information natively?

Neither of above. But:

  multi sub foo(Int $a, Num $b) { ... }


  .sub foo @MULTI(Int, Num)

- creates a MultiSub PMC stored in the current namespace as "foo"
- stores the sub itself as "[EMAIL PROTECTED]@Num" and
- attaches that Sub PMC to the MultiSub

> ..., and Ponie can then
> reuse the same name-mangling to call into Perl 6 subroutines.

Well, I presume that this could cover just the static case, which with
the absence of types in Perl5/Ponie, would make it impossible to call

Anyway Parrots MMD system depends on types. *If* the Perl6 compiler defines
above array as

  cl = subclass "FixedFloatArray", "num_Array_shape_3_3_3"

then this kind of array would be a distinct type. The other possiblity
is: we have one Multi_shaped_FloatArray, which takes an initializer with
the dimensions (see e.g. classes/multiarray.pmc) then all these shaped
num arrays would be one type, dispatching to the same routines.

> Thanks,
> /Autrijus/


Reply via email to