comp.lang.ada
 help / color / mirror / Atom feed
From: "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de>
Subject: Re: Return by reference
Date: Sun, 17 Dec 2017 15:57:02 +0100
Date: 2017-12-17T15:57:02+01:00	[thread overview]
Message-ID: <p160js$1ndt$1@gioia.aioe.org> (raw)
In-Reply-To: a94cf715-a4a4-42bb-8800-9bb6a8baf9ac@googlegroups.com

On 2017-12-17 15:38, Jere wrote:
> Implicit dereference has gone a long way in providing
> a sort of return by reference capability in Ada.

I don't think this is a right way anyway. A great number of application 
interested in in-place semantics would rather like to implement 
referential semantics of their own, possibly unrelated to any access 
type at all. Consider as example a DB interface:

    Table.Select (Column) := Value;

There is simply to object to get access to.

Using iterators and holders is one method, which is as you have noticed 
quite clunky, requires helper types obscuring everything, and still 
requiring access types.

I would prefer language-assisted delegation to a getter/setter pair:

    function Getter (To : Container) return Element;
    procedure Setter (To : in out Container; Item : Element);

-- 
Regards,
Dmitry A. Kazakov
http://www.dmitry-kazakov.de

  reply	other threads:[~2017-12-17 14:57 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-17 14:38 Return by reference Jere
2017-12-17 14:57 ` Dmitry A. Kazakov [this message]
2017-12-18  0:51   ` Mehdi Saada
2017-12-18  8:18     ` Dmitry A. Kazakov
2017-12-18 10:47       ` Mehdi Saada
2017-12-18 12:16         ` Dmitry A. Kazakov
2017-12-18 22:41     ` Randy Brukardt
2017-12-18 22:33 ` Randy Brukardt
2017-12-19  1:29   ` Jere
  -- strict thread matches above, loose matches on Subject: below --
1999-11-01  0:00 Brian Rogoff
1999-11-02  0:00 ` Robert A Duff
1999-11-02  0:00   ` Brian Rogoff
1999-11-03  0:00     ` Matthew Heaney
1999-11-03  0:00       ` Matthew Heaney
1999-11-03  0:00       ` Brian Rogoff
1999-11-03  0:00     ` Lutz Donnerhacke
1999-11-03  0:00       ` Brian Rogoff
1999-11-04  0:00         ` Lutz Donnerhacke
1999-11-06  0:00           ` Brian Rogoff
1999-11-07  0:00             ` Lutz Donnerhacke
1999-11-04  0:00       ` Robert A Duff
1999-11-02  0:00 ` Lutz Donnerhacke
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox