> @Araq: We could come up with a simple rule like: The last section of top > level statements of the main .nim file is turned into a proc. A section is a > list of statements that is not disrupted by proc, func, ... declarations. It > would be pretty easy to implement. But it's not clear that it's worth it.
**Please, do NOT do this!** Nim is already a big language. Special treatment of such a dubious corner-case would be bad. Global variables, unless they are compile-time constants, come with their own set of problems and better be avoided in well designed code. Besides, as you already mentioned `--gc:arc` or '\--gc:orc' (soon to be default) alleviates the problem.