On Thu, 26 Jan 2017, Sven Schreiber wrote:
Hi,
very short minimal script here:
<hansl>
matrix heyho = ("a" == "b") ? garbl[3,] : I(2)
</hansl>
There is no object "garbl", but that's by design in the case that the
condition isn't true. Gretl says "[" would be invalid here.
That's because '[' is accepted the by parser only if it's preceded
by the name of an object of a type that can be subsetted. We don't
actually evaluate the LHS of a ternary expression if the antecedent
is false, but we always have to parse it. There may be some way
around this, but the practical answer is: use "if" in this sort of
case.
Allin