syntax for inferred upper bound Peter McGoron (15 Apr 2026 11:37 UTC)
Re: syntax for inferred upper bound Wolfgang Corcoran-Mathe (15 Apr 2026 15:55 UTC)
Re: syntax for inferred upper bound Peter McGoron (15 Apr 2026 16:31 UTC)
Re: syntax for inferred upper bound Artyom Bologov (15 Apr 2026 23:21 UTC)
Re: syntax for inferred upper bound Bradley Lucier (16 Apr 2026 00:21 UTC)
Re: syntax for inferred upper bound John Cowan (16 Apr 2026 01:19 UTC)
Re: syntax for inferred upper bound Bradley Lucier (16 Apr 2026 01:27 UTC)

Re: syntax for inferred upper bound Peter McGoron 15 Apr 2026 16:31 UTC

 > Presumably an exception
is raised [...] if an inferred upper
bound cannot be determined (e.g. if the contents are mishaped
in that dimension.)

That is the behavior of Octave:

     >> [1,2,3; 4,5,6]
     ans =

        1   2   3
        4   5   6

     >> [1,2; 3,4,5,6]
     error: vertical dimensions mismatch (1x2 vs 1x4)

 > Is there any situation in which you know enough to write a valid
contents datum but not enough to write all of the array's upper
bounds?

1. The array syntax could be used as an alternative to a CSV file. In
that case, a data file could contain:

     #a f32 ((0 ?) (0 3))
     ((1 2 3)
      (0.0 1.1 2.3)
      (5.5 4.3 2.1)
      ...)

I could then add and remove values from the outermost dimension without
having to bump the upper bound.

2. If I want to input a short matrix with a nonzero lower bound, it is
easier if I don't have to do the mental math to figure out the lower
bound, i.e. when entering things at a REPL.

-- Peter McGoron