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/28 Message-ID: #1/1 X-Deja-AN: 170653998 references: <4rb9dp$qe6@news1.delphi.com> <4t9un9$imn@goanna.cs.rmit.edu.au> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-07-28T00:00:00+00:00 List-Id: In article <4t9un9$imn@goanna.cs.rmit.edu.au>, Richard A. O'Keefe wrote: >>How much are upward funargs used in day to day functional programming? I >>think Bob Duff is still looking for a compelling example of why they are >>so much better than the explicitly simulated closure via an instance of a >>tagged type. > >Whenever you simulate any mechanism, >...[all manner of evil happens] True, but the logical conclusion is that all useful mechanisms that anybody has ever thought of should be included in the language. One has to make a trade-off between a useful gizmo and language complexity (etc). Anyway, I think this argument is getting confused between "downward closures" and "full closures". If I understand your example correctly, it needs downward closures, but not full closures. True? I have argued in favor of downward closures (because in my experience they have been very useful, and they are very cheap to implement). But I remain unconvinced about full closures (because they seem less commonly needed, and they are substantially more expensive to implement -- although your benchmark shows that in at least one case, the run-time cost is a myth). And the only serious example anybody posted was Ackermann's function, which is useful in explaining how full closures work, but doesn't exactly make me want to use them every day. I have never in my entire career needed to compute Ackermann's function, as far as I can recall. ;-) - Bob