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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,fa18fb47ddd229a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-11 07:18:48 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!news.tele.dk!news.tele.dk!small.news.tele.dk!fr.ip.ndsoftware.net!teaser.fr!enst.fr!melchior!cuivre.fr.eu.org!melchior.frmug.org!not-for-mail From: ada_wizard@toadmail.com Newsgroups: comp.lang.ada Subject: Re: Proposed change to BC iterator parameters Date: Thu, 11 Dec 2003 10:05:38 -0500 Organization: Cuivre, Argent, Or Message-ID: NNTP-Posting-Host: lovelace.ada-france.org X-Trace: melchior.cuivre.fr.eu.org 1071155144 43995 80.67.180.195 (11 Dec 2003 15:05:44 GMT) X-Complaints-To: usenet@melchior.cuivre.fr.eu.org NNTP-Posting-Date: Thu, 11 Dec 2003 15:05:44 +0000 (UTC) To: comp.lang.ada@ada-france.org Return-Path: X-Virus-Scanned: by amavisd-new-20030616-p5 (Debian) at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.3 Precedence: list List-Id: Gateway to the comp.lang.ada Usenet newsgroup List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:3371 Date: 2003-12-11T10:05:38-05:00 MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit User-Agent: Internet Messaging Program (IMP) 3.2.1 "Steve" writes: > "Robert A Duff" wrote in message > news:wccekvc2rol.fsf@shell01.TheWorld.com... > [snip] > > > > I don't understand the point of Param_Type and Param above. If you want > > to pass extra information to Apply, nest the instantiation in a place > > where it can see that data. > > The reason for Param_Type and Param is to avoid using data outside of the > scope of the Apply routine except for the arguments to the Apply machine. > It comes from that old school of thought: > Avoid global data > All inputs and outputs of a procedure should appear in their parameter > lists Just for the record, I agree with Robert Duff here :). While the rules you state are in general reasonable, no rule should be treated as an absolute. A local instantiation of a generic iterator that accesses data in the local scope that is not in the parameter list is _not_ using global data. SAL takes this approach. In addition, it is useful to have a version of the iterator that does _not_ take Param_Type. I haven't looked at the booch components (yes, that is a failing on my part :); perhaps it offers both flavors of iterators. For me, that is an unnecessary complication, requiring extra testing and maintenance. On a slightly related topic: There was an interesting paper at the SigAda conference yesterday (I'm posting from my hotel) on "shortcuts" as an efficient way to implement "safe" containers (no dangling links, even when iterators are used to delete items). Looked like a good idea; I recommend checking it out. I think the proceedings will be in a future issue of Ada Letters. -- -- Stephe ___________________________________________________________ This mail sent using ToadMail -- Web based e-mail @ ToadNet