It seems like the language requires Pascal/C89 style declarations on top of the scope. I've never been sure why Pascal developers have stuck to this convention for so long. Is it the zeal to preserve single-pass compilation?
Yes, that's from the Pascal/Modula/Oberon heritage. It's both a design style and a feature to support single-pass compilation (know the stack size and offsets of all parameters and locals before parsing/generating the body). Even that C/C++ are my main languages, I have no problem with declaring variables and nested procedures on top. It's just a matter of taste and getting used to it.
Yes, that's from the Pascal/Modula/Oberon heritage. It's both a design style and a feature to support single-pass compilation (know the stack size and offsets of all parameters and locals before parsing/generating the body). Even that C/C++ are my main languages, I have no problem with declaring variables and nested procedures on top. It's just a matter of taste and getting used to it.