On Wed, May 17, 2006 at 07:54:21AM +0800, Audrey Tang wrote: > Chip Salzenberg wrote: > > On Tue, May 16, 2006 at 03:24:20PM -0500, Patrick R. Michaud wrote: > >>>> sub foo($x is rw) { > >>>> $x = new SomeClass > >>>> } > >>>> > >>>> @z = 0..2; > >>>> foo( @z[1] ); > > The assignment does do what Patrick suggests.
As a Perl 6 user: "Good." :-) > If you change the assignment to a binding, it acts on the lexical pad of > &foo, changing the object $x points to, and does _not_ touch @z. Understood. [Remainder of helpful & detialed description of := vs. = elided.] > now suppose we assign into $x; that invokes the Scalar object's > assignment method: Interesting. So it seems that "is rw" will work fine w/o Parrot changes. <speculation> All that's needed is for the Perl 6 implementors to create a perl6;Scalar container that's more or less a translucent reference: It will handle assignment by switching to a new value, but it will handle most other operations by delegating to the value it currently holds. </speculation> Audrey, is this basically your plan for (scalar) containers? If not, what is? -- Chip Salzenberg <[EMAIL PROTECTED]>