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!.POSTED!not-for-mail From: Paul Rubin Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Thu, 03 May 2018 17:28:10 -0700 Organization: A noiseless patient Spider Message-ID: <87vac4z2lh.fsf@nightsong.com> 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> <87efiuope8.fsf@nightsong.com> <322f9b26-01de-4753-bb50-6ef2f3d993d8@googlegroups.com> <87a7th9pd1.fsf@nightsong.com> <87h8no1nli.fsf@nightsong.com> <874ljo1hvy.fsf@nightsong.com> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: reader02.eternal-september.org; posting-host="cfddbed4150ee81aab76f63ea380976f"; logging-data="20697"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/XV517Fe7rbvTh7mLa16a3" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.3 (gnu/linux) Cancel-Lock: sha1:0b2g77gw+Ks9z0nCUmeyVpYpFAc= sha1:rDB7mOMYorLe9j8LHATDMC5igHY= Xref: reader02.eternal-september.org comp.lang.ada:51960 Date: 2018-05-03T17:28:10-07:00 List-Id: "Randy Brukardt" writes: > All of the Ada containers have "cursors", which serve the reference > function. You need something like that to specify where to insert something > in a tree ("insert_child (tree, parent)" - the parent is represented by a > cursor). Ok, but can you insert the same child tree into multiple places in the parent? If yes, what happens if you insert it in 5 places, then delete 3 of them, then insert a few more, then delete some of those? Is there reference counting, or are you supposed to do it manually? If manually, why would you choose to use such a system if you had an automatic one available? What if you want one of the elements of a tree node to be a pointer to its parent? That's very common in (say) expression trees in compilers, which you work on, or similarly in XML DOM objects or the like. So that's a natural source of circular structure in data. In that case, reference counting can fail because if you delete a node, its subtrees can become unreachable while still containing references. GC is a completely normal way to handle this. > Depends on the job, of course. Much of my software indeed works that way, > because there is much less security issues with compiled-in settings. There is something to be said for that, but I've still been taught that a principle of configuration management (CM) is to keep stuff like compilers away from the system as much as you can, so who knows. In the case of the corporate jargon generator though, I'd consider the phrase lists to be data rather than settings. So having them compiled into the program still seems awfully primitive.