proc incx(i: int): int =
let j = i
{.emit: "++j;".}
result = j

echo incx(5)

https://glot.io/snippets/gfgq0p65a6
let で定義された変数も書き換え可能なんですね素敵ですね