Jon Lang wrote:
> This approach could be functionally equivalent to the "proxy object"
> approach, but with a potentially more user-friendly interface. That
> is,
>
> sub foo (*$value) { yadda }
>
> might be shorthand for something like:
>
> sub foo () is rw {
> return new Proxy:
> FETCH => method { return .doit() },
> STORE => method ($val) { .doit($val) },
> doit => method ($value?) { yadda }
> }
Correction:
sub foo (*$value) { yadda }
might be shorthand for something like:
sub foo () is rw {
return new Proxy:
FETCH => method { return .() },
STORE => method ($val) { .($val) },
postcircumfix:<( )> => method ($value?) { yadda }
}
i.e., it can be called like a regular function as well as via
assignment semantics.
--
Jonathan "Dataweaver" Lang