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.
-------------------------------------------------------
Riccardo (Jack) Lucchetti
Dipartimento di Scienze Economiche e Sociali (DiSES)
Università Politecnica delle Marche
(formerly known as Università di Ancona)
r.lucchetti(a)univpm.it
http://www2.econ.univpm.it/servizi/hpp/lucchetti
-------------------------------------------------------