Normally this is used for producing very large lists in an on-demand manner, rather than precomputing, but it can be abused for some very unique things.
I'm not 100% certain what you are describing, but it sounds like using continuations.
I have made a gist which should illustrate it maybe a little better: https://gist.github.com/anonymous/24a43cd81843e79df52d
Perhaps you want even more access to environments elsewhere in the call stack; ISTR that there are languages now that allow that.
Of course, doing stuff like that makes it much harder to reason about your programs than treating functions as sealed boxes that communicate via arguments and return values, which is one (but not the only!) reason why most languages deliberately don't make it easy to do.