31 lines
456 B
Plaintext
31 lines
456 B
Plaintext
#lang honu
|
|
|
|
operator gg 2 'left
|
|
function(left right){
|
|
withSyntax left = left,
|
|
right = right {
|
|
syntax(left * 2 - right)
|
|
}
|
|
}
|
|
|
|
3 gg 4 gg 5
|
|
|
|
binary_operator b1 2 'left
|
|
function(left, right){
|
|
left + right * 2
|
|
}
|
|
|
|
3 b1 8
|
|
|
|
unary_operator u1 4 function(x){ x - 2 }
|
|
|
|
2 + u1 u1 5
|
|
|
|
unary_operator u2 5 postfix function(x){ x + 8 }
|
|
unary_operator u3 5 postfix function(x){ x * 2 };
|
|
|
|
7 u3;
|
|
u2 7 u3;
|
|
1 + u2 7 u3;
|
|
1 + u2 7 u3 * 3;
|