[Python-ideas] A "local" pseudo-function
Steven D'Aprano
steve at pearwood.info
Tue May 1 03:11:46 EDT 2018
On Tue, May 01, 2018 at 06:06:06PM +1200, Greg Ewing wrote:
> Steven D'Aprano wrote:
> >Pascal, for example, had lexical scoping back in the 1970s, but
> >no closures.
>
> Well, it kind of had a limited form of closure. You could pass
> a procedure or function *in* to another procedure or function
> as a parameter, but there was no way to return one or pass it
> out in any way. This ensured that the passed-in procedure or
> function couldn't outlive its lexical environment.
So what was the closure? If the surrounding function was still running,
there was no need to capture the running environment in a closure?
Not a rhetorical question, I'm genuinely unsure.
--
Steve
More information about the Python-ideas
mailing list