Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!hplabs!otter.hpl.hp.com!otter!sfk From: sfk@otter.hpl.hp.com (Steve Knight) Newsgroups: comp.lang.misc Subject: Re: Re^4: Closures (was Re: class-sic.) Message-ID: <2400030@otter.hpl.hp.com> Date: 25 Jan 91 09:46:31 GMT References: <446@data.UUCP> Organization: Hewlett-Packard Laboratories, Bristol, UK. Lines: 27 Ken writes: > I must claim ignorance of Pop, but in common usage [...] > a closure is called such because it captures free variables by > "closing over" the environment at time of creation. This differs from > currying [see (1), (3)] which seems to be what you mean by "closure". ^^^^^^^^ Partial application, not currying, of course. I presume this is a slip of the fingers. Yes, partial application can be used to implement a full-closure mechanism. It is fairly easy to transform (nested) procedures so that they have no free-variables EXCEPT for global-variables -- this is akin to lambda-lifting but works equally well in imperative languages. This transformation assumes partial application works, of course. Having transformed a program into this form, all closure-forming operations are trivially tackled by partial application, since formal parameter lists are the only environments that need to be closed over. This resolves the conflict of terminology. > Again, my viewpoint comes from literature in lambda calculus and > denotational semantics. Are there references in the general > literature which support your definition? As you can see, the same ones :-) Steve