What are the restrictions on "is rw"? For example, can it be used with
variables of a particular type? If so, does the parameter passed have to
already be that type? What does this do?
sub process(int $i is rw) { $i++ }
my $x = "10";
process($x);
Does C<$x> become 11? That would require that a temporary be created, I
suppose, which is not horrible, I just worry about implying efficiency
where it doesn't really exist.
The above is the simple case, of course because a scalar can contain an
integer. What does this do:
sub process(Dog $i is rw) { $i.bark }
my Cat $x;
process($x);
That I guess the sub could expand to:
my Dog $i = @_[0]; # If it works, it works
$i.bark
@_[0] = $i;
But that could have very different semantics than the user expects....
--
Aaron Sherman <[EMAIL PROTECTED]>
http://www.ajs.com/~ajs