tunicode_operators.nim 239 B

1234567891011121314151617
  1. #{.experimental: "unicodeOperators".}
  2. proc `⊙`(x, y: int): int = x * y
  3. proc `⊙=`(x: var int, y: int) = x *= y
  4. proc `⊞++`(x, y: int): int = x + y
  5. const a = 9
  6. var x = 45
  7. x ⊙= a⊞++4⊙3
  8. var y = 45
  9. y *= 9 + 4 * 3
  10. assert x == y