Hello everyone,
I was wondering if I just stumbled upon a bug here. Why does this compile and output 10? Shouldn't it be an error to define variables with the same name of arguments to the proc?
proc test(a : int = 0) =
let a = 10
echo a
test()
No, in fact it's common idiom to do this:
proc test(n: int) =
let n = n - 1 # my indexing starts at 0 or something
echo a[n]