Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!mcsun!ukc!mucs!chl From: chl@cs.man.ac.uk (Charles Lindsey) Newsgroups: comp.lang.misc Subject: Re: first class functions Keywords: proc, function, first class, scope, algol-68 Message-ID: Date: 6 Mar 91 15:10:27 GMT References: <3787@bruce.cs.monash.OZ.AU> Organization: Dept. Of Comp Sci, Univ. of Manchester, UK. Lines: 40 In <3787@bruce.cs.monash.OZ.AU> lloyd@bruce.cs.monash.OZ.AU (lloyd allison) writes: >Does anyone know the full story about why Algol-68 >did not allow heap proc, >or something like, and thus widen the scope (!) of procs? You answer your own question fairly well below. >In AB37.4.2 July 1974 there is a proposal for partial-parametrization >by Charles Lindsey which discusses some of the problems of proc scope. >Bekic is mentioned as having a proposal for lifting the >scope restriction on procs. Bekic argued his case strongly during the period leading to the Revised ALGOL 68 Report. The trouble is that there are both run-time and compile-time penalties for this feature, and it is difficult to tell at compile time whether the extra run-time stuff can safely be omitted in the simple cases (thus the Bauer-Samelson criterion - that people who do not use a feature should not pay for it - is violated). I was able to show that partial parametrization provided equivalent functionality to the Bekic proposal, but of course the user then had to explicitly indicate when he needed the extra facilities. In fact, I understand that the ALGOL 68RS system does in fact implement the Bekic proposal, or something close to it. Moreover, all current functional languages do it as a matter of course, but then they have long ago given up the stack model for their implementations. I could send you the relevant working paper on the subject if you really want to see all the gory detail. >B.T.W. did any A68 every implement the partial-p' extension? Not that I know of. >Lloyd ALLISON >Department of Computer Science, UUCP:lloyd@bruce.cs.monash.edu.au >Monash University, Clayton, or :uunet!munnari!bruce.cs.monash.edu.au!lloyd >VICTORIA 3168, AUSTRALIA Tel :565-5205 FAX: +61 3 565 5146