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=-0.3 required=5.0 tests=BAYES_00, REPLYTO_WITHOUT_TO_CC autolearn=no 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!news3.google.com!feeder1-2.proxad.net!proxad.net!feeder2-2.proxad.net!newsfeed.arcor.de!newsspool4.arcor-online.net!news.arcor.de.POSTED!not-for-mail From: "Dmitry A. Kazakov" Subject: Re: using an Ada.Container as a private type Newsgroups: comp.lang.ada User-Agent: 40tude_Dialog/2.0.15.1 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Reply-To: mailbox@dmitry-kazakov.de Organization: cbb software GmbH References: <42c84166-c7e4-42e0-b1bf-2104d3bb0cda@e10g2000prf.googlegroups.com> Date: Thu, 3 Apr 2008 18:02:48 +0200 Message-ID: <151julprm1vv4.82a26cafccm6$.dlg@40tude.net> NNTP-Posting-Date: 03 Apr 2008 18:02:48 CEST NNTP-Posting-Host: f9826511.newsspool3.arcor-online.net X-Trace: DXC=CZfXKMIRG\:nBOkdL^Lo7>McF=Q^Z^V384Fo<]lROoR1^;5]aA^R6>2T`HEQ_c?<<2[6LHn;2LCV>[ 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. Kazakov http://www.dmitry-kazakov.de