Merged 47b429933e0e and 445368176cf3 (branch default - CVS HEAD) jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Thu, 25 Apr 2013 11:30:13 +0100
branchjv
changeset 18053 e0683b878c4c
parent 18052 47b429933e0e (current diff)
parent 15153 445368176cf3 (diff)
child 18054 56594a8c6b83
Merged 47b429933e0e and 445368176cf3 (branch default - CVS HEAD) Reverted UnixOperatingSystem>>primPathNameOf: to older revision as the current from 445368176cf3 seems to be broken.
LargeInteger.st
Make.proto
Make.spec
Makefile
SmallInteger.st
UnixOperatingSystem.st
abbrev.stc
bc.mak
libInit.cc
libbasic.rc
stx_libbasic.st
--- a/LargeInteger.st	Thu Apr 25 10:49:32 2013 +0100
+++ b/LargeInteger.st	Thu Apr 25 11:30:13 2013 +0100
@@ -290,6 +290,8 @@
     "Modified: / 8.5.1998 / 21:40:41 / cg"
 ! !
 
+
+
 !LargeInteger class methodsFor:'queries'!
 
 isBuiltInClass
@@ -1264,29 +1266,29 @@
 setBit:index
     "return a new integer, where the specified bit is on.
      Bits are counted from 1 starting with the least significant.
-     The methods name may be missleading: the receiver is not changed,
+     The methods name may be misleading: the receiver is not changed,
      but a new number is returned. Should be named #withBitSet:"
 
     |myDigitLength newDigitLength newDigitBytes byteIndexOfBitToSet|
 
     index <= 0 ifTrue:[
-	^ SubscriptOutOfBoundsSignal
-		raiseRequestWith:index
-		errorString:'index out of bounds'
+        ^ SubscriptOutOfBoundsSignal
+                raiseRequestWith:index
+                errorString:'index out of bounds'
     ].
 
     myDigitLength := digitByteArray size.
     byteIndexOfBitToSet := ((index-1)//8)+1.
     byteIndexOfBitToSet > myDigitLength ifTrue:[
-	newDigitLength := myDigitLength max:byteIndexOfBitToSet.
-	newDigitBytes := ByteArray new:newDigitLength.
-	newDigitBytes replaceFrom:1 to:myDigitLength with:digitByteArray startingAt:1.
+        newDigitLength := myDigitLength max:byteIndexOfBitToSet.
+        newDigitBytes := ByteArray new:newDigitLength.
+        newDigitBytes replaceFrom:1 to:myDigitLength with:digitByteArray startingAt:1.
     ] ifFalse:[
-	newDigitBytes := digitByteArray copy
+        newDigitBytes := digitByteArray copy
     ].
     newDigitBytes
-	at:byteIndexOfBitToSet
-	put:((newDigitBytes at:byteIndexOfBitToSet) setBit:(((index-1)\\8)+1)).
+        at:byteIndexOfBitToSet
+        put:((newDigitBytes at:byteIndexOfBitToSet) setBit:(((index-1)\\8)+1)).
     ^ (self class digitBytes:newDigitBytes) sign:sign
 
     "
@@ -5170,9 +5172,10 @@
 !LargeInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.205 2013-02-08 12:57:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.206 2013-04-25 07:12:35 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.205 2013-02-08 12:57:01 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/LargeInteger.st,v 1.206 2013-04-25 07:12:35 stefan Exp $'
 ! !
+
--- a/Make.proto	Thu Apr 25 10:49:32 2013 +0100
+++ b/Make.proto	Thu Apr 25 11:30:13 2013 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libbasic/Make.proto,v 1.261 2013-03-20 18:26:50 cg Exp $
+# $Header: /cvs/stx/stx/libbasic/Make.proto,v 1.263 2013-04-25 07:36:53 stefan Exp $
 #
 # DO NOT EDIT
 # automagically generated from the projectDefinition: stx_libbasic.
@@ -44,7 +44,7 @@
 LOCALDEFINES=
 
 LIBNAME=libstx_libbasic
-STCLOCALOPT=-lineInfo '-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=. $(COMMONSYMBOLS) -varPrefix=$(LIBNAME)
+STCLOCALOPT='-package=$(PACKAGE)' -I. $(LOCALINCLUDES) $(STCLOCALOPTIMIZATIONS) $(STCWARNINGS) $(LOCALDEFINES) -headerDir=. $(COMMONSYMBOLS) -varPrefix=$(LIBNAME)
 
 
 # ********** OPTIONAL: MODIFY the next line ***
@@ -278,6 +278,7 @@
 $(OUTDIR)OSFileHandle.$(O) OSFileHandle.$(H): OSFileHandle.st $(INCLUDE_TOP)/stx/libbasic/OSHandle.$(H) $(INCLUDE_TOP)/stx/libbasic/ExternalAddress.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)ObjectCoder.$(O) ObjectCoder.$(H): ObjectCoder.st $(INCLUDE_TOP)/stx/libbasic/AspectVisitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Visitor.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)OrderedCollection.$(O) OrderedCollection.$(H): OrderedCollection.st $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)OrderedSet.$(O) OrderedSet.$(H): OrderedSet.st $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Point.$(O) Point.$(H): Point.st $(INCLUDE_TOP)/stx/libbasic/ArithmeticValue.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)PositionableStream.$(O) PositionableStream.$(H): PositionableStream.st $(INCLUDE_TOP)/stx/libbasic/PeekableStream.$(H) $(INCLUDE_TOP)/stx/libbasic/Stream.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Query.$(O) Query.$(H): Query.st $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -287,6 +288,7 @@
 $(OUTDIR)Time.$(O) Time.$(H): Time.st $(INCLUDE_TOP)/stx/libbasic/AbstractTime.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)TimeoutNotification.$(O) TimeoutNotification.$(H): TimeoutNotification.st $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Timestamp.$(O) Timestamp.$(H): Timestamp.st $(INCLUDE_TOP)/stx/libbasic/AbstractTime.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)UserConfirmation.$(O) UserConfirmation.$(H): UserConfirmation.st $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)UserInterrupt.$(O) UserInterrupt.$(H): UserInterrupt.st $(INCLUDE_TOP)/stx/libbasic/ControlInterrupt.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)UserNotification.$(O) UserNotification.$(H): UserNotification.st $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)YesToAllConfirmation.$(O) YesToAllConfirmation.$(H): YesToAllConfirmation.st $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -316,6 +318,7 @@
 $(OUTDIR)MetaNumber.$(O) MetaNumber.$(H): MetaNumber.st $(INCLUDE_TOP)/stx/libbasic/Number.$(H) $(INCLUDE_TOP)/stx/libbasic/ArithmeticValue.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)Metaclass.$(O) Metaclass.$(H): Metaclass.st $(INCLUDE_TOP)/stx/libbasic/ClassDescription.$(H) $(INCLUDE_TOP)/stx/libbasic/Behavior.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)MethodWithBreakpoints.$(O) MethodWithBreakpoints.$(H): MethodWithBreakpoints.st $(INCLUDE_TOP)/stx/libbasic/Method.$(H) $(INCLUDE_TOP)/stx/libbasic/CompiledCode.$(H) $(INCLUDE_TOP)/stx/libbasic/ExecutableFunction.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
+$(OUTDIR)OrderedDictionary.$(O) OrderedDictionary.$(H): OrderedDictionary.st $(INCLUDE_TOP)/stx/libbasic/Dictionary.$(H) $(INCLUDE_TOP)/stx/libbasic/Set.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)OsError.$(O) OsError.$(H): OsError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)PluginSupport.$(O) PluginSupport.$(H): PluginSupport.st $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(INCLUDE_TOP)/stx/libbasic/Query.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(STCHDR)
 $(OUTDIR)ProceedableError.$(O) ProceedableError.$(H): ProceedableError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
@@ -332,7 +335,6 @@
 $(OUTDIR)StringCollection.$(O) StringCollection.$(H): StringCollection.st $(INCLUDE_TOP)/stx/libbasic/OrderedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)TerminateProcessRequest.$(O) TerminateProcessRequest.$(H): TerminateProcessRequest.st $(INCLUDE_TOP)/stx/libbasic/ControlRequest.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)UninterpretedBytes.$(O) UninterpretedBytes.$(H): UninterpretedBytes.st $(INCLUDE_TOP)/stx/libbasic/ArrayedCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/SequenceableCollection.$(H) $(INCLUDE_TOP)/stx/libbasic/Collection.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
-$(OUTDIR)UserConfirmation.$(O) UserConfirmation.$(H): UserConfirmation.st $(INCLUDE_TOP)/stx/libbasic/UserNotification.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)UserInformation.$(O) UserInformation.$(H): UserInformation.st $(INCLUDE_TOP)/stx/libbasic/UserNotification.$(H) $(INCLUDE_TOP)/stx/libbasic/Notification.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)UtcTimestamp.$(O) UtcTimestamp.$(H): UtcTimestamp.st $(INCLUDE_TOP)/stx/libbasic/Timestamp.$(H) $(INCLUDE_TOP)/stx/libbasic/AbstractTime.$(H) $(INCLUDE_TOP)/stx/libbasic/Magnitude.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
 $(OUTDIR)VMInternalError.$(O) VMInternalError.$(H): VMInternalError.st $(INCLUDE_TOP)/stx/libbasic/Error.$(H) $(INCLUDE_TOP)/stx/libbasic/Exception.$(H) $(INCLUDE_TOP)/stx/libbasic/GenericException.$(H) $(INCLUDE_TOP)/stx/libbasic/Object.$(H) $(STCHDR)
--- a/Make.spec	Thu Apr 25 10:49:32 2013 +0100
+++ b/Make.spec	Thu Apr 25 11:30:13 2013 +0100
@@ -207,6 +207,7 @@
 	OSFileHandle \
 	ObjectCoder \
 	OrderedCollection \
+	OrderedSet \
 	Point \
 	PositionableStream \
 	Query \
@@ -245,6 +246,7 @@
 	MetaNumber \
 	Metaclass \
 	MethodWithBreakpoints \
+	OrderedDictionary \
 	OsError \
 	PluginSupport \
 	ProceedableError \
@@ -557,6 +559,7 @@
     $(OUTDIR_SLASH)OSFileHandle.$(O) \
     $(OUTDIR_SLASH)ObjectCoder.$(O) \
     $(OUTDIR_SLASH)OrderedCollection.$(O) \
+    $(OUTDIR_SLASH)OrderedSet.$(O) \
     $(OUTDIR_SLASH)Point.$(O) \
     $(OUTDIR_SLASH)PositionableStream.$(O) \
     $(OUTDIR_SLASH)Query.$(O) \
@@ -595,6 +598,7 @@
     $(OUTDIR_SLASH)MetaNumber.$(O) \
     $(OUTDIR_SLASH)Metaclass.$(O) \
     $(OUTDIR_SLASH)MethodWithBreakpoints.$(O) \
+    $(OUTDIR_SLASH)OrderedDictionary.$(O) \
     $(OUTDIR_SLASH)OsError.$(O) \
     $(OUTDIR_SLASH)PluginSupport.$(O) \
     $(OUTDIR_SLASH)ProceedableError.$(O) \
--- a/Makefile	Thu Apr 25 10:49:32 2013 +0100
+++ b/Makefile	Thu Apr 25 11:30:13 2013 +0100
@@ -1,22 +1,20 @@
 #
-# DO NOT EDIT 
-# automagically generated from Make.proto (by make mf)
+# DO NOT EDIT
+#
+# make uses this file (Makefile) only, if there is no
+# file named "makefile" (lower-case m) in the same directory.
+# My only task is to generate the real makefile and call make again.
+# Thereafter, I am no longer used and needed.
 #
-include ../rules/stdHeader
-include ../configurations/COMMON/defines
-include ../configurations/vendorConf
-include ../configurations/myConf
-include ../rules/stdHeader2
-include Make.spec
+
+.PHONY: run
+
+run: makefile
+	$(MAKE) -f makefile
+
+#only needed for the definition of $(TOP)
 include Make.proto
 
-BASE_CONF=osx_x
-BASE_CONF_VENDOR=mac
-CONF_PACKS=
-CONF_TOOLS=
-
-include ../rules/stdRules
-
 makefile: mf
 
 mf:
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrderedDictionary.st	Thu Apr 25 11:30:13 2013 +0100
@@ -0,0 +1,970 @@
+"
+ COPYRIGHT.
+ This is a Manchester Goodie protected by copyright.
+ These conditions are imposed on the whole Goodie, and on any significant
+ part of it which is separately transmitted or stored:
+	* You must ensure that every copy includes this notice, and that
+	  source and author(s) of the material are acknowledged.
+	* These conditions must be imposed on anyone who receives a copy.
+	* The material shall not be used for commercial gain without the prior
+	  written consent of the author(s).
+ Further information on the copyright conditions may be obtained by
+ sending electronic mail:
+	To: goodies-lib@cs.man.ac.uk
+	Subject: copyright
+ or by writing to The Smalltalk Goodies Library Manager, Dept of
+ Computer Science, The University, Manchester M13 9PL, UK
+
+ (C) Copyright 1992 University of Manchester
+ For more information about the Manchester Goodies Library (from which 
+ this file was distributed) send e-mail:
+	To: goodies-lib@cs.man.ac.uk
+	Subject: help 
+"
+"{ Package: 'stx:libbasic' }"
+
+Dictionary subclass:#OrderedDictionary
+	instanceVariableNames:'order'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Collections-Sequenceable'
+!
+
+!OrderedDictionary class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT.
+ This is a Manchester Goodie protected by copyright.
+ These conditions are imposed on the whole Goodie, and on any significant
+ part of it which is separately transmitted or stored:
+	* You must ensure that every copy includes this notice, and that
+	  source and author(s) of the material are acknowledged.
+	* These conditions must be imposed on anyone who receives a copy.
+	* The material shall not be used for commercial gain without the prior
+	  written consent of the author(s).
+ Further information on the copyright conditions may be obtained by
+ sending electronic mail:
+	To: goodies-lib@cs.man.ac.uk
+	Subject: copyright
+ or by writing to The Smalltalk Goodies Library Manager, Dept of
+ Computer Science, The University, Manchester M13 9PL, UK
+
+ (C) Copyright 1992 University of Manchester
+ For more information about the Manchester Goodies Library (from which 
+ this file was distributed) send e-mail:
+	To: goodies-lib@cs.man.ac.uk
+	Subject: help 
+"
+!
+
+documentation
+"
+    I am a subclass of Dictionary whose elements (associations) are ordered in a
+    similar fashion to OrderedCollection.
+    That is, while being filled via #at:put: messages (or similar Dictionary protocol),
+    the order in which associations are added is remembered and accessable via the #atIndex:
+    or #order messages.
+
+    I have one instance variable:
+
+    order <OrderedCollection>       Ordered collection of keys reflecting the order of
+                                    associations in the dictionary.
+
+    [author:]
+        Ifor Wyn Williams <ifor@uk.ac.man.cs>
+
+    [see also:]
+        OrderedCollection Dictionary
+        OrderedSet
+"
+!
+
+examples
+"
+    |o|
+
+    o := OrderedDictionary new.
+
+    o at:'one'   put:1.
+    o at:'two'   put:2.
+    o at:'three' put:3.
+    o at:'four'  put:4.
+    o at:'five'  put:5.
+    o at:'six'   put:6.
+    o at:'seven' put:7.
+    o at:'eight' put:8.
+    o at:'nine'  put:9.
+    o at:'zero'  put:0.
+
+    o at:'eight'.
+    o atIndex:1.   
+    o atIndex:5.    
+    o atIndex:10.  
+
+    o from:3 to:6 do:[:each | Transcript showCR:each ].
+
+    o collect:[:eachAssoc | eachAssoc key -> eachAssoc value squared]. 
+    o associations.  
+    o order.         
+    o reverse.    
+
+    o atIndex:1.  
+    o atIndex:5. 
+    o atIndex:10. 
+"
+!
+
+info
+"
+	NAME            OrderedDictionary
+	AUTHOR          Ifor Wyn Williams <ifor@uk.ac.man.cs>
+	CONTRIBUTOR     Ifor Wyn Williams <ifor@uk.ac.man.cs>
+	FUNCTION        An ordered dictionary
+	ST-VERSIONS     2.3-5, 4.0
+	PREREQUISITES   
+	CONFLICTS       
+	DISTRIBUTION    global
+	VERSION         1.2
+	DATE            28.3.90
+	SUMMARY         A dictionary that behaves like a SequencableCollection
+			(except that associations cannot be removed). 
+"
+! !
+
+!OrderedDictionary class methodsFor:'instance creation'!
+
+new
+        ^ super new initializeOrder
+!
+
+new: anInteger
+        ^(super new: anInteger) initializeOrder
+! !
+
+!OrderedDictionary methodsFor:'accessing'!
+
+after: anAssociation 
+    "Return the association after anAssociation in the order. 
+     If anAssociation is the last association in the order, return nil. 
+     If anAssociation is not found, invoke an error notifier"
+
+    1 to: order size - 1 do: [:index | (self associationAt: (order at: index))
+                    = anAssociation ifTrue: [^self associationAt: (order at: index + 1)]].
+    (self associationAt: (order last))
+            = anAssociation
+            ifTrue: [^nil]
+            ifFalse: [^self error: 'not found']
+!
+
+associations
+    "Return an OrderedCollection containing the receiver's associations."
+
+    ^ order collect: [:key | self associationAt: key ].
+!
+
+at:aKey ifAbsentPut:valueBlock
+    |val|
+
+    ^ self at:aKey ifAbsent:[ self at:aKey put:valueBlock value ]
+!
+
+at: key put: anObject 
+    "Set the value at key to be anObject. 
+     If key is not found, create a new entry for key and set is value to anObject. 
+     If key is already present, the order remains unchanged.
+     Return anObject."
+
+    "/ claus: super can check this much faster ...
+    "/ (super includesKey:key)
+    "/ ... but that leads to trouble in add:* methods. (sigh)
+
+    (order includes: key) ifFalse: [order add: key].
+    ^ super at: key put: anObject
+!
+
+atAll:indexCollection put: anObject 
+    "Put anObject into the value field of every association specified by indexCollection,
+     which is typically an interval."
+
+    indexCollection do:[:index | self at:(order at: index) put:anObject]
+!
+
+atAllPut: anObject 
+    "Put anObject into the value field of every association in the dictionary"
+
+    order do: [:key | self at: key put: anObject]
+!
+
+atIndex:index
+    "return an element at a given index"
+
+    ^ self at:(order at:index)
+
+    "Created: 28.9.1995 / 13:49:39 / stefan"
+!
+
+atIndex:index put:anAssociation
+    "put an association to a given index. remove the old associatioan at this index"
+    |key|
+
+    key := anAssociation key.
+    (super includesKey:key) ifTrue:[
+        ^ self error:'duplicate key'.
+    ].
+    super removeKey:(order at:index) ifAbsent:[].
+    order at:index put:key.
+    ^ super add:anAssociation.
+
+    "Created: 28.9.1995 / 16:30:15 / stefan"
+!
+
+before: anAssociation 
+    "Return the association before anAssociation in the order. 
+     If anAssociation is the first association in the order, return nil. 
+     If anAssociation is not found, invoke an error notifier"
+
+    2 to:order size do:[:index | 
+        (self associationAt:(order at:index)) = anAssociation 
+            ifTrue:[ ^ self associationAt:(order at:index - 1)] 
+    ].
+    (self associationAt:order first) = anAssociation ifTrue: [^ nil].
+    ^ self error: 'not found'
+!
+
+first
+    "Return the first association of the receiver.  
+     Provide an error notification if the receiver contains no elements."
+
+    ^ self associationAt: (order first)
+
+    "
+        OrderedDictionary new first
+    "
+!
+
+keyAt:index
+    "get the key at the given index"
+
+    ^ order at:index.
+
+    "
+     |s|
+
+     s := OrderedDictionary new.
+     s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'.
+     s keyAt:2    
+    "
+
+    "Created: 29.9.1995 / 11:32:07 / stefan"
+!
+
+keys
+    "Return a OrderedCollection containing the receiver's keys."
+
+    ^ order copy.
+
+    "
+     |s|
+
+     s := OrderedDictionary new.
+     s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'.
+     s keys       
+    "
+!
+
+last
+    "Return the last association of the receiver. 
+     Provide an error notification if the receiver contains no elements."
+
+    ^ self associationAt: (order last)
+
+    "
+        OrderedDictionary new last
+    "
+!
+
+order
+    "returns the keys in the order of their appearance"
+
+    ^ order
+
+    "
+     |s|
+
+     s := OrderedDictionary new.
+     s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'.
+     s order    
+    "
+!
+
+valueAt:index
+    "get the value at the given index"
+
+    ^ super at:(order at:index).
+
+    "
+     |s|
+
+     s := OrderedDictionary new.
+     s at:#a put:'aaa'; at:#b put:'bbb'; at:#c put:'ccc'; at:#d put:'ddd'; at:#a put:'aaaa'.
+     s valueAt:2       
+    "
+!
+
+values
+    "Return a OrderedCollection containing the receiver's values."
+
+    ^ order collect: [:key | (self at: key) ].
+! !
+
+!OrderedDictionary methodsFor:'adding'!
+
+add: anAssociation 
+    "add anAssociation to the dictionary. 
+     If anAssociation is already present in the dictionary,
+     the order will not be changed. (See also: #addLast:)"
+
+    | key |
+
+    key := anAssociation key.
+    (super includesKey: key)
+            ifFalse: [order add: key].
+    ^ super add: anAssociation
+!
+
+add: anAssociation after: oldAssociation 
+    "Add the argument, anAssociation, as an element of the dictionary. Put it 
+    in the position just succeeding oldAssociation. Return anAssociation."
+
+    | index |
+
+    index := self indexOfAssociation: oldAssociation 
+                            ifAbsent: [self error: 'association not found'].
+    self removeFromOrder: anAssociation key.
+    order add: anAssociation key after: (order at: index).
+    super add: anAssociation.
+    ^ anAssociation
+!
+
+add: anAssociation before: oldAssociation 
+    "Add the argument, anAssociation, as an element of the dictionary. Put it 
+    in the position just preceding oldAssociation. Return anAssociation."
+
+    | index |
+
+    index := self indexOfAssociation: oldAssociation 
+                            ifAbsent: [self error: 'association not found'].
+    self removeFromOrder: anAssociation key.
+    order add: anAssociation key before: (order at: index).
+    super add: anAssociation.
+    ^ anAssociation
+!
+
+add: anAssociation beforeIndex: spot 
+    "Add the argument, anAssociation, as an element of the receiver.  Put it
+    in the position just preceding the indexed position spot.  Return newObject."
+
+    self removeFromOrder: anAssociation key.
+    order add: anAssociation key beforeIndex: spot.
+    ^ super add: anAssociation
+
+    "Modified: 28.9.1995 / 14:06:53 / stefan"
+!
+
+addAll:aCollectionOfAssociations 
+    "Add each element of anOrderedCollectionOfAssociations at my end. 
+     We expect the argument to enumerate associations with #reverseDo:; 
+     if it does not (i.e. it is another OD or a dictionary), use #addAllAssociationsFirst:.
+     Returns the argument, aCollectionOfAssociations (sigh)."
+
+    self addAllLast:aCollectionOfAssociations.
+    ^ aCollectionOfAssociations
+
+    "Modified: 28.2.1997 / 15:51:23 / cg"
+!
+
+addAllAssociations:aDictionaryOrOrderedDictionary
+    "Add each association of aDictionaryOrOrderedDictionary to my end.
+     We expect the argument to respond to #associationsDo:."
+
+    self addAllAssociationsLast:aDictionaryOrOrderedDictionary.
+    ^ aDictionaryOrOrderedDictionary
+
+    "Created: 28.2.1997 / 15:52:02 / cg"
+!
+
+addAllAssociationsFirst:aDictionaryOrOrderedDictionary
+    "Add each association of aDictionaryOrOrderedDictionary at the beginning of the 
+     receiver. We expect the argument to respond to #associationsReverseDo:."
+
+    aDictionaryOrOrderedDictionary associationsReverseDo:[:each | self addFirst:each].
+    ^ aDictionaryOrOrderedDictionary
+
+    "Created: 28.2.1997 / 15:50:14 / cg"
+!
+
+addAllAssociationsLast:aDictionaryOrOrderedDictionary
+    "Add each association of aDictionaryOrOrderedDictionary at the end of the 
+     receiver. We expect the argument to respond to #associationsDo:."
+
+    aDictionaryOrOrderedDictionary associationsDo:[:each | self addLast:each].
+    ^ aDictionaryOrOrderedDictionary
+
+    "Created: 28.2.1997 / 15:48:37 / cg"
+!
+
+addFirst: anAssociation 
+    "Add anAssociation to the beginning of the receiver."
+
+    self removeFromOrder: anAssociation key.
+    order addFirst: anAssociation key.
+    ^ super add: anAssociation.
+!
+
+addLast: anAssociation 
+    "Add anAssociation to the end of the receiver.
+     If anAssociation is already present in the dictionary,
+     it will be moved to the end. (See also: #add:)"
+
+    self removeFromOrder: anAssociation key.
+    order add: anAssociation key.
+    ^ super add: anAssociation.
+! !
+
+!OrderedDictionary methodsFor:'copying'!
+
+copyEmpty
+    "Return a copy of the receiver that contains no elements."
+
+    ^ (self class) new: 10
+!
+
+copyFrom: startIndex to: endIndex 
+    "Return a copy of the receiver that contains elements from 
+     position startIndex to endIndex."
+
+    | newDict |
+    endIndex < startIndex ifTrue: [^self copyEmpty].
+    (startIndex < 1 or: [endIndex > order size])
+            ifTrue: [^ self errorNotFound].
+    newDict := self copyEmpty: endIndex - startIndex + 1.
+    startIndex to: endIndex do: [:index | newDict add: (self associationAt: (order at: index))].
+    ^ newDict
+!
+
+copyWith: anAssociation 
+    "Return a copy of the dictionary that is 1 bigger than the receiver and 
+     includes the argument, anAssociation, at the end."
+
+    | newDict |
+    newDict := self copy.
+    newDict add: anAssociation.
+    ^ newDict
+!
+
+copyWithout: anAssociation 
+    "Return a copy of the dictionary that is 1 smaller than the receiver and 
+     does not include the argument, anAssociation
+     No error is reported, if elementToSkip is not in the collection."
+
+    | newDict |
+    newDict := self class new:order size - 1.
+    self associationsDo: [:assoc | anAssociation = assoc ifFalse: [newDict add: assoc]]
+!
+
+postCopy
+    "have to copy the order too"
+
+    super postCopy.
+    order := order copy
+! !
+
+!OrderedDictionary methodsFor:'enumerating'!
+
+associationsCollect: aBlock 
+    "Evaluate aBlock with each of the associations of the dictionary as argument,
+     and return a new (ordered) collection with the results"
+
+    ^ order collect:[:key | (aBlock value: (self associationAt:key))].
+!
+
+associationsDo: aBlock 
+    "Evaluate aBlock for each of the dictionary's associations."
+
+    order do: [:key | aBlock value: (self associationAt: key)]
+!
+
+associationsDo: aBlock from: firstIndex to: secondIndex 
+    "Evaluate aBlock with each of the dictionary's associations from index 
+    firstIndex to index secondIndex as the argument."
+
+    firstIndex to: secondIndex do: [:index | 
+        aBlock value: (self associationAt: (order at: index))
+    ]
+!
+
+associationsReverseDo: aBlock 
+    "Evaluate aBlock for each of the dictionary's associations in reverse order."
+
+    order reverseDo:[:key | aBlock value:(self associationAt:key)]
+
+    "Created: 28.2.1997 / 15:52:31 / cg"
+!
+
+associationsSelect:aBlock 
+    "Evaluate aBlock with each of the dictionary's associations as the argument.
+     Collect into a new OrderedDictionary only those associations for which 
+     aBlock evaluates to true. Return the new OrderedDictionary."
+
+    |newDict|
+
+    newDict := self class new.
+    order do:[:key | 
+        |assoc|
+
+        assoc := self associationAt:key.
+        (aBlock value:assoc) ifTrue: [
+            newDict add:assoc
+        ]
+    ].
+    ^ newDict
+!
+
+collect: aBlock 
+    "Evaluate aBlock with each of the values of the dictionary as argument,
+     and return a new (ordered) collection with the results"
+
+    ^ order collect:[:key | (aBlock value: (self at:key))].
+!
+
+do: aBlock 
+    "Evaluate aBlock for each of the dictionary's values."
+
+    order do: [:key | aBlock value: (self at: key)]
+!
+
+do: aBlock from: firstIndex to: lastIndex 
+    "Evaluate aBlock with each of the dictionary's associations from index 
+    firstIndex to index secondIndex as the argument."
+
+    self from:firstIndex to:lastIndex do:aBlock.
+!
+
+findFirst:aBlock ifNone:exceptionalValue
+    "Return the index of the first association in the dictionary for which aBlock
+    evaluates as true. If the block does not evaluate to true, return exceptionalValue"
+
+    1 to:order size do:[:index | 
+        (aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index]
+    ].
+    ^ exceptionalValue value
+!
+
+findLast:aBlock 
+    "Return the index of the last association in the dictionary for which aBlock
+     evaluates as true. If the block does not evaluate to true, return 0"
+
+    order size to:1 by:-1 do: [:index | 
+        (aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index]
+    ].
+    ^ 0
+!
+
+findLast:aBlock startingAt:startIndex
+    "Return the index of the last association in the dictionary for which aBlock
+     evaluates as true. Start the search at startIndex.
+     If the block does not evaluate to true, return 0"
+
+    startIndex to:1 by:-1 do: [:index | 
+        (aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index]
+    ].
+    ^ 0
+!
+
+findLast:aBlock startingAt:startIndex endingAt:endIndex
+    "Return the index of the last association in the dictionary for which aBlock
+     evaluates as true. Start the search at startIndex.
+     End the search at endIndex or when an element is found.
+     If the block does not evaluate to true, return 0"
+
+    startIndex to:endIndex by:-1 do: [:index | 
+        (aBlock value:(self associationAt:(order at:index))) ifTrue: [^ index]
+    ].
+    ^ 0
+!
+
+from:firstIndex to:lastIndex do: aBlock
+    "Evaluate aBlock with each of the dictionary's associations from index 
+    firstIndex to index secondIndex as the argument."
+
+    order from:firstIndex to:lastIndex do:[:key |
+        aBlock value: (self at:key)
+    ].
+!
+
+keysAndValuesDo:aBlock
+    "perform the block for all keys in the collection.
+
+     See also:
+        #associationsDo:   (which passes key-value associations)
+        #keysAndValuesDo:  (which passes keys & values separately)
+        #do:               (which passes values only)
+
+     WARNING: do not add/remove elements while iterating over the receiver.
+              Iterate over a copy to do this."
+
+    order do: [:key | aBlock value:key value:(self at: key)].
+
+    "Modified: / 26.6.1999 / 10:55:30 / ps"
+    "Created: / 15.10.1999 / 16:49:31 / cg"
+    "Modified: / 15.10.1999 / 16:53:50 / cg"
+!
+
+keysDo:aBlock
+    "evaluate the argument, aBlock for every key in the collection.
+
+     See also:
+        #associationsDo:   (which passes key-value associations)
+        #keysAndValuesDo:  (which passes keys & values separately)
+        #do:               (which passes values only)
+
+     WARNING: do not add/remove elements while iterating over the receiver.
+              Iterate over a copy to do this."
+
+    order do:[:key | aBlock value:key].
+
+    "Created: / 26-06-1999 / 10:53:00 / ps"
+    "Modified: / 24-08-2010 / 10:14:06 / cg"
+!
+
+reverseDo: aBlock 
+    "Evaluate aBlock with each of the dictionary's associations as the argument,
+    starting with the last element and taking each in sequence up to the first."
+
+    order size to:1 by:-1 do: [:index | 
+        aBlock value:(self associationAt:(order at:index))
+    ]
+!
+
+reversed
+    "Return with a new OrderedDictionary with its associations in reverse order."
+
+    | newDict|
+
+    newDict := self class new.
+    order size to:1 by:-1 do:[:index | 
+        |key|
+
+        key := order at:index.
+        newDict at:key put:(self at:key)
+    ].
+    ^ newDict
+!
+
+select:aBlock 
+    "Evaluate aBlock with each of the dictionary's values as the argument.
+     Collect into a new OrderedDictionary only those associations for which 
+     aBlock evaluated to true. Return the new OrderedDictionary."
+
+    |newColl|
+
+    newColl := self species new.
+    order do:[:key | 
+        |assoc|
+
+        assoc := self associationAt:key.
+        (aBlock value:(assoc value)) ifTrue: [
+            newColl add:assoc
+        ]
+    ].
+    ^ newColl
+! !
+
+!OrderedDictionary methodsFor:'initialization'!
+
+initializeOrder
+        order := OrderedCollection new
+! !
+
+!OrderedDictionary methodsFor:'private'!
+
+removeFromOrder: aKey 
+	order remove: aKey ifAbsent: []
+! !
+
+!OrderedDictionary methodsFor:'queries'!
+
+occurrencesOfKey: aKey 
+    "Return how many of the dictionary's keys are equal to aKey."
+
+    ^ order count:[:eachKey | aKey = eachKey]
+
+"/ cg: the original code was not very smalltalkish:
+"/
+"/    | count |
+"/
+"/    count := 0.
+"/    1 to: self size do: [:index | aKey = (order at: index) ifTrue: [count := count + 1]].
+"/    ^count
+!
+
+occurrencesOfValue: aValue 
+    "Return how many of the dictionary's values are equal to aValue."
+
+    ^ order count:[:eachKey | aValue = (self at:eachKey)]
+
+"/ cg: the original code was not very smalltalkish:
+"/
+"/    | count |
+"/
+"/    count := 0.
+"/    1 to: self size do: [:index | 
+"/        aValue = (self at: (order at: index)) ifTrue: [count := count + 1]].
+"/    ^count
+! !
+
+!OrderedDictionary methodsFor:'removing'!
+
+removeFirst
+    |key|
+
+    order size == 0 ifTrue:[
+	"error if collection is empty"
+
+	^ self emptyCollectionError.
+    ].
+    key := order removeFirst.
+    ^ super removeKey:key.
+!
+
+removeFromIndex:fromIndex toIndex:toIndex
+    "Returns the receiver."
+
+    | keys |
+
+    keys := order copyFrom:fromIndex to:toIndex.
+    order removeFromIndex:fromIndex toIndex:toIndex.
+    keys do:[ :key |
+        super removeKey:key.
+    ].
+
+    "Created: 28.9.1995 / 12:04:33 / stefan"
+!
+
+removeKey:aKey
+    order remove:aKey.
+    ^ super removeKey:aKey.
+!
+
+removeKey:aKey ifAbsent:aBlock
+    order remove:aKey ifAbsent:[].
+    ^ super removeKey:aKey ifAbsent:aBlock.
+
+    "Created: / 31-01-2011 / 22:04:01 / cg"
+!
+
+removeLast
+    |key|
+
+    order size == 0 ifTrue:[
+	"error if collection is empty"
+
+	^ self emptyCollectionError.
+    ].
+    key := order removeLast.
+    ^ super removeKey:key.
+! !
+
+!OrderedDictionary methodsFor:'searching'!
+
+identityIndexOfAssociation: anAssociation 
+    "Return the identity index of anAssociation within the receiver. If the receiver
+    does not contain anAssociation, return 0."
+
+    ^ self identityIndexOfAssociation: anAssociation ifAbsent: [0]
+!
+
+identityIndexOfAssociation: anAssociation ifAbsent: exceptionBlock 
+    "Return the identity index of anAssociation within the receiver. 
+     If the receiver does not contain anAssociation, 
+     return the result of evaluating the exceptionBlock."
+
+    "/ as ST/X's dictionaries do not store the associations 
+    "/ (instead, they store the keys and values in separate collections)
+    "/ this will not work. You have to think about it and rewrite your code.
+    self error:'this does not work in Smalltalk/X'.
+
+    order keysAndValuesDo:[:i :key |
+        (self associationAt:key) == anAssociation ifTrue: [^i]
+    ].
+    ^exceptionBlock value
+!
+
+identityIndexOfKey: aKey 
+    "Return the identity index of aKey within the receiver. If the receiver 
+    does not contain aKey, return 0."
+
+    ^self identityIndexOfKey: aKey ifAbsent: [0]
+!
+
+identityIndexOfKey: aKey ifAbsent: exceptionBlock 
+    "Return the identity index of aKey within the receiver.  If the receiver does
+    not contain aKey, return the result of evaluating the exceptionBlock."
+
+    ^ order identityIndexOf:aKey ifAbsent:exceptionBlock
+!
+
+identityIndexOfValue: aValue 
+    "Return the identity index of aValue within the receiver. If the receiver 
+    does not contain aValue, return 0."
+
+    ^self identityIndexOfValue: aValue ifAbsent: [0]
+!
+
+identityIndexOfValue: aValue ifAbsent: exceptionBlock 
+    "Return the identity index of aValue within the receiver. If the receiver 
+    does not contain aValue, return the result of evaluating the exceptionBlock."
+
+    order keysAndValuesDo:[:i :key | (self at:key) == aValue ifTrue: [^i]].
+    ^exceptionBlock value
+!
+
+indexOfAssociation: anAssociation 
+    "Return the index of anAssociation within the receiver. If the receiver does
+    not contain anAssociation, return 0."
+
+    ^self indexOfAssociation: anAssociation ifAbsent: [0]
+!
+
+indexOfAssociation: anAssociation ifAbsent: exceptionBlock 
+    "Return the identity index of anAssociation within the receiver. If the receiver
+    does not contain anAssociation, return the result of evaluating the exceptionBlock."
+
+    order keysAndValuesDo:[:i :key | 
+        (self associationAt:key) = anAssociation ifTrue: [^i]
+    ].
+    ^exceptionBlock value
+!
+
+indexOfKey: aKey 
+    "Return the index of aKey within the receiver. If the receiver does 
+     not contain aKey, return 0."
+
+    ^self indexOfKey: aKey ifAbsent: [0]
+!
+
+indexOfKey: aKey ifAbsent: exceptionBlock 
+    "Return the identity index of aKey within the receiver.  If the receiver does
+     not contain aKey, return the result of evaluating the exceptionBlock."
+
+    ^ order indexOf:aKey ifAbsent:exceptionBlock
+!
+
+indexOfValue: aValue 
+    "Return the index of aValue within the receiver. 
+     If the receiver does not contain aValue, return 0."
+
+    ^self indexOfValue: aValue ifAbsent: [0]
+!
+
+indexOfValue: aValue ifAbsent: exceptionBlock 
+    "Return the identity index of aValue within the receiver. 
+     If the receiver does not contain aValue, return the result of evaluating the exceptionBlock."
+
+    order keysAndValuesDo:[:i :key | (self at:key) = aValue ifTrue: [^i]].
+    ^ exceptionBlock value
+!
+
+nextIndexOfAssociation: aAssociation from: startIndex to: stopIndex 
+    "Return the next index of aAssociation within the receiver between startIndex
+     and stopIndex. If the receiver does not contain aAssociation, return nil"
+
+    startIndex to: stopIndex do: [:i | 
+        (self associationAt: (order at: i)) = aAssociation ifTrue: [^i]].
+    ^nil
+!
+
+nextIndexOfKey: aKey from: startIndex to: stopIndex 
+    "Return the next index of aKey within the receiver between startIndex and 
+     stopIndex.  If the receiver does not contain aKey, return nil"
+
+    startIndex to: stopIndex do: [:i | 
+        (order at: i) = aKey ifTrue: [^i]].
+    ^nil
+!
+
+nextIndexOfValue: aValue from: startIndex to: stopIndex 
+    "Return the next index of aValue within the receiver between startIndex and
+     stopIndex. If the receiver does not contain aValue, return nil"
+
+    startIndex to: stopIndex do: [:i | 
+        (self at: (order at: i)) = aValue ifTrue: [^i]].
+    ^nil
+!
+
+prevIndexOfAssociation: aAssociation from: startIndex to: stopIndex 
+    "Return the previous index of aAssociation within the receiver between 
+     startIndex  and stopIndex working backwards through the receiver. 
+     If the receiver does not contain aAssociation, return nil"
+
+    startIndex to: stopIndex by: -1
+            do: [:i | (self associationAt: (order at: i)) = aAssociation ifTrue: [^i]].
+    ^nil
+!
+
+prevIndexOfKey: aKey from: startIndex to: stopIndex 
+    "Return the previous index of aKey within the receiver between startIndex and
+     stopIndex working backwards through the receiver. 
+     If the receiver does not contain aKey, return nil"
+
+    startIndex to: stopIndex by: -1
+            do: [:i | (order at: i) = aKey ifTrue: [^i]].
+    ^nil
+!
+
+prevIndexOfValue: aValue from: startIndex to: stopIndex 
+    "Return the previous index of aValue within the receiver between startIndex
+     and stopIndex working backwards through the receiver. 
+     If the receiver does not contain aValue, return nil"
+
+    startIndex to: stopIndex by: -1
+            do: [:i | 
+                (self at: (order at: i)) = aValue ifTrue: [^i]].
+    ^nil
+! !
+
+!OrderedDictionary methodsFor:'sorting & reordering'!
+
+reverse
+    "Destructively reverse my order.
+     WARNING: this is a destructive operation, which modifies the receiver.
+              Please use reversed (with a d) for a functional version."
+
+    order reverse
+!
+
+sort
+    "Destructively sort my order.
+     WARNING: this is a destructive operation, which modifies the receiver"
+
+    order sort
+!
+
+sort:aSortBlock
+    "Destructively sort my order.
+     WARNING: this is a destructive operation, which modifies the receiver"
+
+    order sort:aSortBlock
+! !
+
+!OrderedDictionary class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic/OrderedDictionary.st,v 1.40 2013-04-25 07:18:43 stefan Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic/OrderedDictionary.st,v 1.40 2013-04-25 07:18:43 stefan Exp $'
+! !
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/OrderedSet.st	Thu Apr 25 11:30:13 2013 +0100
@@ -0,0 +1,427 @@
+"
+ COPYRIGHT (c) 2001 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+"{ Package: 'stx:libbasic' }"
+
+Set subclass:#OrderedSet
+	instanceVariableNames:'order'
+	classVariableNames:''
+	poolDictionaries:''
+	category:'Collections-Sequenceable'
+!
+
+!OrderedSet class methodsFor:'documentation'!
+
+copyright
+"
+ COPYRIGHT (c) 2001 by eXept Software AG
+              All Rights Reserved
+
+ This software is furnished under a license and may be used
+ only in accordance with the terms of that license and with the
+ inclusion of the above copyright notice.   This software may not
+ be provided or otherwise made available to, or used by, any
+ other person.  No title to or ownership of the software is
+ hereby transferred.
+"
+!
+
+documentation
+"
+    I am a subclass of Set whose elements are ordered in a
+    similar fashion to OrderedCollection.
+    That is, I have both Set behavior (only keeping a single instance of
+    an element) but I also remember the original order, in which elements
+    were added.
+
+    I have one additional instance variable:
+
+    order <OrderedCollection>       Ordered collection of values reflecting the order 
+                                    in the set. 
+
+    [author:]
+        Claus Gittinger
+
+    [see also:]
+        OrderedCollection 
+        Dictionary OrderedDictionary
+        Set Bag
+"
+!
+
+examples
+"
+                                                                    [exBegin]
+        |s|
+
+        s := OrderedSet new.
+        s add:'one'.
+        s add:'two'.
+        s add:'one'.
+        s add:'two'.
+        s add:'three'.
+        s size.         
+        s do:[:each | Transcript showCR:each].         
+                                                                    [exEnd]
+
+
+                                                                    [exBegin]
+        |s|
+
+        s := OrderedSet new.
+        s add:'one'.
+        s add:'two'.
+        s add:'one'.
+        s add:'two'.
+        s add:'three'.
+        s remove:'one'.
+        s size.         
+        s do:[:each | Transcript showCR:each].         
+                                                                    [exEnd]
+
+                                                                    [exBegin]
+        |s|
+
+        s := OrderedSet new.
+        s add:'one'.
+        s addFirst:'two'.
+        s addFirst:'three'.
+        s add:'one'.
+        s add:'two'.
+        s add:'three'.
+        s size.         
+        s do:[:each | Transcript showCR:each].         
+                                                                    [exEnd]
+"
+! !
+
+!OrderedSet class methodsFor:'instance creation'!
+
+new
+        ^super new initializeOrder
+
+    "Created: / 16.11.2001 / 10:10:37 / cg"
+!
+
+new: anInteger
+        ^(super new: anInteger) initializeOrder
+
+    "Created: / 16.11.2001 / 10:10:07 / cg"
+! !
+
+!OrderedSet methodsFor:'accessing'!
+
+at:index
+    "return the indexed instance variable with index, anInteger.
+     Report an error, if the index is wrong."
+
+    ^ order at:index
+
+    "Modified: / 16.11.2001 / 10:27:40 / cg"
+!
+
+at:index ifAbsent:exceptionalValue
+    "return the indexed instance variable with index, anInteger.
+     If not present, return the value from exceptionalValue."
+
+    ^ order at:index ifAbsent:exceptionalValue
+
+    "Modified: / 16.11.2001 / 10:27:40 / cg"
+!
+
+order
+    "returns the values in the order of their appearance"
+
+    ^ order
+
+    "
+     |s|
+
+     s := OrderedSet new.
+     s add:'aaa'; add:'bbb'; add:'ccc'; add:'ddd'; add:'aaa'.
+     s order
+    "
+! !
+
+!OrderedSet methodsFor:'adding & removing'!
+
+add:anObject 
+    "Add anObject to the receiver (if not already included). 
+     Also, remember in the order (i.e. add to the end)
+     If anAssociation is already present in the dictionary,
+     the order will not be changed. (See also: #addLast:)"
+
+    (super testAndAdd:anObject) ifFalse:[
+        order add:anObject.
+    ].
+    ^ anObject
+
+    "
+        self new 
+                add:1;
+                add:2;
+                add:nil;
+                add:1;
+                yourself
+    "
+!
+
+addFirst:anObject 
+    "Add anObject to the receiver (if not already included). 
+     Also, remember in the order (i.e. add to the beginning)"
+
+    |oldObject|
+
+    (self includes:anObject) ifTrue:[
+        "/ must either remove the old one from both and add the new one to both,
+        "/ or ensure that the old one is also in the order.
+        "/ otherwise, the constraint that the object in the set and the one in the order
+        "/ must be identical could be broken.
+        oldObject := order remove:anObject.
+    ] ifFalse:[
+        oldObject := super add:anObject.
+    ].
+    order addFirst:oldObject.
+    ^ anObject
+
+    "
+        self new 
+                addFirst:1;
+                addFirst:nil;
+                yourself
+    "
+!
+
+addLast:anObject 
+    "Add anObject to the receiver (if not already included). 
+     Also, remember in the order (i.e. add to the end)
+     If anAssociation is already present in the receiver,
+     it will be moved to the end. (See also: #add:)"
+
+    |oldObject|
+
+    (self includes:anObject) ifTrue:[
+        oldObject := order remove:anObject.
+    ] ifFalse:[
+        oldObject := super add:anObject.
+    ].
+    order add:oldObject.
+    ^ anObject
+
+    "
+        self new 
+                addLast:1;
+                addLast:nil;
+                yourself
+    "
+!
+
+remove:oldObject ifAbsent:exceptionValueProvider
+    "remove oldObject from the collection and return it.
+     If it was not in the collection return the value of exceptionValueProvider.
+
+     WARNING: do not remove elements while iterating over the receiver."
+
+    |removedObject|
+
+    removedObject := super remove:oldObject 
+                           ifAbsent:[ ^ exceptionValueProvider value].      
+    order removeIdentical:removedObject.
+
+    ^ removedObject
+
+    "
+        OrderedSet new remove:nil
+    "
+
+    "Modified: / 16.11.2001 / 10:21:07 / cg"
+!
+
+removeAll
+    "remove all elements from the receiver. Returns the receiver."
+
+    super removeAll.
+    self initializeOrder.
+
+    "Created: / 16.11.2001 / 10:21:40 / cg"
+!
+
+removeFirst
+    "remove the first object from the collection and return it.
+     If it was not in the collection, raise an error.
+
+     WARNING: do not remove elements while iterating over the receiver."
+
+    ^ self removeFirstIfAbsent:[self emptyCollectionError].
+!
+
+removeFirstIfAbsent:exceptionalValue
+    "remove the first object from the collection and return it.
+     If it was not in the collection, return the value from exceptionalValue.
+
+     WARNING: do not remove elements while iterating over the receiver."
+
+    |element|
+
+    order isEmpty ifTrue:[^ exceptionalValue value].
+    element := order first.
+    ^ self remove:element.
+!
+
+removeLast
+    "remove the last object from the collection and return it.
+     If it was not in the collection, raise an error.
+
+     WARNING: do not remove elements while iterating over the receiver."
+
+    ^ self removeLastIfAbsent:[self emptyCollectionError].
+!
+
+removeLastIfAbsent:exceptionalValue
+    "remove the last object from the collection and return it.
+     If it was not in the collection, return the value from exceptionalValue.
+
+     WARNING: do not remove elements while iterating over the receiver."
+
+    |lastElement|
+
+    order isEmpty ifTrue:[^ exceptionalValue value].
+    lastElement := order last.
+    ^ self remove:lastElement.
+!
+
+saveRemove:oldObject ifAbsent:exceptionValueProvider
+    "remove the element, oldObject from the collection.
+     Return the element 
+     (could be non-identical to oldObject, since I hash on equality, not on identity).
+     If it was not in the collection return the value of exceptionValueProvider.
+
+     In contrast to #remove:, this does not resize the underlying collection
+     and therefore does NOT rehash & change the elements order.
+     Therefor this can be used while enumerating the receiver,
+     which is not possible if #remove: is used.
+
+     WARNING: since no resizing is done, the physical amount of memory used
+              by the container remains the same, although the logical size shrinks.
+              You may want to manually resize the receiver using #emptyCheck.
+              (after the loop)"
+
+    |removedObject|
+
+    removedObject := super saveRemove:oldObject ifAbsent:[^ exceptionValueProvider value].
+    order removeIdentical:removedObject.
+
+    ^ removedObject
+
+    "Created: / 16.11.2001 / 10:23:48 / cg"
+    "Modified: / 16.11.2001 / 10:24:03 / cg"
+!
+
+testAndAdd:anObject 
+    "add the argument, anObject to the receiver.
+     Answer true, if the element did already exist in the collection,
+     false otherwise.
+     Also, remember in the order (i.e. add to the end)
+     If anObject is already present in the set,
+     the order will not be changed. (See also: #addLast:)"
+
+    (super testAndAdd:anObject) ifFalse:[
+        order add:anObject.
+        ^ false.
+    ].
+    ^ true
+! !
+
+!OrderedSet methodsFor:'converting'!
+
+asNewOrderedSet
+    "make sure to return a unique new set"
+
+    "could be an instance of a subclass..."
+    self class == OrderedSet ifTrue:[
+        ^ self copy
+    ].
+    ^ super asOrderedSet
+!
+
+asOrderedSet
+    "make sure to return a unique new set"
+
+    "could be an instance of a subclass..."
+    self class == OrderedSet ifTrue:[
+        ^ self.
+    ].
+    ^ super asOrderedSet
+! !
+
+!OrderedSet methodsFor:'copying'!
+
+postCopy
+    "have to copy the keyArray too"
+
+    super postCopy.
+    order := order copy.
+
+    "Created: / 16.11.2001 / 10:28:50 / cg"
+! !
+
+!OrderedSet methodsFor:'enumerating'!
+
+do:aBlock 
+    "Evaluate aBlock for each of the sets's values
+     in the order they have been added."
+
+    order do:aBlock
+
+    "Modified: / 16.11.2001 / 10:04:00 / cg"
+!
+
+doWithIndex:aBlock 
+    "Squeak/V'Age compatibility; 
+     Evaluate aBlock for each of the sets's values and index
+     in the order they have been added."
+
+    order doWithIndex:aBlock
+
+    "Created: / 09-11-2010 / 16:09:17 / cg"
+!
+
+reverseDo:aBlock 
+    "Evaluate aBlock for each of the sets's values
+     in the reverse order they have been added."
+
+    order reverseDo:aBlock
+! !
+
+!OrderedSet methodsFor:'initialization'!
+
+initializeOrder
+    order := OrderedCollection new
+
+    "Created: / 16.11.2001 / 10:06:05 / cg"
+! !
+
+!OrderedSet methodsFor:'searching'!
+
+indexOf:anObject
+    ^ order indexOf:anObject.
+! !
+
+!OrderedSet class methodsFor:'documentation'!
+
+version
+    ^ '$Header: /cvs/stx/stx/libbasic/OrderedSet.st,v 1.24 2013-04-25 07:32:44 stefan Exp $'
+!
+
+version_CVS
+    ^ '$Header: /cvs/stx/stx/libbasic/OrderedSet.st,v 1.24 2013-04-25 07:32:44 stefan Exp $'
+! !
+
--- a/SmallInteger.st	Thu Apr 25 10:49:32 2013 +0100
+++ b/SmallInteger.st	Thu Apr 25 11:30:13 2013 +0100
@@ -802,6 +802,7 @@
 ! !
 
 
+
 !SmallInteger methodsFor:'bit operators'!
 
 bitAnd:anInteger
@@ -1133,27 +1134,27 @@
 clearBit:anInteger
     "return a new integer where the specified bit is off.
      Bits are counted from 1 starting with the least significant.
-     The methods name may be missleading: the receiver is not changed,
+     The methods name may be misleading: the receiver is not changed,
      but a new number is returned. Should be named #withBitCleared:"
 
 %{  /* NOCONTEXT */
 
     if (__isSmallInteger(anInteger)) {
-	int index = __intVal(anInteger);
-
-	if (index > 0) {
+        int index = __intVal(anInteger);
+
+        if (index > 0) {
 #if __POINTER_SIZE__ == 8
-	    if (index <= 62)
+            if (index <= 62)
 #else
-	    if (index <= 30)
+            if (index <= 30)
 #endif
-	    {
-		INT mask = __MASKSMALLINT(1 << (index-1));
-
-		RETURN ( ((OBJ) ((INT)self & ~(INT)mask)) );
-	    }
-	    RETURN (self);  /* nothing to do ... */
-	}
+            {
+                INT mask = __MASKSMALLINT(1 << (index-1));
+
+                RETURN ( ((OBJ) ((INT)self & ~(INT)mask)) );
+            }
+            RETURN (self);  /* nothing to do ... */
+        }
     }
 %}.
     ^ super clearBit:anInteger
@@ -1282,26 +1283,26 @@
 invertBit:anInteger
     "return a new number where the specified bit is inverted.
      Bits are counted from 1 starting with the least significant.
-     The methods name may be missleading: the receiver is not changed,
+     The methods name may be misleading: the receiver is not changed,
      but a new number is returned. Should be named #withBitInverted:"
 
 %{  /* NOCONTEXT */
 
     if (__isSmallInteger(anInteger)) {
-	int index = __intVal(anInteger);
-
-	if (index > 0) {
+        int index = __intVal(anInteger);
+
+        if (index > 0) {
 #if __POINTER_SIZE__ == 8
-	    if (index <= 62)
+            if (index <= 62)
 #else
-	    if (index <= 30)
+            if (index <= 30)
 #endif
-	    {
-		INT mask = __MASKSMALLINT(1 << (index-1));
-
-		RETURN ( ((OBJ) ((INT)self ^ (INT)mask)) );
-	    }
-	}
+            {
+                INT mask = __MASKSMALLINT(1 << (index-1));
+
+                RETURN ( ((OBJ) ((INT)self ^ (INT)mask)) );
+            }
+        }
     }
 %}.
     ^ super invertBit:anInteger
@@ -1318,8 +1319,6 @@
      (16r0 invertBit:33) hexPrintString
      (16r0 invertBit:100) hexPrintString
     "
-
-
 !
 
 lowBit
@@ -1503,26 +1502,26 @@
 setBit:anInteger
     "return a new integer where the specified bit is on.
      Bits are counted from 1 starting with the least significant.
-     The methods name may be missleading: the receiver is not changed,
+     The methods name may be misleading: the receiver is not changed,
      but a new number is returned. Should be named #withBitSet:"
 
 %{  /* NOCONTEXT */
 
     if (__isSmallInteger(anInteger)) {
-	int index = __intVal(anInteger);
-
-	if (index > 0) {
+        int index = __intVal(anInteger);
+
+        if (index > 0) {
 #if __POINTER_SIZE__ == 8
-	    if (index <= 62)
+            if (index <= 62)
 #else
-	    if (index <= 30)
+            if (index <= 30)
 #endif
-	    {
-		INT mask = __MASKSMALLINT(1 << (index-1));
-
-		RETURN ( ((OBJ) ((INT)self | (INT)mask)) );
-	    }
-	}
+            {
+                INT mask = __MASKSMALLINT(1 << (index-1));
+
+                RETURN ( ((OBJ) ((INT)self | (INT)mask)) );
+            }
+        }
     }
 %}.
     ^ super setBit:anInteger
@@ -4188,10 +4187,10 @@
 !SmallInteger class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.203 2013-04-15 13:07:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.204 2013-04-25 07:02:27 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.203 2013-04-15 13:07:21 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/SmallInteger.st,v 1.204 2013-04-25 07:02:27 stefan Exp $'
 ! !
 
--- a/UnixOperatingSystem.st	Thu Apr 25 10:49:32 2013 +0100
+++ b/UnixOperatingSystem.st	Thu Apr 25 11:30:13 2013 +0100
@@ -12,56 +12,56 @@
 "{ Package: 'stx:libbasic' }"
 
 AbstractOperatingSystem subclass:#UnixOperatingSystem
-    instanceVariableNames: ''
-    classVariableNames: 'HostName DomainName SlowFork ForkFailed CurrentDirectory
+	instanceVariableNames:''
+	classVariableNames:'HostName DomainName SlowFork ForkFailed CurrentDirectory
 		LastTimeInfo LastTimeInfoSeconds LastTimeInfoMilliseconds
 		LastTimeInfoIsLocal CachedMountPoints CacheMountPointsTimeStamp
 		Codeset CodesetEncoder'
-    poolDictionaries: ''
-    category: 'OS-Unix'
+	poolDictionaries:''
+	category:'OS-Unix'
 !
 
 Object subclass:#FileDescriptorHandle
-    instanceVariableNames: 'fd'
-    classVariableNames: 'OpenFiles'
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	instanceVariableNames:'fd'
+	classVariableNames:'OpenFiles'
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 OSFileHandle subclass:#FilePointerHandle
-    instanceVariableNames: ''
-    classVariableNames: ''
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	instanceVariableNames:''
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 Object subclass:#FileStatusInfo
-    instanceVariableNames: 'type mode uid gid size id accessed modified statusChanged path
+	instanceVariableNames:'type mode uid gid size id accessed modified statusChanged path
 		numLinks'
-    classVariableNames: ''
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 Object subclass:#MountInfo
-    instanceVariableNames: 'mountPointPath deviceOrRemotePath fsType attributeString'
-    classVariableNames: ''
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	instanceVariableNames:'mountPointPath deviceOrRemotePath fsType attributeString'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 Object subclass:#OSProcessStatus
-    instanceVariableNames: 'pid status code core'
-    classVariableNames: ''
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	instanceVariableNames:'pid status code core'
+	classVariableNames:''
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 UnixOperatingSystem::FileDescriptorHandle subclass:#SocketHandle
-    instanceVariableNames: ''
-    classVariableNames: 'ProtocolCache'
-    poolDictionaries: ''
-    privateIn: UnixOperatingSystem
+	instanceVariableNames:''
+	classVariableNames:'ProtocolCache'
+	poolDictionaries:''
+	privateIn:UnixOperatingSystem
 !
 
 !UnixOperatingSystem primitiveDefinitions!
@@ -528,6 +528,341 @@
 %}
 ! !
 
+!UnixOperatingSystem primitiveFunctions!
+%{
+
+/*
+ * some systems' system() is broken in that it does not correctly
+ * handle EINTR and returns failure even though it actually succeeded.
+ * (LINUX is one of them)
+ * Here is a fixed version. If you encounter EINTR returns from
+ * UnixOperatingSystem>>executeCommand, you ought to define WANT_SYSTEM
+ * in the xxxIntern.h file to get this fixed version.
+ *
+ * As an added BONUS, this system() enables interrupts while waiting
+ * for the child which enables other threads to continue.
+ * (i.e. it is RT safe)
+ */
+
+#if defined(WANT_SYSTEM)
+
+/* # define DPRINTF(x)     printf x */
+# define DPRINTF(x)     /* nothing */
+
+# ifndef _STDDEF_H_INCLUDED_
+#  include <stddef.h>
+#  define _STDDEF_H_INCLUDED_
+# endif
+
+# ifndef _STDLIB_H_INCLUDED_
+#  include <stdlib.h>
+#  define _STDLIB_H_INCLUDED_
+# endif
+
+# ifndef _UNISTD_H_INCLUDED_
+#  include <unistd.h>
+#  define _UNISTD_H_INCLUDED_
+# endif
+
+# ifndef _SYS_WAIT_H_INCLUDED
+#  include <sys/wait.h>
+#  define _SYS_WAIT_H_INCLUDED
+# endif
+
+# ifndef _SIGNAL_H_INCLUDED_
+#  include <signal.h>
+#  define _SIGNAL_H_INCLUDED_
+# endif
+
+# ifndef _SYS_TYPES_H_INCLUDED_
+#  include <sys/types.h>
+#  define _SYS_TYPES_H_INCLUDED_
+# endif
+
+# if (!defined(HAVE_GNU_LD) && !defined (__ELF__)) || !defined(LINUX)
+#  define       __environ       environ
+#  if 1 /* !defined(LINUX) */
+#   define      __sigemptyset   sigemptyset
+#   define      __sigaction     sigaction
+#   define      __sigaddset     sigaddset
+#   define      __sigprocmask   sigprocmask
+#   define      __execve        execve
+#   define      __wait          wait
+#   define      __waitpid       waitpid
+#  endif /* ! LINUX */
+// #  ifndef __osx__
+    extern char **environ;
+// #  endif
+# endif
+
+# define      __sigprocmask   sigprocmask
+# define      __execve        execve
+
+# define        SHELL_PATH      "/bin/sh"       /* Path of the shell.  */
+# define        SHELL_NAME      "sh"            /* Name to give it.  */
+
+
+static int
+mySystem(line)
+    register CONST char *line;
+{
+    int status, save;
+    pid_t pid;
+    struct sigaction sa, intr, quit;
+    sigset_t block, omask;
+
+    if (line == NULL)
+	return -1;
+
+    sa.sa_handler = SIG_IGN;
+    sa.sa_flags = 0;
+    __sigemptyset (&sa.sa_mask);
+
+    if (__sigaction (SIGINT, &sa, &intr) < 0) {
+	DPRINTF(("1: errno=%d\n", errno));
+	return -1;
+    }
+    if (__sigaction (SIGQUIT, &sa, &quit) < 0) {
+	save = errno;
+	(void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
+	errno = save;
+	DPRINTF(("2: errno=%d\n", errno));
+	return -1;
+    }
+
+    __sigemptyset (&block);
+    __sigaddset (&block, SIGCHLD);
+    save = errno;
+    if (__sigprocmask(SIG_BLOCK, &block, &omask) < 0) {
+	if (errno == ENOSYS)
+	    errno = save;
+	else {
+	    save = errno;
+	    (void) __sigaction(SIGINT, &intr, (struct sigaction *) NULL);
+	    (void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
+	    errno = save;
+	    DPRINTF(("3: errno=%d\n", errno));
+	    return -1;
+	}
+    }
+
+    pid = FORK ();
+    if (pid == (pid_t) 0) {
+	/* Child side.  */
+	CONST char *new_argv[4];
+	new_argv[0] = SHELL_NAME;
+	new_argv[1] = "-c";
+	new_argv[2] = line;
+	new_argv[3] = NULL;
+
+	/* Restore the signals.  */
+	(void) __sigaction (SIGINT, &intr, (struct sigaction *) NULL);
+	(void) __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL);
+	(void) __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL);
+
+	/* Exec the shell.  */
+	(void) __execve (SHELL_PATH, (char *CONST *) new_argv, __environ);
+	_exit (127);
+    } else {
+	if (pid < (pid_t) 0) {
+	    /* The fork failed.  */
+	    DPRINTF(("4: errno=%d\n", errno));
+	    status = -1;
+	} else {
+	    /* Parent side.  */
+#ifdef  NO_WAITPID
+	    pid_t child;
+
+	    do {
+		__BEGIN_INTERRUPTABLE__
+		child = __wait (&status);
+		__END_INTERRUPTABLE__
+		if (child < 0 && errno != EINTR) {
+		    DPRINTF(("5: errno=%d\n", errno));
+		    status = -1;
+		    break;
+		}
+	    } while (child != pid);
+#else
+	    pid_t child;
+
+	    /* claus: the original did not care for EINTR here ... */
+	    do {
+		__BEGIN_INTERRUPTABLE__
+		child = __waitpid (pid, &status, 0);
+		__END_INTERRUPTABLE__
+	    } while ((child != pid) && (errno == EINTR));
+	    if (child != pid) {
+		DPRINTF(("6: errno=%d\n", errno));
+		status = -1;
+	    }
+#endif /* NO_WAITPID */
+	}
+    }
+    save = errno;
+    if ((__sigaction (SIGINT, &intr, (struct sigaction *) NULL)
+     | __sigaction (SIGQUIT, &quit, (struct sigaction *) NULL)
+     | __sigprocmask (SIG_SETMASK, &omask, (sigset_t *) NULL)) != 0) {
+	if (errno == ENOSYS) {
+	    errno = save;
+	} else {
+	    status = -1;
+	    DPRINTF(("7: errno=%d\n", errno));
+	}
+    }
+
+    return status;
+}
+#else
+# define __wait wait
+#endif /* WANT_SYSTEM */
+
+
+/*
+ * some systems do not have realpath();
+ * the alternative of reading from a 'pwp'-pipe
+ * is way too slow. Here is a realpath for the rest of us.
+ * define WANT_REALPATH in the xxxIntern-file to get it.
+ */
+
+#if defined(HAS_REALPATH)
+# undef WANT_REALPATH
+#endif
+#if !defined(HAS_GETWD) && !defined(HAS_GETCWD)
+# undef WANT_REALPATH
+#endif
+
+#if defined(WANT_REALPATH)
+
+# ifndef NULL
+#  define NULL (char *)0
+# endif
+
+# define MAX_READLINKS 32
+
+# ifndef MAXPATHLEN
+#  define MAXPATHLEN     1024
+# endif
+
+static
+char *
+realpath(path, resolved_path)
+    char *path;
+    char resolved_path [];
+{
+	char copy_path[MAXPATHLEN];
+	char link_path[MAXPATHLEN];
+	char *new_path = resolved_path;
+	char *max_path;
+	int readlinks = 0;
+	int n;
+
+	/* Make a copy of the source path since we may need to modify it. */
+	strcpy(copy_path, path);
+	path = copy_path;
+	max_path = copy_path + MAXPATHLEN - 2;
+	/* If it's a relative pathname use getwd for starters. */
+	if (*path != '/') {
+#ifdef HAS_GETCWD
+		new_path = getcwd(new_path, MAXPATHLEN - 1);
+#else
+		new_path = getwd(new_path);
+#endif
+		if (new_path == NULL)
+		    return(NULL);
+
+		new_path += strlen(new_path);
+		if (new_path[-1] != '/')
+			*new_path++ = '/';
+	}
+	else {
+		*new_path++ = '/';
+		path++;
+	}
+	/* Expand each slash-separated pathname component. */
+	while (*path != '\0') {
+		/* Ignore stray "/". */
+		if (*path == '/') {
+			path++;
+			continue;
+		}
+		if (*path == '.') {
+			/* Ignore ".". */
+			if (path[1] == '\0' || path[1] == '/') {
+				path++;
+				continue;
+			}
+			if (path[1] == '.') {
+				if (path[2] == '\0' || path[2] == '/') {
+					path += 2;
+					/* Ignore ".." at root. */
+					if (new_path == resolved_path + 1)
+						continue;
+					/* Handle ".." by backing up. */
+					while ((--new_path)[-1] != '/')
+						;
+					continue;
+				}
+			}
+		}
+		/* Safely copy the next pathname component. */
+		while (*path != '\0' && *path != '/') {
+			if (path > max_path) {
+				errno = ENAMETOOLONG;
+				return NULL;
+			}
+			*new_path++ = *path++;
+		}
+#ifdef S_IFLNK
+		/* Protect against infinite loops. */
+		if (readlinks++ > MAX_READLINKS) {
+			errno = ELOOP;
+			return NULL;
+		}
+		/* See if latest pathname component is a symlink. */
+		*new_path = '\0';
+		n = readlink(resolved_path, link_path, MAXPATHLEN - 1);
+		if (n < 0) {
+			/* EINVAL means the file exists but isn't a symlink. */
+			if (errno != EINVAL)
+				return NULL;
+		}
+		else {
+			/* Note: readlink doesn't add the null byte. */
+			link_path[n] = '\0';
+			if (*link_path == '/')
+				/* Start over for an absolute symlink. */
+				new_path = resolved_path;
+			else
+				/* Otherwise back up over this component. */
+				while (*(--new_path) != '/')
+					;
+			/* Safe sex check. */
+			if (strlen(path) + n >= MAXPATHLEN) {
+				errno = ENAMETOOLONG;
+				return NULL;
+			}
+			/* Insert symlink contents into path. */
+			strcat(link_path, path);
+			strcpy(copy_path, link_path);
+			path = copy_path;
+		}
+#endif /* S_IFLNK */
+		*new_path++ = '/';
+	}
+	/* Delete trailing slash but don't whomp a lone slash. */
+	if (new_path != resolved_path + 1 && new_path[-1] == '/')
+		new_path--;
+	/* Make sure it's null terminated. */
+	*new_path = '\0';
+	return resolved_path;
+}
+# define HAS_REALPATH
+#endif /* WANT_REALPATH && not HAS_REALPATH */
+
+%}
+! !
+
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 copyright
@@ -648,7 +983,6 @@
 "
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'initialization'!
 
 initialize
@@ -689,7 +1023,6 @@
     "Modified: / 11.12.1998 / 16:22:48 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'OS signal constants'!
 
 sigABRT
@@ -1421,7 +1754,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'error messages'!
 
 currentErrorNumber
@@ -2496,7 +2828,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'executing OS commands-implementation'!
 
 exec:aCommandPathArg withArguments:argColl environment:environmentDictionary
@@ -2568,7 +2899,7 @@
 %{  /* STACK: 16000 */
     char **argv;
     int nargs, i, id;
-    OBJ arg; 
+    OBJ arg;
 #ifdef __osx__
     char **environ = _NSGetEnviron();
 #else
@@ -2941,7 +3272,6 @@
     "Created: / 12.11.1998 / 14:39:20 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'executing OS commands-queries'!
 
 commandAndArgsForOSCommand:aCommandString
@@ -3039,7 +3369,6 @@
     "Modified: / 5.6.1998 / 19:03:32 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'file access'!
 
 closeFd:anInteger
@@ -3567,7 +3896,6 @@
     ^ self primitiveFailed
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'file access rights'!
 
 accessMaskFor:aSymbol
@@ -3710,7 +4038,6 @@
     ^ self primitiveFailed
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'file locking'!
 
 lockFD:aFileDescriptor shared:isSharedReadLock blocking:blockIfLocked
@@ -3937,7 +4264,6 @@
     ^ false
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'file queries'!
 
 caseSensitiveFilenames
@@ -4449,18 +4775,18 @@
 
     if (__isStringLike(encodedPathName)) {
 # ifdef TRACE_STAT_CALLS
-	printf("stat on '%s' for isValidPath\n", __stringVal(encodedPathName));
-# endif
-	__BEGIN_INTERRUPTABLE__
-	do {
-	    ret = stat((char *) __stringVal(encodedPathName), &buf);
-	} while ((ret < 0) && (errno == EINTR));
-	__END_INTERRUPTABLE__
-	if (ret < 0) {
-	    @global(LastErrorNumber) = __mkSmallInteger(errno);
-	    RETURN (false);
-	}
-	RETURN ( ret ? false : true );
+        printf("stat on '%s' for isValidPath\n", __stringVal(encodedPathName));
+# endif
+        __BEGIN_INTERRUPTABLE__
+        do {
+            ret = stat((char *) __stringVal(encodedPathName), &buf);
+        } while ((ret < 0) && (errno == EINTR));
+        __END_INTERRUPTABLE__
+        if (ret < 0) {
+            @global(LastErrorNumber) = __mkSmallInteger(errno);
+            RETURN (false);
+        }
+        RETURN ( ret ? false : true );
     }
 %}.
     ^ self primitiveFailed
@@ -5015,7 +5341,6 @@
     "Modified: / 5.6.1998 / 18:38:11 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'interrupts & signals'!
 
 defaultSignal:signalNumber
@@ -5715,7 +6040,6 @@
     "Modified: / 27.1.1998 / 20:05:59 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'ipc support'!
 
 makeBidirectionalPipe
@@ -6018,7 +6342,6 @@
     self primitiveFailed
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'misc'!
 
 closeLeftOverFiles
@@ -6099,7 +6422,6 @@
     "Modified: 22.4.1996 / 13:13:09 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'os queries'!
 
 executableFileExtensions
@@ -6215,7 +6537,7 @@
 
     |resultArray error dict sz "{ Class: SmallInteger }"|
 
-%{ 
+%{
 #ifdef __osx__
     char **environ = _NSGetEnviron();
 #else
@@ -7011,8 +7333,8 @@
     ].
 
     "we prefer OrderedDictionary here, because we want to keep the 
-     order as defined in the OS. But OrderedDictionary is in libbasic2."
-    retDictionary := OrderedDictionary ? Dictionary new:noOfIf.
+     order as defined in the OS."
+    retDictionary := OrderedDictionary new:noOfIf.
     1 to:noOfIf do:[:cnt|
         |macAddress|
         
@@ -8234,7 +8556,6 @@
 
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'path queries'!
 
 decodePath:encodedPathName
@@ -8364,7 +8685,6 @@
     "Created: / 12.6.1998 / 16:30:43 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'shared memory access'!
 
 shmAttach:id address:addr flags:flags
@@ -8447,7 +8767,6 @@
     "Modified: 22.4.1996 / 13:14:46 / cg"
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'socket creation'!
 
 socketAccessor
@@ -8464,7 +8783,6 @@
     ^ SocketHandle new domain:domainArg type:typeArg protocol:protocolArg
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'time and date'!
 
 computeOSTimeFromUTCYear:y month:m day:d hour:h minute:min second:s millisecond:millis
@@ -8907,7 +9225,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'users & groups'!
 
 getEffectiveGroupID
@@ -9278,7 +9595,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'waiting for events'!
 
 blockingChildProcessWait
@@ -9997,7 +10313,6 @@
     ^ self primitiveFailed
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle class methodsFor:'change & update'!
 
 update:aspect with:argument from:anObject
@@ -10017,7 +10332,6 @@
     "Created: 30.9.1997 / 12:57:35 / stefan"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle class methodsFor:'initialization'!
 
 initialize
@@ -10032,7 +10346,6 @@
     "Modified: 30.9.1997 / 12:40:55 / stefan"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle class methodsFor:'instance creation'!
 
 for:aFileDescriptor
@@ -10043,7 +10356,6 @@
     "Created: 30.9.1997 / 14:00:00 / stefan"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'error handling'!
 
 error:anErrorSymbolOrErrno
@@ -10056,7 +10368,6 @@
     self primitiveFailed:anErrorSymbolOrErrno.
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'file access'!
 
 close
@@ -10071,7 +10382,6 @@
     "Modified: 30.9.1997 / 13:06:55 / stefan"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'initialization'!
 
 for:aFileDescriptor
@@ -10097,7 +10407,6 @@
     "Modified (comment): / 16-03-2013 / 00:04:56 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'input/output'!
 
 readBytes:count into:aByteBuffer startingAt:firstIndex
@@ -10372,7 +10681,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'misc functions'!
 
 nextError
@@ -10529,7 +10837,6 @@
 
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'private-accessing'!
 
 fileDescriptor
@@ -10556,7 +10863,6 @@
 
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'queries'!
 
 canReadWithoutBlocking
@@ -10672,7 +10978,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'registering'!
 
 register
@@ -10705,7 +11010,6 @@
     "Modified (comment): / 16-03-2013 / 00:04:38 / Jan Vrany <jan.vrany@fit.cvut.cz>"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'releasing'!
 
 invalidate
@@ -10718,7 +11022,6 @@
     "Modified: 30.9.1997 / 12:42:16 / stefan"
 ! !
 
-
 !UnixOperatingSystem::FileDescriptorHandle methodsFor:'waiting'!
 
 readWaitWithTimeoutMs:timeout
@@ -10787,7 +11090,6 @@
     ^ canWrite not
 ! !
 
-
 !UnixOperatingSystem::FilePointerHandle methodsFor:'release'!
 
 closeFile
@@ -10804,7 +11106,6 @@
 
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo class methodsFor:'instance creation'!
 
 type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP numLinks:nL
@@ -10812,7 +11113,6 @@
 	type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP numLinks:nL
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'accessing'!
 
 accessTime
@@ -10903,7 +11203,6 @@
     ^ uid
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'accessing-vms'!
 
 fixedHeaderSize
@@ -10936,7 +11235,6 @@
     ^ nil
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'backward compatibility'!
 
 accessed
@@ -10968,7 +11266,6 @@
     ^ self statusChangeTime
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'private-accessing'!
 
 type:t mode:m uid:u gid:g size:s id:i accessed:aT modified:mT statusChanged:sT path:lP numLinks:nL
@@ -10985,7 +11282,6 @@
     numLinks := nL.
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'queries-access'!
 
 isGroupExecutable
@@ -11060,7 +11356,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::FileStatusInfo methodsFor:'queries-type'!
 
 isBlockSpecial
@@ -11095,7 +11390,6 @@
     ^ type == #unknown
 ! !
 
-
 !UnixOperatingSystem::MountInfo methodsFor:'accessing'!
 
 mountPointPath
@@ -11113,7 +11407,6 @@
     attributeString := attributeStringArg.
 ! !
 
-
 !UnixOperatingSystem::MountInfo methodsFor:'printing'!
 
 printOn:aStream
@@ -11122,14 +11415,12 @@
 	nextPutAll:mountPointPath.
 ! !
 
-
 !UnixOperatingSystem::MountInfo methodsFor:'queries'!
 
 isRemote
     ^ fsType = 'nfs'
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus class methodsFor:'documentation'!
 
 documentation
@@ -11156,7 +11447,6 @@
 "
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus class methodsFor:'instance creation'!
 
 pid:pid status:status code:code core:core
@@ -11177,7 +11467,6 @@
     "Modified: 30.4.1996 / 18:25:05 / cg"
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus methodsFor:'accessing'!
 
 code
@@ -11216,7 +11505,6 @@
     "Modified: 30.4.1996 / 18:26:54 / cg"
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus methodsFor:'initialization'!
 
 pid:newPid status:newStatus code:newCode core:newCore
@@ -11228,7 +11516,6 @@
     "Created: 28.12.1995 / 14:18:22 / stefan"
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus methodsFor:'printing & storing'!
 
 printOn:aStream
@@ -11240,7 +11527,6 @@
     aStream nextPut:$).
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus methodsFor:'private-OS interface'!
 
 code:something
@@ -11276,7 +11562,6 @@
     "Created: 28.12.1995 / 14:05:07 / stefan"
 ! !
 
-
 !UnixOperatingSystem::OSProcessStatus methodsFor:'queries'!
 
 couldNotExecute
@@ -11305,7 +11590,6 @@
     "Modified: 28.12.1995 / 14:13:41 / stefan"
 ! !
 
-
 !UnixOperatingSystem::SocketHandle class methodsFor:'constants'!
 
 protocolCodeOf:aNameOrNumber
@@ -11397,7 +11681,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::SocketHandle class methodsFor:'initialization'!
 
 reinitialize
@@ -11406,7 +11689,6 @@
     ProtocolCache := nil.
 ! !
 
-
 !UnixOperatingSystem::SocketHandle class methodsFor:'queries'!
 
 XXgetAddressInfo:hostName serviceName:serviceNameArg domain:domainArg type:typeArg protocol:protoArg flags:flags
@@ -12407,7 +12689,6 @@
     ^ result.
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'accepting'!
 
 acceptWithPeerAddressBuffer:peerOrNil
@@ -12481,7 +12762,6 @@
     ^ self class for:newFd
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'binding'!
 
 bindTo:socketAddress
@@ -12536,7 +12816,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'connecting'!
 
 cancelConnect
@@ -12659,7 +12938,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'datagram transmission'!
 
 receiveFrom:socketAddress buffer:aDataBuffer start:startIndex for:nBytes flags:flags
@@ -12896,7 +13174,6 @@
     ^ self error:error.
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'initialization'!
 
 domain:domainArg type:typeArg protocol:protocolArg
@@ -12982,7 +13259,6 @@
     "
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'misc'!
 
 getOptionsLevel:level name:name
@@ -13174,7 +13450,6 @@
     ^ nil.
 ! !
 
-
 !UnixOperatingSystem::SocketHandle methodsFor:'queries'!
 
 getNameInto:socketAddress
@@ -13252,15 +13527,14 @@
     ^ nil
 ! !
 
-
 !UnixOperatingSystem class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.309 2013-04-22 15:51:25 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.312 2013-04-25 09:23:16 stefan Exp $'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.309 2013-04-22 15:51:25 stefan Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/UnixOperatingSystem.st,v 1.312 2013-04-25 09:23:16 stefan Exp $'
 !
 
 version_HG
@@ -13269,5 +13543,5 @@
 ! !
 
 
+UnixOperatingSystem initialize!
 UnixOperatingSystem::FileDescriptorHandle initialize!
-UnixOperatingSystem initialize!
--- a/abbrev.stc	Thu Apr 25 10:49:32 2013 +0100
+++ b/abbrev.stc	Thu Apr 25 11:30:13 2013 +0100
@@ -72,7 +72,6 @@
 Magnitude Magnitude stx:libbasic 'Magnitude-General' 0
 MappedExternalBytes MappedExternalBytes stx:libbasic 'System-Support' 0
 Message Message stx:libbasic 'Kernel-Methods' 0
-MethodOverrideTests MethodOverrideTests stx:libbasic '* as yet unknown category *' 0
 MiniDebugger MiniDebugger stx:libbasic 'System-Debugging-Support' 0
 MiniInspector MiniInspector stx:libbasic 'System-Debugging-Support' 0
 MiniLogger MiniLogger stx:libbasic 'System-Debugging-Support' 0
@@ -198,7 +197,7 @@
 Complex Complex stx:libbasic 'Magnitude-Numbers' 0
 ControlRequest ControlRequest stx:libbasic 'Kernel-Exceptions-Control' 1
 Dictionary Dictionary stx:libbasic 'Collections-Unordered' 0
-EncodedStream EncodedStream stx:libbasic 'Collections-Text-Encodings' 0
+EncodedStream EncodedStream stx:libbasic 'Streams-Misc' 0
 EndOfStreamNotification EndOfStreamNotification stx:libbasic 'Kernel-Exceptions-Errors' 1
 Error Error stx:libbasic 'Kernel-Exceptions-Errors' 1
 ExternalFunctionCallback ExternalFunctionCallback stx:libbasic 'System-Support' 0
@@ -394,3 +393,6 @@
 AbstractClassInstantiationError AbstractClassInstantiationError stx:libbasic 'Kernel-Exceptions-ExecutionErrors' 1
 InvalidTypeError InvalidTypeError stx:libbasic 'Kernel-Exceptions-ExecutionErrors' 1
 OSXOperatingSystem OSXOperatingSystem stx:libbasic 'OS-Unix' 0
+MethodOverrideTests MethodOverrideTests stx:libbasic '* as yet unknown category *' 0
+OrderedDictionary OrderedDictionary stx:libbasic 'Collections-Sequenceable' 0
+OrderedSet OrderedSet stx:libbasic 'Collections-Sequenceable' 0
--- a/bc.mak	Thu Apr 25 10:49:32 2013 +0100
+++ b/bc.mak	Thu Apr 25 11:30:13 2013 +0100
@@ -1,4 +1,4 @@
-# $Header: /cvs/stx/stx/libbasic/bc.mak,v 1.196 2013-03-19 13:32:03 stefan Exp $
+# $Header: /cvs/stx/stx/libbasic/bc.mak,v 1.198 2013-04-25 07:36:55 stefan Exp $
 #
 # DO NOT EDIT
 # automagically generated from the projectDefinition: stx_libbasic.
@@ -55,10 +55,6 @@
 prereq:
 
 
-# build all packages containing referenced classes for this package
-# they are nor needed to compile the package
-references:
-
 
 
 
@@ -213,6 +209,7 @@
 $(OUTDIR)OSFileHandle.$(O) OSFileHandle.$(H): OSFileHandle.st $(INCLUDE_TOP)\stx\libbasic\OSHandle.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalAddress.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)ObjectCoder.$(O) ObjectCoder.$(H): ObjectCoder.st $(INCLUDE_TOP)\stx\libbasic\AspectVisitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Visitor.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)OrderedCollection.$(O) OrderedCollection.$(H): OrderedCollection.st $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)OrderedSet.$(O) OrderedSet.$(H): OrderedSet.st $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Point.$(O) Point.$(H): Point.st $(INCLUDE_TOP)\stx\libbasic\ArithmeticValue.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)PositionableStream.$(O) PositionableStream.$(H): PositionableStream.st $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Query.$(O) Query.$(H): Query.st $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -222,6 +219,7 @@
 $(OUTDIR)Time.$(O) Time.$(H): Time.st $(INCLUDE_TOP)\stx\libbasic\AbstractTime.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)TimeoutNotification.$(O) TimeoutNotification.$(H): TimeoutNotification.st $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Timestamp.$(O) Timestamp.$(H): Timestamp.st $(INCLUDE_TOP)\stx\libbasic\AbstractTime.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)UserConfirmation.$(O) UserConfirmation.$(H): UserConfirmation.st $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)UserInterrupt.$(O) UserInterrupt.$(H): UserInterrupt.st $(INCLUDE_TOP)\stx\libbasic\ControlInterrupt.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)UserNotification.$(O) UserNotification.$(H): UserNotification.st $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)YesToAllConfirmation.$(O) YesToAllConfirmation.$(H): YesToAllConfirmation.st $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -251,6 +249,7 @@
 $(OUTDIR)MetaNumber.$(O) MetaNumber.$(H): MetaNumber.st $(INCLUDE_TOP)\stx\libbasic\Number.$(H) $(INCLUDE_TOP)\stx\libbasic\ArithmeticValue.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)Metaclass.$(O) Metaclass.$(H): Metaclass.st $(INCLUDE_TOP)\stx\libbasic\ClassDescription.$(H) $(INCLUDE_TOP)\stx\libbasic\Behavior.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)MethodWithBreakpoints.$(O) MethodWithBreakpoints.$(H): MethodWithBreakpoints.st $(INCLUDE_TOP)\stx\libbasic\Method.$(H) $(INCLUDE_TOP)\stx\libbasic\CompiledCode.$(H) $(INCLUDE_TOP)\stx\libbasic\ExecutableFunction.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)OrderedDictionary.$(O) OrderedDictionary.$(H): OrderedDictionary.st $(INCLUDE_TOP)\stx\libbasic\Dictionary.$(H) $(INCLUDE_TOP)\stx\libbasic\Set.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)OsError.$(O) OsError.$(H): OsError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)PluginSupport.$(O) PluginSupport.$(H): PluginSupport.st $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\Query.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(STCHDR)
 $(OUTDIR)ProceedableError.$(O) ProceedableError.$(H): ProceedableError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -267,7 +266,6 @@
 $(OUTDIR)StringCollection.$(O) StringCollection.$(H): StringCollection.st $(INCLUDE_TOP)\stx\libbasic\OrderedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)TerminateProcessRequest.$(O) TerminateProcessRequest.$(H): TerminateProcessRequest.st $(INCLUDE_TOP)\stx\libbasic\ControlRequest.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)UninterpretedBytes.$(O) UninterpretedBytes.$(H): UninterpretedBytes.st $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
-$(OUTDIR)UserConfirmation.$(O) UserConfirmation.$(H): UserConfirmation.st $(INCLUDE_TOP)\stx\libbasic\UserNotification.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)UserInformation.$(O) UserInformation.$(H): UserInformation.st $(INCLUDE_TOP)\stx\libbasic\UserNotification.$(H) $(INCLUDE_TOP)\stx\libbasic\Notification.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)UtcTimestamp.$(O) UtcTimestamp.$(H): UtcTimestamp.st $(INCLUDE_TOP)\stx\libbasic\Timestamp.$(H) $(INCLUDE_TOP)\stx\libbasic\AbstractTime.$(H) $(INCLUDE_TOP)\stx\libbasic\Magnitude.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)VMInternalError.$(O) VMInternalError.$(H): VMInternalError.st $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
@@ -390,11 +388,11 @@
 $(OUTDIR)DirectoryStream.$(O) DirectoryStream.$(H): DirectoryStream.st $(INCLUDE_TOP)\stx\libbasic\FileStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ReadWriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PositionableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)InvalidEncodingError.$(O) InvalidEncodingError.$(H): InvalidEncodingError.st $(INCLUDE_TOP)\stx\libbasic\DecodingError.$(H) $(INCLUDE_TOP)\stx\libbasic\CharacterEncoderError.$(H) $(INCLUDE_TOP)\stx\libbasic\ConversionError.$(H) $(INCLUDE_TOP)\stx\libbasic\ProceedableError.$(H) $(INCLUDE_TOP)\stx\libbasic\Error.$(H) $(INCLUDE_TOP)\stx\libbasic\Exception.$(H) $(INCLUDE_TOP)\stx\libbasic\GenericException.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
 $(OUTDIR)PipeStream.$(O) PipeStream.$(H): PipeStream.st $(INCLUDE_TOP)\stx\libbasic\NonPositionableExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalStream.$(H) $(INCLUDE_TOP)\stx\libbasic\ReadWriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\WriteStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PositionableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\PeekableStream.$(H) $(INCLUDE_TOP)\stx\libbasic\Stream.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Win32Constants.$(O) Win32Constants.$(H): Win32Constants.st $(INCLUDE_TOP)\stx\libbasic\SharedPool.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Win32Handle.$(O) Win32Handle.$(H): Win32Handle.st $(INCLUDE_TOP)\stx\libbasic\OSHandle.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalAddress.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(STCHDR)
+$(OUTDIR)Win32OperatingSystem.$(O) Win32OperatingSystem.$(H): Win32OperatingSystem.st $(INCLUDE_TOP)\stx\libbasic\Win32Constants.$(H) $(INCLUDE_TOP)\stx\libbasic\AbstractOperatingSystem.$(H) $(INCLUDE_TOP)\stx\libbasic\Object.$(H) $(INCLUDE_TOP)\stx\libbasic\OSHandle.$(H) $(INCLUDE_TOP)\stx\libbasic\ExternalAddress.$(H) $(INCLUDE_TOP)\stx\libbasic\ByteArray.$(H) $(INCLUDE_TOP)\stx\libbasic\UninterpretedBytes.$(H) $(INCLUDE_TOP)\stx\libbasic\ArrayedCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\SequenceableCollection.$(H) $(INCLUDE_TOP)\stx\libbasic\Collection.$(H) $(INCLUDE_TOP)\stx\libbasic\Win32Handle.$(H) $(STCHDR)
 $(OUTDIR)PCFilename.$(O) PCFilename.$(H): PCFilename.st $(STCHDR)
-$(OUTDIR)Win32Constants.$(O) Win32Constants.$(H): Win32Constants.st $(STCHDR)
 $(OUTDIR)Win32FILEHandle.$(O) Win32FILEHandle.$(H): Win32FILEHandle.st $(STCHDR)
-$(OUTDIR)Win32Handle.$(O) Win32Handle.$(H): Win32Handle.st $(STCHDR)
-$(OUTDIR)Win32OperatingSystem.$(O) Win32OperatingSystem.$(H): Win32OperatingSystem.st $(STCHDR)
 $(OUTDIR)Win32Process.$(O) Win32Process.$(H): Win32Process.st $(STCHDR)
 
 # ENDMAKEDEPEND --- do not remove this line
--- a/libInit.cc	Thu Apr 25 10:49:32 2013 +0100
+++ b/libInit.cc	Thu Apr 25 11:30:13 2013 +0100
@@ -1,5 +1,5 @@
 /*
- * $Header: /cvs/stx/stx/libbasic/libInit.cc,v 1.188 2013-03-19 13:32:14 stefan Exp $
+ * $Header: /cvs/stx/stx/libbasic/libInit.cc,v 1.190 2013-04-25 07:37:04 stefan Exp $
  *
  * DO NOT EDIT
  * automagically generated from the projectDefinition: stx_libbasic.
@@ -173,6 +173,7 @@
 _OSFileHandle_Init(pass,__pRT__,snd);
 _ObjectCoder_Init(pass,__pRT__,snd);
 _OrderedCollection_Init(pass,__pRT__,snd);
+_OrderedSet_Init(pass,__pRT__,snd);
 _Point_Init(pass,__pRT__,snd);
 _PositionableStream_Init(pass,__pRT__,snd);
 _Query_Init(pass,__pRT__,snd);
@@ -182,6 +183,7 @@
 _Time_Init(pass,__pRT__,snd);
 _TimeoutNotification_Init(pass,__pRT__,snd);
 _Timestamp_Init(pass,__pRT__,snd);
+_UserConfirmation_Init(pass,__pRT__,snd);
 _UserInterrupt_Init(pass,__pRT__,snd);
 _UserNotification_Init(pass,__pRT__,snd);
 _YesToAllConfirmation_Init(pass,__pRT__,snd);
@@ -211,6 +213,7 @@
 _MetaNumber_Init(pass,__pRT__,snd);
 _Metaclass_Init(pass,__pRT__,snd);
 _MethodWithBreakpoints_Init(pass,__pRT__,snd);
+_OrderedDictionary_Init(pass,__pRT__,snd);
 _OsError_Init(pass,__pRT__,snd);
 _PluginSupport_Init(pass,__pRT__,snd);
 _ProceedableError_Init(pass,__pRT__,snd);
@@ -227,7 +230,6 @@
 _StringCollection_Init(pass,__pRT__,snd);
 _TerminateProcessRequest_Init(pass,__pRT__,snd);
 _UninterpretedBytes_Init(pass,__pRT__,snd);
-_UserConfirmation_Init(pass,__pRT__,snd);
 _UserInformation_Init(pass,__pRT__,snd);
 _UtcTimestamp_Init(pass,__pRT__,snd);
 _VMInternalError_Init(pass,__pRT__,snd);
--- a/libbasic.rc	Thu Apr 25 10:49:32 2013 +0100
+++ b/libbasic.rc	Thu Apr 25 11:30:13 2013 +0100
@@ -3,7 +3,7 @@
 // automagically generated from the projectDefinition: stx_libbasic.
 //
 VS_VERSION_INFO VERSIONINFO
-  FILEVERSION     6,2,1,112
+  FILEVERSION     6,2,1,115
   PRODUCTVERSION  6,2,3,0
 #if (__BORLANDC__)
   FILEFLAGSMASK   VS_FF_DEBUG | VS_FF_PRERELEASE
@@ -20,12 +20,12 @@
     BEGIN
       VALUE "CompanyName", "eXept Software AG\0"
       VALUE "FileDescription", "Smalltalk/X Basic Classes (LIB)\0"
-      VALUE "FileVersion", "6.2.1.112\0"
+      VALUE "FileVersion", "6.2.1.115\0"
       VALUE "InternalName", "stx:libbasic\0"
       VALUE "LegalCopyright", "Copyright Claus Gittinger 1988-2012\nCopyright eXept Software AG 1998-2013\0"
       VALUE "ProductName", "Smalltalk/X\0"
       VALUE "ProductVersion", "6.2.3.0\0"
-      VALUE "ProductDate", "Tue, 19 Mar 2013 13:31:56 GMT\0"
+      VALUE "ProductDate", "Thu, 25 Apr 2013 07:36:51 GMT\0"
     END
 
   END