The mistake I had on the original slides were simply a misnaming of the formal arguments to foo. Now that these are fixed, it is clear that the question is how the x inside foo is resolved: always to the statically enclosing (global declaration, in this case) or to the most recently bound x during execution (the parameter to bar).