From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,99ab4bb580fc34cd X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Q: access to subprogram Date: 1996/07/23 Message-ID: #1/1 X-Deja-AN: 169751671 references: <4rb9dp$qe6@news1.delphi.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-23T00:00:00+00:00 List-Id: In article , Brian Rogoff wrote: >Hi Bob, Hi Brian, > While this is now straying a bit from Ada 95, Indeed. I hope people don't get too annoyed at us for discussing general language design stuff. >.. I'm curious as to >whether you find Pascal style iterators using downward funargs (there, I'm >using Lisp terminology) superior to CLU/Sather-1.0 style iterators. No. When I was a Pascal programmer many years ago, I used procedures-as-params a lot for iterators. But CLU iterators are clearly superior. I don't know Sather, but from what I've read, they seem even more superior. >...And >how do the Ada 95 alternatives stack up? Not very well, I'm afraid. You can use generics, but you end up with a lot of verbose junk for some simple things. Sigh. >... Also, were these downward funargs >widely used, or was there a small set of problems in which they were the ideal >vehicle of expression, like the multidimensioal integration example? I'd say Pascal's downward "funargs" were widely used for iterators. At least in the code I saw, and the code I wrote. >...I realize >in Scheme that functions are used for everything, so I am interested more in >the answer for Pascal and other Ada-like languages. > > This is a really fascinating question in language design. Indeed. >...I'd like >find some examples like the ones Richard O'Keefe posted, and see what the >best Ada 95 alternatives are. That way I can get a better sense as to how much >we are really missing. Ada's generics can do *almost* everything that Pascal can do. They can't recurse, in Ada, like they can in Pascal. (I needed that once.) And they're verbose, as I said. Smalltalk's version is pretty nice, by the way. You don't pass procedures -- you pass blocks. And that avoids the annoyance of having to name something that doesn't need or deserve a name -- it's just the Body_Of_The_Loop, or whatever. - Bob P.S. I was away for more than a week, so I may have missed some answers to my question about full closures. Did anybody answer that?