|
From: Teo S B. <teo...@gm...> - 2010-02-14 22:18:06
|
I gave an argument for allowing trailing definitions at bottom of http://article.gmane.org/gmane.comp.graphics.gnuplot.devel/9253 On Sun, Feb 14, 2010 at 9:24 PM, Ethan Merritt <merritt@u.washington.edu> wrote: > On Sunday 14 February 2010, Teo S Bernhard wrote: >> historic gnuplot implementations. See the brief usage instruction: >> plot {<ranges>} >> {<iteration>} >> {<function> | {"<datafile>" {datafile-modifiers}}} >> {axes <axes>} {<title-spec>} {with <style>} >> {, {definitions{,}} <function> ...} > > You are not interpreting this BNF description correctly. > The meaning of the final line quoted immediately above is > "If you append a comma you must follow it with a function. > The function may optionally be preceded by a definition, > with or without a separating comma." > > The <function> element is not in curly brackets, and hence is > not optional. There is no expansion of this set of BNF rules that > results in a trailing definition. So no, the documentation > has never stated that a trailing definition was valid syntax. Agreed, but strict interpretation of this BNF does also tell that initial definitions are disallowed. This contradicts a given example of 'help plot' (version 4.2). plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x) Given also that the help text of gnuplot 4.2 says, from 'help plot': "It is also possible to define functions and parameters on the `plot` command itself. This is done merely by isolating them from other items with commas." The implementation of gnuplot 4.2 and 4.3 allows in a quite liberal form definitions at both leading and trailing end of the plot command as long a they are separated by comma, example: plot f(x) = sin(x*a), a = .2, f(x), a = .4, f(x), a=0.6 IMHO, the stated BNF contradicts other parts of the help text and also the actual code-implementation. For the historic (pre 4.4 rc1) gnuplot versions, a BNF consistent with other help text and code-implementation (considering definitions mainly) should be roughly: plot {<ranges>} {<iteration>} {definitions,}... { <function> | {"<datafile>" {datafile-modifiers}}} {axes <axes>} {<title-spec>} {with <style>} {,definitions}... {,<function>... } It is obviously a philosophical point, if implementation or documentation should govern. I think the historical implementation in this case. Teo |