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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,f89c9977a6e4ceda X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-10 21:48:42 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-fra1.dfn.de!news-mue1.dfn.de!newsfeed.vmunix.org!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Mon, 11 Nov 2002 10:41:22 +0500 References: <3dcb8eec$0$307$bed64819@news.gradwell.net> Organization: Extreme Code Software (http://ex-code.com) Subject: Re: Missing in Booch: range operations Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii X-URL: http://www.ex-code.com/ Message-ID: <3dcf44ba$0$300$bed64819@news.gradwell.net> NNTP-Posting-Date: 11 Nov 2002 05:48:42 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1036993722 news.gradwell.net 300 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30701 Date: 2002-11-11T05:48:42+00:00 List-Id: In article , Simon Wright writes: > porton@ex-code.com (Victor Porton) writes: > >> I don't understand what is "the STL/Charles view of iteration" and > > I meant, the idea that two iterators designate a range within a > container over which some algorithm is to be applied. You cause me to wonder that you don't want accept this! Programmers often need to deal with a range of elements of a container. I now deal with exactly this (modifying a HTML stream I consider parts of a HTML element as ranges in the buffer to which I read from a file). In any case I use this range, but now I just designate it by natural numbers instead of iterators. Well, e.g. many sorting algorithms deal with ranges. Why?!! > This modified code nearly compiles: > > with BC.Containers; > generic > with package Containers_Base is new BC.Containers (<>); > For_Container : in out Containers_Base.Container'Class; > package BC.Containers.Container_Instance is > Container : Containers_Base.Container'Class renames For_Container; > type Iterator is new Containers_Base.Iterator with private; > function New_Iterator return Iterator'Class; > private > type Iterator is new Containers_Base.Iterator with null record; > end BC.Containers.Container_Instance; > > package body BC.Containers.Container_Instance is > function New_Iterator return Iterator'Class is > begin > return Iterator'Class (Containers_Base.New_Iterator (Container)); > end; > end BC.Containers.Container_Instance; > > but fails with > > bc-containers-container_instance.ads:10:09: type must be declared > abstract or "RESET" overridden > > and when you think about it it's hard to see how this type Iterator > could be of any use (the concrete iterators in BCs are derived from > BC.Containers.Iterator, not from this new one). I don't see your point about how this scheme of derivation would disturb its use. P.S. I want iterator ranges. May be I will even create modified version of Booch at SourceForge. I think this split would not cause any harm to the community as in any case we now only in the process of standartization of Ada Standard Containers.