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.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!feeder.eternal-september.org!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.de!news.jacob-sparre.dk!franka.jacob-sparre.dk!pnx.dk!.POSTED.rrsoftware.com!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Tue, 1 May 2018 17:17:58 -0500 Organization: JSA Research & Innovation Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.com> <87k1su7nag.fsf@nightsong.com> <87po2la2qt.fsf@nightsong.com><87in8buttb.fsf@jacob-sparre.dk> <87wowqpowu.fsf@nightsong.com><16406268-83df-4564-8855-9bd0fe9caac0@googlegroups.com><87o9i2pkcr.fsf@nightsong.com> <87in88m43h.fsf@nightsong.com> Injection-Date: Tue, 1 May 2018 22:17:59 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="6422"; mail-complaints-to="news@jacob-sparre.dk" X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5931 X-RFC2646: Format=Flowed; Original X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.7246 Xref: reader02.eternal-september.org comp.lang.ada:51894 Date: 2018-05-01T17:17:58-05:00 List-Id: "Paul Rubin" wrote in message news:87in88m43h.fsf@nightsong.com... ... > A cleaner approach imho is immutable data passed by reference (this is > how most of functional programming works). It's not really feasible to > code in that style in Ada, as far as I can tell. Why do you say that? It's not done that often, but plenty feasible: an immutably limited type is always passed by reference, and constants don't change (with a few technical exceptions easily avoided if you wish), so one can easily use limited records in that way: type Data is limited record ... function Munge (Obj : in Data) return Data; The problem comes (in any design) when you start using references rather than the actual objects; my point was that you need to minimize references (in all forms) to really reduce these issues. A reference necessarily leads to dangling references or methods to avoid such -- and that way leads to madness (or GC, roughly equivalent ;-). Claw uses references in only a very few targetted situations; almost everything in the GUI is constructed by aggregation. Works great (even if a bit stale since it is for Win32). Randy.