Daniel B. answered 05/12/21
PhD in Computer Science with 42 years in Computer Research
As an example consider the standard Lisp function map.
In some flavors of Lisp you can write a function foo containing
(map 'list (lambda (x) (sqrt x)) '(1 4 36))
which computes the square root of each element of the given list.
So the above expression would evaluate to '(1 2 6).
However, you could write a different map function that visits the given list in reverse,
resulting in (6 2 1).
By looking at the implementation of foo you cannot tell which version of map
will be in the dynamic environment invoking foo, and hence which version
of map will be called by foo.
In contrast, if the scoping were static then foo would always invoke the global map,
independently of any re-implementation of map available at run time.