On Tue, 27 Feb 2001, Ian Brayshaw wrote:

> >Ian Brayshaw" <[EMAIL PROTECTED]> writes:
> >
> > > Hi,
> > >
> > > Given the following lvalue subroutine
> > >
> > >   sub mysub : lvalue {
> > >           $value;
> > >   }
> > >
> > > is there any way for mysub() to be able to determine that it
> > > was called in an lvalue context?
> >
> >No. If you need to know that sort of thing, you kind of have to tie
> >the $value that you're going to return, and use that as a proxy for
> >the *actual* value. If you're called in an lvalue context then the> tied
> >object is going to have its STORE method called...
> >
>
> I'm new to the discussion of Perl6, so are there any discussions around
> providing operators such as wantlvalue and wantvoid
> to perform similar queries to wantarray?
>

wantarray will tell you if you are in a void context - IIRC correctly it
returns undef in void context and 0 in scalar context I also recall there
being a little controversy over this recently in p5p ...

/J\
-- 
Jonathan Stowe                   |
http://www.gellyfish.com         |       I'm with Grep on this one
http://www.tackleway.co.uk       |

Reply via email to