On Thu, 21 Jun 2018, Sven Schreiber wrote:
Am 21.06.2018 um 10:53 schrieb Artur Tarassow:
> Hi Marcin,
>
> Am 21.06.2018 um 10:10 schrieb Marcin Błażejowski:
>>
>> string desc = "This is something about my foo series"
>>
>> setinfo foo1 --description=desc
>
> I am with you this should only work for "--description="desc" for
> consistency reasons.
It should be noted that the doc only talks about a string (literal) in
double quotes. String variables came later in gretl I think. Then using
--description=desc is ambiguous: Does the user mean the string variable
with name desc, or a literal string with a sloppy use (without the
double quotes)?
So I don't think it's a bug, but I would also be OK to be strict about
requiring the double quotes for literal strings.
>
>> setinfo foo3 --description=@desc
>
> This one works with "@desc" -- which is the standard way I think.
--description=@foostring also works, as long as no spaces are in foostring:
desc = "hello"
setinfo foo3 --description=@desc # works
However, this would stop working when the need for double quotes is
enforced. Artur is right and the safe way is "@desc".
I think we probably should enforce the "double-quotes needed" rule
for the sake of clarity.
One other point: there's something that was added, experimentally,
some time ago but has never been documented, designed to help when
you want to set an option parameter using an expression rather than
a hard-wired value. This is an "eval" function, as in
string foo = "Some descriptive stuff"
setinfo s1 --description=eval(foo)
or even
strings S = defarray("First thing", "Second thing")
setinfo s1 --description=eval(S[2])
Allin