Patrick R. Michaud via RT wrote:
On Sat, Mar 07, 2009 at 09:50:02PM -0800, Vasily Chekalkin wrote:
+our List multi min(*...@values) {
+ my $by = @values[0] ~~ Code ?? shift @values !! sub { $^a cmp $^b };
+ @values.min($by);
+}
This doesn't match the spec -- the $by parameter is required.
At any rate, the first argument should not be explicitly checked
for being a Code object -- if we do this it should be via a multi
signature.
Yes, the PIR code was "cheating" in this respect, but I don't
want to blindly copy our cheats from PIR into the setting without
subjecting them to another review.
This is workaround for this situation:
<bacek> rakudo: multi sub foo(Code &x, *...@values) {...}; multi sub
foo(*...@values) {...}; say foo(sub {}, 1,2,3);
<p6eval> rakudo 2daf6b: OUTPUT«Ambiguous dispatch to multi 'foo'.
Ambiguous candidates had signatures::(Code x, Any @values):(Any
@values)current instr.: '_block14' pc 101 (EVAL_18:52)»
Should I fill bug report for this?
--
Bacek