|
From: <HBB...@t-...> - 2007-08-16 12:10:27
|
Ethan A Merritt wrote:
> On Wednesday 15 August 2007 00:40, plotter wrote:
> The space required to write it out once should be about the same either way.
> But yes, I can see that the earlier f(x)=assign("var",expression)
> makes it much easier to re-use the definition concisely in multiple plot
> commands.
Maybe, instead of inventing more new syntax, we should follow
established C syntax a little further, e.g. implement the comma operator
and the "each assignment is an expression, too" idea. E.g. an averaging
filter could be expressed as:
using 1:(N = N + 1, sum = sum + $2, sum / N)
or even
using 1:((sum += $2)/++n)
> It would be very easy to move the assignment evaluation to the beginning
> of the per-line processing rather than the end. But then it becomes a
> problem what to do if the data line turns out to have missing or invalid
> entries. The earlier variant already suffers from this (see below).
> I'm open to suggestions here.
Honestly, I think this whole idea is going in the wrong direction.
We're straying awfully far from the "one tool <--> one task" approch of
Unix tradition here. gnuplot is a plotting program, not a substitute
for awk, Perl or Excel. I'd prefer it if we left generic data
processing to generic tools designed for the job.
And even if we're going to do this, the using specification is not
really the right place to do it in. It should be moved to a separate
command.
|