On Wed, 4 Dec 2019, Artur Tarassow wrote:
I am bit puzzled why one cannot assign new values to a stringified
series
(using current git). Why should be the behavior differently compared to
numerical series?
<hansl>
set verbose off
nulldata 2
series foo = seq(1,2)'
strings s = defarray("A", "B")
stringify(foo, s)
print foo
series foo = 1 # "Cannot overwrite entire string-valued series
</hansl>
Well, the intent is to preserve the integrity of such series. We
obviously couldn't have anything like series foo = log(foo) and
still have a string-valued series.
In the case of assigning a scalar value (that's within the range of
the existing encodings) to the entire series, as above, no harm
would be done.
The question then is whether we just issue a blanket ban on
assigning to an entire string-valued series (the case at present),
or take the trouble to code an observation-by-observation check on
the validity of such an assignment.
We could do the latter but it didn't seem worthwhile to me when we
first introduced such series. It wasn't clear to me that there was
any real use case -- do you have one?
Allin