Skip to main content
  1. Notes/

Dynamic Scoping

Table of Contents
  • used by: original Lisp, Emacs Lisp, TeX, Perl, scripting languages
  • generally considered to be a mistake
  • not robust: names of local variables can interfere with other parts of the program!
    • global reasoning required
    • 3rd party libraries need to document local variables
    • security risk: allows access to local variables from the outside
  • allows one to simulate default parameters

Example #

  • C++ output stream (hex)