what is a closure?

Nick Trout nickatvideosystemdotcodotuk
Mon Dec 18 06:22:51 EST 2000


:-D

So "what is a closure" and "does Python have first class functions" are 2
difficult and controversial questions to ask! :-)



"Terry Reedy" <tjreedy at udel.edu> wrote in message
news:91dmf7$efb$1 at news.udel.edu...
>
> "Steve Horne" <sh at ttsoftware.co.uk> wrote in message
> news:8nck3tocsg8kp1u2g1du6nd3lt9gfeckr2 at 4ax.com...
> > I was reading a book about developing compilers recently (Modern
> > Compiler Design, by Dick Grune, Henri Bal, Ceriel Jacobs and Koen
> > Langendoen), and something that was presented in it was a 'closure
> > algorithm'. This took a collection of data and some related
> > expressions, and repeatedly evaluated the expressions using both
> > original and previously derived data until all the data it was
> > possible to derive was fully derived.
> >
> > The thing that made it a closure algorithm seemed to be the fact that
> > the expressions were applied repeatedly on an accumulating set of data
> > until no further data could be derived - the closure being the
> > complete collection of data.
>
> This sounds like 'transitive closure', often denoted by '*', which is
> different from function closure.
>
>
>





More information about the Python-list mailing list