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=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1ed4b5bd91d02f0b X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!postnews.google.com!i12g2000prf.googlegroups.com!not-for-mail From: Graham Newsgroups: comp.lang.ada Subject: Re: using an Ada.Container as a private type Date: Thu, 3 Apr 2008 09:20:40 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1cc05c5f-2c29-46d9-88fc-03c4f8c93029@i12g2000prf.googlegroups.com> References: <42c84166-c7e4-42e0-b1bf-2104d3bb0cda@e10g2000prf.googlegroups.com> <151julprm1vv4.82a26cafccm6$.dlg@40tude.net> NNTP-Posting-Host: 86.140.79.145 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207239641 20573 127.0.0.1 (3 Apr 2008 16:20:41 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Thu, 3 Apr 2008 16:20:41 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: i12g2000prf.googlegroups.com; posting-host=86.140.79.145; posting-account=04rmagoAAABZ9PN7u3MdbKIs6DPG57E- User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.13) Gecko/20061201 Firefox/2.0.0.13 (Ubuntu-feisty),gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20786 Date: 2008-04-03T09:20:40-07:00 List-Id: On Apr 3, 5:02 pm, "Dmitry A. Kazakov" wrote: > On Thu, 3 Apr 2008 08:29:28 -0700 (PDT), Graham wrote: > > Hi, > > I'm writing a little financial application. I want to model a > > stream of payments made at arbitrary periods (the periods are positive > > numbers; they might be actual dates later on). > > > I think I want to declare this: > > > type Payment_Stream is private; > > > procedure Add_To_Payment_Stream( > > stream : in out Payment_Stream; > > period : Positive; > > amount : Money ); > > > ...... > > > and then privately declare the payment stream as an Ordered Map, like: > > > private > > > package Payment_Stream_Package is new Ada.Containers.Ordered_Maps( > > Element_Type => Money, > > Key_Type => Positive ); > > > type Payment_Stream is new Payment_Stream_Package.Map; > > type Payment_Stream is new Payment_Stream_Package.Map with null record; > > > but I can't do this. Gnat complains that "type derived from tagged > > type must have extension". > > -- > Regards, > Dmitry A. Kazakovhttp://www.dmitry-kazakov.de Oh, I see (I think..) Thanks very much to both of you. Graham