On Sun Jan 25 09:09:51 2009, dave.wh...@gmail.com wrote:
> According to S29, the "min" and "max" methods should accept the same
> ordering args as "sort":
> 
> say "{(1..10).sort: { ($_-3) * ($_-5) }}";
> >>> 4 3 5 2 6 1 7 8 9 10
> 
> say (1..10).min: { ($_-3) * ($_-5) };
> >>> 4
> 
> The former works as expected: the latter fails:
> 
> % ./perl6 -e 'say (1..10).min: { ($_-3) * ($_-5) }'
> too many arguments passed (3) - 1 params expected
> current instr.: 'parrot;Range;min' pc 7736 (src/classes/Range.pir:143)
> called from Sub '_block14' pc 106 (EVAL_20:49)
> called from Sub '!UNIT_START' pc 18152 (src/builtins/guts.pir:321)
> called from Sub 'parrot;PCT;HLLCompiler;eval' pc 950
> (src/PCT/HLLCompiler.pir:527)
> called from Sub 'parrot;PCT;HLLCompiler;command_line' pc 1496
> (src/PCT/HLLCompiler.pir:787)
> called from Sub 'parrot;Perl6;Compiler;main' pc 22199 (perl6.pir:159)
> Exit 1

Both min and max now have a single-arity form as of git 44c4879, which
seem to give the expected results. Added a couple of tests in
S32-list/minmax.t. Resolving ticket.

Thanks,

Jonathan

Reply via email to