I assume you meant that :lvalue() takes a parameter list. Either a
singleton named variable $, @, or %.
Or If it makes sense even a more complex parameter list could be
demanded.
sub foo :lvalue(Dog $fido, int @array, %hash) {}
foo() = ($name, 0..10, %bar);
<chaim>
>>>>> "BB" == Buddha Buck <[EMAIL PROTECTED]> writes:
BB> sub foo : lvalue($newval) {
BB> # $newval is a lexical scaler in this block, initialised with a
BB> reference
BB> # to the value to be assigned to $self{foo}
BB> my $self = shift;
BB> return $self{foo} unless defined $newval; # rvalue context
BB> # lvalue context
BB> # verify new foo is in correct range
BB> return $self{foo} if $$newval < $MINFOO;
BB> return $self{foo} if $$newval > $MAXFOO;
--
Chaim Frenkel Nonlinear Knowledge, Inc.
[EMAIL PROTECTED] +1-718-236-0183
- Re: Make lvalue subs the def... Nathan Torkington
- Re: Make lvalue subs the def... Nathan Wiger
- Re: Make lvalue subs the def... James Mastros
- Re: Make lvalue subs the default... Nathan Torkington
- Re: Make lvalue subs the def... Nathan Wiger
- Re: Make lvalue subs the def... Nathan Torkington
- Re: Make lvalue subs the def... Nathan Wiger
- Re: Make lvalue subs the def... Graham Barr
- Re: Make lvalue subs the def... Chaim Frenkel
- Re: RFC 107 (v1) lvalue subs should recei... Buddha Buck
- Re: RFC 107 (v1) lvalue subs should r... Chaim Frenkel
- Re: RFC 107 (v1) lvalue subs sho... Buddha Buck
- Re: RFC 107 (v1) lvalue subs should receive the rvalue... Piers Cawley
- Re: RFC 107 (v1) lvalue subs should receive the r... Jonathan Scott Duff
- Re: RFC 107 (v1) lvalue subs should receive t... Piers Cawley
- Re: RFC 107 (v1) lvalue subs should receive t... Chris Nandor
- Re: RFC 107 (v1) lvalue subs should recei... Chaim Frenkel
- Re: RFC 107 (v1) lvalue subs should r... Nathan Torkington
- Re: RFC 107 (v1) lvalue subs should receive t... Andy Wardley
- Re: RFC 107 (v1) lvalue subs should recei... Buddha Buck
- Re: RFC 107 (v1) lvalue subs should receive the rvalue... skud
