mutating parameter var vs global var added by outtabwz on Sat Aug 1 02:14:34 2020
func mutate(x: var int): int = x = 42 var x: int = -9 echo "x: ", x echo "mutate(x): ", mutate(x) echo "x: ", x # output: # x: -9 # mutate(x): 0 # x: 42
func mutate(x: var int): int = x = 42 var x: int = -9 echo "x: ", x echo "mutate(x): ", mutate(x) echo "x: ", x # output: # x: -9 # mutate(x): 0 # x: 42