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,fa18fb47ddd229a7 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-12-17 12:25:47 PST Path: archiver1.google.com!news2.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news-out.visi.com!petbe.visi.com!newspeer.monmouth.com!newsfeed.mathworks.com!nntp.TheWorld.com!not-for-mail From: Robert A Duff Newsgroups: comp.lang.ada Subject: Re: Proposed change to BC iterator parameters Date: 17 Dec 2003 15:25:46 -0500 Organization: The World Public Access UNIX, Brookline, MA Message-ID: References: NNTP-Posting-Host: pip1-5.std.com Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: pcls4.std.com 1071692746 8274 192.74.137.185 (17 Dec 2003 20:25:46 GMT) X-Complaints-To: abuse@TheWorld.com NNTP-Posting-Date: Wed, 17 Dec 2003 20:25:46 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2 Xref: archiver1.google.com comp.lang.ada:3515 Date: 2003-12-17T15:25:46-05:00 List-Id: "amado.alves" writes: > <<... > Avoid global data > All inputs and outputs of a procedure should appear in their parameter > lists > > Following these simple guidelines usually makes code a lot easier to follow.>> > In the big, yes, but not in the small, namely in loops, ifs, and... visits. That's a good point. The reason this thing is a generic, forcing the body of the loop to be in a separate procedure, is that Ada has such weak support for iterators. If a procedure is naturally a procedure, then it might make sense to say that it shouldn't be messing around with global data. But in this case, it's just the body of a loop, so *of course* it touches the data local to the procedure containing the loop. The fact that those variables are global to the loop-body procedure is accidental. - Bob