|
From: Allin C. <cot...@wf...> - 2014-10-30 00:42:33
|
On Wed, 29 Oct 2014, Philipp K. Janert wrote: > On Wed, 29 Oct 2014 15:59:21 -0700 > Ethan A Merritt <sf...@us...> wrote: > >> On Wednesday, 29 October, 2014 15:14:40 Philipp K. Janert wrote: >> >> [big snip to get to a discussion point] >> >>>> Placing it in a heredoc makes the script self-contained. > > I am splitting this thread into two. > > This one is to heredocs: My argument is > that if heredocs stay, then they should > be thought through and implemented in > such a way as to present a consistent > user experience. > > They can be loaded with "load" and in no > other way. Hence, they should be written > (or at least: be writeable) with "save". It's not true that "heredoc" data can be loaded only with "load" (and also not true that the only, or even primary, practical use of heredoc data is in the gnuplot demo files). The attraction of this feature is that one can efficiently construct an integrated plot file (gnuplot commands plus data) for use now and re-use later. It seems to me you're missing entirely the business of creating gnuplot files by programmatic means (whether C programs, perl or python scripts or whatever). In that context you can now output a gnuplot file with the data inline, so that the data and commands will not come "unstuck". The generating program will simply print the data into a "heredoc" field, with no "load" required. You could achieve a similar effect before, but less efficiently, since you'd have to use "plot '-'" plus e-terminated "stdin" blocks. This meant that if you wanted to plot n variables on the y-axis against a single x variable, you'd have to repeat the x data n times. I find it difficult to imagine much use for "heredoc" data blocks composed interactively, other than perhaps in trivial cases: would you really trust yourself to type large amounts of data in that way? Surely you'd compose the script in your favorite editor, then run it and revise it as needed. Allin Cottrell |