On Tue, 5 Nov 2024, Riccardo (Jack) Lucchetti wrote:
On 04/11/2024 23:26, Cottrell, Allin wrote:
> Thanks for the report, Klaus. My reactions:
>
> * '@' is treated specially on the gretl command-line: it calls
> for string substitution. So I'm not surprised that OECD's
> revising their identifiers to include '@' in some cases (which
> seems to me a bit goofy) has caused trouble. But in gretl git
> there's now a workaround for that: we recognize '@' as simply a
> literal character in the context of the "data" command when the
> command "open dbnomics" has been issued. This change will be in
> gretl snapshots tomorrow.
Uhm, are we sure we want this?
Actually, yes. What I did was right but I messed up on the
explanation. Let me try again.
First, when we encounter '@' in pre-processing a gretl command we
check if there's a portion of the input string immediately to the
right that names a string variable, and if so we substitute the
value of that variable, otherwise we leave the '@' alone. That is
unchanged.
Second, when it comes to executing the command we check for
instances of "undigested" '@'. In general these will be erroneous,
since '@' doesn't occur in gretl command words, function names,
variable names or punctuation. However, '@' could obviously occur
legitimately in a string literal. Up till now our policy has been to
reject undigested '@' in all contexts other than string literals.
What's new in git is that we also make an exception for the argument
to the "data" command when it follows "open dbnomics".
The net result is that all these variants now work:
<hansl>
open dbnomics
# standard version
data OECD/DSD_PRICES(a)DF_PRICES_ALL/AUT.M.N.CPI.PD._T.N.GOY
# using a string variable for the whole request
string dbreq = "OECD/DSD_PRICES(a)DF_PRICES_ALL/AUT.M.N.CPI.PD._T.N.GOY"
data @dbreq
# using a string variable for part of the request
string endbit = "T.N.GOY"
data OECD/DSD_PRICES@DF_PRICES_ALL/AUT.M.N.CPI.PD._@endbit
</hansl>
BTW, as Sven suggested, it might be good to accept a quoted argument
for "data" (since we now treat it as if it were quoted in the
dbnomics case). But I don't think that would give any additional
functionality.
Allin