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-08 12:33:47 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: mheaney@on2.com (Matthew Heaney) Newsgroups: comp.lang.ada Subject: Re: Booch: missing r/w access through iterators Date: 8 Nov 2002 12:33:46 -0800 Organization: http://groups.google.com/ Message-ID: <1ec946d1.0211081233.fb278a9@posting.google.com> References: <3dc92622$0$308$bed64819@news.gradwell.net> NNTP-Posting-Host: 66.162.65.162 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1036787627 7178 127.0.0.1 (8 Nov 2002 20:33:47 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: 8 Nov 2002 20:33:47 GMT Xref: archiver1.google.com comp.lang.ada:30606 Date: 2002-11-08T20:33:47+00:00 List-Id: porton@ex-code.com (Victor Porton) wrote in message news:<3dc92622$0$308$bed64819@news.gradwell.net>... > 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?! The Charles library has such a function: generic type Element_Access is access all Element_Type; function Generic_Element (Iterator : Iterator_Type) return Element_Access; This allows you to modify elements in place: type Element_Access is access all Element_Subtype; function To_Access is new Generic_Element (Element_Access); declare E : Element_Type renames To_Access (Iterator).all; begin end; You can get the latest version of Charles at my home page: http://home.earthlink.net/~matthewjheaney/charles/index.html