Author: lwall Date: 2009-02-14 23:56:24 +0100 (Sat, 14 Feb 2009) New Revision: 25334
Modified: docs/Perl6/Spec/S02-bits.pod Log: [S02] allow *.foo to mean -> $obj { $obj.foo } Modified: docs/Perl6/Spec/S02-bits.pod =================================================================== --- docs/Perl6/Spec/S02-bits.pod 2009-02-14 20:56:51 UTC (rev 25333) +++ docs/Perl6/Spec/S02-bits.pod 2009-02-14 22:56:24 UTC (rev 25334) @@ -821,9 +821,14 @@ produces a function of a single argument: - { $^x - 1 } + { $_ - 1 } -This closure is of type C<Code:($)>, not C<Whatever>, so that constructs can distinguish +Likewise, the single dispatcher recognizes C<*.meth> and returns C<{ $_.meth }>, +so it can be used where patterns are expected: + + @primes = grep *.prime, 2..*; + +These closures are of type C<Code:($)>, not C<Whatever>, so that constructs can distinguish via multiple dispatch: 1,2,3 ... *