Re: Quickcheck of context of index expressions

2005-04-29 Thread Autrijus Tang
On Fri, Apr 29, 2005 at 06:22:57AM -0700, Larry Wall wrote: > : @x[want()] = $_; # scalar context > : @x[want()] = @_; # scalar context > > Maybe "unknown" context, which defaults to list. > > : @x[0,] = want(); # list context > : @x[want(),] = $_; # list context > : @x[wan

Re: Quickcheck of context of index expressions

2005-04-29 Thread Autrijus Tang
On Fri, Apr 29, 2005 at 06:22:57AM -0700, Larry Wall wrote: > : @x[want()] = $_; # scalar context > : @x[want()] = @_; # scalar context > > Maybe "unknown" context, which defaults to list. I think allowing unknown LHS index expression to default to scalar context is a bit more useful h

Re: Quickcheck of context of index expressions

2005-04-29 Thread Larry Wall
On Tue, Apr 26, 2005 at 03:56:37AM +0800, Autrijus Tang wrote: : On Tue, Apr 26, 2005 at 03:33:44AM +0800, Autrijus Tang wrote: : > Another quick check on expression context for indexed expressions. : > Please sanity-check the return value of want() below: : > : > @x[0] = want(); # scalar cont

Re: Quickcheck of context of index expressions

2005-04-29 Thread Larry Wall
On Tue, Apr 26, 2005 at 03:33:44AM +0800, Autrijus Tang wrote: : Another quick check on expression context for indexed expressions. : Please sanity-check the return value of want() below: : : @x[0] = want(); # scalar context Good. : @x[want()] = $_; # scalar context : @x[want()] =

Re: Quickcheck of context of index expressions

2005-04-25 Thread Autrijus Tang
On Tue, Apr 26, 2005 at 03:33:44AM +0800, Autrijus Tang wrote: > Another quick check on expression context for indexed expressions. > Please sanity-check the return value of want() below: > > @x[0] = want(); # scalar context > @x[want()] = $_; # scalar context > @x[want()] = @_; #

Quickcheck of context of index expressions

2005-04-25 Thread Autrijus Tang
Another quick check on expression context for indexed expressions. Please sanity-check the return value of want() below: @x[0] = want(); # scalar context @x[want()] = $_; # scalar context @x[want()] = @_; # scalar context @x[0,] = want(); # list context @x[want(),] = $_; #