On Sun, 10 Jan 2021, Sven Schreiber wrote:
Am 09.01.2021 um 22:14 schrieb Sven Schreiber:
> Am 09.01.2021 um 16:44 schrieb Allin Cottrell:
>> we could support an array of strings variant, something like:
>> strings R = defarray("b[1,2] = 0", "b[2,1] = 0")
>> restrict $system
>> strings R
>> end restrict
>> with the keyword "strings" guiding gretl's interpretation.
[Not the main point of this reply, but: wouldn't it be a problem that
normally "strings" is an alias for "genr", but here it's not? Of
the context resolves this, but still.]
Yes, "strings" may not be the best keyword for that context. We
already have "Rvec" so we could use "Rstrings". But if we think this
approach might be helpful for programmatic handling of other
block-commands then a more generic keyword would be wanted, maybe
"cmdstrings" or similar.
BTW this facility (with keyword "strings", and for "restrict" only)
is now in git. (I'm confident it's a harmless experiment.)
Here's another approach to helping a little to construct
systems. The idea is that it's fairly difficult for the user to know
what variable position indices to put into the restriction syntax,
because in the system context using the identifiers of the variables is
not supported. So my idea is that you can use the names of the LHS and
the RHS variables (plus a lag number) in a natural way, and you get back
the two position numbers you need if you want to restrict the coefficent.
The relevant helper functions are in the attached file, and below are
some tested examples. [...]
OK, that's worth exploring.