Hi all,
I wrote some unit-tests for the recent "end" operator. See here:
https://sourceforge.net/p/gretl/workspace/ci/09881e0435c18730b1a8b54210dc...
I found some edge cases for which the current behavior may be discussed:
<hansl>
clear
set verbose off
WHICH = 1
if WHICH == 1
bundles B = array(0)
eval B[end]
elif WHICH == 2
matrix m = {}
eval m[end]
elif WHICH == 3
strings Sempty = array()
eval Sempty[end]
elif WHICH == 4
open denmark.gdt --quiet --preserve
list L0 = null
eval L0[end]
elif WHICH == 5
open denmark.gdt --quiet --preserve
eval LRM[end] # Index value 2147483647 is out of bounds
elif WHICH == 6
open denmark.gdt --quiet --preserve
eval LRM[(end-1)]
/*
DUM_END: not interpreted for upsym SERIES
LRM[(end-
The symbol 'end' is undefined
Data error
*/
endif
</hansl>
For the first four cases, I get the message (by the way, no error or
warning is flagged): "Index value 0 is out of bounds". Is this expected,
or should it be handled differently?
For case 5, I would have expected the last entry (conditional on the
currently active sample) of series LRM.
Hope that's useful.
Best,
Artur