poly: more parsing quirks
chsievers opened this issue · comments
Christian Sievers commented
- The outermost expression can't be a let expression:
Poly> let x=0 in x
"<stdin>" (line 1, column 11):
unexpected reserved word "in"
expecting letter or digit
- Unlike let declarations, let expressions don't allow function definitions with arguments:
Poly> (let f x = x in f 0)
"<stdin>" (line 1, column 8):
unexpected "x"
expecting "="
- let rec expressions aren't recursive:
Poly> (let rec x = x in x)
Not in scope: "x"
- Since
fix
is a special syntactic form that has to be applied to an expression, I expectedg fix x
not to parse. Instead, it is parsed asg (fix x)
.