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!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!feeder.eternal-september.org!news.stack.nl!reality.xs3.de!news.jacob-sparre.dk!loke.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail From: "Randy Brukardt" Newsgroups: comp.lang.ada Subject: Re: Binary and XML serialization of types Date: Thu, 23 Jan 2014 18:58:51 -0600 Organization: Jacob Sparre Andersen Research & Innovation Message-ID: References: <20a36d96-850e-4020-8dfa-777eb9c944f4@googlegroups.com> <9e27abb7-e944-4bd4-a10c-600fe4da7872@googlegroups.com> <0301ad03-929d-4c9b-8849-494f7f78c777@googlegroups.com> NNTP-Posting-Host: static-69-95-181-76.mad.choiceone.net X-Trace: loke.gir.dk 1390525131 15657 69.95.181.76 (24 Jan 2014 00:58:51 GMT) X-Complaints-To: news@jacob-sparre.dk NNTP-Posting-Date: Fri, 24 Jan 2014 00:58:51 +0000 (UTC) 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.6157 Xref: news.eternal-september.org comp.lang.ada:18275 Date: 2014-01-23T18:58:51-06:00 List-Id: wrote in message news:0301ad03-929d-4c9b-8849-494f7f78c777@googlegroups.com... > On Thursday, January 23, 2014 2:44:16 PM UTC-8, Simon Wright wrote: > >> > What's going on is that if some client package says "with A.Types" and >> > uses the Guid_Write type, and uses Guid_Write'Write(...) or >> > Guid_Write'Output(...), the client has to know that there's a Write >> > routine that isn't the default. That's why the "for Guid_Write'Write >> > use ..." has to be in the visible part of A.Types, so that other >> > clients are allowed to know about it. >> >> The type was called Guid. > >> But, more importantly, are you sure about this? GNAT's >> Ada.Containers.Vectors, for example, declares the stream-related stuff >> in the private part. > > Sorry, I think I must have had caffeine deficiency syndrome when I wrote > that. > > You're right. Here's what I should have said: > > What's going on is that "for Guid'Write" specifies a property, or > "aspect", of the type Guid, > and that needs to be done in the same place where Guid is defined, which > in this case is > the package specification (although it could be in the private part). To clarify (or confuse?) this more, it does have to be visible if Guid is a limited type, because in that case it won't have a usable 'Write unless it is explicitly defined. For other types, it can be in the private part. Randy.