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=unavailable autolearn_force=no version=3.4.4 X-Received: by 2002:a0c:b5c5:: with SMTP id o5mr18427921qvf.6.1560718646844; Sun, 16 Jun 2019 13:57:26 -0700 (PDT) X-Received: by 2002:a9d:6c13:: with SMTP id f19mr19843859otq.76.1560718646618; Sun, 16 Jun 2019 13:57:26 -0700 (PDT) Path: eternal-september.org!reader01.eternal-september.org!feeder.eternal-september.org!news.gegeweb.eu!gegeweb.org!usenet-fr.net!proxad.net!feeder1-2.proxad.net!209.85.160.216.MISMATCH!j96no3412641qte.0!news-out.google.com!33ni387qtt.0!nntp.google.com!j96no3412633qte.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Newsgroups: comp.lang.ada Date: Sun, 16 Jun 2019 13:57:26 -0700 (PDT) In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=47.185.234.171; posting-account=zwxLlwoAAAChLBU7oraRzNDnqQYkYbpo NNTP-Posting-Host: 47.185.234.171 References: <728c4668-8fa0-4a57-a502-2bf476fc3940@googlegroups.com> <67a4abcc-6a33-40af-a3c4-6855b3bf8226@googlegroups.com> User-Agent: G2/1.0 MIME-Version: 1.0 Message-ID: <89a5a38e-ac42-4418-a694-fda5affefe75@googlegroups.com> Subject: Re: Latest suggestion for 202x From: Optikos Injection-Date: Sun, 16 Jun 2019 20:57:26 +0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Xref: reader01.eternal-september.org comp.lang.ada:56652 Date: 2019-06-16T13:57:26-07:00 List-Id: On Sunday, June 16, 2019 at 3:10:55 PM UTC-5, John Perry wrote: > On Sunday, June 16, 2019 at 2:34:05 PM UTC-5, Optikos wrote: > > 2) Algol-family languages (especially the widely-influential Algol60 an= d the otherwise-influential-on-Ada Algol68) utilize brackets [] for array i= ndexing. Nearly all other programming languages (which often are little mo= re than Algol60 rejiggered a little bit) have followed Algol's lead on arra= y indexing via bracket [] syntax. >=20 > One exception to this rule is Eiffel, which uses the @ operator. I decide= d to see if I could find a summary, and [1] has it. The only really strange= one IMHO is Haskell, which uses !. >=20 > (This doesn't contradict what you wrote; I just thought it was interestin= g trivia.) >=20 > [1] https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28= array%29#Indexing Continuing with the thought of not-() and not-[] oddball languages, let's c= onsider what is going on over in the ML family (of which Haskell is a [dist= ant?] cousin): Over in the ML family languages, array indexing/subscripting has the follow= ing variety of syntaxes=E2=80=94one of which resembles the Fortran=E2=80=93= Ada a(i) style: 1) Standard ML invokes a function sub as in sub( a, i ), calling to mind su= bscripts in mathematics notation. 2) CAML allows the shorthand a.(i), somewhat calling to mind the Fortran=E2= =80=93Ada precedent of a(i) and the mathematics function notation (but perh= aps the . is to also be a visual nod-of-the-hat to the location of subscrip= ts at or below the baseline typographically). The shorthand a.(i) is short= for the verbose Array.get a i. https://caml.inria.fr/pub/docs/manual-ocaml/libref/Array.html 3) OCaml reserves [] for lists, so OCaml novelly devised [| |] for calling = out elements of an array as in a[|i|]. http://xahlee.info/ocaml/ocaml_list.html 4) Breaking with ATS's otherwise strong influence by SML and OCaml as well = as break-in with its homage to mathematics/logic (e.g., renaming what we ca= ll types to be sorts as in logic; bringing in a thing called type that has = no direct analogy in our programming languages), an ATS sats library defers= to Algol's [] convention as in a[i] as shorthand for the verbose array0_ge= t_elt_at( a, i ). And because I forgot to mention it on a prior posting above (although it ha= s nothing to do with ML family), PL/1 follows Fortran's lead of a(i) syntax= , meaning that as far as array syntax goes there is a Fortran=E2=80=93PL/1= =E2=80=93Ada continuity in constrast to the Algol a[i] contorted abuse of m= athematics' [ ] vector/matrix notation. C & C++ are the weirdo oddballs on a[i][j] being the syntax for Algol's/Pas= cal's/ATS's/C#'s a[i,j], Fortran=E2=80=93PL/1=E2=80=93Ada's a(i,j), OCaml's= a[|i,j|], and CAML's a.(i,j).