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!gandalf.srv.welterde.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: Return by reference Date: Mon, 18 Dec 2017 16:41:54 -0600 Organization: JSA Research & Innovation Message-ID: References: <4d13b387-b813-449f-93b1-850822560578@googlegroups.com> Injection-Date: Mon, 18 Dec 2017 22:41:56 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="20534"; 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:49524 Date: 2017-12-18T16:41:54-06:00 List-Id: "Mehdi Saada" <00120260a@gmail.com> wrote in message news:4d13b387-b813-449f-93b1-850822560578@googlegroups.com... > Not like they were omnicient, but people in ARG certainly had at least > some reasons to provide a "clunky" mechanism ? Surely. Every mechanism that we tried ended up simply regressing the problem -- there still was a non-user-defined dereference involved. And that had to be controlled, lest one be able to make long-lived copies of the dereferenced access type. It turned out that access discriminants have the right lifetime to do the control, and making the type with an access discriminant controlled gives the necessary hook. So it was much less change than a new kind of function return that really didn't solve the problem anyway. Dmitry's delegation scheme would have worked, I guess, but such things can't replace assignment because they don't make sense for discriminant-dependent components. So you'd lose the assignment syntax, or have a horrible wart in the way it works. Randy.