my old code compiles so far without problems. But I think I have problems to understand the scoping rules for "if". As far as I understood, this should compile:
proc reverseFac(val : int): int =
return
if (let n = 1; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 2; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 3; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 4; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 5; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 6; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 7; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 8; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 9; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 10; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 11; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 12; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 13; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 14; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 15; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 16; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 17; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 18; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 19; var x = 1; for i in 1..n: x *= i; x == val) : n
elif (let n = 20; var x = 1; for i in 1..n: x *= i; x == val) : n
else : -1
but I got an error at the first elif with a redefinition of n.
cheers, Adrian.
Can't compile the newparser branch on macosx, log at http://dl.dropbox.com/u/145894/t/recompile_log.2640.txt.
EDIT: Ok, so you need to download fresh C sources from http://build.nimrod-code.org, then it compiles.