comp.lang.ada
 help / color / mirror / Atom feed
From: Brian Rogoff <bpr@shell5.ba.best.com>
Subject: Re: Return by reference
Date: 1999/11/03
Date: 1999-11-03T00:00:00+00:00	[thread overview]
Message-ID: <Pine.BSF.4.10.9911032055450.14434-100000@shell5.ba.best.com> (raw)
In-Reply-To: slrn820g0f.l7.lutz@taranis.iks-jena.de

On 3 Nov 1999, Lutz Donnerhacke wrote:
> * Brian Rogoff wrote:
> >In any case, in response to Lutz Donnerhack, who wonders why I might want
> 
> 'Donnerhacke' (= 'thunder & hoe') please. Today exaktly seven guys with this
> surname live on this earth. 'Donnerhack' is much more common (something like
> 'Smith' ;-)).

My apologies.

> >to do such a thing, consider the problem of trying to write a printf like
> >like formatting library in Ada. One interface (proposed in the programming
> >FAQ at adahome) goes something like this
> >
> >    type Format_Type is limited private;
> >
> >    function  Format(S : in String) return Format_Type;
> >    procedure Printf    (Fmt : in Format_Type);
> >    function "&" (Fmt : in Format_Type; S : in String)    return Format_Type;
> >    function "&" (Fmt : in Format_Type; I : in Integer)   return Format_Type;
> >
> >etc.
> >
> >I was going to use the "Rosen trick" to modify data in the Fmt each time 
> >"&" is called. Unfortunately, that requires making the full view of
> >Format_Type limited and you run into the problem I described. 
> >
> >Is there a cleaner way to implement that interface? 
> 
> To my first and ignorant view it should work fine with an unlimited type.
> I implemented it for myself to check this view. Your will get it by E-Mail.

Thanks for the code, but I already know how to do this with a type whose 
public view is limited and its private view, not limited. I was wondering
if I can do this entirely with minimal potential copying.

-- Brian





  reply	other threads:[~1999-11-03  0:00 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-11-01  0:00 Return by reference Brian Rogoff
1999-11-02  0:00 ` Lutz Donnerhacke
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 [this message]
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
  -- strict thread matches above, loose matches on Subject: below --
2017-12-17 14:38 Jere
2017-12-17 14:57 ` Dmitry A. Kazakov
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
replies disabled

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