The Trunk: Collections-ul.896.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-ul.896.mcz

commits-2
Levente Uzonyi uploaded a new version of Collections to project The Trunk:
http://source.squeak.org/trunk/Collections-ul.896.mcz

==================== Summary ====================

Name: Collections-ul.896
Author: ul
Time: 26 May 2020, 5:06:35.966934 am
UUID: 1eb414fc-31f2-4890-8a0e-2cfe892ef798
Ancestors: Collections-nice.895

- prepare to introduce primitive 158 for string comparison

=============== Diff against Collections-nice.895 ===============

Item was changed:
  ----- Method: String>>< (in category 'comparing') -----
  < aString
  "Answer whether the receiver sorts before aString.
  The collation order is simple ascii (with case differences)."
 
+ ^(self compareWith: aString) < 0!
- ^ (self compare: self with: aString collated: AsciiOrder) = 1!

Item was changed:
  ----- Method: String>><= (in category 'comparing') -----
  <= aString
  "Answer whether the receiver sorts before or equal to aString.
  The collation order is simple ascii (with case differences)."
 
+ ^(self compareWith: aString) <= 0!
- ^ (self compare: self with: aString collated: AsciiOrder) <= 2!

Item was changed:
  ----- Method: String>>= (in category 'comparing') -----
  = aString
  "Answer whether the receiver sorts equally as aString.
  The collation order is simple ascii (with case differences)."
 
  self == aString ifTrue: [ ^true ].
  aString isString ifFalse: [ ^false ].
  self size = aString size ifFalse: [ ^false ].
+ ^ (self compareWith: aString) = 0!
- ^ (self compare: self with: aString collated: AsciiOrder) = 2!

Item was changed:
  ----- Method: String>>> (in category 'comparing') -----
  > aString
  "Answer whether the receiver sorts after aString.
  The collation order is simple ascii (with case differences)."
 
+ ^(self compareWith: aString) > 0!
- ^ (self compare: self with: aString collated: AsciiOrder) = 3!

Item was changed:
  ----- Method: String>>>= (in category 'comparing') -----
  >= aString
  "Answer whether the receiver sorts after or equal to aString.
  The collation order is simple ascii (with case differences)."
 
+ ^(self compareWith: aString) >= 0!
- ^ (self compare: self with: aString collated: AsciiOrder) >= 2!

Item was changed:
  ----- Method: String>>compare:caseSensitive: (in category 'comparing') -----
  compare: aString caseSensitive: aBool
  "Answer a comparison code telling how the receiver sorts relative to aString:
  1 - before
  2 - equal
  3 - after.
  "
  | map |
  map := aBool ifTrue:[CaseSensitiveOrder] ifFalse:[CaseInsensitiveOrder].
+ ^(self compareWith: aString collated: map) + 2!
- ^self compare: self with: aString collated: map!

Item was added:
+ ----- Method: String>>compareWith: (in category 'comparing') -----
+ compareWith: aString
+
+ "<primitive: 158>"
+ ^(self compare: self with: aString collated: AsciiOrder) - 2!

Item was added:
+ ----- Method: String>>compareWith:collated: (in category 'comparing') -----
+ compareWith: aString collated: collation
+
+ "<primitive: 158>"
+ ^(self compare: self with: aString collated: collation) - 2!