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!nntp-feed.chiark.greenend.org.uk!ewrotcd!newsfeed.xs3.de!io.xs3.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: Unbounded_String'Write et al in GNAT Date: Wed, 15 Nov 2017 16:34:28 -0600 Organization: JSA Research & Innovation Message-ID: References: Injection-Date: Wed, 15 Nov 2017 22:34:29 -0000 (UTC) Injection-Info: franka.jacob-sparre.dk; posting-host="rrsoftware.com:24.196.82.226"; logging-data="17215"; 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: feeder.eternal-september.org comp.lang.ada:48919 Date: 2017-11-15T16:34:28-06:00 List-Id: "Simon Wright" wrote in message news:lyzi7oew9c.fsf@pushface.org... > Victor Porton writes: ... > So Unbounded_String _must_ support 'Read, 'Write, 'Output, 'Input, but > it's up to the compiler vendor to implement them, which GNAT does *in* > *the* *private* *part* - which is exactly the way the standard expects > any other vendor to do it. The ARG goes to a lot of trouble to ensure > that a vendor can implement the standard's requirements. > > [1] http://www.ada-auth.org/standards/rm12_w_tc1/html/RM-13-13-2.html#p2 Correct. All non-limited types defined in the Standard or by language-defined declarations have to properly support 'Read, 'Write and the rest. How that happens is up to the implementation. It might be the case that some compiler can implement Unbounded_String'Read and so on without any explicit code (that is, the default implementation does the right thing), in which case no additional code is necessary. Based on your message, GNAT needs to override the default implementation for Unbounded_String and thus does so in the private part. That's exactly the way it ought to work. In general, looking at a particular implementation's source code for a language-defined package can give one the wrong idea about the implementation. One should depend only on the RM definition and its requirements as much as possible, as that maximizes portability. Randy.