Em Seg, 2009-01-05 às 20:32 +0100, Moritz Lenz escreveu:
> Daniel Ruoso wrote:
> > would force item context in the capture, and here is the problem, as a
> > capture in item context was supposed to return the invocant.
> Maybe we could have a different rule for captures in scalar contexts
> that don't have an invocant?
I've just realized we were missing some spots, so remaking the list of
possibilities
my $a = sub s1 { return a => 1 }
my $b = sub s2 { return a => 1, b => 2 }
my $c = sub s3 { return 1, 2, 3, a => 1, b => 2 }
my $d = sub s4 { return 1 }
my $e = sub s5 { return 1, 2, 3 }
my $f = sub s6 { return 1: #< it doesnt matter > }
my $g = sub s7 { return }
But while writing this email, I've realized that a Capture object is
supposed to implement both .[] and .{}, so maybe we can just simplify...
$g is an undefined Object
$f is 1
$d is 1
$a is a Pair
everything else is the Capture itself
daniel