I've just clarified this in my own mind, so I'll make a brief
posting here, and try to add something along these lines in the
manual soon.
1. In computing the value returned by a "genr" formula, by design
gretl forces all numeric strings into the "C" numeric locale, where
'.' is the decimal separator, for internal manipulation. However,
this was not done with full consistency, with the results that Sven
noted. I think this is now consistent.
2. As part of the "pre-processing" of a genr string, two things are
done: (a) all spaces are squeezed out; and (b) if the current locale
has ',' as decimal deparator, all commas that appear between two
digits are replaced by '.'s. For the most part this works OK. For
example (user input on the left, processed version on the right):
genr x = 0,5 -> genr x=0.5
genr x = 0,25 * 0,3 -> genr x=0.25*0.3
3. But the case Sven noted did not work:
genr x = pvalue(X, 3, 5.67) -> genr x = pvalue(X,3.5.67)
The pre-processed string contains a syntax error.
4. I've now modified the space-squeezing routine: a space that
immediately follows a comma is not removed. Thus, when the rule
"replace commas between digits with '.'" is applied, it should not
break things like these pvalue arguments:
genr x = pvalue(X, 3, 5.67) -> genr x=pvalue(X, 3, 5.67)
genr x = pvalue(X, 3, 5,67) -> genr x=pvalue(X, 3, 5.67)
5. So this should be the situation: (a) Regardless of locale, you
should be able to use '.' as decimal separator in genr formulae; (b)
if you use ',' as decimal separator this should be OK too, with the
qualification that you have to make sure to leave a space after an
argument-separating comma in the case of numeric arguments, as in
the pvalue function.
If anyone spots any remaining problems in this area, please let me
know.
Allin Cottrell