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.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,965fbd9798ca1677 X-Google-Attributes: gid103376,public From: lutz@iks-jena.de (Lutz Donnerhacke) Subject: Re: Return by reference Date: 1999/11/03 Message-ID: #1/1 X-Deja-AN: 543951413 Distribution: world Content-Transfer-Encoding: 8bit References: Content-Type: text/plain; charset=ISO-8859-1 Organization: IKS GmbH Jena Mime-Version: 1.0 User-Agent: slrn/0.9.5.7 (UNIX) Newsgroups: comp.lang.ada Date: 1999-11-03T00:00:00+00:00 List-Id: * 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' ;-)). >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.