Am 26.01.2012 17:55, schrieb Allin Cottrell:
On Thu, 26 Jan 2012, Talha Yalta wrote:
> In the plot controls, if I add a line and enter, say, "2,5 + 2,5*x"
> gretl automatically converts the commas and draws the line correctly.
It's true that in some GUI contexts (contexts that do not have
a script counterpart) we attempt to recognize the decimal
comma on input, in locales where this applies. It's also true
that this introduces a degree of inconsistency, since, as you
say, the decimal comma is never accepted in a "genr" dialog.
The rigorous way to fix the inconsistency would be to insist
on '.' as the decimal character in _all_ input contexts.
Perhaps we should consider that option.
Yes, perhaps.
You suggest that gretl might automatically fix up the decimal
comma in GUI "genr" contexts (meaning that the actual string
passed to genr, and recorded in the command log, would use the
decimal point). That could be done, but only at a basic
heuristic level.
The comma is the argument separator for functions, and also
the row/column separator in matrix-range specifications. To
make sure we don't break user input that's already correct,
we'd have to do something like this:
I believe it would take a long time to iron out bugs introduced by such
an approach, since I'm sure there are cases where gretl would then
mis-interpret the commas.
I note that spreadsheet programs that have always (?) had
locale-dependent decimal separators therefore don't use the comma as an
argument separator. Instead they seem to use the semicolon. *IF* gretl
allowed commas as decimal separators for input (and I'm not saying it
should) I would be in favor of a policy that then also requires the use
of semicolons for argument separations (etc.) so as to avoid any
ambiguities.
Clarification: This should only apply to somebody who chooses a new
tickbox option "allow comma decimal separator for GUI command input",
not for the rest of us who could merrily continue the current status
quo. But again, this is very hypothetical, I'm only stating this as a
suggested damage-prevention way of things, not as my wish.
thanks,
sven