On Mon, 2 Nov 2020, Artur Tarassow wrote:
Even though in principle I like the idea of directly defining a
string-valued
series as proposed by you, Sven, I think this introduces some "inconsistency"
which we should try to avoid. Inconsistency in the sense that the syntax
> series s = defarray("hey", "ho", "aha")
works only for very special case which may confuse the user. True, it is
convenient but can be realized by a two-liner:
<>
series s = {1; 2; 3}
stringify(s, defarray("hey", "ho", "aha"))
</>
On the consistency question, I think Sven is right that his proposal
doesn't really differ from the case of defining a numeric series via
a vector of suitable length.
On your two-liner: Yes, that's fine in the simple case, but here's
the sort of thing I had in mind (converted to Sven's style):
nulldata 8
strings S = defarray("A", "B", "B", "A",
"D", "D", "C", "B")
series sx = S
That is, your primary data take the form of a sequence of strings,
and the proposed syntax allows you to create a series without the
need to compute the numerically encoded counterpart yourself.
Allin