On Mon, 18 Sep 2017, Riccardo (Jack) Lucchetti wrote:
On Mon, 18 Sep 2017, Sven Schreiber wrote:
> Hi,
>
> the first:
>
> <hansl>
> open data9-3.gdt
> matrix check = {1;2}
> series x = (price > 3) ? check[1] : check[2] # fails
> </hansl>
>
> A 1x1 matrix apparently is not allowed here. (If I do 'scalar s = check[1]'
> first, then it runs.)
True, it should.
That's now fixed in git.
But let me add something quite off-topic. In my experience, our
"replace" function doen't get the popularity it deserves IMO. Your
example would become:
<hansl>
open data9-3.gdt
matrix check = {1;2}
series x = replace(price > 3, {1;0}, check)
</hansl>
which I find quite cool
Indeed, quite nice.
> The second "issue":
> eval pi # works
>
> Not sure if 'pi' is supposed to be an alias for '$pi'. For me
'pi' was a
> typo and the fact that it didn't fail caused another bug that was a bit
> difficult to track down.
That's a relic from the past. At some point we decided we'd deprecate the
dollar-less form, but never did in the end. Perhaps we now should.
It has actually been deprecated since version 1.9.10. From the
"backward-incompatible changes" log for 2012-11-05:
<quote>
The built-in constants "pi" and "macheps" have been renamed as
"$pi" and "$macheps". The old names continue to work at present
but they will be removed before long.
</quote>
So I guess their removal is now overdue. I'll fix that.
Allin