This one is already in Pharo (md 7/24/2009) 2009/10/19 Stéphane Ducasse <stephane.ducasse@inria.fr>:
Begin forwarded message:
From: Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> Date: October 19, 2009 3:00:19 PM GMT+02:00 To: Stéphane Ducasse <stephane.ducasse@inria.fr>, stephane ducasse <stephane.ducasse@gmail.com
Subject: Fwd: [squeak-dev] The Trunk: Collections-nice.167.mcz
Salut bis,
Minor change to be integrated in pharo...
Nicolas
---------- Forwarded message ---------- From: Â <commits@source.squeak.org> Date: 2009/10/19 Subject: [squeak-dev] The Trunk: Collections-nice.167.mcz To: squeak-dev@lists.squeakfoundation.org
Nicolas Cellier uploaded a new version of Collections to project The Trunk: http://source.squeak.org/trunk/Collections-nice.167.mcz
==================== Summary ====================
Name: Collections-nice.167 Author: nice Time: 19 October 2009, 12:32:29 pm UUID: 95819d6c-2419-0244-bce5-75e402e44ec3 Ancestors: Collections-ar.166
http://bugs.squeak.org/view.php?id=7362 use self class instead of Text, so that we can subclass Text
=============== Diff against Collections-ar.166 ===============
Item was changed: Â ----- Method: Text>>reversed (in category 'converting') ----- Â reversed
    "Answer a copy of the receiver with element order reversed."
    ^ self class string: string reversed runs: runs reversed.
  "  It is assumed that  self size = runs size  holds. "!
Item was changed:  ----- Method: Text>>copyFrom:to: (in category 'copying') -----  copyFrom: start to: stop     "Answer a copied subrange of the receiver."
    | realStart realStop |     stop > self size         ifTrue: [realStop := self size]     "handle selection at end of string"         ifFalse: [realStop := stop].     start < 1         ifTrue: [realStart := 1]             "handle selection before start of string"         ifFalse: [realStart := start]. +    ^self class -    ^Text         string: (string copyFrom: realStart to: realStop)         runs: (runs copyFrom: realStart to: realStop)!
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project