From: <pl...@pi...> - 2012-05-19 08:53:07
|
On 05/19/12 00:19, Tait wrote: >> If you are suggesting that associating a file descriptor with a file; >> opening; reading; closing; reopening (with implies a seek(0) ) ; and >> rereading is the same as opening ; reading up to 'e' marker *in the >> data* then continuing to read the same opened device, I have to say >> your reasoning is getting a bit contrived. >> >> I find it hard to see that as being the same behavior. > > Maybe we're drifting beyond the point of useful distinction. I mean in > terms of behavior the users see, plot consumes inputs. Each data set > given to plot is consumed by that plot. Plot 'file' opens and reads > file; it's consumed in generating the plot, and everything is reset > for the next plot, whether in the same plot command or in a > subsequent. For instance... > plot 'file1' > plot 'file2' > is the same -- for purposes of reading input -- as > plot 'file1', 'file2' > > And... > plot '-' > ... > e > plot '-' > ... > e > is the same, in terms of reading input, as > plot '-', '-' > ... > e > ... > e > > In both cases, the data is consumed by the plot command, and the > next plot command begins consuming a new set of data (even though > file1 and file2 may be the same, and thus consume the same data > multiple times). A test of whether the behaviour is the same would be to use a variable to define the data source: datasrc='file1.dat' plot datasrc, datasrc datasrc='-' plot datasrc, datasrc It would be nice if gnuplot was data source agnostic in that way, but I can see why it was thought to be more useful to treat '-' as a special case. That's the way it was done and there is not sufficient problems to suggest breaking compatibility. regards. Peter. > > That's what I mean when I say the behavior of '-' and 'file' > are the same. I think I see the model you suggest, though, > which is more like saying the lines between plot and e create > a named record called '-', which would then be treated the same > as a named record called 'file1' and referenced multiple times. > If those lines could be given a name explicitly -- other than > '-' -- and could exist outside of an appendage to a plot > command, then I think that model would make more sense. And > that's a little closer to what Allin was suggesting, which is > why I liked that idea. > > |