[XML-SIG] Re: Mr. Nitpicker looks at saxlib

Jack Jansen Jack.Jansen@cwi.nl
Fri, 29 May 1998 10:35:34 +0200


> |   but it has one serious drawback: the string slicing operator
> |   copies the string, 
> 
> Just a thought: should that be changed, since strings are supposed to
> be mutable anyway and this is such a common operation?

This is difficult. I looked into this a few years ago (add a "parent" pointer 
to the string object and incref the parent when you refer to parts of its 
string), but it had the serious disadvantage that the parent string would 
never be released as long as it had any children. This is quite common. And 
then we got string interning which basically killed the whole idea.

However: isn't it possible to be intelligent about the slicing, i.e. only do 
the slice if necessary?
--
Jack Jansen             | ++++ stop the execution of Mumia Abu-Jamal ++++
Jack.Jansen@cwi.nl      | ++++ if you agree copy these lines to your sig ++++
http://www.cwi.nl/~jack | see http://www.xs4all.nl/~tank/spg-l/sigaction.htm