University of Washington • CSE583 • D. Notkin © 2000
55
First-class functions and scoping
lWhat if you return a function that has free variables?
–In lexical scoping, they should be bound in the context in which it is defined
–In dynamic scoping, they should be bound in the context in which it is used
lThis is a classic issue, called the (upwards) funarg problem