tsidee3.nim 295 B

123456789101112131415161718
  1. discard """
  2. file: "tsidee3.nim"
  3. output: "5"
  4. """
  5. var
  6. global: int
  7. proc dontcare(x: int): int {.noSideEffect.} = return x
  8. proc noSideEffect(x, y: int, p: proc (a: int): int {.noSideEffect.}): int {.noSideEffect.} =
  9. return x + y + dontcare(x)
  10. echo noSideEffect(1, 3, dontcare) #OUT 5