define ((
(make-adder (lambda (x) (make-closure)))
(make-closure (lambda () (function (lambda (y) (addx y)))))
(addx (lambda (z) (plus x z)))
(do-test (lambda () (prog (a)
(setq a (make-adder 4))
(print (a 2))
(print (a 3))
(setq a (make-adder 5))
(print (a 2))
(print (a 3)))))
))
=> (make-adder make-closure addx do-test)
do-test ()
6
7
7
8
=> NIL
In make-closure, the "function" special form binds the "(lambda (y) (addx y))" to the current dynamic environment, in which x is bound to the argument to make-adder.
In the old literature this was called the FunargDevice. Passing a function as an argument to another function (such as maplist) was known as a DownwardFunarg. Returning a function as the value of another function was known as an UpwardFunarg or a FunctionalValue. Nowadays, functions that take functions as arguments or return functions as values are normally known as HigherOrderFunctions. See ftp://publications.ai.mit.edu/ai-publications/pdf/AIM-199.pdf for a discussion of how the "Funarg Problem" was dealt with in the days of dynamic scope.
Henry Baker published a method for implementing DynamicClosure and ShallowBinding. http://www.pipeline.com/~hbaker1/ShallowBinding.html