On 11/09/2012 06:34 PM, Allin Cottrell wrote:
On Mon, 5 Nov 2012, Sven Schreiber wrote:
> nothing new here, but I just recently fully realized that the backslash
> char \ has a double meaning in hansl: matrix left-division as well as
> line continuation character. Isn't that unfortunate from a syntactical
> point of view, in the sense that I could fairly easily imagine cases
> where the meanings clash?
Actually, I can't imagine such a case. Maybe my imagination is
lacking, but here's my reasoning.
* Backslash indicates command continuation only if it is the
last (non-white space) character on a line of hansl input.
* The left-division operator can never be valid as the last
character on a line of hansl, since it requires a right-hand
operand.
Good points, and you mostly convinced me. But maybe one more thought:
The following split line
matrix C = A'\
B
has a different meaning from:
matrix C = A'\B
although the only difference between them are whitespace characters.
Even though as a Python fan I value whitespace chars highly, I find this
a little worrying. Just merging these lines and forgetting to remove the
backslash (which would be a user error, of course) introduces a subtle
bug which wouldn't result in a gretl error.
I have to admit that I don't have a solution ATM, though. I wouldn't
want to change the line-continuation character. And the backslash
division syntax obviously was taken from Matlab I guess. Hm.
cheers,
sven