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-Thread: 103376,ffc9e2fe760c58fd X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news2.google.com!news4.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newscon06.news.prodigy.com!prodigy.net!newspeer.monmouth.com!nntp.abs.net!news.abs.net!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Records that could be arrays References: From: Stephen Leake Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (windows-nt) Cancel-Lock: sha1:jQIenpLFSSsNVYCvRJUDwlnFKGI= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Date: Thu, 23 Feb 2006 08:11:01 -0500 NNTP-Posting-Host: 66.159.65.1 X-Complaints-To: abuse@toad.net X-Trace: news.abs.net 1140700269 66.159.65.1 (Thu, 23 Feb 2006 08:11:09 EST) NNTP-Posting-Date: Thu, 23 Feb 2006 08:11:09 EST Xref: g2news1.google.com comp.lang.ada:3102 Date: 2006-02-23T08:11:01-05:00 List-Id: Jean-Pierre Rosen writes: > Justin Gombos a �crit : >> I have set a rule for myself: Composite types composed solely of one >> type of element should be declared as arrays rather than records. >> I've never seen this rule in a coding standard. The idea is that you >> can be more expressive with an array. Example- there are more options >> when it comes to an arrays role in control structures. Plus the >> "others =>" notation is available. Thoughts? >> > I beg to disagree here. Arrays are for *iterative* structures, if you > don't have a for loop over an array, it should be a record. This is a good point. However, in my experience, I often end up using a for loop in ancilliary places, even if there is no for loop in the main use of the type. For example, Text_IO Put, Get, and AUnit checks, are more easily done with for loops. > The fact that all components are of the same type may be an accident > that changes during program evolution. Yes. -- -- Stephe