Changing the rule for arrow like operators again.
This commit is contained in:
parent
d71f1b98e0
commit
34997292f4
4 changed files with 12 additions and 12 deletions
|
|
@ -73,11 +73,11 @@ echo "all" | tester & " " & args
|
|||
echo "all"|tester & " " & args
|
||||
|
||||
# Test arrow like operators. See also tests/macros/tclosuremacro.nim
|
||||
proc `-+>`(a, b: int): int = a + b*4
|
||||
proc `+->`(a, b: int): int = a + b*4
|
||||
template `===>`(a, b: int): expr = a - b shr 1
|
||||
|
||||
echo 3 -+> 2 + 2 and 4
|
||||
var arrowed = 3-+>2 + 2 and 4 # arrowed = 4
|
||||
echo 3 +-> 2 + 2 and 4
|
||||
var arrowed = 3+->2 + 2 and 4 # arrowed = 4
|
||||
echo arrowed ===> 15
|
||||
echo (2 * 3-+>2) == (2*3 -+> 2)
|
||||
echo arrowed ===> 2 + 3-+>2
|
||||
echo (2 * 3+->2) == (2*3 +-> 2)
|
||||
echo arrowed ===> 2 + 3+->2
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue