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!aioe.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: How to get Ada to ?cross the chasm?? Date: Wed, 9 May 2018 21:48:26 +0200 Organization: Aioe.org NNTP Server Message-ID: References: <1c73f159-eae4-4ae7-a348-03964b007197@googlegroups.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> <87lgd1heva.fsf@nightsong.com> <87zi1gz3kl.fsf@nightsong.com> <878t8x7k1j.fsf@nightsong.com> <87k1sg2qux.fsf@nightsong.com> NNTP-Posting-Host: kQkuQcRDy1QFvWpyB1foYw.user.gioia.aioe.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: abuse@aioe.org User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 X-Notice: Filtered by postfilter v. 0.8.3 Content-Language: en-US Xref: reader02.eternal-september.org comp.lang.ada:52166 Date: 2018-05-09T21:48:26+02:00 List-Id: On 2018-05-09 21:41, Niklas Holsti wrote: > On 18-05-09 00:46 , Dmitry A. Kazakov wrote: >> On 2018-05-08 23:28, Niklas Holsti wrote: >>> On 18-05-07 10:25 , Dmitry A. Kazakov wrote: >>>> On 07/05/2018 03:31, Paul Rubin wrote: >>>>> "Dmitry A. Kazakov" writes: >>>>>> This is easily done in present Ada using handles to a >>>>>> reference-counted objects. >>>>> >>>>> That's not much different from gc from the user's perspective, other >>>>> than problems handling cycles. >>>> >>>> Cycles are easily avoidable too by separating target objects and >>>> handles. All target objects types go into the private part of the >>>> package. When only handles are visible there is no way the end user >>>> could construct a cycle. >>> >>> True for a single such data structure; much harder if the client >>> combines different, independently implemented data structures and >>> stores, in one structure, handles that point at the other structure, >>> and perhaps in the other direction too. Since the implementations of >>> the two data structures are ignorant of each other's existence, >>> neither can detect such cross-structure cycles, I believe. >> >> Yes, but that is a bad design anyway. I would say that all such cases >> fall into the category when references going in one direction are strong >> and the backward ones are weak. > > That makes it difficult to maintain value semantics for these data > structures; how could one have "weak" and "strong" values? Weak and strong references. E.g let there be a list of files to show, the references in the list are weak. In the files directory the references to the files are strong. When you remove a file from the directory that removes the file and renders the weak reference in the list invalid. The list is updated to remove the file from there. If list references were strong the file will never be removed. -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de