...
Given this model, how shoudl be implement the two kinds of strings?
Using java.lang.String for immutable strings is a possibility, but
it has some problems: Current Kawa represents Scheme symbols using
java.lang.String, and it would have to be changed (to use
gnu.mapping.Symbol, like JEmacs does). This might break a lot of
existing code, plus it would require a lot of work on my part.
A better solution is to use two - or three Java classes, for mutable
strings, immutable strings, and a common super-class. There are
various ways of doing this, but I'm leaning towards:
gnu.lists.FString // <string>
gnu.lists.VString extends FString // <mutable-string>
("VString" for "variable string".)
The "type" of immutable strings would be the "differnce"
between <string> and <mutable-string> - i.e. those whose
class is FString.