my @a=1,2,3,4; my @b=9,8,7,1; say (@a minmax @b).perl
yields an error
S03:1621 gives @a minmax @b as an example.
While rakudo doesn't implement infix:<minmax> yet, the operator is
constrained to having two elements on either side, so the above code
wouldn't work anyway.
It would be good to have some tests for infix:<minmax> -- that should
make it much easier to implement.
Pm
Patrick R. Michaud via RT wrote:
> On Tue Jun 16 10:14:11 2009, richardh wrote:
>
>> my @a=1,2,3,4; my @b=9,8,7,1; say (@a minmax @b).perl
>>
>
> While rakudo doesn't implement infix:<minmax> yet, the operator is
> constrained to having two elements on either side, so the above code
> wouldn't work anyway.
>
I took
@a minmax @b
from the Spec.
say (...).perl
formats and prints the return value.
What have I misunderstood?
Yes, the spec mentions C< @a minmax @b >; it also says that the
result would be (@a[0] min @b[0], @a[1] max @b[1]) . So in
your example above, would you expect the result to be (1, 8) ?
Pm
Closing ticket,
Pm