Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!uunet!mcsun!ukc!edcastle!aiai!jeff From: jeff@aiai.ed.ac.uk (Jeff Dalton) Newsgroups: comp.lang.misc Subject: Re: Closures (was Re: class-sic.) Message-ID: <4022@skye.ed.ac.uk> Date: 28 Jan 91 19:38:38 GMT References: <20058@yunexus.YorkU.CA> <27942:Jan902:20:0791@kramden.acf.nyu.edu> <27770.278aef90@kuhub.cc.ukans.edu> <22345:Jan1021:30:4591@ <1991Jan21.120628.2749@waikato.ac.nz> Reply-To: jeff@aiai.UUCP (Jeff Dalton) Organization: AIAI, University of Edinburgh, Scotland Lines: 35 In article <1991Jan21.120628.2749@waikato.ac.nz> ldo@waikato.ac.nz (Lawrence D'Oliveiro, Waikato University) writes: >The only surviving language I know of that implements a proper >closure facility is POP-11. Some LISP hackers seem to think they've got >closures too, but they haven't--all they've got is an almost-as-useful >kludge that requires call frames to be allocated on the heap. Not so. First, you are assuming a particular definition of "closure" that does too much violence to current usage. Scheme, for example, has lexical closures, and this is a perfectly reasonable and not at all improper use of "closure". Other dialects of Lisp have dynamic closures (Lisp 1.5) or closures where the variables to close over are listed explicitly (Lisp Machine Lisp, Franz). Second, if you think that every function call has to do some heap allocation in Lisp, you are mistaken. What Pop has is "frozen formals". There may well not be any other language that has exactly that facility, but it is not too hard to add an equivalent to Lisp. (Where the discussion usually goes at this point is that the Pop ideologue starts to list other aspects of Pop -- uses of closures, if you will -- that aren't so easy to duplicate.) However, if you want to maintain your "proper closure" claim above, please give us some evidence that yours really is the proper definition (and tell us what your definition is while you're at it). (Sigh. Why are some Pop fans so committed to atacking (and misrepresenting) Lisp? From the Scheme point of view, what Pop has might well be called a hack to make up for the lack of proper closures, and one could point out many cases where the Scheme facility is more useful. I would certainly be annoyed at having to list the formals to freeze every time I made a closure. But, fortunately, the Scheme folk don't try to insist that there is but one proper notion of closure in the world.)