defn
Lexical & Dynamic Scope Damon Kelley Writing Micro About Aug 9, 2016 — 4 min read Lexical & Dynamic Scope Take this snippet of pseudo-code var a = 1 defn g()…
Lexical & Dynamic Scope Damon Kelley Writing Micro About Aug 9, 2016 — 4 min read Lexical & Dynamic Scope Take this snippet of pseudo-code var a = 1 defn g() print a defn h var a = 10 print a defn f() var a = 2 g() If we were to call g, what value would print out? Would it print out at all? Would it raise an exception? The answer to these questions depends on the scoping rules of this…





