Regarding DOMString, Rob Weir wrote:

>How about having general copy-on-write semantics?  Constant DOMStrings and
>DOMStrings passed by value would still share data.  Pass a reference or
>pointer where you want mutability.  clone() would then be redundant.  And
>we would avoid possible confusion with the aliasing, something I admit to
>having fallen into once.  I think the efficiency are the same.

If I were doing it over, I'd probably just copy the design of Java's
immutable strings.  At the time I had been fighting (in another
project) Java performance problems resulting from excessive string
object creation, due largely to the fact that they were immutable.
I was annoyed enough not to repeat that.

At this point, with the code out there and having a significant
user base, I think that we should either leave DOMString's API as
is, or migrate to an existing standard string that we do not have
to design, implement, support, and teach users about ourselves.
I'd prefer to spend effort doing XML, not strings.

   -- Andy


Reply via email to