Juergen Wieferink <wie...@fr...> writes:
> 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")
>
This particular case can probably be handled using 'call'.
> 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.
>
I've suggested 'eval string-expr' in the past, to be like sh, perl, etc.
>
> 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?
>
I think replot is implemented by building up a new input line and
retokenising.
dd
--
Dave Denholm <dde...@es...> http://www.esmertec.com
|