Wow, that was needlessly complicated and (IMO) incorrect.<p>Any function that has free variables that are not global variables is a closure. Another way to think about it: any function that cannot be implemented in C is a closure.<p>So, in these examples, the inner functions are closures, the outer ones are not, but <i>only</i> because the outer ones are used in a global scope. If you enclosed everything in another function, then also the outer functions would be closures.