Code Select
(let ((x 1))
(let ((f (lambda (y)
(+ x y)))
(g (lambda (f y)
(let ((x 3))
(f y)))))
(g f 2)))
which is also valid Scheme, evaluates to 5 in newLISP, indicating that f gets its value for the free variable x from the binding in g, rather than from the outermost binding in its definition, which is 1. In Scheme (Guile and mzscheme), the same code evaluates to 3, indicating that when f is evaluated inside of g the previous binding of x to 1 is used (static binding). The trend in functional languages these days is going towards static binding, because referential transparency is considered a valuable property, and languages that do dynamic binding make referential transparency all but impossible (e.g. the function f in my example would evaluate to different values in a context that had a different binding for the free variable x). I would be of a mind to question the wisdom of this behavior, seeing as every new functional language since the mid-1980's has made use of static binding. I suppose it must be easier to implement, as Richard Stallman has often said (of Emacs LISP, which also uses it), but are there other more pressing reasons for this design decision?