The following code is currently well-formed:
length := 1
But length can't ever be used. In particular:
length := 1; length
will cause the parser to look for a function application, which doesn't exist, resulting in a parsing error.
There are two possible solutions for this problem:
- Forbid users from defining a variable with a function name entirely.
- Have two namespaces properly: one for function names and one for variable names (there's no higher-order function in this language anyway...) and change the parser to allow the above filter.