[Dan Sugalski]
>me>Dan, can you explain how assignment will work for Perl6 mapping over Parrot,
>me>and what mechanisms will be there to be used by other languages?
>
>When you assign to a PMC, the destination PMC's "assign to me" vtable 
>function will be called. If that function doesn't like the inbound type, it 
>throws an exception. The PMC flags section has a flag to note whether 
>typing should be enforced.
I see why you need that for Perl6. OTOH I think other languages
will workaround that, it is very unnatural for object-based systems,
you assign objects carrying type to type agnostic slots, you don't assign
to objects, of course there copyInto and similar ops but ...
But I think everybody knows that.

If you have a little time, how will the following piece of Perl
(is this valid Perl6?) be mapped over Parrot, at least the role of PMC
and their relation with variables vs. their contents:

@a = (1, 2, 3);
$b = \@a ;
@a = (3, 4, 5);
print $b->[1],"\n";  # outputs 4

Thanks. Samuele Pedroni.

Reply via email to