Author: masak Date: 2009-01-07 09:34:18 +0100 (Wed, 07 Jan 2009) New Revision: 24796
Modified: docs/Perl6/Spec/S29-functions.pod Log: [S29] added any, all, one and none as subs and methods on List and Hash Modified: docs/Perl6/Spec/S29-functions.pod =================================================================== --- docs/Perl6/Spec/S29-functions.pod 2009-01-07 06:25:35 UTC (rev 24795) +++ docs/Perl6/Spec/S29-functions.pod 2009-01-07 08:34:18 UTC (rev 24796) @@ -15,7 +15,7 @@ Moritz Lenz <mor...@faui2k3.org> Date: 12 Mar 2005 Last Modified: 7 Jan 2009 - Version: 36 + Version: 37 This document attempts to document the list of builtin functions in Perl 6. It assumes familiarity with Perl 5 and prior synopses. @@ -1022,6 +1022,41 @@ is used as an C<Ordering> then sort-specific traits such as C<is canonicalized($how)> are allowed on the positional elements. +=item any + + our Junction multi method any( @values: ) is export + our Junction multi any( @values ) is export + +Returns a junction with all the values of the list C<|>-ed together. The +junction will only match against another value if at least one of the +values in the list matches. + +=item all + + our Junction multi method all( @values: ) is export + our Junction multi all( @values ) is export + +Returns a junction with all the values of the list C<&>-ed together. The +junction will only match against another value if all of the values in the +list match. + +=item one + + our Junction multi method one( @values: ) is export + our Junction multi one( @values ) is export + +Returns a junction with all the values of the list C<^>-ed together. The +junction will only match against another value if exactly one of the values +in the list matches. + +=item none + + our Junction multi method none( @values: ) is export + our Junction multi none( @values ) is export + +Returns a junction which will only match against another value if none of +the values in the list matches. + =back =head2 Hash @@ -1084,6 +1119,37 @@ The lvalue form of C<keys> is not longer supported. Use the C<.buckets> property instead. +=item any + + our Junction multi method any( %hash: ) is export + +Returns a junction with all the keys of the hash C<|>-ed together. The +junction will only match against another value if at least one of the +keys in the hash matches. + +=item all + + our Junction multi method all( %hash: ) is export + +Returns a junction with all the keys of the hash C<&>-ed together. The +junction will only match against another value if all of the keys in the hash +match. + +=item one + + our Junction multi method one( %hash: ) is export + +Returns a junction with all the keys of the hash C<^>-ed together. The +junction will only match against another value if exactly one of the keys +in the hash matches. + +=item none + + our Junction multi method none( %hash: ) is export + +Returns a junction which will only match against another value if none of +the keys in the hash matches. + =back