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,FREEMAIL_FROM autolearn=unavailable autolearn_force=no version=3.4.4 X-Received: by 10.182.126.137 with SMTP id my9mr4143556obb.13.1390520581334; Thu, 23 Jan 2014 15:43:01 -0800 (PST) X-Received: by 10.50.234.163 with SMTP id uf3mr18114igc.4.1390520581166; Thu, 23 Jan 2014 15:43:01 -0800 (PST) Path: border1.nntp.dca3.giganews.com!backlog4.nntp.dca3.giganews.com!border4.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!uq10no3373090igb.0!news-out.google.com!vg8ni9igb.0!nntp.google.com!c10no2610270igq.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Thu, 23 Jan 2014 15:43:00 -0800 (PST) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=66.126.103.122; posting-account=KSa2aQoAAACOxnC0usBJYX8NE3x3a1Xq NNTP-Posting-Host: 66.126.103.122 References: <20a36d96-850e-4020-8dfa-777eb9c944f4@googlegroups.com> <9e27abb7-e944-4bd4-a10c-600fe4da7872@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <0301ad03-929d-4c9b-8849-494f7f78c777@googlegroups.com> Subject: Re: Binary and XML serialization of types From: adambeneschan@gmail.com Injection-Date: Thu, 23 Jan 2014 23:43:01 +0000 Content-Type: text/plain; charset=ISO-8859-1 X-Original-Bytes: 2569 Xref: number.nntp.dca.giganews.com comp.lang.ada:184533 Date: 2014-01-23T15:43:00-08:00 List-Id: 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). Anyway, my goal was to help the OP understand intuitively why it wouldn't make sense to have a type declared in one package and then allow a property of that type to be changed in some other package. I hope I got that across, even if I did so badly. -- Adam