|
From: Ethan M. <merritt@u.washington.edu> - 2004-10-25 18:02:24
|
On Monday 25 October 2004 06:32 am, Petr Mikulik wrote:
> > (2) it makes me really uneasy that you could trigger evaluation
> > of this function from, say, inside a plot statement:
> > plot <foo> 1:using (command("something expensive"))
> > This could, to say the least, consume system resources.
>
> It could whatever syntax is used, couldn't it?
No. Because the proposed syntax is only relevant at the
time the input line is first lexically parsed.
var = @"command"
Only executes once.
An executable function could be triggered as part of the
point-by-point evaluation of a "using" spec. That is arguably
a legitimate use, but my initial reaction is that this is very ugly.
If you need some external program or shell command to
process each data point, then it would be better to process
the whole input stream at one go prior to plotting rather than
trigger the external program all over again for each point.
plot "foo" using (command)
executes once per line of data in "foo"
> > Note that the sprintf call uses single-quote + back-tic to delimit
> > the command string.
>
> Well, this needs a lot of thinkinkg to understand this syntax, but looks
> feasible if enough examples are given in the docs. (BTW, there should be
> "help string" and "help quotes" added to gnuplot.doc to easily find them.)
I agree. I have updated all 3 patchsets on SourceForge to contain
documentation entries in gnuplot.doc
see
"help string"
"help substitution"
"help macro"
--
Ethan A Merritt merritt@u.washington.edu
Biomolecular Structure Center
Mailstop 357742
University of Washington, Seattle, WA 98195
|