Am 14.05.20 um 02:47 schrieb Allin Cottrell:
On Sun, 10 May 2020, Sven Schreiber wrote:
>
> 1 - This first problem I cannot reproduce with a minimal function
> example; I'm suspecting it might depend on being wrapped inside a
> package. The problem is that the descriptive label of a series is _not_
> overwritten with a new content when the series itself is replaced by the
> return value of the package.
>
> 1b - Another thing that somehow seems to depend on doing it inside a
> package: Doing 'setinfo myseries --description="@mylabel"' for an
> existing string variable 'mylabel' just yields the literal
"mylabel" as
> description.
I'd have to see examples to say anything useful in those cases.
I noticed this
while preparing the series_calculator package which is in
staging. I could probably send a modified version which would serve as
an example.
> 2 - The --description option to 'setinfo' apparently does not allow a
> string variable as input. Doing --description=s for an existing string s
> just gives the literal "s" as the label.
In general you cannot expect a string variable to be cashed out in the
context of a gretl command option parameter.
OK - I thought there were some cases where it is possible but I don't
exactly remember where (in 'join' perhaps?).
However, there is a "hidden" mechanism available which
should probably
be tested more, perhaps modified, and documented: you use eval() in
this content. So for example this should work:
string s = "whatever"
setinfo some_series --description=eval(s)
Good to know, I can try that.
thanks
sven