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.3 required=5.0 tests=BAYES_00,INVALID_MSGID, MSGID_RANDY autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e511f3ccb3da24af X-Google-Attributes: gid103376,public From: mjsilva@my-deja.com Subject: Re: How to make like Fortran "do i = 1,20,2" Date: 2000/07/28 Message-ID: <8lsg7k$q55$1@nnrp1.deja.com>#1/1 X-Deja-AN: 651879883 References: <8lpcbe$40n$1@news.uit.no> <39805669.3E7CF6CF@lmtas.lmco.com> <7rhf9bb362.fsf@butter.albany.duck.com> <3981A390.A1F3D127@lmtas.lmco.com> X-Http-Proxy: 1.1 x61.deja.com:80 (Squid/1.1.22) for client 206.169.137.75 Organization: Deja.com - Before you buy. X-Article-Creation-Date: Fri Jul 28 17:34:44 2000 GMT X-MyDeja-Info: XMYDJUIDmjsilva Newsgroups: comp.lang.ada X-Http-User-Agent: Mozilla/4.0 (compatible; MSIE 5.0; Windows 98; DigExt) Date: 2000-07-28T00:00:00+00:00 List-Id: In article <3981A390.A1F3D127@lmtas.lmco.com>, Gary Scott wrote: > > > Matthew J Heaney wrote: > > > > Gary Scott writes: > > > > > Hmmm, these and similar examples posted do not make Ada look very > > > elegant...it makes a very simple concept seem somewhat convoluted. > > > > This "very simple concept" is a major source of bugs -- that's why it's > > not in the language. > > "Studies" of language usage and error inducing constructs can be made to > support virtually any preconceived notion. I'm more interested in > producing the code that solves a particular problem in the easiest to > understand and straightforward form rather than in the most elegant in > terms of abstraction. Of course it is very common... I don't think there's any concensus that this is the case. Just for grins I checked my current project (in C) and found 241 "for" loops. Not a single one had a step size other than 1. OTOH, each of those 241 loops would have a much more elegant form in Ada... >...to use steps in > languages with somewhat limited alternative constructs in certain > circumstances when the problem might be solved in another way more > clearly and/or elegantly. Fortran 95 supports all of the alternative > methods presented so far in addition to the single DO-STEP construct. Out of curiosity does Fortran 95 have the equivalent of Ada's various implicit loop bounds (I in X'range, I in X'first..X'last, I in X_type)? Mike Sent via Deja.com http://www.deja.com/ Before you buy.