Email list hosting service & mailing list manager

empty intervals Alex Shinn (21 Apr 2022 11:02 UTC)
Re: empty intervals Bradley Lucier (21 Apr 2022 16:30 UTC)
Re: empty intervals Bradley Lucier (21 Apr 2022 16:37 UTC)
Re: empty intervals Per Bothner (21 Apr 2022 19:23 UTC)
Re: empty intervals Bradley Lucier (21 Apr 2022 21:59 UTC)
Re: empty intervals Per Bothner (21 Apr 2022 22:11 UTC)
Re: empty intervals Bradley Lucier (23 Apr 2022 17:56 UTC)
Re: empty intervals Per Bothner (23 Apr 2022 19:44 UTC)
Re: empty intervals Alex Shinn (24 Apr 2022 05:03 UTC)
Re: empty intervals John Cowan (21 Apr 2022 22:56 UTC)
Re: empty intervals Alex Shinn (22 Apr 2022 09:03 UTC)

Re: empty intervals Per Bothner 21 Apr 2022 22:11 UTC


On 4/21/22 14:59, Bradley Lucier wrote:
> To be honest, I cannot see how SRFI 164 deals with array-ref with arrays some of whose axes have length zero.

The same as vector-ref with a vector or length zero.  Which is the same as (array-ref arr 10 10) for a 5x5 array.
I.e. it throws an index-out-of-range error.

> And now, if functionally an array with at least one axis of length zero has
>
> (array-ref a i j k l)
>
> raise an error no matter the number or values of the arguments, is there a difference between empty arrays of different dimensions?

Not really. When you catch and print out data (if any) associated with the error
ideally it should tell you the invalid indexes along with the array bounds, but that's
just to help debugging.
--
	--Per Bothner
xxxxxx@bothner.com   http://per.bothner.com/