logoalt Hacker News

darubedarobyesterday at 7:41 AM1 replyview on HN

But.. why ? Globals are just variables that reside in the wrapping env table that also contain the C functions. If a closures is a onion of table lookups out of the function context from local -> function scope -> global scope is simply the last lookup before a not found variable with nil is declared?


Replies

andrewmcwattersyesterday at 4:47 PM

Module exports with side effects, and setting environments doesn’t guarantee global access.