chenhsi / Ambroscum

An interpreter/compiler for a programming language we're probably going to create
MIT License
0 stars 0 forks source link

Scoping #25

Closed chenhsi closed 10 years ago

chenhsi commented 10 years ago

What statements create a scope?

Obviously, certain statements like function and class declarations have a scope exclusive to them. However, should other conditional statements (specifically if, while, and for) also create scopes? In Java they do, but in Python they do not (afaik).

Currently, the code is set up to follow Python's standard; however, I do not know if you prefer Java's policy. I do not have a strong opinion myself, so if you would desire, I can change the way the code currently works.

edgao commented 10 years ago

I strongly prefer not creating new scopes for loops and conditionals, so let's just leave it as is.