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-09 09:35:05 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!newsfeed.media.kyoto-u.ac.jp!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Sat, 09 Nov 2002 21:12:57 +0500 References: <3dcb8eec$0$307$bed64819@news.gradwell.net> Subject: Re: Missing in Booch: range operations Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii Message-ID: <3dcd4746$0$301$bed64819@news.gradwell.net> NNTP-Posting-Date: 09 Nov 2002 17:35:02 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1036863302 news.gradwell.net 301 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30657 Date: 2002-11-09T17:35:02+00:00 List-Id: In article , Simon Wright writes: > porton@ex-code.com (Victor Porton) writes: > >> generic >> For_Container: in out Containers_Library.Container_Type; >> package Container_Instance is >> Container: Containers_Library.Container_Type renames For_Container; >> type Iterator is new Containers_Library.Iterator; >> function New_Iterator return Iterator; >> end; > > I don't at first see how to do this in the BCs, where the > Container_Type and Iterator (BTW, if you are going to say > Container_Type, eew, why not Iterator_Type?) are abstract .. > > but there would be no point anyway unless I make the major change of > supporting the STL/Charles view of iteration, and the likelihood of > that is minimal. I don't understand what is "the STL/Charles view of iteration" and why you don't want add my code. In the first letter I've written just a rough template (for both Booch and Charles) which is something like Booch, but not Booch. Now the code for Booch (not checked for errors!): generic For_Container: in out BC.Containers.Container'Class; package BC.Containers.Container_Instance is Container: BC.Containers.Container'Class renames For_Container; type Iterator is new BC.Containers.Iterator; function New_Iterator return Iterator'Class; end; generic For_Container: in out BC.Containers.Container'Class; package body BC.Containers.Container_Instance is function New_Iterator return Iterator'Class is begin return Iterator'Class(BC.Containers.New_Iterator(Container)); end; end;