On Sat, 9 Jan 2021, Sven Schreiber wrote:
Am 08.01.2021 um 22:18 schrieb Allin Cottrell:
>> restrict $system
>> @rs # error: undefined symbol b
>> end restrict
>> </hansl>
>
> hansl input has already been carved into lines by the time string
> substitution comes along, so this is not going to work. Try this
> instead:
>
> <hansl>
> Rmat = {0,1,0,0,0;0,0,1,0,0}
> qvec = {0;0}
> restrict $system
> R = Rmat
> q = qvec
> end restrict
> </hansl>
Yeah, well, I knew that, but was somehow hoping to simply relay the
standard restriction specification syntax.
Perhaps I can come up with a function that translates human-readable
system restrictions into that format...
That's precisely what "restrict" does. Rather than hacking up a way
to send a multi-line string to restrict via string-substitution, I
suppose 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.
Allin