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.1 required=5.0 tests=BAYES_00, PP_MIME_FAKE_ASCII_TEXT autolearn=no autolearn_force=no version=3.4.4 Path: buffer2.nntp.dca1.giganews.com!border2.nntp.dca1.giganews.com!nntp.giganews.com!newspeer1.nac.net!newsfeed.xs4all.nl!newsfeed7.news.xs4all.nl!feeds.phibee-telecom.net!weretis.net!feeder4.news.weretis.net!gandalf.srv.welterde.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: If not Ada, what else... Date: Thu, 30 Jul 2015 13:10:06 -0500 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <87mvz36fen.fsf@jester.gateway.sonic.net><2215b44f-8a89-47c6-a4c4-52b74d2dac45@googlegroups.com><9e492c82-868d-43d3-a18a-38274400e337@googlegroups.com><40184feb-4053-4ac3-8eaa-c3bd9cd8a77c@googlegroups.com><10272577-945f-4682-85bc-8ad47f3653ae@googlegroups.com><87si8i81k2.fsf@atmarama.net> <8076cbd0-2655-4c98-b70e-cb5f0c32e4ba@googlegroups.com><5e6cb30b-5f8c-4fed-969e-3941315ecba0@googlegroups.com><87si87nf8k.fsf@jester.gateway.sonic.net> <877fpiom3q.fsf@jester.gateway.sonic.net> <87wpximwv0.fsf@jester.gateway.sonic.net> NNTP-Posting-Host: rrsoftware.com X-Trace: loke.gir.dk 1438279807 24812 24.196.82.226 (30 Jul 2015 18:10:07 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Thu, 30 Jul 2015 18:10:07 +0000 (UTC) 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.6157 Xref: number.nntp.giganews.com comp.lang.ada:194535 Date: 2015-07-30T13:10:06-05:00 List-Id: "Paul Rubin" wrote in message news:87wpximwv0.fsf@jester.gateway.sonic.net... > Björn Lundin writes: >>> Will look there, but those kinds of containers are more useful with GC. >> I think you are missing the point. Many things in Ada is done without >> allocating with 'new' And things that are, if OO, may inherit from >> Ada.Finalized, which gives a call to the objects' 'Finalize' method >> where deallcation - if necessary - can be done. So, the user does not >> fiddle with new/free. > > Right, that's sort of like C++ RAII. But GC gives you much more > flexibility. For example, maybe you want to allocate a container and > then pass it to another thread to work on it. What does this have to do with GC? When you pass a container to another task, it gets passed like any other parameter (by-reference in this case). There's no need to create an explicit access type. You need explicit access types in Ada only when you need to have a dynamically organized structure. And even some of those can be replaced by a container (lots of structures are really multi-way trees, so the tree container ought to work well for managing them). (There's also a few cases involving function returns where one might need them for efficiency reasons -- but worrying about that is premature optimization -- only introduce access types if you've demonstrated that the performance is insufficient.) Randy.