develooper Front page | perl.perl6.language | Postings from April 2005

Re: Sun Fortress and Perl 6

Thread Previous | Thread Next
Leopold Toetsch
April 30, 2005 00:26
Re: Sun Fortress and Perl 6
Message ID:
Autrijus Tang <> 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 "foo_@Int_@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/


Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About