This patch fixes a few operations which are badly inherited by string
from scalar.pmc. increment/decrement have been removed as they aren't
really required for Strings. 'neg' also also suffered from a similar
problem, so this patch also stops this example segfaulting:
.sub test
new $P0, .String
$P0 = "12"
neg $P0
print $P0
print_newline
.end
You may need to do a make clean or similar to get string.c to be
properly built...(?)
[My feeling is that scalar should define set_integer_native,
set_number_native etc. to automatically morph, and then for integer,
float and string to override these to either not morph (for better
performance), or just do their own thing (i.e.
string::set_integer_native to convert the int to a String). That way you
can't get data being changed without its interpretation.]
> You may need to do a make clean or similar to get string.c to be
> properly built...(?)
Hmm, the old dependency-problems story :-(
> [My feeling is that scalar should define set_integer_native,
> set_number_native etc. to automatically morph, and then for integer,
> float and string to override these to either not morph (for better
> performance), or just do their own thing (i.e.
> string::set_integer_native to convert the int to a String). That way you
> can't get data being changed without its interpretation.]
jens