There's a 'minmax' operator in S03. Is this coherent with that?
On Mon, Apr 26, 2010 at 6:51 PM, wrote:
> Author: colomon
> Date: 2010-04-27 01:51:12 +0200 (Tue, 27 Apr 2010)
> New Revision: 30480
>
> Modified:
> docs/Perl6/Spec/S32-setting-library/Containers.pod
> Log:
> [Spec] Add .minmax method along the lines of the .min and .max methods.
>
> Modified: docs/Perl6/Spec/S32-setting-library/Containers.pod
> ===
> --- docs/Perl6/Spec/S32-setting-library/Containers.pod 2010-04-26 23:20:02
> UTC (rev 30479)
> +++ docs/Perl6/Spec/S32-setting-library/Containers.pod 2010-04-26 23:51:12
> UTC (rev 30480)
> @@ -378,6 +378,30 @@
> For a C function that does not require an ordering, see the
> C<[max]> reduction operator.
>
> +=item minmax
> +
> + our multi method minmax( @values: *&by )
> + our multi method minmax( @values: Ordering @by )
> + our multi method minmax( @values: Ordering $by = &infix: )
> +
> + our multi minmax( Ordering @by, �...@values )
> + our multi minmax( Ordering $by, �...@values )
> +
> +Returns the earliest (i.e., lowest index) minimum and maximum elements
> +of C<@values> , using criteria C<$by> or C<@by> for
> +comparisons. C<@by> differs from C<$by> in that each criterion
> +is applied, in order, until a non-zero (tie) result is achieved.
> +
> +C is as described in L<"Type Declarations">. Any
> +C may receive the mixin C to
> +adjust the case, sign, or other order sensitivity of C.
> +(Mixins are applied to values using C.) If a C
> +is used as an C then sort-specific traits such as C +canonicalized($how)> are allowed on the positional elements.
> +
> +For a C function that does not require an ordering, see the
> +C<[minmax]> reduction operator.
> +
> =item any
>
> our Junction multi method any( @values: )
>
>