Re: lvalue methods

2009-10-20 Thread David Green
On 2009-Oct-20, at 8:04 am, Jon Lang wrote: The above example is of course trivial. A more serious example might be one based off of a coordinate system: role point { has Num $x, Num $y; method angle() is rw( { $.x = .r * cos($_); $.y = .r * sin($_) } ) { return atn($.y/$.x

lvalue methods

2009-10-20 Thread Jon Lang
I recently attempted to write a sample mutable role that made use of a number of lvalue methods, and I had a bear of a time getting it to work. Could we arrange for a more intuitive option to be available? For example, allow the programmer to pass a writer code block in through the rw trait, and