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: george.priv@gmail.com Newsgroups: comp.lang.ada Subject: Re: How to return an empty aggregate Date: Mon, 7 Apr 2008 13:23:35 -0700 (PDT) Organization: http://groups.google.com Message-ID: <43907652-a6ce-4b51-8907-ce0a65277f15@c65g2000hsa.googlegroups.com> References: <945217e8-ec37-4a33-9847-28e8e7d55798@59g2000hsb.googlegroups.com> <2c23eecd-d5bf-4320-b0cd-a45b584ddfe3@m36g2000hse.googlegroups.com> <922ed137-6353-4b11-b7cd-03987ef6896b@e39g2000hsf.googlegroups.com> <4683ef29-28aa-47a1-9603-114666c15eab@m71g2000hse.googlegroups.com> NNTP-Posting-Host: 151.196.71.114 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: posting.google.com 1207599816 1805 127.0.0.1 (7 Apr 2008 20:23:36 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Mon, 7 Apr 2008 20:23:36 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: c65g2000hsa.googlegroups.com; posting-host=151.196.71.114; posting-account=VnNb3AoAAACTpRtCcTrcjmPX7cs92k1Q User-Agent: G2/1.0 X-HTTP-Via: 1.1 SPARKS X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; 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:20871 Date: 2008-04-07T13:23:35-07:00 List-Id: On Apr 6, 4:04 pm, Maciej Sobczak wrote: > On 6 Kwi, 09:00, george.p...@gmail.com wrote: > > > You receive the events for logging but you don't want > > 5,000,000 records of the same to go in when some device malfunctions. > > You rather want first 10, and something stating that this is serious > > condition, etc. Is there a way to use stateless adapter or you have to > > have a context? > > There is a way to have a filter Log that feeds its selected output > into another Log'Class - and that second Log object can be whatever, > including empty null log. > > Hint: essentially you want some Ada equivalent of the following pipe > construct: > > $ someprogram | head > somefile.log > > which in some particular case might become just: > > $ someprogram | head > /dev/null > > as opposed to direct: > > $ someprogram > somefile.log > > or: > > $ someprogram > /dev/null > > The presence of "head" filter changes nothing in the applicability of / > dev/null - that's why, in Ada terms, it can always have the same > implementation: > > type Null_Log is new Log with null record. > > -- > Maciej Sobczak *www.msobczak.com*www.inspirel.com I think you misunderstand. I am not questioning value of the concept of adapter in general. My point was that value of adapter (strategy if you wish) with no context is approaching 0 and my example was to demonstrate precisely that point. G.