std/outparams

Source   Edit  

outParamsAt macro for easy writing code that works with both 2.0 and 1.x.

Macros

macro outParamsAt(positions: static openArray[int]; n: untyped): untyped
Use this macro to annotate out parameters in a portable way.

Example:

proc p(x: var int) {.outParamsAt: [1].} =
  discard "x is really an 'out int' if the Nim compiler supports 'out' parameters"
Source   Edit