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.9 required=5.0 tests=BAYES_00,FORGED_GMAIL_RCVD, FREEMAIL_FROM autolearn=no autolearn_force=no version=3.4.4 X-Google-Thread: 103376,64fe8f87aae99538 X-Google-Attributes: gid103376,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!c65g2000hsa.googlegroups.com!not-for-mail From: Maciej Sobczak Newsgroups: comp.lang.ada Subject: Re: How to return an empty aggregate Date: Sun, 6 Apr 2008 12:53:11 -0700 (PDT) Organization: http://groups.google.com Message-ID: <1e92bc4a-3b14-49ba-bc27-5e191d77dc3b@c65g2000hsa.googlegroups.com> References: <945217e8-ec37-4a33-9847-28e8e7d55798@59g2000hsb.googlegroups.com> <2c23eecd-d5bf-4320-b0cd-a45b584ddfe3@m36g2000hse.googlegroups.com> <0742cf95-b2a9-438a-98ac-318f1f1c311e@d1g2000hsg.googlegroups.com> NNTP-Posting-Host: 85.3.234.135 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207511592 8489 127.0.0.1 (6 Apr 2008 19:53:12 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Sun, 6 Apr 2008 19:53:12 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c65g2000hsa.googlegroups.com; posting-host=85.3.234.135; posting-account=bMuEOQoAAACUUr_ghL3RBIi5neBZ5w_S User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Xref: g2news1.google.com comp.lang.ada:20850 Date: 2008-04-06T12:53:11-07:00 List-Id: On 6 Kwi, 00:36, george.p...@gmail.com wrote: > > I would create the derived (concrete) log that is *empty* and does > > nothing and pass it as Log'Class to wherever it is expected. > > It cannot be simpler than that. > > So you derive concrete from not-empty type? I derive empty concrete from the interface: type Log is interface; procedure Put (L : in Log; S : in String) is abstract; -- ... type Null_Log is new Log with null record; procedure Put (L : in Null_Log; S : in String) is begin -- some pragma here to shut up warnings -- about unused parameters null; end Put; -- Maciej Sobczak *www.msobczak.com*www.inspirel.com