On Tue, Mar 15, 2005 at 12:20:16PM +1100, Russell Shaw wrote: > How is a pointer to a nested function any different to a pointer to > an un-nested function? Why need trampolines?
Because you have to pass the context of that nested function somehow, so that it can access variables in the outer functions. An alternative implementation technique is to give pointers to functions that can be nested two words, one to point to the function, the other to pass the "display", a data structure that allows variables in outer functions to be accessed.