Em Dom, 2009-06-14 às 10:09 -0500, Patrick R. Michaud escreveu:
> On Sat, Jun 06, 2009 at 08:01:50AM -0700, Daniel Ruoso wrote:
> > <ruoso> rakudo: multi a (Str $a, Str $b) { [+$a, +$b] }; multi a (Array
> > $a, $b where '+') { [+] @($a) }; ('1', '2', '+').reduce: &a;
> > <p6eval> rakudo fb2fd4: OUTPUT«Unknown introspection value
> > 'pos_required'␤in method Any::reduce (src/gen_setting.pm:3226)␤called
> > from Main (/tmp/MvPkx61zJn:2)␤»
> At present C<reduce> doesn't work well with multisubs, as it's
> not certain how to find the arity of the (multi)sub to pass
> along to reduce.

This is a different problem indeed. We still don't know what to do in
reduce with varying arity multis, but this specific example shows a case
with fixed arity in all the candidates.

> It may be that we want reduce to simply assume arity 2.

I'm not sure that is a sane option... Since we have the ... operator
(which I like to think as the inverse of reduce), that should be able to
work with multies as well...

daniel

Reply via email to