|
From: Juergen W. <wie...@fr...> - 2005-07-05 19:05:24
|
Johannes Zellner wrote:
> 1. A limitation to 80 characters for sprintf really hurts!
Full ACK.
> 2. dynamical macros would be really nice ;-)
>
> set macros
> pl(x) = sprintf("plot '<extract -n %s' u 2, '<extract -n -f %s' u 3",\
> x, x)
> @pl("myfile.dat")
The hardest part in your suggestion would be to construct the
function call. OTOH, parsing a constant expression is already
implemented. Thus the hardest part would be to terminate the
expression correctly.
How about:
gnuplot> set macros {expressions}
gnuplot> pl(x) = ...
gnuplot> @@pl("myfile.dat")@@
The "@@" syntax would have the additional advantages of backwards
compatibility and that you could use a general expression, not only
single functions.
...
A few minutes later:
Arrgh! At the time string_expand() is called, the input line has not
yet been tokenized.
Is there any possibility to tokenize and parse a string not on the
input line?
Juergen
|