On Fri, 17 Sep 2021, Riccardo (Jack) Lucchetti wrote:
On Wed, 15 Sep 2021, Cottrell, Allin wrote:
> > In current git there's a first pass at implementing this, for
> > matrices. It's a bit of a hack, but a more rigorous version would be
> > quite complicated. [...]
>
> Here's a description of what we have now. Comments welcome.
>
> In the current, experimental implementation of indexation from the
> end, the keyword 'end' is defined as the maximum signed 32-bit integer
> (INT_MAX = 2147483647). If we come across 'end-k' we replace it with
> INT_MAX-k (and similarly for end/2, 0.25*end or whatever).
It IS a hack, but I'd say a VERY clever one. Kudos, Allin.
The only thing I found missing, after some experimentation, is the ability to
use "end" for the starting element of the matric slice, as in
<hansl>
y = x[end-2:]
</hansl>
Otherwise, I haven't been able to find anything wrong with it.
That's good to hear. I'll be away this weekend but I'll take a look at
the missing use-case when I get back.
Allin