|
From: Ethan A M. <merritt@u.washington.edu> - 2006-04-09 18:03:55
|
On Saturday 08 April 2006 11:28 am, Daniel J Sebald wrote:
>
> So, abstractions:
>
> ------------------
> level 1 (low)
> df_readline_ascii and df_readline_binary put data into similar format, double floats.
> ------------------
> level 2 (intermediate)
> interpret that data into more meaningful chunks, for example *strings*
I have no idea what you mean by this.
How can you represent or store a string in a "double float"?
> Right now, there is no intermediate level of processing.
Doesn't expression evaluation count as exactly this intermediate level of
processing? For instance the last plot in stringvar.dem:
plot 'silver.dat' using 1:2 with linespoints notitle, \
'' using 1:2:(sprintf("[%.0f,%.0f]",$1,$2)) with labels
> But let me illustrate one that could be: strings.
> Recently introduced, strings are meant to read in strings as though
> they were some type of data object.
You are confusing two separate things, added at separate times.
The "datastrings" capability, which allows reading string constants from
a data file, was first offered as a patch in 2001/2002.
It probably should have gone into version 4.0 since at that point it had
already been tested for 2 years or so. It was stable then, and it remains
stable now.
The "string variables" capability was added much more recently.
It was refined over 3 years or so, guided by extensive feedback from
various people with regard to 2 earlier attempts I made at string
handling. The earlier attempts never made it into cvs.
As I pointed out in a separate posting, the only interaction I can
think of at the moment between string variables and data input
(either ascii or binary) is through the use of string-valued
expression evaluation in the 'using' specification.
> No problem. However, the code for it was placed in df_readascii using
> a global variable, placing strings I think (correct me if I'm wrong),
> into a slightly different "container" than the "points" model that seems
> to be the basis of much of gnuplot.
I'm not entirely sure what "it" you are talking about.
If you mean the implementation of xtics(col) and 'using title <col>',
then of course they do not fit the "points model", because they are
not points within a curve at all. They are axis labels or key title
entries, respectively. Since they are not points, they are not stored
as points.
The other capability that the original datastings code added is
plot with labels
Here you could argue that these strings are indeed analagous to
"points", but they are even more analogues to "labels".
At that time the only mechanism we had for placing strings onto a
plot was the "set labels" code, so that was what I used.
Remember that string variables were still 4 years in the future.
> Had the strings instead been implemented at the (currently non-existent)
> intermediate level, it would work automatically for ascii and binary.
You've lost me. What is a "binary string"?
I think this intermediate level already exists, and works for both
ascii and binary data. If the syntax
plot "foo" binary using (expr($1)):(expr($2)):(expr($3))
doesn't work, then file a bug report. But that would be a general
problem to do with expression evalution of binary data, nothing
in particular to do with strings.
In other words, if you want to use binary data to construct a string,
that should work already. But I'm having trouble coming up with an
example where you would want to do this.
--
Ethan A Merritt
Biomolecular Structure Center
University of Washington, Seattle 98195-7742
|