The Trunk: Collections-nice.167.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Trunk: Collections-nice.167.mcz

commits-2
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)!