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=0.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: rogoff@sccm.Stanford.EDU (Brian Rogoff) Subject: Re: Q: access to subprogram Date: 1996/07/30 Message-ID: #1/1 X-Deja-AN: 171244259 references: <4rb9dp$qe6@news1.delphi.com> organization: /u/rogoff/.organization reply-to: rogoff@sccm.stanford.edu newsgroups: comp.lang.ada Date: 1996-07-30T00:00:00+00:00 List-Id: bobduff@world.std.com (Robert A Duff) writes: In article , Brian Rogoff wrote: >I think that you posted that you like Smalltalk blocks a lot, which are >essentially just anonymous closures, right? Yes, I did post that. But it's not because they are full closures -- almost all of the uses in my code, and almost all of the uses I've seen, are the downward kind. On reflection, this makes a lot of sense, because a lot of the uses I saw of full closures in Scheme (in the SICP book) would use Smalltalk objects. So in a language with both objects and closures, full closures might seem redundant. If your experience can be generalized, it seems like some kind of (potentially anonymous) downward closure construct would fit in well with the Ada ideal of "high abstraction if it can be easily implemented efficiently". I guess that this is one of the constructs Magnus Kempe had in mind when he mentioned that he thought Ada could have headed further in the direction of functional programming. <... other reasons for liking anonymous blocks deleted ...> >....I think the beauty of this >construct is that you can implement lots of features cleanly in terms of >it, like control structures. No, that merely requires downward closures. I'm still looking for an example that really makes the upward direction look wonderfully powerful. I'm still thinking :-). I don't know if you'll find a "killer example", just a wide range of examples that can be solved using closures. >...Also the implementation of closures on objects >seems heavy/verbose to me. True. But that's OK, unless full closures are really as powerful and commonly needed as I've heard. Powerful, yes. If you have objects, downward closures, packages and generics, they might be a bit redundant. -- Brian