should the default be lower bounds or upper bounds?
Peter McGoron 11 Apr 2026 13:37 UTC
Currently a single integer in the bounds infers that the lower bound is
zero, and that integer becomes the upper bound.
Would it be better to have the single integer be the lower bound, and
have the upper bound be determined by the length of the array? It would
be easier to modify the array without having to count the number of
elements in each dimension (which could be difficult if it is more than
two dimensions).
Taking the above convention, the following array
#af32 (0 0) ((1.0 2.0) (3.0 4.0))
is a 2x2 starting from 0. If I then want to add more elements
#af32 (0 0) ((1.0 2.0 3.0) (3.0 4.0 5.0))
or
#af32 (0 0) ((1.0 2.0) (3.0 4.0) (5.0 6.0))
I can do so without modifying the type of the array. I would find this
more useful, personally, and if I wanted the reader to check my numbers
I could use the lower-upper bound combination.
_______________________________________________
Minor things:
1. This sentence:
> The number of dimensions is inferred from the length of bounds it
would be impossible
sounds like it should have something between "bounds" and "it":
> The number of dimensions is inferred from the length of bounds; it
would be impossible
2. This part of the grammar:
bound := integer | "(" integer* ")
should be
bound := integer | "(" integer integer ")
because the bounds can either be one or two integers.
3. The "integer" production should be modified to include prefixed
integers, like #xFF.
4. I would add an examples of 3D and 4D arrays, because those are going
to be less intuitive.
-- Peter McGoron