Allin Cottrell schrieb:
One more take on this (still trying to square the circle here!).
It strikes me that logical OR as applied to matrices, is, while
potentially meaningful, quite arcane. I'd be surprised if there are any
gretl scripts in circulation that involve OR'ing matrices.
Right, especially when the truth value of a matrix seems undefined?
So, could we perhaps do this (as Jack suggests, with one amendment):
* Amend the gretl manual to make "&&" and "||" the preferred
forms of
logical AND and OR.
Perfectly fine with me. Just to add another perspective: in python it's
just the keywords 'and' and 'or', would that be an option? (python is
quite intuitive, you know ;-)
* Continue to support "&" as AND and "|" as OR for the near
future, but
with a "deprecation" message...
* ...with the exception that "A|B" in matrix-generating expressions
means vertical concatenation (and if you really want to OR matrices you
must use the new "||" form).
Fine again. Another possibility would be to allow a and b to be matrices
in expressions like {a;b}, giving implicit concatenation. Though I guess
it's more difficult to implement...
I'm not pushing this idea all that hard, just wondering. It carries
some potential for confusion. The main problem I see is identifying a
"matrix-generating expression" for the purpose of interpreting "|".
My
notion is that this would be the right-hand side of a "matrix M = ..."
command, or the right-hand side of commands on the pattern
genr M = ...
M = ...
where "M" can be identified as a pre-existing matrix.
Has the syntax changed here? I thought the 'matrix' keyword always has
to precede matrix-related statements?
thanks,
Sven