Merged with /trunk jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Sat, 05 May 2012 22:58:24 +0100
branchjv
changeset 17940 985e22966acb
parent 17939 9ea58e0aad5a
child 17941 3651a18f3703
Merged with /trunk
ArrayedCollection.st
Association.st
Character.st
CharacterArray.st
CharacterEncoderImplementations__ASCII.st
CharacterEncoderImplementations__BIG5.st
CharacterEncoderImplementations__CNS11643.st
CharacterEncoderImplementations__CP437.st
CharacterEncoderImplementations__GB2313_1980.st
CharacterEncoderImplementations__HANGUL.st
CharacterEncoderImplementations__ISO10646_1.st
CharacterEncoderImplementations__ISO10646_to_JavaText.st
CharacterEncoderImplementations__ISO10646_to_SGML.st
CharacterEncoderImplementations__ISO10646_to_UTF16BE.st
CharacterEncoderImplementations__ISO10646_to_UTF16LE.st
CharacterEncoderImplementations__ISO10646_to_UTF8.st
CharacterEncoderImplementations__ISO8859_1.st
CharacterEncoderImplementations__ISO8859_10.st
CharacterEncoderImplementations__ISO8859_11.st
CharacterEncoderImplementations__ISO8859_13.st
CharacterEncoderImplementations__ISO8859_14.st
CharacterEncoderImplementations__ISO8859_15.st
CharacterEncoderImplementations__ISO8859_16.st
CharacterEncoderImplementations__ISO8859_2.st
CharacterEncoderImplementations__ISO8859_3.st
CharacterEncoderImplementations__ISO8859_4.st
CharacterEncoderImplementations__ISO8859_5.st
CharacterEncoderImplementations__ISO8859_6.st
CharacterEncoderImplementations__ISO8859_7.st
CharacterEncoderImplementations__ISO8859_8.st
CharacterEncoderImplementations__ISO8859_9.st
CharacterEncoderImplementations__JIS0201.st
CharacterEncoderImplementations__JIS0208.st
CharacterEncoderImplementations__JIS0208_to_EUC.st
CharacterEncoderImplementations__JIS0208_to_JIS7.st
CharacterEncoderImplementations__JIS0208_to_SJIS.st
CharacterEncoderImplementations__JIS0212.st
CharacterEncoderImplementations__JOHAB.st
CharacterEncoderImplementations__KOI7.st
CharacterEncoderImplementations__KOI8_R.st
CharacterEncoderImplementations__KOI8_U.st
CharacterEncoderImplementations__KSC5601.st
CharacterEncoderImplementations__MAC_Arabic.st
CharacterEncoderImplementations__MAC_CentralEuropean.st
CharacterEncoderImplementations__MAC_Croatian.st
CharacterEncoderImplementations__MAC_Cyrillic.st
CharacterEncoderImplementations__MAC_Dingbats.st
CharacterEncoderImplementations__MAC_Farsi.st
CharacterEncoderImplementations__MAC_Greek.st
CharacterEncoderImplementations__MAC_Hebrew.st
CharacterEncoderImplementations__MAC_Iceland.st
CharacterEncoderImplementations__MAC_Japanese.st
CharacterEncoderImplementations__MAC_Korean.st
CharacterEncoderImplementations__MAC_Roman.st
CharacterEncoderImplementations__MAC_Romanian.st
CharacterEncoderImplementations__MAC_Symbol.st
CharacterEncoderImplementations__MAC_Thai.st
CharacterEncoderImplementations__MAC_Turkish.st
CharacterEncoderImplementations__MS_Ansi.st
CharacterEncoderImplementations__MS_Arabic.st
CharacterEncoderImplementations__MS_Baltic.st
CharacterEncoderImplementations__MS_Cyrillic.st
CharacterEncoderImplementations__MS_EastEuropean.st
CharacterEncoderImplementations__MS_Greek.st
CharacterEncoderImplementations__MS_Hebrew.st
CharacterEncoderImplementations__MS_Symbol.st
CharacterEncoderImplementations__MS_Turkish.st
CharacterEncoderImplementations__NEXT.st
CharacterEncoderImplementations__SingleByteEncoder.st
CharacterEncoderImplementations__TwoByteEncoder.st
ConfigurableFeatures.st
ExternalBytes.st
ExternalLibraryFunction.st
Float.st
ImmutableArray.st
ImmutableByteArray.st
ImmutableString.st
Interval.st
LongFloat.st
LookupKey.st
Make.proto
Make.spec
SequenceableCollection.st
SortedCollection.st
StringCollection.st
TwoByteString.st
Unicode16String.st
bc.mak
--- a/ArrayedCollection.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ArrayedCollection.st	Sat May 05 22:58:24 2012 +0100
@@ -12,10 +12,10 @@
 "{ Package: 'stx:libbasic' }"
 
 SequenceableCollection subclass:#ArrayedCollection
-        instanceVariableNames:''
-        classVariableNames:''
-        poolDictionaries:''
-        category:'Collections-Abstract'
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Collections-Abstract'
 !
 
 !ArrayedCollection class methodsFor:'documentation'!
@@ -358,12 +358,11 @@
     "return a new instance of the receivers species with size
      nilled elements and any named instance variables copied."
 
-    "special case for Array, which has no named instance vars"
+    "Performance optimization for classes like Array, String, ...,
+     which have no named instance vars"
 
-    |cls|
-
-    (cls := self class) instSize == 0 ifTrue:[
-        ^ cls new:size
+    self class instSize == 0 ifTrue:[
+        ^ self species new:size
     ].
     ^ super copyEmptyAndGrow:size
 ! !
@@ -384,6 +383,7 @@
     "Modified: 18.7.1996 / 21:39:09 / cg"
 ! !
 
+
 !ArrayedCollection methodsFor:'printing & storing'!
 
 storeOn:aStream
@@ -502,11 +502,11 @@
 !ArrayedCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ArrayedCollection.st,v 1.62 2012/03/08 20:29:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ArrayedCollection.st,v 1.63 2012/04/21 15:45:38 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: ArrayedCollection.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ArrayedCollection.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/Association.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/Association.st	Sat May 05 22:58:24 2012 +0100
@@ -130,12 +130,23 @@
 
 !Association methodsFor:'printing & storing'!
 
-displayString
-    "return a string containing a printable representation
-     of the receiver for displaying - redefined to use display string on
-     the components for nicer look"
+displayOn:aGCOrStream
+    "Compatibility
+     append a printed desription on some stream (Dolphin,  Squeak)
+     OR:
+     display the receiver in a graphicsContext at 0@0 (ST80).
+     This method allows for any object to be displayed in some view
+     (although the fallBack is to display its printString ...)"
 
-    ^ key displayString , '->' , value displayString
+    "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
+    "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
+    (aGCOrStream isStream and:[aGCOrStream ~~ Transcript]) ifFalse:[
+        ^ super displayOn:aGCOrStream
+    ].
+
+    key displayOn:aGCOrStream.
+    aGCOrStream nextPutAll:'->'.
+    value displayOn:aGCOrStream.
 !
 
 printOn:aStream
@@ -173,15 +184,15 @@
 !Association class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.23 2009/10/06 15:16:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Association.st,v 1.24 2012/04/24 12:00:50 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Association.st,v 1.23 2009/10/06 15:16:10 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Association.st,v 1.24 2012/04/24 12:00:50 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Association.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Association.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/Character.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/Character.st	Sat May 05 22:58:24 2012 +0100
@@ -305,7 +305,6 @@
     ^ self codePoint:anInteger
 ! !
 
-
 !Character class methodsFor:'accessing untypeable characters'!
 
 endOfInput
@@ -338,7 +337,6 @@
     ^ self codePoint:41
 ! !
 
-
 !Character class methodsFor:'constants'!
 
 backspace
@@ -486,12 +484,6 @@
     ^ Character codePoint:9
 ! !
 
-!Character class methodsFor:'others'!
-
-version_CVS
-    ^ 'Header: /cvs/stx/stx/libbasic/Character.st,v 1.141 2011/08/05 16:56:47 cg Exp '
-! !
-
 !Character class methodsFor:'primitive input'!
 
 fromUser
@@ -575,7 +567,6 @@
     "
 ! !
 
-
 !Character methodsFor:'Compatibility-Dolphin'!
 
 isAlphaNumeric
@@ -623,7 +614,6 @@
       or:[ (asciivalue == 247 ) ]]]]]
 ! !
 
-
 !Character methodsFor:'accessing'!
 
 codePoint
@@ -655,6 +645,8 @@
     "Modified: 27.6.1996 / 12:34:51 / cg"
 !
 
+
+
 // aMagnitude
     "Return the Character who's value is the receiver divided by <aMagnitude>.
      Wrap if the resulting value is not a legal Character value. (JS)"
@@ -669,7 +661,6 @@
     ^ Character codePoint:(asciivalue \\ aMagnitude asInteger \\ 16r3FFFFFFF)
 ! !
 
-
 !Character methodsFor:'comparing'!
 
 < aMagnitude
@@ -1463,7 +1454,6 @@
     "
 ! !
 
-
 !Character methodsFor:'obsolete'!
 
 asciiValue
@@ -1483,13 +1473,28 @@
 
 !Character methodsFor:'printing & storing'!
 
-displayString
-    "return a string used when the receiver is to be displayed
-     in an inspector kind-of-thing"
-
-    ^ (self storeString , ' "16r' , (asciivalue printStringRadix:16) , '"')
+displayOn:aGCOrStream
+    "Compatibility
+     append a printed desription on some stream (Dolphin,  Squeak)
+     OR:
+     display the receiver in a graphicsContext at 0@0 (ST80).
+     This method allows for any object to be displayed in some view
+     (although the fallBack is to display its printString ...)"
+
+    "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
+    "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
+    (aGCOrStream isStream and:[aGCOrStream ~~ Transcript]) ifFalse:[
+        ^ super displayOn:aGCOrStream
+    ].
+
+    self storeOn:aGCOrStream.
+    aGCOrStream nextPutAll:' "16r'.
+    asciivalue printOn:aGCOrStream base:16.
+    aGCOrStream nextPut:$".
 !
 
+
+
 isLiteral
     "return true, if the receiver can be used as a literal constant in ST syntax
      (i.e. can be used in constant arrays)"
@@ -2254,7 +2259,6 @@
     ^ false
 ! !
 
-
 !Character methodsFor:'testing - national'!
 
 isNationalAlphaNumeric
@@ -2783,12 +2787,13 @@
 !Character class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Character.st,v 1.141 2011/08/05 16:56:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Character.st,v 1.143 2012/04/24 12:03:06 stefan Exp $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/Character.st,v 1.143 2012/04/24 12:03:06 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Character.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Character.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
-
-
-
--- a/CharacterArray.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterArray.st	Sat May 05 22:58:24 2012 +0100
@@ -4270,6 +4270,7 @@
     "Created: / 08-03-2012 / 03:11:11 / cg"
 ! !
 
+
 !CharacterArray methodsFor:'padded copying'!
 
 centerPaddedTo:newSize
@@ -4790,6 +4791,7 @@
     "Modified: 17.4.1997 / 12:50:23 / cg"
 ! !
 
+
 !CharacterArray methodsFor:'special string converting'!
 
 expandPlaceholdersWith:argArrayOrDictionary
@@ -5955,6 +5957,18 @@
     "Modified: / 13-09-2006 / 11:35:15 / cg"
 !
 
+isUnicode16String
+    ^ false
+!
+
+isUnicode32String
+    ^ false
+!
+
+isUnicodeString
+    ^ false
+!
+
 isValidSmalltalkIdentifier
     "return true, if the receivers characters make up a valid smalltalk identifier"
 
@@ -6061,15 +6075,15 @@
 !CharacterArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.470 2012/03/08 03:09:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.471 2012/04/24 14:56:08 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.470 2012/03/08 03:09:27 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterArray.st,v 1.471 2012/04/24 14:56:08 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterArray.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: CharacterArray.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 CharacterArray initialize!
--- a/CharacterEncoderImplementations__ASCII.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ASCII.st	Sat May 05 22:58:24 2012 +0100
@@ -240,11 +240,11 @@
 !ASCII class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ASCII.st,v 1.4 2005/03/31 18:12:07 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ASCII.st,v 1.4 2005/03/31 18:12:07 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ASCII.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ASCII.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__BIG5.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__BIG5.st	Sat May 05 22:58:24 2012 +0100
@@ -52,7 +52,7 @@
 !BIG5 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_BIG5.st,v 1.3 2004/03/09 21:59:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__BIG5.st,v 1.3 2004/03/09 21:59:35 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__CNS11643.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__CNS11643.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !CNS11643 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_CNS11643.st,v 1.3 2004/03/09 21:59:27 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__CNS11643.st,v 1.3 2004/03/09 21:59:27 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__CP437.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__CP437.st	Sat May 05 22:58:24 2012 +0100
@@ -933,7 +933,7 @@
 !CP437 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_CP437.st,v 1.4 2005/03/31 18:12:18 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__CP437.st,v 1.4 2005/03/31 18:12:18 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__GB2313_1980.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__GB2313_1980.st	Sat May 05 22:58:24 2012 +0100
@@ -52,7 +52,7 @@
 !GB2313_1980 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_GB2313_1980.st,v 1.3 2004/03/09 21:57:26 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__GB2313_1980.st,v 1.3 2004/03/09 21:57:26 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__HANGUL.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__HANGUL.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !HANGUL class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_HANGUL.st,v 1.3 2004/03/09 21:57:59 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__HANGUL.st,v 1.3 2004/03/09 21:57:59 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_1.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_1.st	Sat May 05 22:58:24 2012 +0100
@@ -63,11 +63,11 @@
 !ISO10646_1 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_1.st,v 1.4 2004/03/09 22:00:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_1.st,v 1.4 2004/03/09 22:00:08 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO10646_1.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO10646_1.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_to_JavaText.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_JavaText.st	Sat May 05 22:58:24 2012 +0100
@@ -146,7 +146,7 @@
 !ISO10646_to_JavaText class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JavaText.st,v 1.1 2006/10/23 11:25:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JavaText.st,v 1.1 2006/10/23 11:25:58 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_to_SGML.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_SGML.st	Sat May 05 22:58:24 2012 +0100
@@ -154,7 +154,7 @@
 !ISO10646_to_SGML class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_to_SGML.st,v 1.3 2006/10/23 11:25:11 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_SGML.st,v 1.3 2006/10/23 11:25:11 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st	Sat May 05 22:58:24 2012 +0100
@@ -264,15 +264,15 @@
 !ISO10646_to_UTF16BE class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_to_UTF16BE.st,v 1.3 2009/11/04 00:46:08 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st,v 1.3 2009/11/04 00:46:08 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_to_UTF16BE.st,v 1.3 2009/11/04 00:46:08 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_UTF16BE.st,v 1.3 2009/11/04 00:46:08 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO10646_to_UTF16BE.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO10646_to_UTF16BE.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_to_UTF16LE.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_UTF16LE.st	Sat May 05 22:58:24 2012 +0100
@@ -82,7 +82,7 @@
 !ISO10646_to_UTF16LE class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_to_UTF16LE.st,v 1.2 2006/04/25 14:16:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_UTF16LE.st,v 1.2 2006/04/25 14:16:44 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO10646_to_UTF8.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO10646_to_UTF8.st	Sat May 05 22:58:24 2012 +0100
@@ -452,11 +452,11 @@
 !ISO10646_to_UTF8 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO10646_to_UTF8.st,v 1.16 2009/09/22 09:08:09 fm Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO10646_to_UTF8.st,v 1.16 2009/09/22 09:08:09 fm Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO10646_to_UTF8.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO10646_to_UTF8.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_1.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_1.st	Sat May 05 22:58:24 2012 +0100
@@ -458,11 +458,11 @@
 !ISO8859_1 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_1.st,v 1.4 2005/03/31 18:12:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_1.st,v 1.4 2005/03/31 18:12:50 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO8859_1.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO8859_1.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_10.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_10.st	Sat May 05 22:58:24 2012 +0100
@@ -734,7 +734,7 @@
 !ISO8859_10 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_10.st,v 1.4 2005/03/31 18:12:38 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_10.st,v 1.4 2005/03/31 18:12:38 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_11.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_11.st	Sat May 05 22:58:24 2012 +0100
@@ -596,7 +596,7 @@
 !ISO8859_11 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_11.st,v 1.4 2005/03/31 18:12:32 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_11.st,v 1.4 2005/03/31 18:12:32 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_13.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_13.st	Sat May 05 22:58:24 2012 +0100
@@ -737,7 +737,7 @@
 !ISO8859_13 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_13.st,v 1.4 2005/03/31 18:12:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_13.st,v 1.4 2005/03/31 18:12:35 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_14.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_14.st	Sat May 05 22:58:24 2012 +0100
@@ -780,7 +780,7 @@
 !ISO8859_14 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_14.st,v 1.4 2005/03/31 18:12:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_14.st,v 1.4 2005/03/31 18:12:55 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_15.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_15.st	Sat May 05 22:58:24 2012 +0100
@@ -638,11 +638,11 @@
 !ISO8859_15 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_15.st,v 1.4 2005/03/31 18:12:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_15.st,v 1.4 2005/03/31 18:12:41 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO8859_15.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO8859_15.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_16.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_16.st	Sat May 05 22:58:24 2012 +0100
@@ -723,7 +723,7 @@
 !ISO8859_16 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_16.st,v 1.4 2005/03/31 18:12:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_16.st,v 1.4 2005/03/31 18:12:53 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_2.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_2.st	Sat May 05 22:58:24 2012 +0100
@@ -765,11 +765,11 @@
 !ISO8859_2 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_2.st,v 1.4 2005/03/31 18:12:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_2.st,v 1.4 2005/03/31 18:12:47 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO8859_2.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO8859_2.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_3.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_3.st	Sat May 05 22:58:24 2012 +0100
@@ -698,7 +698,7 @@
 !ISO8859_3 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_3.st,v 1.4 2005/03/31 18:12:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_3.st,v 1.4 2005/03/31 18:12:44 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_4.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_4.st	Sat May 05 22:58:24 2012 +0100
@@ -749,7 +749,7 @@
 !ISO8859_4 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_4.st,v 1.4 2005/03/31 18:12:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_4.st,v 1.4 2005/03/31 18:12:58 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_5.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_5.st	Sat May 05 22:58:24 2012 +0100
@@ -626,11 +626,11 @@
 !ISO8859_5 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_5.st,v 1.4 2005/03/31 18:13:16 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_5.st,v 1.4 2005/03/31 18:13:16 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO8859_5.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO8859_5.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_6.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_6.st	Sat May 05 22:58:24 2012 +0100
@@ -546,7 +546,7 @@
 !ISO8859_6 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_6.st,v 1.4 2005/03/31 18:13:19 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_6.st,v 1.4 2005/03/31 18:13:19 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_7.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_7.st	Sat May 05 22:58:24 2012 +0100
@@ -668,11 +668,11 @@
 !ISO8859_7 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_7.st,v 1.4 2005/03/31 18:13:13 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_7.st,v 1.4 2005/03/31 18:13:13 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__ISO8859_7.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__ISO8859_7.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_8.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_8.st	Sat May 05 22:58:24 2012 +0100
@@ -550,7 +550,7 @@
 !ISO8859_8 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_8.st,v 1.4 2005/03/31 18:13:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_8.st,v 1.4 2005/03/31 18:13:21 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__ISO8859_9.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__ISO8859_9.st	Sat May 05 22:58:24 2012 +0100
@@ -445,7 +445,7 @@
 !ISO8859_9 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_ISO8859_9.st,v 1.4 2005/03/31 18:13:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__ISO8859_9.st,v 1.4 2005/03/31 18:13:10 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0201.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0201.st	Sat May 05 22:58:24 2012 +0100
@@ -558,7 +558,7 @@
 !JIS0201 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JIS0201.st,v 1.3 2004/03/09 21:59:06 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JIS0201.st,v 1.3 2004/03/09 21:59:06 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0208.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0208.st	Sat May 05 22:58:24 2012 +0100
@@ -28646,7 +28646,7 @@
 !JIS0208 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JIS0208.st,v 1.4 2008/10/30 19:54:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JIS0208.st,v 1.4 2008/10/30 19:54:58 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0208_to_EUC.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0208_to_EUC.st	Sat May 05 22:58:24 2012 +0100
@@ -332,7 +332,7 @@
 !JIS0208_to_EUC class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JIS0208_to_EUC.st,v 1.4 2005/07/08 17:15:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JIS0208_to_EUC.st,v 1.4 2005/07/08 17:15:01 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0208_to_JIS7.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0208_to_JIS7.st	Sat May 05 22:58:24 2012 +0100
@@ -372,7 +372,7 @@
 !JIS0208_to_JIS7 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JIS0208_to_JIS7.st,v 1.7 2004/03/12 09:15:11 ca Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JIS0208_to_JIS7.st,v 1.7 2004/03/12 09:15:11 ca Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0208_to_SJIS.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0208_to_SJIS.st	Sat May 05 22:58:24 2012 +0100
@@ -339,15 +339,15 @@
 !JIS0208_to_SJIS class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_SJIS.st,v 1.12 2009/11/05 16:26:27 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SJIS.st,v 1.12 2009/11/05 16:26:27 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Encoder_SJIS.st,v 1.12 2009/11/05 16:26:27 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SJIS.st,v 1.12 2009/11/05 16:26:27 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__JIS0208_to_SJIS.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__JIS0208_to_SJIS.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JIS0212.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JIS0212.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !JIS0212 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JIS0212.st,v 1.3 2004/03/09 21:58:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JIS0212.st,v 1.3 2004/03/09 21:58:52 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__JOHAB.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__JOHAB.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !JOHAB class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_JOHAB.st,v 1.3 2004/03/09 21:57:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__JOHAB.st,v 1.3 2004/03/09 21:57:37 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__KOI7.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__KOI7.st	Sat May 05 22:58:24 2012 +0100
@@ -381,7 +381,7 @@
 !KOI7 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_KOI7.st,v 1.3 2004/03/09 22:01:17 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__KOI7.st,v 1.3 2004/03/09 22:01:17 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__KOI8_R.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__KOI8_R.st	Sat May 05 22:58:24 2012 +0100
@@ -852,11 +852,11 @@
 !KOI8_R class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_KOI8_R.st,v 1.3 2004/03/09 21:57:30 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__KOI8_R.st,v 1.3 2004/03/09 21:57:30 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__KOI8_R.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__KOI8_R.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__KOI8_U.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__KOI8_U.st	Sat May 05 22:58:24 2012 +0100
@@ -411,7 +411,7 @@
 !KOI8_U class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_KOI8_U.st,v 1.3 2004/03/09 21:58:42 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__KOI8_U.st,v 1.3 2004/03/09 21:58:42 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__KSC5601.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__KSC5601.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !KSC5601 class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_KSC5601.st,v 1.3 2004/03/09 21:58:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__KSC5601.st,v 1.3 2004/03/09 21:58:35 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Arabic.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Arabic.st	Sat May 05 22:58:24 2012 +0100
@@ -584,7 +584,7 @@
 !MAC_Arabic class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Arabic.st,v 1.3 2004/03/09 21:59:43 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Arabic.st,v 1.3 2004/03/09 21:59:43 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_CentralEuropean.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_CentralEuropean.st	Sat May 05 22:58:24 2012 +0100
@@ -373,7 +373,7 @@
 !MAC_CentralEuropean class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_CentralEuropean.st,v 1.3 2004/03/09 21:57:41 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_CentralEuropean.st,v 1.3 2004/03/09 21:57:41 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Croatian.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Croatian.st	Sat May 05 22:58:24 2012 +0100
@@ -399,7 +399,7 @@
 !MAC_Croatian class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Croatian.st,v 1.3 2004/03/09 22:00:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Croatian.st,v 1.3 2004/03/09 22:00:00 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Cyrillic.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Cyrillic.st	Sat May 05 22:58:24 2012 +0100
@@ -398,7 +398,7 @@
 !MAC_Cyrillic class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Cyrillic.st,v 1.3 2004/03/09 21:57:56 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Cyrillic.st,v 1.3 2004/03/09 21:57:56 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Dingbats.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Dingbats.st	Sat May 05 22:58:24 2012 +0100
@@ -375,7 +375,7 @@
 !MAC_Dingbats class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Dingbats.st,v 1.3 2004/03/09 22:01:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Dingbats.st,v 1.3 2004/03/09 22:01:02 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Farsi.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Farsi.st	Sat May 05 22:58:24 2012 +0100
@@ -569,7 +569,7 @@
 !MAC_Farsi class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Farsi.st,v 1.3 2004/03/09 22:00:02 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Farsi.st,v 1.3 2004/03/09 22:00:02 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Greek.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Greek.st	Sat May 05 22:58:24 2012 +0100
@@ -847,7 +847,7 @@
 !MAC_Greek class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Greek.st,v 1.3 2004/03/09 21:59:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Greek.st,v 1.3 2004/03/09 21:59:52 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Hebrew.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Hebrew.st	Sat May 05 22:58:24 2012 +0100
@@ -611,7 +611,7 @@
 !MAC_Hebrew class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Hebrew.st,v 1.3 2004/03/09 22:01:14 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Hebrew.st,v 1.3 2004/03/09 22:01:14 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Iceland.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Iceland.st	Sat May 05 22:58:24 2012 +0100
@@ -417,7 +417,7 @@
 !MAC_Iceland class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Iceland.st,v 1.3 2004/03/09 21:59:24 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Iceland.st,v 1.3 2004/03/09 21:59:24 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Japanese.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Japanese.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !MAC_Japanese class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Japanese.st,v 1.3 2004/03/09 21:59:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Japanese.st,v 1.3 2004/03/09 21:59:58 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Korean.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Korean.st	Sat May 05 22:58:24 2012 +0100
@@ -46,7 +46,7 @@
 !MAC_Korean class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Korean.st,v 1.3 2004/03/09 21:58:29 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Korean.st,v 1.3 2004/03/09 21:58:29 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Roman.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Roman.st	Sat May 05 22:58:24 2012 +0100
@@ -965,11 +965,11 @@
 !MAC_Roman class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Roman.st,v 1.4 2011/01/29 20:33:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Roman.st,v 1.4 2011/01/29 20:33:33 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Encoder_MAC_Roman.st,v 1.4 2011/01/29 20:33:33 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Roman.st,v 1.4 2011/01/29 20:33:33 cg Exp §'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Romanian.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Romanian.st	Sat May 05 22:58:24 2012 +0100
@@ -414,7 +414,7 @@
 !MAC_Romanian class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Romanian.st,v 1.3 2004/03/09 21:58:05 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Romanian.st,v 1.3 2004/03/09 21:58:05 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Symbol.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Symbol.st	Sat May 05 22:58:24 2012 +0100
@@ -445,7 +445,7 @@
 !MAC_Symbol class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Symbol.st,v 1.3 2004/03/09 21:57:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Symbol.st,v 1.3 2004/03/09 21:57:44 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Thai.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Thai.st	Sat May 05 22:58:24 2012 +0100
@@ -432,7 +432,7 @@
 !MAC_Thai class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Thai.st,v 1.3 2004/03/09 21:59:00 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Thai.st,v 1.3 2004/03/09 21:59:00 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MAC_Turkish.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MAC_Turkish.st	Sat May 05 22:58:24 2012 +0100
@@ -389,7 +389,7 @@
 !MAC_Turkish class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MAC_Turkish.st,v 1.3 2004/03/09 21:59:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MAC_Turkish.st,v 1.3 2004/03/09 21:59:55 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Ansi.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Ansi.st	Sat May 05 22:58:24 2012 +0100
@@ -618,11 +618,11 @@
 !MS_Ansi class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Ansi.st,v 1.7 2008/05/07 14:46:49 mb Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Ansi.st,v 1.7 2008/05/07 14:46:49 mb Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__MS_Ansi.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__MS_Ansi.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Arabic.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Arabic.st	Sat May 05 22:58:24 2012 +0100
@@ -839,7 +839,7 @@
 !MS_Arabic class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Arabic.st,v 1.4 2005/03/31 18:48:44 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Arabic.st,v 1.4 2005/03/31 18:48:44 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Baltic.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Baltic.st	Sat May 05 22:58:24 2012 +0100
@@ -851,11 +851,11 @@
 !MS_Baltic class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Baltic.st,v 1.4 2005/03/31 18:48:58 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Baltic.st,v 1.4 2005/03/31 18:48:58 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__MS_Baltic.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__MS_Baltic.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Cyrillic.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Cyrillic.st	Sat May 05 22:58:24 2012 +0100
@@ -717,11 +717,11 @@
 !MS_Cyrillic class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Cyrillic.st,v 1.4 2005/03/31 18:48:53 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Cyrillic.st,v 1.4 2005/03/31 18:48:53 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__MS_Cyrillic.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__MS_Cyrillic.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_EastEuropean.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_EastEuropean.st	Sat May 05 22:58:24 2012 +0100
@@ -813,7 +813,7 @@
 !MS_EastEuropean class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_EastEuropean.st,v 1.4 2005/03/31 18:48:47 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_EastEuropean.st,v 1.4 2005/03/31 18:48:47 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Greek.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Greek.st	Sat May 05 22:58:24 2012 +0100
@@ -670,11 +670,11 @@
 !MS_Greek class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Greek.st,v 1.4 2005/03/31 18:49:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Greek.st,v 1.4 2005/03/31 18:49:01 cg Exp $'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__MS_Greek.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__MS_Greek.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Hebrew.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Hebrew.st	Sat May 05 22:58:24 2012 +0100
@@ -607,7 +607,7 @@
 !MS_Hebrew class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Hebrew.st,v 1.4 2005/03/31 18:48:50 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Hebrew.st,v 1.4 2005/03/31 18:48:50 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Symbol.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Symbol.st	Sat May 05 22:58:24 2012 +0100
@@ -88,7 +88,7 @@
 !MS_Symbol class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Symbol.st,v 1.5 2005/03/31 18:48:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Symbol.st,v 1.5 2005/03/31 18:48:55 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__MS_Turkish.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__MS_Turkish.st	Sat May 05 22:58:24 2012 +0100
@@ -819,7 +819,7 @@
 !MS_Turkish class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_MS_Turkish.st,v 1.5 2005/03/31 18:49:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__MS_Turkish.st,v 1.5 2005/03/31 18:49:37 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__NEXT.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__NEXT.st	Sat May 05 22:58:24 2012 +0100
@@ -313,7 +313,7 @@
 !NEXT class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_NEXT.st,v 1.3 2004/03/09 22:00:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__NEXT.st,v 1.3 2004/03/09 22:00:52 cg Exp $'
 ! !
 
 
--- a/CharacterEncoderImplementations__SingleByteEncoder.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__SingleByteEncoder.st	Sat May 05 22:58:24 2012 +0100
@@ -73,15 +73,15 @@
 !SingleByteEncoder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_SingleByteEncoder.st,v 1.9 2009/12/11 16:54:15 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SingleByteEncoder.st,v 1.9 2009/12/11 16:54:15 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Encoder_SingleByteEncoder.st,v 1.9 2009/12/11 16:54:15 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__SingleByteEncoder.st,v 1.9 2009/12/11 16:54:15 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__SingleByteEncoder.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__SingleByteEncoder.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/CharacterEncoderImplementations__TwoByteEncoder.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/CharacterEncoderImplementations__TwoByteEncoder.st	Sat May 05 22:58:24 2012 +0100
@@ -79,15 +79,15 @@
 !TwoByteEncoder class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Encoder_TwoByteEncoder.st,v 1.6 2009/11/04 00:47:35 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__TwoByteEncoder.st,v 1.6 2009/11/04 00:47:35 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Encoder_TwoByteEncoder.st,v 1.6 2009/11/04 00:47:35 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/CharacterEncoderImplementations__TwoByteEncoder.st,v 1.6 2009/11/04 00:47:35 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: CharacterEncoderImplementations__TwoByteEncoder.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: CharacterEncoderImplementations__TwoByteEncoder.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/ConfigurableFeatures.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ConfigurableFeatures.st	Sat May 05 22:58:24 2012 +0100
@@ -134,6 +134,23 @@
     "Created: / 03-01-2012 / 15:36:12 / cg"
 !
 
+hasExternalLookupSupport
+    "Return true, if the VM is compiled with external lookup MOP"
+%{
+#ifdef SUPPORT_EXTERNAL_LOOKUP
+    RETURN ( true );
+#endif
+%}.
+    ^false
+
+    "
+        ConfigurableFeatures hasExternalLookupSupport
+        ConfigurableFeatures includesFeature:#ExternalLookupSupport
+    "
+
+    "Created: / 16-04-2012 / 20:00:37 / Jan Vrany <jan.vrany@fit.cvut.cz>"
+!
+
 hasFileBasedSourceCodeManagerSupport
     "/ use Smalltalk-at to trick the dependency/prerequisite generator
     ^ (Smalltalk at: #'FileBasedSourceCodeManager' ifAbsent:nil) notNil
@@ -240,13 +257,13 @@
 !ConfigurableFeatures class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.7 2012/03/13 17:24:12 vrany Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.8 2012/04/16 18:03:49 vrany Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.7 2012/03/13 17:24:12 vrany Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ConfigurableFeatures.st,v 1.8 2012/04/16 18:03:49 vrany Exp §'
 !
 
 version_SVN
-    ^ '$Id: ConfigurableFeatures.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ConfigurableFeatures.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
--- a/ExternalBytes.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ExternalBytes.st	Sat May 05 22:58:24 2012 +0100
@@ -950,28 +950,28 @@
     ^ super replaceBytesFrom:start to:stop with:aCollection startingAt:repStart
 
     "
-     (ExternalBytes unprotectedNew:16)
-            replaceFrom:1 to:8
+     ((ExternalBytes unprotectedNew:16)
+            replaceBytesFrom:1 to:8
             with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
-            startingAt:1
+            startingAt:1) copy
 
      (ExternalBytes unprotectedNew:16)
-            replaceFrom:3 to:10
+            replaceBytesFrom:3 to:10
             with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
             startingAt:4
 
      (ExternalBytes unprotectedNew:16)
-            replaceFrom:3 to:4
+            replaceBytesFrom:3 to:4
             with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
             startingAt:1
 
      (ExternalBytes unprotectedNew:16)
-            replaceFrom:0 to:9
+            replaceBytesFrom:0 to:9
             with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
             startingAt:1
 
      (ExternalBytes unprotectedNew:16)
-            replaceFrom:1 to:10
+            replaceBytesFrom:1 to:10
             with:#[10 20 30 40 50 60 70 80 90 100 110 120 130 140 150 160]
             startingAt:0
     "
@@ -1310,15 +1310,15 @@
 !ExternalBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.83 2012/04/03 11:57:15 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.84 2012/04/24 14:58:43 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.83 2012/04/03 11:57:15 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.84 2012/04/24 14:58:43 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ExternalBytes.st 10804 2012-04-13 13:18:13Z vranyj1 $'
+    ^ '$Id: ExternalBytes.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 ExternalBytes initialize!
--- a/ExternalLibraryFunction.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ExternalLibraryFunction.st	Sat May 05 22:58:24 2012 +0100
@@ -16,7 +16,7 @@
 	classVariableNames:'DLLPATH FLAG_VIRTUAL FLAG_NONVIRTUAL FLAG_ASYNC
 		FLAG_UNLIMITEDSTACK FLAG_RETVAL_IS_CONST CALLTYPE_MASK
 		CALLTYPE_API CALLTYPE_C CALLTYPE_OLE CALLTYPE_V8 CALLTYPE_V9
-		CALLTYPE_UNIX64'
+		CALLTYPE_UNIX64 DllMapping'
 	poolDictionaries:''
 	category:'System-Support'
 !
@@ -184,6 +184,24 @@
     ]
 !
 
+dllMapping
+    "allows for dll's to be replaced,
+     for example, if you want to use the mozilla sqlite dll
+        C:\Program Files\Mozilla Firefox\mozsqlite3.dll
+     for the sqlite3, execute:
+        ExternalLibraryFunction 
+            dllMapping at:'sqlite3'
+            put: 'C:\Program Files\Mozilla Firefox\mozsqlite3.dll'
+    "
+
+    DllMapping isNil ifTrue:[
+        DllMapping := Dictionary new.
+    ].
+    ^ DllMapping
+
+    "Created: / 10-04-2012 / 12:21:45 / cg"
+!
+
 dllPath
     ^ DLLPATH
 !
@@ -600,7 +618,7 @@
     moduleHandle isNil ifTrue:[
         handle := self loadLibrary:moduleNameUsed.
         handle isNil ifTrue:[
-            self error:('Cannot load module: "%1"' bindWith: moduleNameUsed).
+            self error:('Cannot load dll/module: "%1"' bindWith: moduleNameUsed).
         ].
         moduleHandle := handle.
     ].
@@ -616,14 +634,18 @@
         ].
     ].
 
-    "Modified: / 01-08-2006 / 16:24:14 / cg"
-    "Modified (comment): / 07-10-2011 / 16:43:11 / cg"
+    "Modified: / 10-04-2012 / 12:12:44 / cg"
 !
 
 loadLibrary:dllName
     |handle nameString filename|
 
-    filename := dllName asFilename.
+    filename := dllName.
+    DllMapping notNil ifTrue:[
+        filename := DllMapping at:filename ifAbsent:[ filename ]
+    ].
+
+    filename := filename asFilename.
     nameString := filename name.
 
     "try to load, maybe the system knows where to find the dll"
@@ -653,6 +675,8 @@
     ].
 
     ^ nil
+
+    "Modified: / 10-04-2012 / 12:21:06 / cg"
 !
 
 prepareInvoke
@@ -1604,11 +1628,11 @@
 !ExternalLibraryFunction class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.85 2012/03/01 15:22:21 mb Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.86 2012/04/15 16:58:21 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: ExternalLibraryFunction.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ExternalLibraryFunction.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 ExternalLibraryFunction initialize!
--- a/Float.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/Float.st	Sat May 05 22:58:24 2012 +0100
@@ -471,18 +471,21 @@
 !Float class methodsFor:'class initialization'!
 
 initialize
-    DefaultPrintFormat := '.15'.  "/ print 15 valid digits
-    Pi := 3.14159265358979323846264338327950288419716939937510582097494459.
-    Halfpi := Pi / 2.0.
-    HalfpiNegative := Halfpi negated.
-    Twopi := Pi * 2.0.
-    E := 2.7182818284590452353602874713526625.
-    Sqrt2 := 1.41421356237309504880168872420969808.
-    RadiansPerDegree := Pi / 180.0.
-    Ln2 := 0.69314718055994530941723212145817657.
-    Ln10 := 10.0 ln.
+    Pi isNil ifTrue:[
+        DefaultPrintFormat := '.15'.  "/ print 15 valid digits
+        Pi := 3.14159265358979323846264338327950288419716939937510582097494459.
+        Halfpi := Pi / 2.0.
+        HalfpiNegative := Halfpi negated.
+        Twopi := Pi * 2.0.
+        E := 2.7182818284590452353602874713526625.
+        Sqrt2 := 1.41421356237309504880168872420969808.
+        RadiansPerDegree := Pi / 180.0.
+        Ln2 := 0.69314718055994530941723212145817657.
+        Ln10 := 10.0 ln.
+    ].
 
     "
+     Pi := nil.
      self initialize
     "
 
@@ -577,6 +580,44 @@
     "Modified: 23.4.1996 / 09:27:15 / cg"
 ! !
 
+!Float class methodsFor:'misc'!
+
+getFPUControl
+    "get the fpu control word."
+
+%{
+#ifdef __BORLANDC__
+    unsigned int _control87();
+
+    int result = _control87(0, 0);
+    RETURN(__MKSMALLINT(result));
+#endif
+%}
+
+    "
+        self getFPUControl
+    "
+!
+
+setFPUControl
+    "set the fpu control word.
+     We want 64 bit precision for long double here"
+
+%{
+#ifdef __BORLANDC__
+#include <float.h>
+
+    // Set precision to long double / 64bit
+    int result = _control87(PC_64, MCW_PC);
+    RETURN(__MKSMALLINT(result));
+#endif
+%}
+
+    "
+        self setFPUControl
+    "
+! !
+
 !Float class methodsFor:'queries'!
 
 exponentCharacter
@@ -649,7 +690,6 @@
     ^ 2 "must be careful here, whenever ST/X is used on VAX or a 370"
 ! !
 
-
 !Float methodsFor:'arithmetic'!
 
 * aNumber
@@ -1433,7 +1473,6 @@
     "Modified: / 16.11.2001 / 14:14:43 / cg"
 ! !
 
-
 !Float methodsFor:'printing & storing'!
 
 printString
@@ -1840,7 +1879,6 @@
     "
 ! !
 
-
 !Float methodsFor:'testing'!
 
 isFinite
@@ -2737,15 +2775,15 @@
 !Float class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.176 2010/11/23 13:35:52 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Float.st,v 1.179 2012/04/17 20:36:48 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Float.st,v 1.176 2010/11/23 13:35:52 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Float.st,v 1.179 2012/04/17 20:36:48 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Float.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Float.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 Float initialize!
--- a/ImmutableArray.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ImmutableArray.st	Sat May 05 22:58:24 2012 +0100
@@ -105,18 +105,6 @@
 
 !ImmutableArray methodsFor:'copying'!
 
-copyEmpty
-    "when copying, return a real (mutable) Array"
-
-    ^ Array new:self size
-!
-
-copyEmptyAndGrow:size
-    "when copying, return a real (mutable) Array"
-
-    ^ Array new:size
-!
-
 postCopy
     "when copied, make it me a real (mutable) Array"
 
@@ -136,7 +124,11 @@
 
     sz := self size.
     ^ (Array new:sz)
-	replaceFrom:1 to:sz with:self startingAt:1
+        replaceFrom:1 to:sz with:self startingAt:1
+
+    "
+     #(1 2 3 4) asImmutableArray shallowCopy
+    "
 ! !
 
 !ImmutableArray methodsFor:'error handling'!
@@ -185,13 +177,13 @@
 !ImmutableArray class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.29 2012/02/27 19:44:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.30 2012/04/21 16:00:59 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.29 2012/02/27 19:44:21 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableArray.st,v 1.30 2012/04/21 16:00:59 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ImmutableArray.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ImmutableArray.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
--- a/ImmutableByteArray.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ImmutableByteArray.st	Sat May 05 22:58:24 2012 +0100
@@ -111,18 +111,6 @@
 
 !ImmutableByteArray methodsFor:'copying'!
 
-copyEmpty
-    "when copying, return a real (mutable) ByteArray"
-
-    ^ ByteArray new:self size
-!
-
-copyEmptyAndGrow:size
-    "when copying, return a real (mutable) ByteArray"
-
-    ^ ByteArray new:size
-!
-
 postCopy
     "when copied, make me a real (mutable) ByteArray"
 
@@ -148,7 +136,11 @@
 
     sz := self size.
     ^ (ByteArray new:sz)
-	replaceFrom:1 to:sz with:self startingAt:1
+        replaceBytesFrom:1 to:sz with:self startingAt:1
+
+    "
+     #[1 2 3 4] asImmutableByteArray shallowCopy
+    "
 ! !
 
 !ImmutableByteArray methodsFor:'private'!
@@ -197,9 +189,9 @@
 !ImmutableByteArray class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableByteArray.st,v 1.8 2012/02/27 19:44:26 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableByteArray.st,v 1.9 2012/04/21 16:01:08 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ImmutableByteArray.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ImmutableByteArray.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
--- a/ImmutableString.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/ImmutableString.st	Sat May 05 22:58:24 2012 +0100
@@ -104,22 +104,6 @@
 
 !ImmutableString methodsFor:'copying'!
 
-copyEmpty
-    "when copying, return a real (mutable) String"
-
-    ^ String new:self size
-
-    "Created: / 3.8.1998 / 14:46:22 / cg"
-!
-
-copyEmptyAndGrow:size
-    "when copying, return a real (mutable) String"
-
-    ^ String new:size
-
-    "Created: / 3.8.1998 / 14:46:34 / cg"
-!
-
 postCopy
     "when copied, make me a real (mutable) String"
 
@@ -148,6 +132,10 @@
     sz := self size.
     ^ (String new:sz) replaceFrom:1 to:sz with:self startingAt:1
 
+    "
+     'hello world' asImmutableString shallowCopy
+    "
+
     "Created: / 3.8.1998 / 14:47:00 / cg"
 ! !
 
@@ -192,13 +180,13 @@
 !ImmutableString class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableString.st,v 1.10 2012/02/27 19:44:31 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/ImmutableString.st,v 1.11 2012/04/21 16:01:10 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableString.st,v 1.10 2012/02/27 19:44:31 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ImmutableString.st,v 1.11 2012/04/21 16:01:10 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: ImmutableString.st 10792 2012-03-21 17:45:38Z vranyj1 $'
+    ^ '$Id: ImmutableString.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
--- a/Interval.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/Interval.st	Sat May 05 22:58:24 2012 +0100
@@ -286,28 +286,25 @@
 collect:aBlock
     "evaluate the argument, aBlock for every element in the collection
      and return a collection of the results.
-     Redefined since SeqColl accesses the receiver via at:, which is slow for intervals"
+     Redefined since the inherited method (SeqColl) accesses the receiver via at:, 
+     which is slow for intervals"
 
-    |newCollection|
+    |elementValue mySize newCollection|
 
-    (start == 1 and:[step == 1]) ifTrue:[
-        newCollection := Array new:(self size).
-        self do:[:each |
-            newCollection at:each put:(aBlock value:each)
-        ].
-    ] ifFalse:[
-        newCollection := self species new:(self size).
-        self do:[:each |
-            newCollection add:(aBlock value:each)
-        ].
+    elementValue := start.
+    newCollection := Array new:(mySize := self size).
+    1 to: mySize do:[:i |
+        newCollection at:i put:(aBlock value:elementValue).
+        elementValue := elementValue + step.
     ].
-    ^ newCollection
+    ^ newCollection    
 
     "
-     (1 to:20) collect:[:i | i*i]  
+     (1 to:20 by:2) collect:[:i | i*i]              
     "
 
-    "Modified: / 22-10-2008 / 12:47:52 / cg"
+    "Modified: / 03-05-2012 / 16:48:16 / cg"
+    "Modified (comment): / 03-05-2012 / 18:31:01 / cg"
 !
 
 do:aBlock
@@ -692,15 +689,15 @@
 !Interval class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Interval.st,v 1.52 2010/09/21 06:57:23 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Interval.st,v 1.53 2012/05/03 16:31:40 cg Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Interval.st,v 1.52 2010/09/21 06:57:23 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Interval.st,v 1.53 2012/05/03 16:31:40 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: Interval.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: Interval.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/LongFloat.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/LongFloat.st	Sat May 05 22:58:24 2012 +0100
@@ -402,13 +402,16 @@
 initialize
     "do not write a literal constant here - we cannot depend on the underlying C-compiler here..."
 
-    DefaultPrintFormat := '.19'.  "/ 19 valid digits
-
-    "/ enough digits for 128bit IEEE quads
-    Pi := self readFrom:'3.1415926535897932384626433832795029'. "/ '3.14159265358979323846264338327950288419716939937510582097494459'.
-    E := self readFrom:'2.7182818284590452353602874713526625'.
+    Pi isNil ifTrue:[
+        DefaultPrintFormat := '.19'.  "/ 19 valid digits
+
+        "/ enough digits for 128bit IEEE quads
+        Pi := self readFrom:'3.1415926535897932384626433832795029'. "/ 3.14159265358979323846264338327950288419716939937510582097494459q
+        E  := self readFrom:'2.7182818284590452353602874713526625'.
+    ].
 
     "
+     Pi := nil.
      self initialize
     "
 
@@ -2537,15 +2540,15 @@
 !LongFloat class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.68 2010/09/05 15:48:37 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.69 2012/04/17 20:24:53 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.68 2010/09/05 15:48:37 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/LongFloat.st,v 1.69 2012/04/17 20:24:53 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: LongFloat.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: LongFloat.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 LongFloat initialize!
--- a/LookupKey.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/LookupKey.st	Sat May 05 22:58:24 2012 +0100
@@ -104,12 +104,25 @@
 
 !LookupKey methodsFor:'printing & storing'!
 
-displayString
-    "return a string containing a printable representation
-     of the receiver for displaying - redefined to use display string on
-     the components for nicer look"
+displayOn:aGCOrStream
+    "Compatibility
+     append a printed desription on some stream (Dolphin,  Squeak)
+     OR:
+     display the receiver in a graphicsContext at 0@0 (ST80).
+     This method allows for any object to be displayed in some view
+     (although the fallBack is to display its printString ...)"
 
-    ^ self class name , '(' , key displayString , ')'
+    "/ what a kludge - Dolphin and Squeak mean: printOn: a stream;
+    "/ ST/X (and some old ST80's) mean: draw-yourself on a GC.
+    (aGCOrStream isStream and:[aGCOrStream ~~ Transcript]) ifFalse:[
+        ^ super displayOn:aGCOrStream
+    ].
+
+    aGCOrStream 
+        nextPutAll:self className; 
+        nextPut:$(.
+    key displayOn:aGCOrStream.
+    aGCOrStream nextPut:$)
 !
 
 printOn:aStream
@@ -123,11 +136,11 @@
 !LookupKey class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LookupKey.st,v 1.9 1999/07/15 19:44:33 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LookupKey.st,v 1.10 2012/04/24 12:01:05 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: LookupKey.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: LookupKey.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/Make.proto	Fri Apr 13 15:03:30 2012 +0100
+++ b/Make.proto	Sat May 05 22:58:24 2012 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libbasic/Make.proto,v 1.251 2012/03/01 16:04:03 stefan Exp $
+# $Header: /cvs/stx/stx/libbasic/Make.proto,v 1.252 2012/04/25 19:08:21 stefan Exp $
 #
 # DO NOT EDIT
 # automagically generated from the projectDefinition: stx_libbasic at 2012-03-01 13:51:24.927.
--- a/Make.spec	Fri Apr 13 15:03:30 2012 +0100
+++ b/Make.spec	Sat May 05 22:58:24 2012 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libbasic/Make.spec,v 1.129 2012/03/01 15:58:53 stefan Exp $
+# $Header: /cvs/stx/stx/libbasic/Make.spec,v 1.130 2012/04/25 19:08:21 stefan Exp $
 #
 # DO NOT EDIT
 # automagically generated from the projectDefinition: stx_libbasic at 2012-03-01 13:51:23.335.
--- a/SequenceableCollection.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/SequenceableCollection.st	Sat May 05 22:58:24 2012 +0100
@@ -380,6 +380,7 @@
     ^ self == SequenceableCollection
 ! !
 
+
 !SequenceableCollection methodsFor:'Compatibility-Squeak'!
 
 allButFirst
@@ -660,6 +661,7 @@
     ^ self replaceFrom:start to:stop with:anArray startingAt:repStart
 ! !
 
+
 !SequenceableCollection methodsFor:'accessing'!
 
 after:anObject
@@ -4378,27 +4380,27 @@
 
     n := stopIndex - startIndex + 1.
     species := self species.
-    species growIsCheap ifFalse:[
-	newColl := OrderedCollection new:n.
-	needCopy := true
+    species growIsCheap ifTrue:[
+        newColl := self copyEmpty:n.
+        needCopy := false
     ] ifTrue:[
-	newColl := self copyEmpty:n.
-	needCopy := false
+        newColl := OrderedCollection new:n.
+        needCopy := true
     ].
     startIndex to:stopIndex do:[:index |
-	element := self at:index.
-	(aBlock value:element) ifTrue:[
-	    newColl add:element
-	].
+        element := self at:index.
+        (aBlock value:element) ifTrue:[
+            newColl add:element
+        ].
     ].
     needCopy ifTrue:[
-	newColl := (species withAll:newColl) postCopyFrom:self
+        newColl := (species withAll:newColl) postCopyFrom:self
     ].
     ^ newColl
 
     "
      #(faba one two three four five six)
-	from:2 to:5 select:[:element | element startsWith:'f']
+        from:2 to:5 select:[:element | element startsWith:'f']
     "
 !
 
@@ -4716,21 +4718,21 @@
 
     sz := self size.
     species := self species.
-    species growIsCheap ifFalse:[
-	newColl := OrderedCollection new:sz.
-	needCopy := true
-    ] ifTrue:[
-	newColl := self copyEmpty:sz.
-	needCopy := false
+    species growIsCheap ifTrue:[
+        newColl := self copyEmpty:sz.
+        needCopy := false
+    ] ifFalse:[
+        newColl := OrderedCollection new:sz.
+        needCopy := true
     ].
     1 to:sz do:[:index |
-	element := self at:index.
-	(aBlock value:element) ifTrue:[
-	    newColl add:element
-	].
+        element := self at:index.
+        (aBlock value:element) ifTrue:[
+            newColl add:element
+        ].
     ].
     needCopy ifTrue:[
-	newColl := (species withAll:newColl) postCopyFrom:self
+        newColl := (species withAll:newColl) postCopyFrom:self
     ].
     ^ newColl
 
@@ -5386,6 +5388,242 @@
     "Modified: / 20.5.1998 / 15:25:08 / cg"
 ! !
 
+!SequenceableCollection methodsFor:'obsolete'!
+
+randomizedQuickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
+    "actual randomizedQuicksort worker for sort:with:-message.
+     This exchanges a random element within the partition, to avoid
+     the worst case O-square situation of quickSort.
+
+     Notice, that this method has a much worse best- and average case
+     runTime, due to the random number generation.
+     The worst case of quickSort is encountered, if the choosen pivot
+     element lies at either end of the partition, so that a split
+     creates partitions of size 1 and (n-1).
+     Since the middle element is choosen, this worst case is very unlikely
+     to be encountered."
+
+    <resource:#obsolete>
+
+    self obsoleteMethodWarning:'use quickSortFrom:to:sortBlock:with:'.
+
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self quickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
+
+
+"/    |begin   "{ Class: SmallInteger }"
+"/     end     "{ Class: SmallInteger }"
+"/     b       "{ Class: SmallInteger }"
+"/     e       "{ Class: SmallInteger }"
+"/     rnd     "{ Class: SmallInteger }"
+"/     middleElement temp1 temp2 |
+"/
+"/    begin := inBegin.   "/ this also does a type-check
+"/    end := inEnd.
+"/
+"/    b := begin.
+"/    e := end.
+"/
+"/    "/ randomize that partition
+"/    "/ by exchanging the first element with any random
+"/    "/ element.
+"/    rnd := Random nextIntegerBetween:b and:e.
+"/    temp1 := self at:b. temp2 := self at:rnd.
+"/    self at:b put:temp2. self at:rnd put:temp1.
+"/    aCollection notNil ifTrue:[
+"/        temp1 := aCollection at:b. temp2 := aCollection at:rnd.
+"/        aCollection at:b put:temp2. aCollection at:rnd put:temp1
+"/    ].
+"/
+"/    "/
+"/    "/ now proceed as usual
+"/    "/
+"/    middleElement := self at:((b + e) // 2).
+"/
+"/    [b < e] whileTrue:[
+"/        [b < end and:[sortBlock value:(self at:b) value:middleElement]] whileTrue:[b := b + 1].
+"/        [e > begin and:[sortBlock value:middleElement value:(self at:e)]] whileTrue:[e := e - 1].
+"/
+"/        (b <= e) ifTrue:[
+"/            (b == e) ifFalse:[
+"/                temp1 := self at:b. temp2 := self at:e.
+"/                self at:b put:temp2. self at:e put:temp1.
+"/                aCollection notNil ifTrue:[
+"/                    temp1 := aCollection at:b. temp2 := aCollection at:e.
+"/                    aCollection at:b put:temp2. aCollection at:e put:temp1
+"/                ].
+"/            ].
+"/            b := b + 1.
+"/            e := e - 1
+"/        ]
+"/    ].
+"/    (begin < e) ifTrue:[self randomizedQuickSortFrom:begin to:e sortBlock:sortBlock with:aCollection].
+"/    (b < end) ifTrue:[self randomizedQuickSortFrom:b to:end sortBlock:sortBlock with:aCollection]
+!
+
+randomizedQuickSortFrom:inBegin to:inEnd with:aCollection
+    "actual randomizedQuicksort worker for randomizedSort:-message.
+     This exchanges a random element within the partition, to avoid
+     the worst case O-square situation of quickSort.
+
+     Notice, that this method has a much worse best- and average case
+     runTime, due to the random number generation.
+     The worst case of quickSort is encountered, if the choosen pivot
+     element lies at either end of the partition, so that a split
+     creates partitions of size 1 and (n-1).
+     Since the middle element is choosen, this worst case is very unlikely
+     to be encountered."
+
+    <resource:#obsolete>
+
+    self obsoleteMethodWarning:'use quickSortFrom:to:with:'.
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self quickSortFrom:inBegin to:inEnd with:aCollection
+
+
+"/    |begin   "{ Class: SmallInteger }"
+"/     end     "{ Class: SmallInteger }"
+"/     b       "{ Class: SmallInteger }"
+"/     e       "{ Class: SmallInteger }"
+"/     rnd     "{ Class: SmallInteger }"
+"/     middleElement temp1 temp2 |
+"/
+"/    begin := inBegin.   "/ this also does a type-check
+"/    end := inEnd.
+"/
+"/    b := begin.
+"/    e := end.
+"/
+"/    "/ randomize that partition
+"/    "/ by exchanging the first element with any random
+"/    "/ element.
+"/    rnd := Random nextIntegerBetween:b and:e.
+"/    temp1 := self at:b. temp2 := self at:rnd.
+"/    self at:b put:temp2. self at:rnd put:temp1.
+"/    aCollection notNil ifTrue:[
+"/        temp1 := aCollection at:b. temp2 := aCollection at:rnd.
+"/        aCollection at:b put:temp2. aCollection at:rnd put:temp1
+"/    ].
+"/
+"/    "/
+"/    "/ now proceed as usual
+"/    "/
+"/    middleElement := self at:((b + e) // 2).
+"/
+"/    [b < e] whileTrue:[
+"/        [b < end and:[(self at:b) < middleElement]] whileTrue:[b := b + 1].
+"/        [e > begin and:[middleElement < (self at:e)]] whileTrue:[e := e - 1].
+"/
+"/        (b <= e) ifTrue:[
+"/            (b == e) ifFalse:[
+"/                temp1 := self at:b. temp2 := self at:e.
+"/                self at:b put:temp2. self at:e put:temp1.
+"/                aCollection notNil ifTrue:[
+"/                    temp1 := aCollection at:b. temp2 := aCollection at:e.
+"/                    aCollection at:b put:temp2. aCollection at:e put:temp1
+"/                ].
+"/            ].
+"/            b := b + 1.
+"/            e := e - 1
+"/        ]
+"/    ].
+"/    (begin < e) ifTrue:[self randomizedQuickSortFrom:begin to:e with:aCollection].
+"/    (b < end) ifTrue:[self randomizedQuickSortFrom:b to:end with:aCollection]
+"/
+"/    "Modified: 21.8.1997 / 18:30:19 / cg"
+"/    "Created: 21.8.1997 / 18:34:23 / cg"
+!
+
+randomizedSort
+    <resource: #obsolete>
+    "sort the collection inplace. The elements are compared using
+     '<' i.e. they should offer a magnitude-like protocol.
+
+     This uses the randomized quicksort algorithm,
+     which has a better worstCase behavior than quickSort
+     (bit worse bestCase & averageCase behavior).
+     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
+
+"/    |stop|
+"/
+"/    stop := self size.
+"/    (stop > 1) ifTrue:[
+"/        self randomizedQuickSortFrom:1 to:stop sortBlock:[:a :b | a < b] with:nil
+"/    ]
+
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self sort
+
+!
+
+randomizedSort:sortBlock
+    <resource: #obsolete>
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. This allows any sort criteria to be implemented.
+
+     This uses the randomized quicksort algorithm,
+     which has a better worstCase behavior than quickSort
+     (bit worse bestCase & averageCase behavior).
+     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
+
+"/    |stop|
+"/
+"/    stop := self size.
+"/    (stop > 1) ifTrue:[
+"/        self randomizedQuickSortFrom:1 to:stop sortBlock:sortBlock with:nil
+"/    ]
+
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self sort:sortBlock
+
+!
+
+randomizedSort:sortBlock with:aCollection
+    <resource: #obsolete>
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. Also reorder the elements in aCollection.
+     Use this, when you have a key collection to sort some other collection with.
+
+     This uses the randomized quicksort algorithm,
+     which has a better worstCase behavior than quickSort
+     (bit worse bestCase & averageCase behavior).
+     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
+
+"/    |stop|
+"/
+"/    stop := self size.
+"/    (stop > 1) ifTrue:[
+"/        self randomizedQuickSortFrom:1 to:stop sortBlock:sortBlock with:aCollection
+"/    ]
+
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self sort:sortBlock with:aCollection
+
+!
+
+randomizedSortWith:aCollection
+    <resource: #obsolete>
+    "sort the receiver collection inplace, using '<' to compare elements.
+     Also, the elements of aCollection are reordered with it.
+     Use this, when you have a key collection to sort another collection with.
+
+     This uses the randomized quicksort algorithm,
+     which has a better worstCase behavior than quickSort
+     (bit worse bestCase & averageCase behavior).
+     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
+
+"/    |stop|
+"/
+"/    stop := self size.
+"/    (stop > 1) ifTrue:[
+"/        self randomizedQuickSortFrom:1 to:stop sortBlock:[:a :b | a < b] with:aCollection
+"/    ]
+
+    "/ code was never used - use regular sort for backward compatibility
+    ^ self sortWith:aCollection
+
+! !
+
 !SequenceableCollection methodsFor:'padded copying'!
 
 leftPaddedTo:size with:padElement
@@ -5609,79 +5847,93 @@
         ^ self.
     ].
 
-    depthLimit := (inEnd-inBegin) integerLog2 * 2.
-
-    stack := OrderedCollection new:(2 * depthLimit).
-    stack add:inBegin; add:inEnd.
-    depthLimit := depthLimit - 1.
-
-    [stack notEmpty] whileTrue:[
-        depthLimit := depthLimit+1.
-        end := stack removeLast.
-        begin := stack removeLast.
-
-        end - begin <= 12 ifTrue:[
-            "for small number of elements do an insertion sort, which is faster"
-            bRun := begin + 1.
-            bRun to:end do:[:idx|
-                temp := self at:idx.
-                prevIdx := idx-1.
-                [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
-                    self at:prevIdx+1 put:(self at:prevIdx).
-                    prevIdx := prevIdx - 1.
+    depthLimit := (1 + inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:depthLimit*2.
+    begin := inBegin.
+    end := inEnd.
+
+    [true] whileTrue:[
+        "do not sort small chunks,
+         instead do an insertion sort over the whole range at the end, which is faster"
+        end - begin > 12 ifTrue:[
+            "ok, her we do the real quickSort..."
+            depthLimit <= 0 ifTrue:[
+                "this is apparently a degenerated quickSort 
+                 - abort the quicksort and fall back to heapSort
+                 which has O(n * log n) complexity in the worst case"
+                self heapSortFrom:begin to:end.
+                begin := end+1.
+            ] ifFalse:[
+                elB := self at:begin.
+                elE := self at:end.
+                m := (begin + end) // 2.
+                elM := self at:m.
+                "take the median of three as pivot (elM)"
+                (elM < elB) ifTrue:[
+                    temp := self at:begin put:elM.
+                    elM := self at:m put:elB.
+                    elB := temp.
                 ].
-                (prevIdx+1) ~~ idx ifTrue:[
-                    self at:prevIdx+1 put:temp.
+                (elE < elB) ifTrue:[
+                    self at:begin put:elE.
+                    elE := self at:end put:elB.
+                ].
+                (elE < elM) ifTrue:[
+                    self at:end put:elM.
+                    elM := self at:m put:elE.
                 ].
+
+                bRun := begin.
+                eRun := end.
+                "use simple expressions without additional statements in whileXXX: conditions,
+                 so STC can optimize"
+                [bRun < eRun] whileTrue:[
+                     [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
+                     [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
+
+                     (bRun < eRun) ifTrue:[
+                         temp := self at:bRun.
+                         self at:bRun put:(self at:eRun). 
+                         self at:eRun put:temp.
+                     ].
+                 ].
+                 (bRun < end) ifTrue:[
+                     "remember right part for later processing"
+                     stack add:end.
+                     stack add:depthLimit-1.
+                 ].
+
+                "now sort the left part from begin .. new end"
+                depthLimit := depthLimit - 1.      
+                end := eRun.                
             ].
         ] ifFalse:[
-           depthLimit <= 0 ifTrue:[
-               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
-               ^ self mergeSort:[:a :b | a < b] from:inBegin to:inEnd.
-           ].
-           elB := self at:begin.
-           elE := self at:end.
-           m := (begin + end) // 2.
-           elM := self at:m.
-           "take the median of three as pivot (elM)"
-           (elM < elB) ifTrue:[
-               temp := self at:begin put:elM.
-               elM := self at:m put:elB.
-               elB := temp.
-           ].
-           (elE < elB) ifTrue:[
-               self at:begin put:elE.
-               elE := self at:end put:elB.
-           ].
-           (elE < elM) ifTrue:[
-               self at:end put:elM.
-               elM := self at:m put:elE.
-           ].
-
-           bRun := begin.
-           eRun := end.
-           "use simple expressions without additional statements in whileXXX: conditions,
-            so STC can optimize"
-           [bRun < eRun] whileTrue:[
-                [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
-                [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
-
-                (bRun < eRun) ifTrue:[
-                    temp := self at:bRun.
-                    self at:bRun put:(self at:eRun). 
-                    self at:eRun put:temp.
+            stack isEmpty ifTrue:[
+                "we are done.
+                 Do a final insertion sort over all the elements,
+                 to eventually sort the small, unsorted chunks"
+                begin := inBegin.
+                bRun := begin + 1.
+                end := inEnd.
+                bRun to:end do:[:idx|
+                    temp := self at:idx.
+                    prevIdx := idx-1.
+                    [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
+                        self at:prevIdx+1 put:(self at:prevIdx).
+                        prevIdx := prevIdx - 1.
+                    ].
+                    (prevIdx+1) ~~ idx ifTrue:[
+                        self at:prevIdx+1 put:temp.
+                    ].
                 ].
-            ].
-            (begin < eRun) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:begin; add:eRun.
+                ^ self
             ].
-            (bRun < end) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:bRun; add:end.
-            ].
+            begin := end + 1.
+            depthLimit := stack removeLast.
+            end := stack removeLast.
         ].
-    ]
+    ].
 !
 
 quickSortFrom:inBegin to:inEnd sortBlock:sortBlock
@@ -5707,77 +5959,91 @@
         ^ self.
     ].
 
-    depthLimit := (inEnd-inBegin) integerLog2 * 2.
-
-    stack := OrderedCollection new:(2 * depthLimit).
-    stack add:inBegin; add:inEnd.
-    depthLimit := depthLimit - 1.
-
-    [stack notEmpty] whileTrue:[
-        depthLimit := depthLimit+1.
-        end := stack removeLast.
-        begin := stack removeLast.
-
-        end - begin < 12 ifTrue:[
-            "for small number of elements do an insertion sort, which is faster"
-            bRun := begin + 1.
-            bRun to:end do:[:idx|
-                temp := self at:idx.
-                prevIdx := idx-1.
-                [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
-                    self at:prevIdx+1 put:(self at:prevIdx).
-                    prevIdx := prevIdx - 1.
+    depthLimit := (1 + inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:depthLimit*2.
+    begin := inBegin.
+    end := inEnd.
+
+    [true] whileTrue:[
+        "do not sort small chunks,
+         instead do an insertion sort over the whole range at the end, which is faster"
+        end - begin > 12 ifTrue:[
+            "ok, her we do the real quickSort..."
+            depthLimit <= 0 ifTrue:[
+                "this is apparently a degenerated quickSort 
+                 - abort the quicksort and fall back to heapSort
+                 which has O(n * log n) complexity in the worst case"
+                self heapSort:sortBlock from:begin to:end.
+                begin := end+1.
+            ] ifFalse:[
+                elB := self at:begin.
+                elE := self at:end.
+                m := (begin + end) // 2.
+                elM := self at:m.
+                "take the median of three as pivot (elM)"
+                (sortBlock value:elM value:elB) ifTrue:[
+                    temp := self at:begin put:elM.
+                    elM := self at:m put:elB.
+                    elB := temp.
                 ].
-                (prevIdx+1) ~~ idx ifTrue:[
-                    self at:prevIdx+1 put:temp.
+                (sortBlock value:elE value:elB) ifTrue:[
+                    self at:begin put:elE.
+                    elE := self at:end put:elB.
+                ].
+                (sortBlock value:elE value:elM) ifTrue:[
+                    self at:end put:elM.
+                    elM := self at:m put:elE.
                 ].
-            ].
+
+                bRun := begin.
+                eRun := end.
+                "use simple expressions without additional statements in whileXXX: conditions,
+                 so STC can optimize"
+                [bRun < eRun] whileTrue:[
+                     [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
+                     [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
+
+                     (bRun < eRun) ifTrue:[
+                         temp := self at:bRun.
+                         self at:bRun put:(self at:eRun). 
+                         self at:eRun put:temp.
+                     ].
+                 ].
+                 (bRun < end) ifTrue:[
+                     "remember right part for later processing"
+                     stack add:end.
+                     stack add:depthLimit-1.
+                 ].
+
+                "now sort the left part from begin .. new end"
+                depthLimit := depthLimit - 1.      
+                end := eRun.                
+            ]
         ] ifFalse:[
-           depthLimit <= 0 ifTrue:[
-               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
-               ^ self mergeSort:sortBlock from:inBegin to:inEnd.
-           ].
-           elB := self at:begin.
-           elE := self at:end.
-           m := (begin + end) // 2.
-           elM := self at:m.
-           "take the median of three as pivot (elM)"
-           (sortBlock value:elM value:elB) ifTrue:[
-               temp := self at:begin put:elM.
-               elM := self at:m put:elB.
-               elB := temp.
-           ].
-           (sortBlock value:elE value:elB) ifTrue:[
-               self at:begin put:elE.
-               elE := self at:end put:elB.
-           ].
-           (sortBlock value:elE value:elM) ifTrue:[
-               self at:end put:elM.
-               elM := self at:m put:elE.
-           ].
-
-           bRun := begin.
-           eRun := end.
-           "use simple expressions without additional statements in whileXXX: conditions,
-            so STC can optimize"
-           [bRun < eRun] whileTrue:[
-                [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
-                [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
-
-                (bRun < eRun) ifTrue:[
-                    temp := self at:bRun.
-                    self at:bRun put:(self at:eRun). 
-                    self at:eRun put:temp.
+            stack isEmpty ifTrue:[
+                "we are done.
+                 Do a final insertion sort over all the elements,
+                 to eventually sort the small, unsorted chunks"
+                begin := inBegin.
+                bRun := begin + 1.
+                end := inEnd.
+                bRun to:end do:[:idx|
+                    temp := self at:idx.
+                    prevIdx := idx-1.
+                    [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
+                        self at:prevIdx+1 put:(self at:prevIdx).
+                        prevIdx := prevIdx - 1.
+                    ].
+                    (prevIdx+1) ~~ idx ifTrue:[
+                        self at:prevIdx+1 put:temp.
+                    ].
                 ].
-            ].
-            (begin < eRun) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:begin; add:eRun.
+                ^ self
             ].
-            (bRun < end) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:bRun; add:end.
-            ].
+            begin := end + 1.
+            depthLimit := stack removeLast.
+            end := stack removeLast.
         ].
     ]
 !
@@ -5795,87 +6061,101 @@
      eRun    "{ Class: SmallInteger }"
      m       "{ Class: SmallInteger }"
      prevIdx "{ Class: SmallInteger }"
-     elB elM elE temp stack depthLimit|
+     elB elM elE temp stack depthLimit policySortBlock|
 
     inEnd <= inBegin ifTrue:[
         "nothing to sort"
         ^ self.
     ].
 
-    depthLimit := (inEnd-inBegin) integerLog2 * 2.
-
-    stack := OrderedCollection new:(2 * depthLimit).
-    stack add:inBegin; add:inEnd.
-    depthLimit := depthLimit - 1.
-
-    [stack notEmpty] whileTrue:[
-        depthLimit := depthLimit+1.
-        end := stack removeLast.
-        begin := stack removeLast.
-
-        end - begin < 12 ifTrue:[
-            "for small number of elements do an insertion sort, which is faster"
-            bRun := begin + 1.
-            bRun to:end do:[:idx|
-                temp := self at:idx.
-                prevIdx := idx-1.
-                [prevIdx >= begin and:[sortBlock value:policy value:temp value:(self at:prevIdx)]] whileTrue:[
-                    self at:prevIdx+1 put:(self at:prevIdx).
-                    prevIdx := prevIdx - 1.
+    depthLimit := (1 + inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:depthLimit*2.
+    begin := inBegin.
+    end := inEnd.
+
+    [true] whileTrue:[
+        "do not sort small chunks,
+         instead do an insertion sort over the whole range at the end, which is faster"
+        end - begin > 12 ifTrue:[
+            "ok, her we do the real quickSort..."
+            depthLimit <= 0 ifTrue:[
+                "this is apparently a degenerated quickSort 
+                 - abort the quicksort and fall back to heapSort
+                 which has O(n * log n) complexity in the worst case"
+                policySortBlock := [:arg1 :arg2| sortBlock value:policy value:arg1 value:arg2].
+                self heapSort:policySortBlock from:begin to:end.
+                begin := end+1.
+            ] ifFalse:[
+               elB := self at:begin.
+               elE := self at:end.
+               m := (begin + end) // 2.
+               elM := self at:m.
+               "take the median of three as pivot (elM)"
+               (sortBlock value:policy value:elM value:elB) ifTrue:[
+                   temp := self at:begin put:elM.
+                   elM := self at:m put:elB.
+                   elB := temp.
+               ].
+               (sortBlock value:policy value:elE value:elB) ifTrue:[
+                   self at:begin put:elE.
+                   elE := self at:end put:elB.
+               ].
+               (sortBlock value:policy value:elE value:elM) ifTrue:[
+                   self at:end put:elM.
+                   elM := self at:m put:elE.
+               ].
+
+               bRun := begin.
+               eRun := end.
+               "use simple expressions without additional statements in whileXXX: conditions,
+                so STC can optimize"
+               [bRun < eRun] whileTrue:[
+                    [(bRun := bRun+1) <= eRun and:[sortBlock value:policy value:(self at:bRun) value:elM]] whileTrue.
+                    [bRun <= (eRun := eRun-1) and:[sortBlock value:policy value:elM value:(self at:eRun)]] whileTrue.
+
+                    (bRun < eRun) ifTrue:[
+                        temp := self at:bRun.
+                        self at:bRun put:(self at:eRun). 
+                        self at:eRun put:temp.
+                    ].
                 ].
-                (prevIdx+1) ~~ idx ifTrue:[
-                    self at:prevIdx+1 put:temp.
-                ].
+                 (bRun < end) ifTrue:[
+                     "remember right part for later processing"
+                     stack add:end.
+                     stack add:depthLimit-1.
+                 ].
+
+                "now sort the left part from begin .. new end"
+                depthLimit := depthLimit - 1.      
+                end := eRun.                
             ].
         ] ifFalse:[
-"/ mergeSort does not handle policy yet
-"/           depthLimit <= 0 ifTrue:[
-"/               "this is apparently a degenerated quickSort - fall back to mergeSort with has O(n * log n)"
-"/               ^ self mergeSort:sortBlock from:inBegin to:inEnd.
-"/           ].
-           elB := self at:begin.
-           elE := self at:end.
-           m := (begin + end) // 2.
-           elM := self at:m.
-           "take the median of three as pivot (elM)"
-           (sortBlock value:policy value:elM value:elB) ifTrue:[
-               temp := self at:begin put:elM.
-               elM := self at:m put:elB.
-               elB := temp.
-           ].
-           (sortBlock value:policy value:elE value:elB) ifTrue:[
-               self at:begin put:elE.
-               elE := self at:end put:elB.
-           ].
-           (sortBlock value:policy value:elE value:elM) ifTrue:[
-               self at:end put:elM.
-               elM := self at:m put:elE.
-           ].
-
-           bRun := begin.
-           eRun := end.
-           "use simple expressions without additional statements in whileXXX: conditions,
-            so STC can optimize"
-           [bRun < eRun] whileTrue:[
-                [(bRun := bRun+1) <= eRun and:[sortBlock value:policy value:(self at:bRun) value:elM]] whileTrue.
-                [bRun <= (eRun := eRun-1) and:[sortBlock value:policy value:elM value:(self at:eRun)]] whileTrue.
-
-                (bRun < eRun) ifTrue:[
-                    temp := self at:bRun.
-                    self at:bRun put:(self at:eRun). 
-                    self at:eRun put:temp.
+            stack isEmpty ifTrue:[
+                "we are done.
+                 Do a final insertion sort over all the elements,
+                 to eventually sort the small, unsorted chunks"
+                begin := inBegin.
+                bRun := begin + 1.
+                end := inEnd.
+                bRun to:end do:[:idx|
+                    temp := self at:idx.
+                    prevIdx := idx-1.
+                    [prevIdx >= begin and:[sortBlock value:policy value:temp value:(self at:prevIdx)]] whileTrue:[
+                        self at:prevIdx+1 put:(self at:prevIdx).
+                        prevIdx := prevIdx - 1.
+                    ].
+                    (prevIdx+1) ~~ idx ifTrue:[
+                        self at:prevIdx+1 put:temp.
+                    ].
                 ].
-            ].
-            (begin < eRun) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:begin; add:eRun.
+                ^ self
             ].
-            (bRun < end) ifTrue:[
-                depthLimit := depthLimit-1.
-                stack add:bRun; add:end.
-            ].
+            begin := end + 1.
+            depthLimit := stack removeLast.
+            end := stack removeLast.
         ].
-    ]
+    ].
 !
 
 quickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
@@ -5898,88 +6178,111 @@
         ^ self.
     ].
 
-    depthLimit := (inEnd-inBegin) integerLog2 * 2.
-
-    stack := OrderedCollection new:(2 * depthLimit).
-    stack add:inBegin; add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-        end := stack removeLast.
-        begin := stack removeLast.
-
-        end - begin < 12 ifTrue:[
-            "for small number of elements do an insertion sort, which is faster"
-            bRun := begin + 1.
-            bRun to:end do:[:idx|
-                temp := self at:idx.
-                temp1 := aCollection at:idx.
-                prevIdx := idx-1.
-                [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
-                    self at:prevIdx+1 put:(self at:prevIdx).
-                    aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
-                    prevIdx := prevIdx - 1.
+    depthLimit := (1 + inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:depthLimit*2.
+    begin := inBegin.
+    end := inEnd.
+
+    [true] whileTrue:[
+        "do not sort small chunks,
+         instead do an insertion sort over the whole range at the end, which is faster"
+        end - begin > 12 ifTrue:[
+            "ok, her we do the real quickSort..."
+            "/ heapSort does not support ...with: yet
+            "depthLimit <= 0" false ifTrue:[
+                "this is apparently a degenerated quickSort 
+                 - abort the quicksort and fall back to heapSort
+                 which has O(n * log n) complexity in the worst case"
+                self heapSort:sortBlock from:begin to:end.
+                begin := end+1.
+            ] ifFalse:[
+                elB := self at:begin.
+                elE := self at:end.
+                m := (begin + end) // 2.
+                elM := self at:m.
+                "take the median of three as pivot (elM)"
+                (sortBlock value:elM value:elB) ifTrue:[
+                    temp := self at:begin put:elM.
+                    elM := self at:m put:elB.
+                    elB := temp.
+
+                    temp := aCollection at:begin.  
+                    aCollection at:begin put:(aCollection at:m).  
+                    aCollection at:m put:temp.  
                 ].
-                (prevIdx+1) ~~ idx ifTrue:[
-                    self at:prevIdx+1 put:temp.
-                    aCollection at:prevIdx+1 put:temp1.
+                (sortBlock value:elE value:elB) ifTrue:[
+                    self at:begin put:elE.
+                    elE := self at:end put:elB.
+
+                    temp := aCollection at:end.  
+                    aCollection at:end put:(aCollection at:begin).  
+                    aCollection at:begin put:temp. 
+                ].
+                (sortBlock value:elE value:elM) ifTrue:[
+                    self at:end put:elM.
+                    elM := self at:m put:elE.
+
+                    temp := aCollection at:end.  
+                    aCollection at:end put:(aCollection at:m).  
+                    aCollection at:m put:temp.  
                 ].
-            ].
+
+                bRun := begin.
+                eRun := end.
+                "use simple expressions without additional statements in whileXXX: conditions,
+                 so STC can optimize"
+                [bRun < eRun] whileTrue:[
+                     [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
+                     [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
+
+                     (bRun < eRun) ifTrue:[
+                         temp := self at:bRun.
+                         self at:bRun put:(self at:eRun). 
+                         self at:eRun put:temp.
+
+                         temp := aCollection at:bRun.
+                         aCollection at:bRun put:(aCollection at:eRun).
+                         aCollection at:eRun put:temp.
+                     ].
+                 ].
+                 (bRun < end) ifTrue:[
+                     "remember right part for later processing"
+                     stack add:end.
+                     stack add:depthLimit-1.
+                 ].
+
+                "now sort the left part from begin .. new end"
+                depthLimit := depthLimit - 1.      
+                end := eRun.                
+            ]
         ] ifFalse:[
-           elB := self at:begin.
-           elE := self at:end.
-           m := (begin + end) // 2.
-           elM := self at:m.
-           "take the median of three as pivot (elM)"
-           (sortBlock value:elM value:elB) ifTrue:[
-               temp := self at:begin put:elM.
-               elM := self at:m put:elB.
-               elB := temp.
-
-               temp := aCollection at:begin.  
-               aCollection at:begin put:(aCollection at:m).  
-               aCollection at:m put:temp.  
-           ].
-           (sortBlock value:elE value:elB) ifTrue:[
-               self at:begin put:elE.
-               elE := self at:end put:elB.
-
-               temp := aCollection at:end.  
-               aCollection at:end put:(aCollection at:begin).  
-               aCollection at:begin put:temp. 
-           ].
-           (sortBlock value:elE value:elM) ifTrue:[
-               self at:end put:elM.
-               elM := self at:m put:elE.
-
-               temp := aCollection at:end.  
-               aCollection at:end put:(aCollection at:m).  
-               aCollection at:m put:temp.  
-           ].
-
-           bRun := begin.
-           eRun := end.
-           "use simple expressions without additional statements in whileXXX: conditions,
-            so STC can optimize"
-           [bRun < eRun] whileTrue:[
-                [(bRun := bRun+1) <= eRun and:[sortBlock value:(self at:bRun) value:elM]] whileTrue.
-                [bRun <= (eRun := eRun-1) and:[sortBlock value:elM value:(self at:eRun)]] whileTrue.
-
-                (bRun < eRun) ifTrue:[
-                    temp := self at:bRun.
-                    self at:bRun put:(self at:eRun). 
-                    self at:eRun put:temp.
-
-                    temp := aCollection at:bRun.
-                    aCollection at:bRun put:(aCollection at:eRun).
-                    aCollection at:eRun put:temp.
+            stack isEmpty ifTrue:[
+                "we are done.
+                 Do a final insertion sort over all the elements,
+                 to eventually sort the small, unsorted chunks"
+                begin := inBegin.
+                bRun := begin + 1.
+                end := inEnd.
+                bRun to:end do:[:idx|
+                    temp := self at:idx.
+                    temp1 := aCollection at:idx.
+                    prevIdx := idx-1.
+                    [prevIdx >= begin and:[sortBlock value:temp value:(self at:prevIdx)]] whileTrue:[
+                        self at:prevIdx+1 put:(self at:prevIdx).
+                        aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
+                        prevIdx := prevIdx - 1.
+                    ].
+                    (prevIdx+1) ~~ idx ifTrue:[
+                        self at:prevIdx+1 put:temp.
+                        aCollection at:prevIdx+1 put:temp1.
+                    ].
                 ].
-            ].
-            (begin < eRun) ifTrue:[
-                stack add:begin; add:eRun.
+                ^ self
             ].
-            (bRun < end) ifTrue:[
-                stack add:bRun; add:end.
-            ].
+            begin := end + 1.
+            depthLimit := stack removeLast.
+            end := stack removeLast.
         ].
     ]
 !
@@ -6005,234 +6308,113 @@
         ^ self.
     ].
 
-    depthLimit := (inEnd-inBegin) integerLog2 * 2.
-
-    stack := OrderedCollection new:(2 * depthLimit).
-    stack add:inBegin; add:inEnd.
-
-    [stack notEmpty] whileTrue:[
-        end := stack removeLast.
-        begin := stack removeLast.
-
-        end - begin < 12 ifTrue:[
-            "for small number of elements do an insertion sort, which is faster"
-            bRun := begin + 1.
-            bRun to:end do:[:idx|
-                temp := self at:idx.
-                temp1 := aCollection at:idx.
-                prevIdx := idx-1.
-                [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
-                    self at:prevIdx+1 put:(self at:prevIdx).
-                    aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
-                    prevIdx := prevIdx - 1.
+    depthLimit := (1 + inEnd-inBegin) integerLog2 * 2.
+
+    stack := OrderedCollection new:depthLimit*2.
+    begin := inBegin.
+    end := inEnd.
+
+    [true] whileTrue:[
+        "do not sort small chunks,
+         instead do an insertion sort over the whole range at the end, which is faster"
+        end - begin > 12 ifTrue:[
+            "ok, her we do the real quickSort..."
+            "/ heapSort does not support ...with: yet
+            "depthLimit <= 0" false ifTrue:[
+                "this is apparently a degenerated quickSort 
+                 - abort the quicksort and fall back to heapSort
+                 which has O(n * log n) complexity in the worst case"
+                self heapSortFrom:begin to:end.
+                begin := end+1.
+            ] ifFalse:[
+                elB := self at:begin.
+                elE := self at:end.
+                m := (begin + end) // 2.
+                elM := self at:m.
+                "take the median of three as pivot (elM)"
+                (elM < elB) ifTrue:[
+                    temp := self at:begin put:elM.
+                    elM := self at:m put:elB.
+                    elB := temp.
+
+                    temp := aCollection at:begin.  
+                    aCollection at:begin put:(aCollection at:m).  
+                    aCollection at:m put:temp.  
                 ].
-                (prevIdx+1) ~~ idx ifTrue:[
-                    self at:prevIdx+1 put:temp.
-                    aCollection at:prevIdx+1 put:temp1.
+                (elE < elB) ifTrue:[
+                    self at:begin put:elE.
+                    elE := self at:end put:elB.
+
+                    temp := aCollection at:end.  
+                    aCollection at:end put:(aCollection at:begin).  
+                    aCollection at:begin put:temp. 
+                ].
+                (elE < elM) ifTrue:[
+                    self at:end put:elM.
+                    elM := self at:m put:elE.
+
+                    temp := aCollection at:end.  
+                    aCollection at:end put:(aCollection at:m).  
+                    aCollection at:m put:temp.  
                 ].
-            ].
+
+                bRun := begin.
+                eRun := end.
+                "use simple expressions without additional statements in whileXXX: conditions,
+                 so STC can optimize"
+                [bRun < eRun] whileTrue:[
+                     [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
+                     [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
+
+                     (bRun < eRun) ifTrue:[
+                         temp := self at:bRun.
+                         self at:bRun put:(self at:eRun). 
+                         self at:eRun put:temp.
+
+                         temp := aCollection at:bRun.
+                         aCollection at:bRun put:(aCollection at:eRun).
+                         aCollection at:eRun put:temp.
+                     ].
+                 ].
+                 (bRun < end) ifTrue:[
+                     "remember right part for later processing"
+                     stack add:end.
+                     stack add:depthLimit-1.
+                 ].
+
+                "now sort the left part from begin .. new end"
+                depthLimit := depthLimit - 1.      
+                end := eRun.                
+            ]
         ] ifFalse:[
-           elB := self at:begin.
-           elE := self at:end.
-           m := (begin + end) // 2.
-           elM := self at:m.
-           "take the median of three as pivot (elM)"
-           (elM < elB) ifTrue:[
-               temp := self at:begin put:elM.
-               elM := self at:m put:elB.
-               elB := temp.
-
-               temp := aCollection at:begin.  
-               aCollection at:begin put:(aCollection at:m).  
-               aCollection at:m put:temp.  
-           ].
-           (elE < elB) ifTrue:[
-               self at:begin put:elE.
-               elE := self at:end put:elB.
-
-               temp := aCollection at:end.  
-               aCollection at:end put:(aCollection at:begin).  
-               aCollection at:begin put:temp. 
-           ].
-           (elE < elM) ifTrue:[
-               self at:end put:elM.
-               elM := self at:m put:elE.
-
-               temp := aCollection at:end.  
-               aCollection at:end put:(aCollection at:m).  
-               aCollection at:m put:temp.  
-           ].
-
-           bRun := begin.
-           eRun := end.
-           "use simple expressions without additional statements in whileXXX: conditions,
-            so STC can optimize"
-           [bRun < eRun] whileTrue:[
-                [(bRun := bRun+1) <= eRun and:[(self at:bRun) < elM]] whileTrue.
-                [bRun <= (eRun := eRun-1) and:[elM < (self at:eRun)]] whileTrue.
-
-                (bRun < eRun) ifTrue:[
-                    temp := self at:bRun.
-                    self at:bRun put:(self at:eRun). 
-                    self at:eRun put:temp.
-
-                    temp := aCollection at:bRun.
-                    aCollection at:bRun put:(aCollection at:eRun).
-                    aCollection at:eRun put:temp.
+            stack isEmpty ifTrue:[
+                "we are done.
+                 Do a final insertion sort over all the elements,
+                 to eventually sort the small, unsorted chunks"
+                begin := inBegin.
+                bRun := begin + 1.
+                end := inEnd.
+                bRun to:end do:[:idx|
+                    temp := self at:idx.
+                    temp1 := aCollection at:idx.
+                    prevIdx := idx-1.
+                    [prevIdx >= begin and:[temp < (self at:prevIdx)]] whileTrue:[
+                        self at:prevIdx+1 put:(self at:prevIdx).
+                        aCollection at:prevIdx+1 put:(aCollection at:prevIdx).
+                        prevIdx := prevIdx - 1.
+                    ].
+                    (prevIdx+1) ~~ idx ifTrue:[
+                        self at:prevIdx+1 put:temp.
+                        aCollection at:prevIdx+1 put:temp1.
+                    ].
                 ].
-            ].
-            (begin < eRun) ifTrue:[
-                stack add:begin; add:eRun.
+                ^ self
             ].
-            (bRun < end) ifTrue:[
-                stack add:bRun; add:end.
-            ].
+            begin := end + 1.
+            depthLimit := stack removeLast.
+            end := stack removeLast.
         ].
     ]
-!
-
-randomizedQuickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
-    "actual randomizedQuicksort worker for sort:with:-message.
-     This exchanges a random element within the partition, to avoid
-     the worst case O-square situation of quickSort.
-
-     Notice, that this method has a much worse best- and average case
-     runTime, due to the random number generation.
-     The worst case of quickSort is encountered, if the choosen pivot
-     element lies at either end of the partition, so that a split
-     creates partitions of size 1 and (n-1).
-     Since the middle element is choosen, this worst case is very unlikely
-     to be encountered."
-
-    <resource:#obsolete>
-
-    self obsoleteMethodWarning:'use quickSortFrom:to:sortBlock:with:'.
-
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self quickSortFrom:inBegin to:inEnd sortBlock:sortBlock with:aCollection
-
-
-"/    |begin   "{ Class: SmallInteger }"
-"/     end     "{ Class: SmallInteger }"
-"/     b       "{ Class: SmallInteger }"
-"/     e       "{ Class: SmallInteger }"
-"/     rnd     "{ Class: SmallInteger }"
-"/     middleElement temp1 temp2 |
-"/
-"/    begin := inBegin.   "/ this also does a type-check
-"/    end := inEnd.
-"/
-"/    b := begin.
-"/    e := end.
-"/
-"/    "/ randomize that partition
-"/    "/ by exchanging the first element with any random
-"/    "/ element.
-"/    rnd := Random nextIntegerBetween:b and:e.
-"/    temp1 := self at:b. temp2 := self at:rnd.
-"/    self at:b put:temp2. self at:rnd put:temp1.
-"/    aCollection notNil ifTrue:[
-"/        temp1 := aCollection at:b. temp2 := aCollection at:rnd.
-"/        aCollection at:b put:temp2. aCollection at:rnd put:temp1
-"/    ].
-"/
-"/    "/
-"/    "/ now proceed as usual
-"/    "/
-"/    middleElement := self at:((b + e) // 2).
-"/
-"/    [b < e] whileTrue:[
-"/        [b < end and:[sortBlock value:(self at:b) value:middleElement]] whileTrue:[b := b + 1].
-"/        [e > begin and:[sortBlock value:middleElement value:(self at:e)]] whileTrue:[e := e - 1].
-"/
-"/        (b <= e) ifTrue:[
-"/            (b == e) ifFalse:[
-"/                temp1 := self at:b. temp2 := self at:e.
-"/                self at:b put:temp2. self at:e put:temp1.
-"/                aCollection notNil ifTrue:[
-"/                    temp1 := aCollection at:b. temp2 := aCollection at:e.
-"/                    aCollection at:b put:temp2. aCollection at:e put:temp1
-"/                ].
-"/            ].
-"/            b := b + 1.
-"/            e := e - 1
-"/        ]
-"/    ].
-"/    (begin < e) ifTrue:[self randomizedQuickSortFrom:begin to:e sortBlock:sortBlock with:aCollection].
-"/    (b < end) ifTrue:[self randomizedQuickSortFrom:b to:end sortBlock:sortBlock with:aCollection]
-!
-
-randomizedQuickSortFrom:inBegin to:inEnd with:aCollection
-    "actual randomizedQuicksort worker for randomizedSort:-message.
-     This exchanges a random element within the partition, to avoid
-     the worst case O-square situation of quickSort.
-
-     Notice, that this method has a much worse best- and average case
-     runTime, due to the random number generation.
-     The worst case of quickSort is encountered, if the choosen pivot
-     element lies at either end of the partition, so that a split
-     creates partitions of size 1 and (n-1).
-     Since the middle element is choosen, this worst case is very unlikely
-     to be encountered."
-
-    <resource:#obsolete>
-
-    self obsoleteMethodWarning:'use quickSortFrom:to:with:'.
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self quickSortFrom:inBegin to:inEnd with:aCollection
-
-
-"/    |begin   "{ Class: SmallInteger }"
-"/     end     "{ Class: SmallInteger }"
-"/     b       "{ Class: SmallInteger }"
-"/     e       "{ Class: SmallInteger }"
-"/     rnd     "{ Class: SmallInteger }"
-"/     middleElement temp1 temp2 |
-"/
-"/    begin := inBegin.   "/ this also does a type-check
-"/    end := inEnd.
-"/
-"/    b := begin.
-"/    e := end.
-"/
-"/    "/ randomize that partition
-"/    "/ by exchanging the first element with any random
-"/    "/ element.
-"/    rnd := Random nextIntegerBetween:b and:e.
-"/    temp1 := self at:b. temp2 := self at:rnd.
-"/    self at:b put:temp2. self at:rnd put:temp1.
-"/    aCollection notNil ifTrue:[
-"/        temp1 := aCollection at:b. temp2 := aCollection at:rnd.
-"/        aCollection at:b put:temp2. aCollection at:rnd put:temp1
-"/    ].
-"/
-"/    "/
-"/    "/ now proceed as usual
-"/    "/
-"/    middleElement := self at:((b + e) // 2).
-"/
-"/    [b < e] whileTrue:[
-"/        [b < end and:[(self at:b) < middleElement]] whileTrue:[b := b + 1].
-"/        [e > begin and:[middleElement < (self at:e)]] whileTrue:[e := e - 1].
-"/
-"/        (b <= e) ifTrue:[
-"/            (b == e) ifFalse:[
-"/                temp1 := self at:b. temp2 := self at:e.
-"/                self at:b put:temp2. self at:e put:temp1.
-"/                aCollection notNil ifTrue:[
-"/                    temp1 := aCollection at:b. temp2 := aCollection at:e.
-"/                    aCollection at:b put:temp2. aCollection at:e put:temp1
-"/                ].
-"/            ].
-"/            b := b + 1.
-"/            e := e - 1
-"/        ]
-"/    ].
-"/    (begin < e) ifTrue:[self randomizedQuickSortFrom:begin to:e with:aCollection].
-"/    (b < end) ifTrue:[self randomizedQuickSortFrom:b to:end with:aCollection]
-"/
-"/    "Modified: 21.8.1997 / 18:30:19 / cg"
-"/    "Created: 21.8.1997 / 18:34:23 / cg"
 ! !
 
 !SequenceableCollection methodsFor:'queries'!
@@ -6337,6 +6519,7 @@
     "Created: 14.2.1997 / 16:13:03 / cg"
 ! !
 
+
 !SequenceableCollection methodsFor:'searching'!
 
 detect:aBlock startingAt:startIndex
@@ -7608,6 +7791,513 @@
     "
 !
 
+randomShuffle
+    "random shuffle my elements in place.
+     This is a destructive algorithm.
+     Moses, Oakford, Durstenfeld, Knuth algorithm.
+     See 'The Art of Computer Programming'."
+
+    self size to:2 by:-1 do:[:endIndex |
+        |rndIndex t|
+
+        rndIndex := Random nextIntegerBetween:1 and:endIndex.
+        "/ exchange
+        t := self at:rndIndex.
+        self at:rndIndex put:(self at:endIndex).
+        self at:endIndex put:t.
+    ].
+
+    "
+     (1 to:10) asOrderedCollection randomShuffle
+
+     |c| c := (1 to:100) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+     |c| c := (1 to:1000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+     |c| c := (1 to:10000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+     |c| c := (1 to:100000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+     |c| c := (1 to:1000000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+     |c| c := (1 to:10000000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
+    "
+
+    "how random are we ? (should all be around 1000000/24.0 i.e. 41666.6):
+
+     |a score|
+
+     a := 'abcd'.
+     score := DictionaryWithDefault newWithDefaultValue:0.
+
+     1000000 times do:[
+         |sorted|
+         sorted := a copy randomShuffle.
+         score at:sorted put:(score at:sorted)+1.
+     ].
+
+     score keys asSortedCollection do:[:k |
+         Transcript showCR:('%1: %2' bindWith:k with:(score at:k)).
+     ].
+    "
+
+    "Modified: / 22-10-2008 / 15:37:48 / cg"
+!
+
+reverse
+    "destructively reverse the order of the elements inplace.
+     WARNING: this is a destructive operation, which modifies the receiver.
+              Please use reversed (with a d) for a functional version."
+
+    |lowIndex "{ Class: SmallInteger }"
+     hiIndex  "{ Class: SmallInteger }"
+     t1 t2|
+
+    hiIndex := self size.
+    lowIndex := 1.
+    [lowIndex < hiIndex] whileTrue:[
+        t1 := self at:lowIndex.  t2 := self at:hiIndex.
+        self at:lowIndex put:t2.  self at:hiIndex put:t1.
+
+        lowIndex := lowIndex + 1.
+        hiIndex := hiIndex - 1
+    ]
+
+    "
+     #(4 5 6 7 7) reverse
+     #(1 4 7 10 2 5) asOrderedCollection reverse
+    "
+!
+
+reversed
+    "return a copy with elements in reverse order"
+
+    ^ self copy reverse
+
+    "
+     #(4 5 6 7 7) reversed
+     #(1 4 7 10 2 5) asOrderedCollection reversed
+    "
+!
+
+sort
+    "sort the collection inplace. The elements are compared using
+     '<' i.e. they should offer a magnitude-like protocol.
+
+     The implementation uses the quicksort algorithm, which may not be
+     the best possible for all situations (quickSort has O-square worst
+     case behavior)."
+
+    self quickSort
+
+    "
+     #(1 16 7 98 3 19 4 0) sort
+
+     |data|
+     data := Random new next:100000.
+     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data sort]).
+     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data sort]).
+     data reverse.
+     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data sort]).
+    "
+
+    "Modified: 21.8.1997 / 18:31:52 / cg"
+!
+
+sort:sortBlock
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. This allows any sort criteria to be implemented.
+
+     The implementation uses the quicksort algorithm, which may not be
+     the best possible for all situations (quickSort has O-square worst
+     case behavior)."
+
+    self quickSort:sortBlock
+
+    "
+     #(1 16 7 98 3 19 4 0) sort:[:a :b | a < b]
+     #(1 16 7 98 3 19 4 0) sort:[:a :b | a > b]
+     #(1 -1 16 -16 7 -7 98 -98) sort:[:a :b | a < b]
+     #(1 -1 16 -16 7 -7 98 -98) sort:[:a :b | a abs < b abs]
+    "
+
+    "Modified: / 27.10.1997 / 20:03:22 / cg"
+!
+
+sort:sortBlock with:aCollection
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. Also reorder the elements in aCollection.
+     Use this, when you have a key collection to sort some other collection with.
+
+     The implementation uses the quicksort algorithm, which may not be
+     the best possible for all situations (quickSort has O-square worst
+     case behavior)."
+
+    self quickSort:sortBlock with:aCollection
+
+    "
+     |c1 c2|
+     c1 := #(1 16 7 9).
+     c2 := #('one' 'sixteen' 'seven' 'nine').
+     c1 sort:[:a :b | a > b] with:c2.
+     c1 printNL.
+     c2 printNL
+    "
+
+    "Modified: 21.8.1997 / 18:32:11 / cg"
+!
+
+sortByApplying:aBlock
+    "Sort my contents inplace based on the value of what aBlock returns for each element.
+     Similar to, but even more flexible than sortBySelector."
+
+    ^ self sort:[:a :b | (aBlock value:a) < (aBlock value:b)]
+
+    "
+     replace all uses of sort as in:
+        ... sort:[:a :b | a foo < b foo]
+     by:
+        ... sortByApplying:[:each | each foo]
+    "
+!
+
+sortBySelector:aSelector
+    "Sort my contents inplace based on the value of what aSelector returns when sent to my
+     elements. Sorting by a selector is so common, that its worth a separate utility"
+
+    ^ self sort:[:a :b | (a perform:aSelector) < (b perform:aSelector)]
+
+    "
+     replace all uses of sort as in:
+        ... sort:[:a :b | a foo < b foo]
+     by:
+        ... sortBySelector:#foo
+
+     find these by searching for code matching (code-search in the browsers method list):
+        `@e sort:[:a :b | a `@msg < b `@msg ]
+    "
+!
+
+sortWith:aCollection
+    "sort the receiver collection inplace, using '<' to compare elements.
+     Also, the elements of aCollection are reordered with it.
+     Use this, when you have a key collection to sort another collection with.
+
+     The implementation uses the quicksort algorithm, which may not be
+     the best possible for all situations (quickSort has O-square worst
+     case behavior)."
+
+    self quickSortWith:aCollection
+
+    "
+     |indices names|
+
+     names := #('nine' 'five' 'eight' 'one' 'four' 'two') copy.
+     indices := #(9 5 8 1 4 2) copy.
+     indices sortWith:names.
+     names.
+     indices     
+    "
+
+    "Modified (comment): / 18-01-2012 / 11:30:01 / cg"
+!
+
+sortedBy:aBlock
+    "Create a copy that is sorted.  Sort criteria is the block that accepts two arguments.
+     When the block is true, the first arg goes first ([:a :b | a > b] sorts in descending order)."
+
+    ^ (self asSortedCollection: aBlock) asOrderedCollection
+
+    "Modified: / 22-10-2008 / 21:25:07 / cg"
+!
+
+stableSort
+    "sort the collection inplace. The elements are compared using
+     '<=' i.e. they should offer a magnitude-like protocol.
+
+     Use a stable sort algorithm - i.e. elements having an equal key will keep
+     their previous order."
+
+    self mergeSort
+
+    "
+     #(1 16 7 98 3 19 4 0) stableSort
+
+     |data|
+     data := Random new next:100000.
+     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data stableSort]).
+     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data stableSort]).
+     data reverse.
+     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data stableSort]).
+    "
+!
+
+stableSort:sortBlock
+    "sort the collection inplace using the 2-arg block sortBlock
+     for comparison. This allows any sort criteria to be implemented.
+
+     Use a stable sort algorithm - i.e. elements having an equal key will keep
+     their previous order.
+
+     NOTE: the sort algorithm will be stable, if the sortblock uses #< or #> for comparison!!
+           Do not use #<= of #>= if you want stable behavior."
+
+    self mergeSort:sortBlock
+
+    "
+     The 4@bla points keep their order:
+         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
+          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} stableSort:[:a :b | a x < b x]
+        
+     But not with quickSort:
+         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
+          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} sort:[:a :b | a x < b x]
+    "
+!
+
+topologicalSort:sortBlock
+    "sort the collection inplace using a sloooow sort algorithm.
+     This algorithm has O-square runtime behavior and should be used only
+     in special situations.
+     It compares all elements, thus can be used when a>b, b>c does NOT imply
+     a>c (for example, to sort classes by inheritance)
+
+     In all other situations, use #sort; which implements the quicksort algorithm.
+
+     If there are cycles, this algorithm may loop endless!!   
+     Note: consider using Collection>>#topologicalSort, which is faster and does not do endless loop.
+    "
+
+    |smallestIndex "{ Class: SmallInteger }"
+     end           "{ Class: SmallInteger }"
+     index2        "{ Class: SmallInteger }"
+     smallest thisOne|
+
+    "this is just a q&d hack - there must be better implementations for this ;-)"
+
+    end := self size.
+    1 to:end-1 do:[:index |
+        smallest := self at:index.
+        smallestIndex := index.
+
+        index2 := index + 1.
+        [
+            thisOne := self at:index2.
+            (index2 ~~ smallestIndex
+            and:[sortBlock value:thisOne value:smallest]) ifTrue:[
+                smallestIndex := index2.
+                smallest := thisOne.
+                index2 := index + 1.
+            ] ifFalse:[
+                index2 := index2 + 1.
+            ].
+        ] doWhile:[index2 <= end].
+
+"/        (index + 1) to:end do:[:index2 |
+"/            thisOne := self at:index2.
+"/            (sortBlock value:thisOne value:smallest) ifTrue:[
+"/                smallestIndex := index2.
+"/                smallest := thisOne
+"/            ].
+"/        ].
+
+        (smallestIndex ~~ index) ifTrue:[
+            thisOne := self at:index.
+            self at:index put:smallest.
+            self at:smallestIndex put:thisOne
+        ].
+    ]
+
+    "
+     #(1 16 7 98 3 19 4 0) topologicalSort:[:a :b | a < b]
+     #(1 16 7 98 3 19 4 0) sort:[:a :b | a < b]
+     Smalltalk allClasses asArray topologicalSort:[:a :b | a == b superclass]
+     Smalltalk allClasses asArray topologicalSort:[:a :b | b isSubclassOf:a]
+     Smalltalk allClasses asArray sort:[:a :b | b isSubclassOf:a]
+    "
+
+    "Modified: 21.8.1997 / 18:30:49 / cg"
+! !
+
+!SequenceableCollection methodsFor:'sorting algorithms'!
+
+heapSort
+    "sort the collection inplace. The elements are compared using
+     '<' i.e. they should offer a magnitude-like protocol.
+
+     Heap sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
+     The implementation uses the heapsort algorithm, which has a complexity
+     of O(n*log(n)) for both average and worst case."
+
+    self heapSortFrom:1 to:self size
+
+    "
+     'franz jagt im komplett verwahrlosten taxi quer durch deutschland' copy heapSort
+     #( 1 2 3 4 5 6 7 8 9) heapSort
+     #( 1 2 3 4 5 6 7 8 9) reversed heapSort
+
+     |data|
+     data := Random new next:500000.
+     Transcript show:'heap random  '; showCR:(Time millisecondsToRun:[data heapSort]).
+     data inject:0 into:[:lastElement :each | lastElement > each ifTrue:[self halt]. each].
+     Transcript show:'heap sorted  '; showCR:(Time millisecondsToRun:[data heapSort]).
+     data inject:0 into:[:lastElement :each | lastElement > each ifTrue:[self halt]. each].
+     data reverse.
+     Transcript show:'heap reverse '; showCR:(Time millisecondsToRun:[data heapSort]).
+     data inject:0 into:[:lastElement :each | lastElement > each ifTrue:[self halt]. each].
+    "
+!
+
+heapSort:sortBlock
+    "sort the collection inplace. The elements are compared using
+     sortBlock.
+
+     Heap sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
+     The implementation uses the heapsort algorithm, which has a complexity
+     of O(n*log(n)) for both average and worst case."
+
+    self heapSort:sortBlock from:1 to:self size
+!
+
+heapSort:sortBlock from:begin to:end
+    "sort the collection inplace. The elements are compared using
+     the sortBlock.
+
+     Heap sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
+     The implementation uses the heapsort algorithm, which has a complexity
+     of O(n*log(n)) for average and worst case."
+
+    |cRun  "{Class: SmallInteger}"
+     parent     "{Class: SmallInteger}"
+     child      "{Class: SmallInteger}"
+     eRun       "{Class: SmallInteger}"
+     childE childERight temp done size|
+
+    eRun := end.
+    size := eRun+1-begin.
+    size <= 1 ifTrue:[
+        ^ self.
+    ].
+
+    cRun := size // 2 + 1.                      "position of the last parent node"
+
+    [true] whileTrue:[
+        cRun > begin ifTrue:[               "Phase 1: do the heap creation"
+            cRun := cRun - 1.
+            temp := self at:cRun.           "parent value is in temp"
+        ] ifFalse:[                             "Phase 2: heap selection"
+            temp := self at:eRun.               "save the last value on the heap"
+            self at:eRun put:(self at:begin).   "put the largest value so far to the end of the heap"
+            eRun := eRun - 1.                   "make new heap smaller"
+            eRun == begin ifTrue:[
+                "the heap is empty - we are done"
+                self at:begin put:temp.
+                ^ self.
+            ].
+        ].
+
+        parent := cRun.
+        child := parent * 2.                    "parents left child"
+
+        "Sift operation - push temp down the heap"
+        done := false.
+        [done not and:[child <= eRun]] whileTrue:[
+            childE := self at:child.
+            "choose the largest child"
+            (child < eRun and:[sortBlock value:childE value:(childERight := self at:child+1)]) ifTrue:[
+                child := child + 1.             "the right child is larger"
+                childE := childERight.
+            ].
+            (sortBlock value:temp value:childE) ifTrue:[
+                self at:parent put:childE.      "move the largest child up"
+                parent := child.                "make child the new parent"
+                child := parent * 2.            "get next child"
+            ] ifFalse:[
+                done := true.                   "now we know where to put temp"
+            ].
+        ].
+        self at:parent put:temp.                "save temp in heap"    
+    ].
+!
+
+heapSortFrom:begin to:end
+    "sort the collection inplace. The elements are compared using
+     '<' i.e. they should offer a magnitude-like protocol.
+
+     Heap sort is an unstable sorting algorithm, i.e. elements with the same sort key
+     don't keep their order.
+
+     The implementation uses the heapsort algorithm, which has a complexity
+     of O(n*log(n)) for average and worst case."
+
+    |cRun  "{Class: SmallInteger}"
+     parent     "{Class: SmallInteger}"
+     child      "{Class: SmallInteger}"
+     eRun       "{Class: SmallInteger}"
+     childE childERight temp done size|
+
+    eRun := end.
+    size := eRun+1-begin.
+    size <= 1 ifTrue:[
+        ^ self.
+    ].
+
+    cRun := size // 2 + 1.                      "position of the last parent node"
+
+    [true] whileTrue:[
+        cRun > begin ifTrue:[               "Phase 1: do the heap creation"
+            cRun := cRun - 1.
+            temp := self at:cRun.           "parent value is in temp"
+        ] ifFalse:[                             "Phase 2: heap selection"
+            temp := self at:eRun.               "save the last value on the heap"
+            self at:eRun put:(self at:begin).   "put the largest value so far to the end of the heap"
+            eRun := eRun - 1.                   "make new heap smaller"
+            eRun == begin ifTrue:[
+                "the heap is empty - we are done"
+                self at:begin put:temp.
+                ^ self.
+            ].
+        ].
+
+        parent := cRun.
+        child := parent * 2.                    "parents left child"
+
+        "Sift operation - push temp down the heap"
+        done := false.
+        [done not and:[child <= eRun]] whileTrue:[
+            childE := self at:child.
+            "choose the largest child"
+            (child < eRun and:[childE < (childERight := self at:child+1)]) ifTrue:[
+                child := child + 1.             "the right child is larger"
+                childE := childERight.
+            ].
+            temp < childE ifTrue:[
+                self at:parent put:childE.      "move the largest child up"
+                parent := child.                "make child the new parent"
+                child := parent * 2.            "get next child"
+            ] ifFalse:[
+                done := true.                   "now we know where to put temp"
+            ].
+        ].
+        self at:parent put:temp.                "save temp in heap"    
+    ].
+
+
+    "
+     'franz jagt im komplett verwahrlosten taxi quer durch deutschland' copy heapSort
+     #( 1 2 3 4 5 6 7 8 9) copy heapSort
+     #( 1 2 3 4 5 6 7 8 9) reversed heapSort
+
+     |data|
+     data := Random new next:500000.
+     Transcript show:'heap random  '; showCR:(Time millisecondsToRun:[data heapSortFrom:1 to:data size]).
+     Transcript show:'heap sorted  '; showCR:(Time millisecondsToRun:[data heapSortFrom:1 to:data size]).
+     data reverse.
+     Transcript show:'heap reverse '; showCR:(Time millisecondsToRun:[data heapSortFrom:1 to:data size]).
+    "
+!
+
 insertionSort
     "sort the collection using a insertionSort algorithm.
      The elements are compared using'#<'
@@ -7900,8 +8590,7 @@
      c1 := #(1 16 7 9).
      c2 := #('one' 'sixteen' 'seven' 'nine').
      c1 sort:[:a :b | a > b] with:c2.
-     c1 printNL.
-     c2 printNL
+     Transcript showCR:c1; showCR:c2.
     "
 
     "Modified: 21.8.1997 / 18:32:11 / cg"
@@ -7927,419 +8616,6 @@
     ]
 
     "Modified: 21.8.1997 / 18:32:21 / cg"
-!
-
-randomShuffle
-    "random shuffle my elements in place.
-     This is a destructive algorithm.
-     Moses, Oakford, Durstenfeld, Knuth algorithm.
-     See 'The Art of Computer Programming'."
-
-    self size to:2 by:-1 do:[:endIndex |
-        |rndIndex t|
-
-        rndIndex := Random nextIntegerBetween:1 and:endIndex.
-        "/ exchange
-        t := self at:rndIndex.
-        self at:rndIndex put:(self at:endIndex).
-        self at:endIndex put:t.
-    ].
-
-    "
-     (1 to:10) asOrderedCollection randomShuffle
-
-     |c| c := (1 to:100) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-     |c| c := (1 to:1000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-     |c| c := (1 to:10000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-     |c| c := (1 to:100000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-     |c| c := (1 to:1000000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-     |c| c := (1 to:10000000) asOrderedCollection . TimeDuration toRun:[ c randomShuffle ] 
-    "
-
-    "how random are we ? (should all be around 1000000/24.0 i.e. 41666.6):
-
-     |a score|
-
-     a := 'abcd'.
-     score := DictionaryWithDefault newWithDefaultValue:0.
-
-     1000000 times do:[
-         |sorted|
-         sorted := a copy randomShuffle.
-         score at:sorted put:(score at:sorted)+1.
-     ].
-
-     score keys asSortedCollection do:[:k |
-         Transcript showCR:('%1: %2' bindWith:k with:(score at:k)).
-     ].
-    "
-
-    "Modified: / 22-10-2008 / 15:37:48 / cg"
-!
-
-randomizedSort
-    <resource: #obsolete>
-    "sort the collection inplace. The elements are compared using
-     '<' i.e. they should offer a magnitude-like protocol.
-
-     This uses the randomized quicksort algorithm,
-     which has a better worstCase behavior than quickSort
-     (bit worse bestCase & averageCase behavior).
-     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
-
-"/    |stop|
-"/
-"/    stop := self size.
-"/    (stop > 1) ifTrue:[
-"/        self randomizedQuickSortFrom:1 to:stop sortBlock:[:a :b | a < b] with:nil
-"/    ]
-
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self sort
-
-!
-
-randomizedSort:sortBlock
-    <resource: #obsolete>
-    "sort the collection inplace using the 2-arg block sortBlock
-     for comparison. This allows any sort criteria to be implemented.
-
-     This uses the randomized quicksort algorithm,
-     which has a better worstCase behavior than quickSort
-     (bit worse bestCase & averageCase behavior).
-     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
-
-"/    |stop|
-"/
-"/    stop := self size.
-"/    (stop > 1) ifTrue:[
-"/        self randomizedQuickSortFrom:1 to:stop sortBlock:sortBlock with:nil
-"/    ]
-
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self sort:sortBlock
-
-!
-
-randomizedSort:sortBlock with:aCollection
-    <resource: #obsolete>
-    "sort the collection inplace using the 2-arg block sortBlock
-     for comparison. Also reorder the elements in aCollection.
-     Use this, when you have a key collection to sort some other collection with.
-
-     This uses the randomized quicksort algorithm,
-     which has a better worstCase behavior than quickSort
-     (bit worse bestCase & averageCase behavior).
-     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
-
-"/    |stop|
-"/
-"/    stop := self size.
-"/    (stop > 1) ifTrue:[
-"/        self randomizedQuickSortFrom:1 to:stop sortBlock:sortBlock with:aCollection
-"/    ]
-
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self sort:sortBlock with:aCollection
-
-!
-
-randomizedSortWith:aCollection
-    <resource: #obsolete>
-    "sort the receiver collection inplace, using '<' to compare elements.
-     Also, the elements of aCollection are reordered with it.
-     Use this, when you have a key collection to sort another collection with.
-
-     This uses the randomized quicksort algorithm,
-     which has a better worstCase behavior than quickSort
-     (bit worse bestCase & averageCase behavior).
-     See: Knuth or Cormen,Leiserson,Rivest pg. 163"
-
-"/    |stop|
-"/
-"/    stop := self size.
-"/    (stop > 1) ifTrue:[
-"/        self randomizedQuickSortFrom:1 to:stop sortBlock:[:a :b | a < b] with:aCollection
-"/    ]
-
-    "/ code was never used - use regular sort for backward compatibility
-    ^ self sortWith:aCollection
-
-!
-
-reverse
-    "destructively reverse the order of the elements inplace.
-     WARNING: this is a destructive operation, which modifies the receiver.
-              Please use reversed (with a d) for a functional version."
-
-    |lowIndex "{ Class: SmallInteger }"
-     hiIndex  "{ Class: SmallInteger }"
-     t1 t2|
-
-    hiIndex := self size.
-    lowIndex := 1.
-    [lowIndex < hiIndex] whileTrue:[
-        t1 := self at:lowIndex.  t2 := self at:hiIndex.
-        self at:lowIndex put:t2.  self at:hiIndex put:t1.
-
-        lowIndex := lowIndex + 1.
-        hiIndex := hiIndex - 1
-    ]
-
-    "
-     #(4 5 6 7 7) reverse
-     #(1 4 7 10 2 5) asOrderedCollection reverse
-    "
-!
-
-reversed
-    "return a copy with elements in reverse order"
-
-    ^ self copy reverse
-
-    "
-     #(4 5 6 7 7) reversed
-     #(1 4 7 10 2 5) asOrderedCollection reversed
-    "
-!
-
-sort
-    "sort the collection inplace. The elements are compared using
-     '<' i.e. they should offer a magnitude-like protocol.
-
-     The implementation uses the quicksort algorithm, which may not be
-     the best possible for all situations (quickSort has O-square worst
-     case behavior)."
-
-    self quickSort
-
-    "
-     #(1 16 7 98 3 19 4 0) sort
-
-     |data|
-     data := Random new next:100000.
-     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data sort]).
-     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data sort]).
-     data reverse.
-     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data sort]).
-    "
-
-    "Modified: 21.8.1997 / 18:31:52 / cg"
-!
-
-sort:sortBlock
-    "sort the collection inplace using the 2-arg block sortBlock
-     for comparison. This allows any sort criteria to be implemented.
-
-     The implementation uses the quicksort algorithm, which may not be
-     the best possible for all situations (quickSort has O-square worst
-     case behavior)."
-
-    self quickSort:sortBlock
-
-    "
-     #(1 16 7 98 3 19 4 0) sort:[:a :b | a < b]
-     #(1 16 7 98 3 19 4 0) sort:[:a :b | a > b]
-     #(1 -1 16 -16 7 -7 98 -98) sort:[:a :b | a < b]
-     #(1 -1 16 -16 7 -7 98 -98) sort:[:a :b | a abs < b abs]
-    "
-
-    "Modified: / 27.10.1997 / 20:03:22 / cg"
-!
-
-sort:sortBlock with:aCollection
-    "sort the collection inplace using the 2-arg block sortBlock
-     for comparison. Also reorder the elements in aCollection.
-     Use this, when you have a key collection to sort some other collection with.
-
-     The implementation uses the quicksort algorithm, which may not be
-     the best possible for all situations (quickSort has O-square worst
-     case behavior)."
-
-    self quickSort:sortBlock with:aCollection
-
-    "
-     |c1 c2|
-     c1 := #(1 16 7 9).
-     c2 := #('one' 'sixteen' 'seven' 'nine').
-     c1 sort:[:a :b | a > b] with:c2.
-     c1 printNL.
-     c2 printNL
-    "
-
-    "Modified: 21.8.1997 / 18:32:11 / cg"
-!
-
-sortByApplying:aBlock
-    "Sort my contents inplace based on the value of what aBlock returns for each element.
-     Similar to, but even more flexible than sortBySelector."
-
-    ^ self sort:[:a :b | (aBlock value:a) < (aBlock value:b)]
-
-    "
-     replace all uses of sort as in:
-        ... sort:[:a :b | a foo < b foo]
-     by:
-        ... sortByApplying:[:each | each foo]
-    "
-!
-
-sortBySelector:aSelector
-    "Sort my contents inplace based on the value of what aSelector returns when sent to my
-     elements. Sorting by a selector is so common, that its worth a separate utility"
-
-    ^ self sort:[:a :b | (a perform:aSelector) < (b perform:aSelector)]
-
-    "
-     replace all uses of sort as in:
-        ... sort:[:a :b | a foo < b foo]
-     by:
-        ... sortBySelector:#foo
-
-     find these by searching for code matching (code-search in the browsers method list):
-        `@e sort:[:a :b | a `@msg < b `@msg ]
-    "
-!
-
-sortWith:aCollection
-    "sort the receiver collection inplace, using '<' to compare elements.
-     Also, the elements of aCollection are reordered with it.
-     Use this, when you have a key collection to sort another collection with.
-
-     The implementation uses the quicksort algorithm, which may not be
-     the best possible for all situations (quickSort has O-square worst
-     case behavior)."
-
-    self quickSortWith:aCollection
-
-    "
-     |indices names|
-
-     names := #('nine' 'five' 'eight' 'one' 'four' 'two') copy.
-     indices := #(9 5 8 1 4 2) copy.
-     indices sortWith:names.
-     names.
-     indices     
-    "
-
-    "Modified (comment): / 18-01-2012 / 11:30:01 / cg"
-!
-
-sortedBy:aBlock
-    "Create a copy that is sorted.  Sort criteria is the block that accepts two arguments.
-     When the block is true, the first arg goes first ([:a :b | a > b] sorts in descending order)."
-
-    ^ (self asSortedCollection: aBlock) asOrderedCollection
-
-    "Modified: / 22-10-2008 / 21:25:07 / cg"
-!
-
-stableSort
-    "sort the collection inplace. The elements are compared using
-     '<=' i.e. they should offer a magnitude-like protocol.
-
-     Use a stable sort algorithm - i.e. elements having an equal key will keep
-     their previous order."
-
-    self mergeSort
-
-    "
-     #(1 16 7 98 3 19 4 0) stableSort
-
-     |data|
-     data := Random new next:100000.
-     Transcript show:'sort random  '; showCR:(Time millisecondsToRun:[data stableSort]).
-     Transcript show:'sort sorted  '; showCR:(Time millisecondsToRun:[data stableSort]).
-     data reverse.
-     Transcript show:'sort reverse '; showCR:(Time millisecondsToRun:[data stableSort]).
-    "
-!
-
-stableSort:sortBlock
-    "sort the collection inplace using the 2-arg block sortBlock
-     for comparison. This allows any sort criteria to be implemented.
-
-     Use a stable sort algorithm - i.e. elements having an equal key will keep
-     their previous order.
-
-     NOTE: the sort algorithm will be stable, if the sortblock uses #< or #> for comparison!!
-           Do not use #<= of #>= if you want stable behavior."
-
-    self mergeSort:sortBlock
-
-    "
-     The 4@bla points keep their order:
-         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
-          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} stableSort:[:a :b | a x < b x]
-        
-     But not with quickSort:
-         {(4@1). (8@2). (4@2). (3@3). (4@3). (-1@4). (17@17). (19@19).
-          (12 @ 12). (13@13). (14@14). (15@15). (10@10). (8@8).} sort:[:a :b | a x < b x]
-    "
-!
-
-topologicalSort:sortBlock
-    "sort the collection inplace using a sloooow sort algorithm.
-     This algorithm has O-square runtime behavior and should be used only
-     in special situations.
-     It compares all elements, thus can be used when a>b, b>c does NOT imply
-     a>c (for example, to sort classes by inheritance)
-
-     In all other situations, use #sort; which implements the quicksort algorithm.
-
-     If there are cycles, this algorithm may loop endless!!   
-     Note: consider using Collection>>#topologicalSort, which is faster and does not do endless loop.
-    "
-
-    |smallestIndex "{ Class: SmallInteger }"
-     end           "{ Class: SmallInteger }"
-     index2        "{ Class: SmallInteger }"
-     smallest thisOne|
-
-    "this is just a q&d hack - there must be better implementations for this ;-)"
-
-    end := self size.
-    1 to:end-1 do:[:index |
-        smallest := self at:index.
-        smallestIndex := index.
-
-        index2 := index + 1.
-        [
-            thisOne := self at:index2.
-            (index2 ~~ smallestIndex
-            and:[sortBlock value:thisOne value:smallest]) ifTrue:[
-                smallestIndex := index2.
-                smallest := thisOne.
-                index2 := index + 1.
-            ] ifFalse:[
-                index2 := index2 + 1.
-            ].
-        ] doWhile:[index2 <= end].
-
-"/        (index + 1) to:end do:[:index2 |
-"/            thisOne := self at:index2.
-"/            (sortBlock value:thisOne value:smallest) ifTrue:[
-"/                smallestIndex := index2.
-"/                smallest := thisOne
-"/            ].
-"/        ].
-
-        (smallestIndex ~~ index) ifTrue:[
-            thisOne := self at:index.
-            self at:index put:smallest.
-            self at:smallestIndex put:thisOne
-        ].
-    ]
-
-    "
-     #(1 16 7 98 3 19 4 0) topologicalSort:[:a :b | a < b]
-     #(1 16 7 98 3 19 4 0) sort:[:a :b | a < b]
-     Smalltalk allClasses asArray topologicalSort:[:a :b | a == b superclass]
-     Smalltalk allClasses asArray topologicalSort:[:a :b | b isSubclassOf:a]
-     Smalltalk allClasses asArray sort:[:a :b | b isSubclassOf:a]
-    "
-
-    "Modified: 21.8.1997 / 18:30:49 / cg"
 ! !
 
 !SequenceableCollection methodsFor:'testing'!
@@ -8369,11 +8645,11 @@
 !SequenceableCollection class methodsFor:'documentation'!
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.316 2012/04/12 19:14:06 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/SequenceableCollection.st,v 1.318 2012/04/20 15:19:12 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: SequenceableCollection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
+    ^ '$Id: SequenceableCollection.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 SequenceableCollection initialize!
--- a/SortedCollection.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/SortedCollection.st	Sat May 05 22:58:24 2012 +0100
@@ -763,7 +763,7 @@
      the same size. This method has been be redefined to
      preserve the sortBlock."
 
-    ^ (self species new:size) sortBlock:sortBlock
+    ^ (super copyEmpty:size) sortBlock:sortBlock
 !
 
 postCopyFrom:anOriginal
@@ -1060,11 +1060,11 @@
 !SortedCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.70 2012/04/12 19:14:44 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SortedCollection.st,v 1.72 2012/04/21 17:38:20 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: SortedCollection.st 10804 2012-04-13 13:18:13Z vranyj1 $'
+    ^ '$Id: SortedCollection.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 SortedCollection initialize!
--- a/StringCollection.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/StringCollection.st	Sat May 05 22:58:24 2012 +0100
@@ -187,14 +187,22 @@
 !StringCollection methodsFor:'copying'!
 
 copyEmpty:size
-    "we have to redefine this, since 'self class new:size' does allocate size nil lines.
-     In order to get collect working, we have to undo this allocation"
+    "we have to redefine this, since 'self class new:size' 
+     does allocate size nil lines (it does an implicit #grow: size).
+     In order to get #collect: working, we should not perform this implicit grow"
 
-    ^ (super copyEmpty:size) grow:0.
+    ^ super copyEmpty:0.
 
     "Created: 14.2.1996 / 11:05:47 / stefan"
 !
 
+copyEmptyAndGrow:size
+    "performance optimization: 
+     StringCollections are always grown to size after #new: / #copyEmpty:"
+
+    ^ super copyEmpty:size.
+!
+
 withoutLeadingBlankLines
     "return a copy of the receiver with leading blank lines removed.
      If there are no leading blank lines, the original receiver is returned.
@@ -377,15 +385,15 @@
 !StringCollection class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.41 2011/04/11 09:17:14 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.42 2012/04/21 15:23:45 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.41 2011/04/11 09:17:14 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/StringCollection.st,v 1.42 2012/04/21 15:23:45 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: StringCollection.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: StringCollection.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 
--- a/TwoByteString.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/TwoByteString.st	Sat May 05 22:58:24 2012 +0100
@@ -95,6 +95,12 @@
     ^ aCharacter
 
     "Modified: 19.4.1996 / 11:16:22 / cg"
+!
+
+unsignedShortAt:index
+    "return the short at position index, an Integer"
+
+    ^ super basicAt:index.
 ! !
 
 !TwoByteString methodsFor:'queries'!
@@ -111,11 +117,11 @@
 !TwoByteString class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.32 2006/12/06 14:12:10 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/TwoByteString.st,v 1.33 2012/04/24 14:56:26 stefan Exp $'
 !
 
 version_SVN
-    ^ '$Id: TwoByteString.st 10761 2012-01-19 11:46:00Z vranyj1 $'
+    ^ '$Id: TwoByteString.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 ! !
 
 TwoByteString initialize!
--- a/Unicode16String.st	Fri Apr 13 15:03:30 2012 +0100
+++ b/Unicode16String.st	Sat May 05 22:58:24 2012 +0100
@@ -118,6 +118,20 @@
 
 !Unicode16String methodsFor:'printing & storing'!
 
+displayOn:aGCOrStream
+    "display myself as on aStream.
+     You must use an ISO10646 unicode font to display this string"
+
+    (aGCOrStream isStream or:[aGCOrStream == Transcript]) ifTrue:[
+        aGCOrStream
+            nextPut:$';
+            nextPutAllUnicode:self;
+            nextPut:$'.
+        ^ self
+    ].
+    ^ super displayOn:aGCOrStream
+!
+
 printOn:aStream
     "print the receiver on aStream. 
      Let aStream decide how to represent this, whether utf8, ucs16, ..."
@@ -155,20 +169,54 @@
     ^ (self utf8Encoded storeString),' utf8Decoded'.
 
     "Modified: / 25-01-2012 / 11:59:34 / cg"
+!
+
+unicodeStoreOn:aStream
+    "put the storeString of myself on aStream"
+
+    aStream nextPut:$'.
+    (self includes:$') ifTrue:[
+        self do:[:thisChar |
+            (thisChar == $') ifTrue:[aStream nextPut:thisChar].
+            aStream nextPutUnicode:thisChar
+        ]
+    ] ifFalse:[
+        aStream nextPutAllUnicode:self
+    ].
+    aStream nextPut:$'
+!
+
+unicodeStoreString
+    "return a UnicodeString for storing myself.
+     This method is a kind of kludge.
+     Use it when you want to write a storeString to an encoded Stream"
+
+    ^ self basicStoreString.
 ! !
 
+!Unicode16String methodsFor:'testing'!
+
+isUnicode16String
+    ^ true
+!
+
+isUnicodeString
+    ^ true
+! !
+
+
 !Unicode16String class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.17 2012/04/02 16:57:21 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.19 2012/04/24 14:56:53 stefan Exp $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.17 2012/04/02 16:57:21 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Unicode16String.st,v 1.19 2012/04/24 14:56:53 stefan Exp §'
 !
 
 version_SVN
-    ^ '$Id: Unicode16String.st 10804 2012-04-13 13:18:13Z vranyj1 $'
+    ^ '$Id: Unicode16String.st 10807 2012-05-05 21:58:24Z vranyj1 $'
 
 ! !
 
--- a/bc.mak	Fri Apr 13 15:03:30 2012 +0100
+++ b/bc.mak	Sat May 05 22:58:24 2012 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libbasic/bc.mak,v 1.185 2012/03/01 12:53:21 cg Exp $
+# $Header: /cvs/stx/stx/libbasic/bc.mak,v 1.186 2012/04/25 19:08:21 stefan Exp $
 #
 # DO NOT EDIT
 # automagically generated from the projectDefinition: stx_libbasic at 2012-03-01 13:51:25.861.