News for hackers. Stuff that matters.
Re:Arrays of Arrays (2009) by Per_Bothner on Sunday December 20, 2020 @06:57AM (#25485667)
Which is why the sane way to do it is to have the array-specifier come before the element type:

  [,][]int crazy;
It reads "2-dimensional array of array of int" in L-to-R order.

Similarly, the type "pointer-to-int" should be "*p" or equivalent.

Unfortunately, history/tradition as well parsing problems make the "sane" solution difficult. One solution is the Pascal approach putting the type after the variable being declared, with a colon between:

  crazy : [,][]int;
Re:Arrays of Arrays (2009) by Athas on Sunday December 20, 2020 @07:45AM (#25485878)
Strongly agreed! During my PhD I had to design array type syntax for a programming language, and we eventually came up with something similar to that: https://futhark-lang.org/blog/2016-12-09-two-syntax-design-p...