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,1c4bf3a1bd5d40f3 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2002-11-06 20:30:49 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!news.kjsl.com!news-peer-lilac.gradwell.net!news-peer.gradwell.net!not-for-mail Newsgroups: comp.lang.ada From: porton@ex-code.com (Victor Porton) Date: Thu, 07 Nov 2002 09:21:21 +0500 References: <3dc92622$0$308$bed64819@news.gradwell.net> Subject: Re: Booch: missing r/w access through iterators Mime-Version: 1.0 X-Newsreader: knews 1.0b.1 Content-Type: text/plain; charset=us-ascii Message-ID: <3dc9ec63$0$300$bed64819@news.gradwell.net> NNTP-Posting-Date: 07 Nov 2002 04:30:27 GMT NNTP-Posting-Host: 195.149.39.13 X-Trace: 1036643427 news.gradwell.net 300 mail2news/195.149.39.13 X-Complaints-To: news-abuse@gradwell.net Xref: archiver1.google.com comp.lang.ada:30506 Date: 2002-11-07T04:30:27+00:00 List-Id: In article , Simon Wright writes: > porton@ex-code.com (Victor Porton) writes: > >> In Booch generic package BC.Containers there are >> function Current_Item which gives read-only access >> to the current item. Why a function giving direct >> read-write access to the current item (by returning >> access to it) is missing?! > > I think you are looking for > > generic > with procedure Apply (Elem : in out Item); > procedure Access_Current_Item (In_The_Iterator : Iterator'Class); > -- Call Apply for the Iterator's current Item. I noticed Access_Current_Item, but with it to gain such access one needs to create a new procedure! Too bad. I want direct access like: function Current_Item_Access(It: Iterator'Class) return Item_Access;