3 ms·
Scheme does the same thing too: scheme@(guile-user)> (define (foo) (write where-did-this-come-from)) ;;; <stdin>:1:14: warning: possibly unbound variable `wher
by kragen 13y ago
Scheme does the same thing too:
scheme@(guile-user)> (define (foo) (write where-did-this-come-from))
;;; <stdin>:1:14: warning: possibly unbound variable `where-did-this-come-from'
scheme@(guile-user)> (define where-did-this-come-from "the damn global scope")
scheme@(guile-user)> (foo)
"the damn global scope"scheme@(guile-user)>
Munificent's assertion that this doesn't represent lexical scoping is wrong, but his assertion in another thread that with() is an exception to lexical scoping is correct, and therefore JS is not lexically scoped, just mostly lexically scoped.