6 ms·
That looks like no scoping at all? I think JavaScript is a bit like that? But most languages would prevent that kind of thing?
by Tichy 17y ago
That looks like no scoping at all? I think JavaScript is a bit like that? But most languages would prevent that kind of thing?
- regularfry 17y agoIt's not no scoping - it's specifically scoped to where the call to f() was made, rather than where it was defined. It basically makes everything in scope in g() available to f() as a hidden parameter. Pre-CL Lisps had this by default. defvar is, as far as I can tell (still learning!) how you get at it now.
- Tichy 17y agoThanks for the info. At first sight it looks impossible to handle (how do you know what variables f expects), but maybe there is a technique to it I don't know yet.