From: Ethan A M. <sf...@us...> - 2014-10-30 18:48:10
|
On Thursday, 30 October, 2014 00:29:42 Philipp K. Janert wrote: > On Wed, 29 Oct 2014 23:29:45 -0700 > sfeam <sf...@us...> wrote: > > > On Wednesday, 29 October 2014 04:52:54 PM Philipp K. Janert wrote: > > > > > > - structured data types > > > > There are no structured data types in gnuplot that I can think of > > other than complex numbers {R, I}, and they were in gnuplot from > > Day One. > > Heredocs are a structured data type - they are not scalars! That is a false dichotomy. They are not scalars. Also they are not structured. More to the point, you seem to be conflating "data type" with "variable type". As I see it, gnuplot has three variable types: complex {real, imaginary} integer i string "null-terminated sequence of bytes" It also has three data source types: file text or binary inline pseudofile '-' heredoc named datablock This is an important distinction. Functions and expressions accept complex/integer/string arguments and return a complex/integer/string result. There is no way to pass a datablock to a function or to declare a function that returns a datablock. > > > - statefulness and persistence. > > Heredocs, again. You now maintain state (=data) in the session. No. Again you are conflating two things that are quite distinct. "data" is not "state". Also "command script" is not "state", nor is it "session". Although there is no formal specification of state variables in gnuplot, I think it is correct to say that the current session state has two components. The first component is operationally defined by a sequence of "set" commands and variable assignments. Let's call this "program state". Program state is what is stored to file by the "save" command. The second component of the current state includes whatever interactions you have performed through the GUI for the current terminal. This includes things like the zoom/unzoom stack, the currently selected or deselected plot components toggled by clicking in the legend, and the size of the window displayed on the screen. Let's call this "GUI state". There is no gnuplot command to save or restore the GUI state, although some of the terminals (Qt, wxt) use a toolkit that maintains some state (size, background, antialiasing, ...) across sessions. Obviously you cannot reproduce a data plot without access to the data being plotted. But this is not "state" as I understand the term. Perhaps you could say plot = state + data. %%% Some of gnuplot's new features extend the operations that are possible through the GUI (toggle, hypertext, export through a toolkit-dependent filter). They affect the GUI state but not the program state. But heredocs do not affect state at all. They are data. Ethan |