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,334f9012742e58fc X-Google-NewGroupId: yes X-Google-Attributes: gida07f3367d7,domainid0,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news2.google.com!postnews.google.com!x21g2000yqa.googlegroups.com!not-for-mail From: Phil Clayton Newsgroups: comp.lang.ada Subject: Re: Gnat GPL 2010 available soon (conditional expressions) Date: Wed, 7 Jul 2010 05:00:47 -0700 (PDT) Organization: http://groups.google.com Message-ID: References: <2010061621145016807-sjs@essexacuk> <4c270613$0$6974$9b4e6d93@newsspool4.arcor-online.net> <1wuwvzgwlwgli$.1birkinieia0d$.dlg@40tude.net> <1ur19ais2ejih.mjbgdsv9pr66.dlg@40tude.net> <4c275562$0$6987$9b4e6d93@newsspool4.arcor-online.net> <4c276114$0$2378$4d3efbfe@news.sover.net> <7ec98a71-edcb-4851-87fd-6702fb963829@q12g2000yqj.googlegroups.com> <8ac6b8d6-f4c0-4a8b-b3aa-ff6f2d136544@k39g2000yqb.googlegroups.com> <1wl74eppoqii9$.1oxpbe851z3jk$.dlg@40tude.net> <87dfe70c-fd5b-4b76-8e37-b38539826502@y11g2000yqm.googlegroups.com> <4payn5nzd163$.8nb20d9btack.dlg@40tude.net> NNTP-Posting-Host: 91.110.176.12 Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: posting.google.com 1278504075 23975 127.0.0.1 (7 Jul 2010 12:01:15 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Wed, 7 Jul 2010 12:01:15 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x21g2000yqa.googlegroups.com; posting-host=91.110.176.12; posting-account=v7gx3AoAAABfjb9m5b7l_Lt2KVEgQBIe User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-GB; rv:1.9.0.15) Gecko/2009102704 Fedora/3.0.15-1.fc10 Firefox/3.0.15,gzip(gfe) Xref: g2news2.google.com comp.lang.ada:13220 Date: 2010-07-07T05:00:47-07:00 List-Id: On Jul 6, 6:18=A0pm, "Dmitry A. Kazakov" wrote: > On Tue, 6 Jul 2010 09:31:05 -0700 (PDT), Phil Clayton wrote: > > The concept of an order is important because the function F could have > > side effects in the above example (though I would not advocate that as > > good practice). > > AFAIK, presently the order is not defined. So though this is legal > > =A0 =A0X : String (1..80) :=3D (others =3D> Character'Read (Stream'Access= )); > > It is not a good idea. It would be good if the order was not defined because that would prevent people depending on it, so making it easier for a compiler to parallelize. > > However, we would be able to write > > > =A0 (for I in reverse A'Range =3D> A(I)) > > > to represent the reverse of the array A is perhaps a little confusing. > > The effect is undefined. Theoretically the compiler could initialize arra= y > elements concurrently on a multi-core processor. There are really two concepts here: 1. the order of evaluation of the expressions for each index 2. the value the bound variable I gets for each index I didn't make it clear that I was switching from [1] to [2], sorry. This above reverse example was really about [2] to show that the use of the keyword 'reverse' would result in I having the value A'Last at index A'First, A'Last - 1 at index A'First + 1, etc. I don't think it matters whether A(I) is evaluated for each index in parallel, so I think the expression should be well defined. > > Also, it really only makes sense to have one variable holding the > > array index. =A0For example, if we could write > > > =A0 (I, J : 1 .. 5 =3D> ...) > > > surely I and J would always be equal: there are only 5 elements in the > > array. =A0Having > > > =A0 (for I in 1 .. 5 =3D> ...) > > > syntactically rules out multiple variables. > > Yes, but many other things as well. However I prefer an absolutely > different approach anyway, e.g. proper index types. In my world a diagona= l > would be initialized like: > > =A0 =A0(Diagonal (5, 5) =3D> 1.0, others =3D> 0.0) > > where Diagonal is a proper function. Interesting.. how would you make the expression a function of the index? For example, how would you write (for I in 3 .. 8 =3D> A(I) + B(I - 2)) ? Phil