Hacker News new | ask | show | jobs
by projektfu 47 days ago
Perhaps you were thinking of lexical scope vs dynamic scope? Lexical scoping would prevent a local definition of inner from changing the definition used in outer.

  (let ((inner (lambda (x) (+ x 3)))) (outer 5))
  "7"
But updating the definition of inner with set! or define changes the top-level definition.
1 comments

Yes, I was thinking of lexical scope; as in redefining the function shadows the existing one and doesn't change the function already defined uses of call.