On 27-01-2012, at 00:34, Allin Cottrell wrote:
On Thu, 26 Jan 2012, Talha Yalta wrote:
>> we'd have to do something like this:
>>
>> * Never touch commas that appear between '(' and ')', or
>> between '[' and ']', in case we're in a function call or a
>> matrix range.
>>
>> * Otherwise substitute '.' for ',' if the comma is followed by
>> a digit.
>>
>> This to be confined to GUI dialog input (we'd never mess with
>> scripts or console input) and the case where the output
>> decimal separator is the comma. I'm not recommending this,
>> just seeing what people think.
> The above sounds very nice to me. [...]
This is in response to Talha (above) but also Sven and Jack.
First, there are two more prohibitions on comma-substitution that
would have to be added: (a) never touch commas within '{' and '}',
since these denote matrix-definition and in that context ','
separates columns; and (b) never touch commas within double quotes
(just in case someone is defining a string via the GUI).
With those prohibitions added, I'm 99.9% (+) confident that the
comma substitution that Talha would like to have will not break any
correct "genr"-type expressions (i.e. those using '.' as decimal
character) entered via the GUI. I've grepped hundreds of highly
varied scripts on my system for ',' and the above-mentioned rules
would protect all legitimate uses of the comma.
Sven says, "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 would say, it depends on what you mean by a bug. In my view one
could talk of a bug only if gretl substituted '.' for comma when the
comma in the original was in fact correct. As I've said above, I'm
confident this will not happen under the proposed rules.
If you include as bugs instances where a comma was intended by the
user as decimal separator but gretl failed to substitute '.' then,
for sure, that can be expected to happen, though probably not very
often. It would definitely happen, for example, if a decimal
comma-preferring user typed into the GUI "genr" box
y = sqrt(1,5*x)
since the comma would be protected by the enclosing parentheses. I'm
taking that as given.
This leads to two questions:
For those who favor accommodation of the decimal comma on GUI input:
would you regard this as acceptable -- where "this" means that use
of the decimal comma would work with simple uses of "genr" but would
predictably fail on complex uses, and that sort of failure would not
be considered a bug?
For the rest of us: are we willing to tolerate the syntactical
sloppiness implied by the above -- given that it won't actually
compromise our own interaction with gretl so long as we use the
decimal point?
I read Jack as saying "No" to the second question, and I respect
that view. It's clear and consistent. But I'm not totally ruling out
a wretched British compromise until I hear some more views.
Also looks like a typical "wretched" Dutch political compromise.
I agree with Jack. No syntactical sloppiness, please.
As far as I am concerned, the only place where I would be prepared to accept a locale
dependent decimal point character in GUI input is where a user can input pure numbers
only. Nowhere else.
Berend