On Fri, Dec 23, 2011 at 10:59:58PM +1100, Kris Shannon wrote:
> sub infix: ($a, $b = ($a foo 2 * 3 - $a)) is tighter(&infix:<*>)
> {
> $a == 0 ?? 1 foo 2 * 3 !! $a + $b
> }
>
> say 1 foo (2 * 3);
> # 7
> say (1 foo 2) * 3;
> # 9
>
> say 1 foo 2 * 3;
> # 9
>
> say infix:(1);
> # Niecza: 7
>
sub infix: ($a, $b = ($a foo 2 * 3 - $a)) is tighter(&infix:<*>)
{
$a == 0 ?? 1 foo 2 * 3 !! $a + $b
}
say 1 foo (2 * 3);
# 7
say (1 foo 2) * 3;
# 9
say 1 foo 2 * 3;
# 9
say infix:(1);
# Niecza: 7
say 0 foo 0;
# Niecza: 9
The way that Niecza does this is to install the operator with de