From: Optikos <optikos@verizon.net>
Subject: Re: Latest suggestion for 202x
Date: Sun, 16 Jun 2019 13:57:26 -0700 (PDT)
Date: 2019-06-16T13:57:26-07:00 [thread overview]
Message-ID: <89a5a38e-ac42-4418-a694-fda5affefe75@googlegroups.com> (raw)
In-Reply-To: <cd747e77-76d7-4d20-bba5-ed7f253132b4@googlegroups.com>
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 and the otherwise-influential-on-Ada Algol68) utilize brackets [] for array indexing. Nearly all other programming languages (which often are little more than Algol60 rejiggered a little bit) have followed Algol's lead on array indexing via bracket [] syntax.
>
> One exception to this rule is Eiffel, which uses the @ operator. I decided to see if I could find a summary, and [1] has it. The only really strange one IMHO is Haskell, which uses !.
>
> (This doesn't contradict what you wrote; I just thought it was interesting trivia.)
>
> [1] https://en.wikipedia.org/wiki/Comparison_of_programming_languages_%28array%29#Indexing
Continuing with the thought of not-() and not-[] oddball languages, let's consider what is going on over in the ML family (of which Haskell is a [distant?] cousin):
Over in the ML family languages, array indexing/subscripting has the following variety of syntaxes—one of which resembles the Fortran–Ada a(i) style:
1) Standard ML invokes a function sub as in sub( a, i ), calling to mind subscripts in mathematics notation.
2) CAML allows the shorthand a.(i), somewhat calling to mind the Fortran–Ada precedent of a(i) and the mathematics function notation (but perhaps the . is to also be a visual nod-of-the-hat to the location of subscripts 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 call 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_get_elt_at( a, i ).
And because I forgot to mention it on a prior posting above (although it has 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–PL/1–Ada continuity in constrast to the Algol a[i] contorted abuse of mathematics' [ ] vector/matrix notation.
C & C++ are the weirdo oddballs on a[i][j] being the syntax for Algol's/Pascal's/ATS's/C#'s a[i,j], Fortran–PL/1–Ada's a(i,j), OCaml's a[|i,j|], and CAML's a.(i,j).
next prev parent reply other threads:[~2019-06-16 20:57 UTC|newest]
Thread overview: 60+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-15 23:59 Latest suggestion for 202x Micah Waddoups
2019-06-16 5:14 ` Jerry
2019-06-16 7:17 ` Dmitry A. Kazakov
2019-06-16 10:22 ` Egil H H
2019-06-16 16:54 ` Maciej Sobczak
2019-06-16 20:09 ` Dmitry A. Kazakov
2019-06-17 6:54 ` Egil H H
2019-06-17 7:42 ` J-P. Rosen
2019-06-17 12:01 ` Mart van de Wege
2019-06-17 13:35 ` Maciej Sobczak
2019-06-17 15:20 ` Dmitry A. Kazakov
2019-06-17 15:32 ` Paul Rubin
2019-06-17 16:43 ` Dmitry A. Kazakov
2019-06-17 21:38 ` Keith Thompson
2019-06-18 15:48 ` Jeffrey R. Carter
2019-06-20 22:21 ` Randy Brukardt
2019-06-21 9:42 ` Dmitry A. Kazakov
2019-06-21 18:12 ` Keith Thompson
2019-06-21 18:43 ` Dmitry A. Kazakov
2019-06-21 20:24 ` Keith Thompson
2019-06-22 6:54 ` Dmitry A. Kazakov
2019-06-22 8:43 ` Randy Brukardt
2019-06-22 9:00 ` Dmitry A. Kazakov
2019-06-22 17:44 ` Keith Thompson
2019-06-22 18:34 ` Bill Findlay
2019-06-22 18:37 ` Dmitry A. Kazakov
2019-06-23 7:38 ` G.B.
2019-06-23 8:29 ` Dmitry A. Kazakov
2019-06-23 18:34 ` Optikos
2019-06-23 19:20 ` Dennis Lee Bieber
2019-06-22 20:48 ` Optikos
2019-06-22 20:53 ` Optikos
2019-06-23 17:42 ` Dennis Lee Bieber
2019-06-24 5:07 ` J-P. Rosen
2019-06-24 5:40 ` Paul Rubin
2019-06-24 7:16 ` Niklas Holsti
2019-06-26 18:00 ` Stephen Leake
2019-06-24 13:07 ` J-P. Rosen
2019-06-24 11:12 ` Stefan.Lucks
2019-06-24 12:06 ` Niklas Holsti
2019-06-24 20:22 ` Randy Brukardt
2019-06-24 20:32 ` Keith Thompson
2019-06-24 20:47 ` Jeffrey R. Carter
2019-06-24 13:10 ` J-P. Rosen
2019-06-22 8:36 ` Randy Brukardt
2019-06-22 17:39 ` Keith Thompson
2019-06-16 19:34 ` Optikos
2019-06-16 20:10 ` John Perry
2019-06-16 20:57 ` Optikos [this message]
2019-06-16 21:36 ` Dmitry A. Kazakov
2019-06-17 16:48 ` G. B.
2019-06-17 17:12 ` Paul Rubin
2019-06-16 21:41 ` Lucretia
2019-06-19 2:36 ` Micah Waddoups
2019-06-19 11:14 ` Lucretia
2019-06-19 11:45 ` briot.emmanuel
2019-06-19 14:34 ` Optikos
2019-06-19 19:29 ` Lucretia
2019-06-19 16:12 ` G. B.
2019-06-23 20:17 ` Per Sandberg
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox