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

Re: Sun Fortress and Perl 6

Thread Previous | Thread Next
From:
Leopold Toetsch
Date:
April 30, 2005 00:26
Subject:
Re: Sun Fortress and Perl 6
Message ID:
200504300641.j3U6fqg30682@thu8.leo.home
Autrijus Tang <autrijus@autrijus.org> wrote:

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

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

Neither of above. But:

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

aka

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

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/

leo

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About