On Fri, 24 May 2024, Sven Schreiber wrote:
I've come across a strange piece of code which goes more or less
like this:
<hansl>
open denmark
matrix M = zeros($nobs,2)
series M[1,] = ones(1,2)
print M
</hansl>
Note the "series" specifier in the third line. I would have
expected an error there, but this works with the same result as if
"matrix" were given there. (Or nothing.) This is with gretl 2024b.
So what's the point? I think a type mismatch error would be the
right thing for a statically typed language like hansl.
It would indeed, and now that's the case in git. It was quite tricky
to get right, since there are formulations (not this one, of course)
that might look wrong but are quite acceptable, for example:
<hansl>
list L = 1 2
series x = normal()
series L[1] = x
bundle b
series b.s = normal()
bundles bb = array(1)
series bb[1].s = normal()
</hansl>
Allin