Discussion:
[eiffel_software] A problem with IMMUTABLE_STRING_8
Colin Adams colinpauladams@gmail.com [eiffel_software]
2015-08-21 09:39:13 UTC
Permalink
Feature `substring' should, IMHO, just call shared_substring. There is
nothing in the contract of READABLE_STRING_GENERAL.substring (the header
comment is another matter, but header comments can be freely changed in
descendants) to forbid this, so it is just wasting memory. An additional
feature, copied_substring, could be added.


[Non-text portions of this message have been removed]
'Emmanuel Stapf' manus@eiffel.com [eiffel_software]
2015-08-21 16:40:42 UTC
Permalink
I remember having an implementation calling shared_substring but did not roll it out
because there has been an implicit assumptions for many years that `substring' would
actually create a duplicate. Even if it was not part of the contract, it can break things.
On the other hand the IMMUTABLE_STRING classes are relatively new so it might be a
non-issue. We are not opposed to changing it, but if we do and then realize that real code
breaks everyone is penalized. So for the time being, it seems safer for users to use
`shared_substring' to really show that they don't mind the new behavior.

Manu
-----Original Message-----
Sent: Friday, August 21, 2015 02:39
Subject: [eiffel_software] A problem with IMMUTABLE_STRING_8
Feature `substring' should, IMHO, just call shared_substring. There is nothing
in the contract of READABLE_STRING_GENERAL.substring (the header comment is
another matter, but header comments can be freely changed in
descendants) to forbid this, so it is just wasting memory. An additional feature,
copied_substring, could be added.
[Non-text portions of this message have been removed]
------------------------------------
------------------------------------
------------------------------------------------------------------------
Eiffel Software
http://www.eiffel.com
Customer support: http://support.eiffel.com
User group: http://groups.eiffel.com/join
------------------------------------------------------------------------
------------------------------------
Yahoo Groups Links
Loading...