Merged with trunk jv
authorJan Vrany <jan.vrany@fit.cvut.cz>
Fri, 04 Dec 2009 20:30:11 +0000
branchjv
changeset 17736 26cfea63471d
parent 17735 6a5bc05f696a
child 17737 0277251e4703
Merged with trunk
ArithmeticValue.st
ClassBuilder.st
ClassDescription.st
Context.st
ExternalLibraryFunction.st
Float.st
FloatArray.st
GenericException.st
Integer.st
Method.st
NameSpace.st
Number.st
Object.st
ProgrammingLanguage.st
ProjectDefinition.st
ProtoObject.st
Semaphore.st
--- a/ArithmeticValue.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ArithmeticValue.st	Fri Dec 04 20:30:11 2009 +0000
@@ -327,6 +327,80 @@
     ^ self / aNumber
 ! !
 
+!ArithmeticValue methodsFor:'arithmetic destructive'!
+
+*= aNumber
+    "Return the product of self multiplied by aNumber.
+     The receiver MAY, but NEED NOT be changed to contain the product.
+     So this method must be used as: 'a := a *= 5'.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self * aNumber
+
+    "Created: / 28.4.1999 / 11:46:11 / stefan"
+    "Modified: / 28.4.1999 / 11:53:28 / stefan"
+!
+
++= aNumber
+    "Return the sum of self and aNumber.
+     The receiver MAY, but NEED NOT be changed to contain the sum.
+     So this method must be used as: 'a := a += 5'.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self + aNumber
+
+    "Created: / 28.4.1999 / 10:13:41 / stefan"
+    "Modified: / 28.4.1999 / 11:54:11 / stefan"
+!
+
+-= aNumber
+    "Return the difference of self and aNumber.
+     The receiver MAY, but NEED NOT be changed to contain the difference.
+     So this method must be used as: 'a := a -= 5'.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self - aNumber
+
+    "Created: / 28.4.1999 / 10:13:58 / stefan"
+    "Modified: / 28.4.1999 / 11:54:37 / stefan"
+!
+
+/= aNumber
+    "Return the quotient of self and aNumber.
+     The receiver MAY, but NEED NOT be changed to contain the quotient.
+     So this method must be used as: 'a := a /= 5'.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self / aNumber
+
+    "Created: / 28.4.1999 / 11:46:22 / stefan"
+    "Modified: / 28.4.1999 / 11:55:06 / stefan"
+!
+
+div2
+    "Return the quotient of self divided by 2.
+     The receiver MAY, but NEED NOT be changed to contain the result.
+     So this method must be used as: 'a := a div2.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self // 2
+
+    "Created: / 28.4.1999 / 10:12:44 / stefan"
+    "Modified: / 28.4.1999 / 11:56:09 / stefan"
+!
+
+mul2
+    "Return the product of self multiplied by 2.
+     The receiver MAY, but NEED NOT be changed to contain the result.
+     So this method must be used as: 'a := a mul2.
+     This method can be redefined for constructed datatypes to do optimisations"
+
+    ^ self * 2
+
+    "Created: / 28.4.1999 / 10:12:55 / stefan"
+    "Modified: / 28.4.1999 / 11:56:38 / stefan"
+! !
+
 !ArithmeticValue methodsFor:'coercing & converting'!
 
 coerce:aNumber
@@ -542,80 +616,6 @@
     ^ self asFloat radiansToDegrees
 ! !
 
-!ArithmeticValue methodsFor:'destructive arithmethic'!
-
-*= aNumber
-    "Return the product of self multiplied by aNumber.
-     The receiver MAY, but NEED NOT be changed to contain the product.
-     So this method must be used as: 'a := a *= 5'.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self * aNumber
-
-    "Created: / 28.4.1999 / 11:46:11 / stefan"
-    "Modified: / 28.4.1999 / 11:53:28 / stefan"
-!
-
-+= aNumber
-    "Return the sum of self and aNumber.
-     The receiver MAY, but NEED NOT be changed to contain the sum.
-     So this method must be used as: 'a := a += 5'.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self + aNumber
-
-    "Created: / 28.4.1999 / 10:13:41 / stefan"
-    "Modified: / 28.4.1999 / 11:54:11 / stefan"
-!
-
--= aNumber
-    "Return the difference of self and aNumber.
-     The receiver MAY, but NEED NOT be changed to contain the difference.
-     So this method must be used as: 'a := a -= 5'.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self - aNumber
-
-    "Created: / 28.4.1999 / 10:13:58 / stefan"
-    "Modified: / 28.4.1999 / 11:54:37 / stefan"
-!
-
-/= aNumber
-    "Return the quotient of self and aNumber.
-     The receiver MAY, but NEED NOT be changed to contain the quotient.
-     So this method must be used as: 'a := a /= 5'.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self / aNumber
-
-    "Created: / 28.4.1999 / 11:46:22 / stefan"
-    "Modified: / 28.4.1999 / 11:55:06 / stefan"
-!
-
-div2
-    "Return the quotient of self divided by 2.
-     The receiver MAY, but NEED NOT be changed to contain the result.
-     So this method must be used as: 'a := a div2.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self // 2
-
-    "Created: / 28.4.1999 / 10:12:44 / stefan"
-    "Modified: / 28.4.1999 / 11:56:09 / stefan"
-!
-
-mul2
-    "Return the product of self multiplied by 2.
-     The receiver MAY, but NEED NOT be changed to contain the result.
-     So this method must be used as: 'a := a mul2.
-     This method can be redefined for constructed datatypes to do optimisations"
-
-    ^ self * 2
-
-    "Created: / 28.4.1999 / 10:12:55 / stefan"
-    "Modified: / 28.4.1999 / 11:56:38 / stefan"
-! !
-
 !ArithmeticValue methodsFor:'double dispatching'!
 
 differenceFromComplex:aComplex
@@ -1284,7 +1284,11 @@
 !ArithmeticValue class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ArithmeticValue.st 10448 2009-06-14 16:10:51Z vranyj1 $'
+    ^ '$Id: ArithmeticValue.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/ArithmeticValue.st,v 1.84 2009/12/01 22:11:48 cg Exp §'
 ! !
 
 ArithmeticValue initialize!
--- a/ClassBuilder.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ClassBuilder.st	Fri Dec 04 20:30:11 2009 +0000
@@ -615,7 +615,7 @@
     ObjectMemory allObjectsDo:[:obj |
         Exception handle:[:ex |
         ] do:[
-            obj isLazyValue ifFalse:[
+            ((obj class isSubclassOf:Object) and:[obj isLazyValue not]) ifTrue:[
                 (obj referencesObject:oldClass) ifTrue:[
                     obj isContext ifFalse:[
                         refs add:obj
@@ -2208,11 +2208,11 @@
 !ClassBuilder class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ClassBuilder.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ClassBuilder.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.86 2009/11/21 21:36:01 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ClassBuilder.st,v 1.87 2009/11/30 16:01:04 cg Exp §'
 ! !
 
 
--- a/ClassDescription.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ClassDescription.st	Fri Dec 04 20:30:11 2009 +0000
@@ -1448,7 +1448,8 @@
         streamType := FileStream.
     ].
 
-    changeFileIsNew := fileName asFilename exists not or:[fileName asFilename fileSize = 0].
+    "/ changeFileIsNew := fileName asFilename exists not or:[fileName asFilename fileSize = 0].
+    changeFileIsNew := (fileName asFilename fileSize ? 0) = 0.
     changeFileIsNew ifTrue:[
         encoder := CharacterEncoder encoderForUTF8.
     ] ifFalse:[
@@ -1900,6 +1901,7 @@
     "Modified: 29.8.1997 / 07:56:49 / cg"
 ! !
 
+
 !ClassDescription methodsFor:'fileIn interface'!
 
 commentStamp:aStamp prior:whatever
@@ -4101,11 +4103,11 @@
 !ClassDescription class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ClassDescription.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ClassDescription.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.210 2009/10/02 15:23:39 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ClassDescription.st,v 1.211 2009/12/02 22:15:24 cg Exp §'
 ! !
 
 ClassDescription initialize!
--- a/Context.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Context.st	Fri Dec 04 20:30:11 2009 +0000
@@ -270,6 +270,14 @@
     ^ c findSpecialHandle:searchForHandle raise:searchForRaise
 ! !
 
+!Context methodsFor:'Compatibility-Squeak'!
+
+longStack
+    ^ String streamContents:[:s |
+            self fullPrintAllOn:s
+    ]
+! !
+
 !Context methodsFor:'Compatibility-VW'!
 
 resumeWith:value
@@ -2339,7 +2347,11 @@
 !Context class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Context.st 10447 2009-06-14 13:09:55Z vranyj1 $'
+    ^ '$Id: Context.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/Context.st,v 1.153 2009/12/01 20:04:26 cg Exp §'
 ! !
 
 Context initialize!
--- a/ExternalLibraryFunction.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ExternalLibraryFunction.st	Fri Dec 04 20:30:11 2009 +0000
@@ -651,6 +651,9 @@
         ^ aType typeSymbol.
     ].
 
+    (aType endsWith:'*') ifTrue:[
+        ^ #pointer.
+    ].
     (aType endsWith:'Pointer') ifTrue:[
         ^ #pointer.
     ].
@@ -708,7 +711,9 @@
 
 invokeFFIwithArguments:argumentsOrNil forCPPInstance:aCPlusPlusObjectOrNil
     |argTypeSymbols returnTypeSymbol failureCode failureInfo returnValue stClass vtOffset
-     virtual async unlimitedStack callTypeNumber returnValueClass argValueClass|
+     virtual async unlimitedStack callTypeNumber returnValueClass argValueClass
+     oldReturnType oldArgumentTypes
+    |
 
     argTypeSymbols := argumentTypes.
     returnTypeSymbol := returnType.
@@ -782,6 +787,7 @@
     ffi_abi __callType = FFI_DEFAULT_ABI;
     VOIDFUNC codeAddress = (VOIDFUNC)__INST(code_);
     int __numArgsWanted;
+
 #   define __FAIL__(fcode) \
     { \
 	failureCode = fcode; goto getOutOfHere; \
@@ -1373,6 +1379,16 @@
 getOutOfHere: ;
 %}.
     failureCode notNil ifTrue:[
+	(failureCode == #UnknownReturnType
+	or:[ failureCode == #UnknownArgumentType ]) ifTrue:[
+	    oldReturnType := returnType.
+	    oldArgumentTypes := argumentTypes.
+	    self adjustTypes.
+	    ((oldReturnType ~= returnType) or:[oldArgumentTypes ~= argumentTypes]) ifTrue:[
+		thisContext restart
+	    ].
+	].
+
 	self primitiveFailed.   "see failureCode and failureInfo for details"
 	^ nil
     ].
@@ -1423,11 +1439,11 @@
 !ExternalLibraryFunction class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ExternalLibraryFunction.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ExternalLibraryFunction.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.73 2009/11/05 22:33:27 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ExternalLibraryFunction.st,v 1.74 2009/12/02 16:16:32 cg Exp §'
 ! !
 
 ExternalLibraryFunction initialize!
--- a/Float.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Float.st	Fri Dec 04 20:30:11 2009 +0000
@@ -653,7 +653,6 @@
     ^ 2 "must be careful here, whenever ST/X is used on VAX or a 370"
 ! !
 
-
 !Float methodsFor:'arithmetic'!
 
 * aNumber
@@ -1253,6 +1252,7 @@
     ^ super ~= aNumber
 ! !
 
+
 !Float methodsFor:'mathematical functions'!
 
 exp
@@ -1323,7 +1323,7 @@
 !
 
 log10
-    "return the bavse-10 logarithm of myself.
+    "return the base-10 logarithm of myself.
      Raises an exception, if the receiver is less or equal to zero."
 
 %{  /* NOCONTEXT */
@@ -1337,26 +1337,26 @@
     if (val > 0.0)
 #endif
     {
-	__threadErrno = 0;
-	rslt = log10(val);
-	if (! isnan(rslt))  /* Currently all our systems support isnan() */
-	{
-	    if (__threadErrno == 0) {
-		__qMKFLOAT(newFloat, rslt);
-		RETURN ( newFloat );
-	    }
-	}
+        __threadErrno = 0;
+        rslt = log10(val);
+        if (! isnan(rslt))  /* Currently all our systems support isnan() */
+        {
+            if (__threadErrno == 0) {
+                __qMKFLOAT(newFloat, rslt);
+                RETURN ( newFloat );
+            }
+        }
     }
 %}.
     "
      an invalid value for logarithm
     "
     ^ self class
-	raise:#domainErrorSignal
-	receiver:self
-	selector:#log10
-	arguments:#()
-	errorString:'bad receiver in log10'
+        raise:#domainErrorSignal
+        receiver:self
+        selector:#log10
+        arguments:#()
+        errorString:'bad receiver in log10'
 
     "Modified: / 16.11.2001 / 14:14:33 / cg"
 !
@@ -1437,7 +1437,6 @@
     "Modified: / 16.11.2001 / 14:14:43 / cg"
 ! !
 
-
 !Float methodsFor:'printing & storing'!
 
 printString
@@ -1843,7 +1842,6 @@
     "
 ! !
 
-
 !Float methodsFor:'testing'!
 
 isFinite
@@ -2740,11 +2738,11 @@
 !Float class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Float.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: Float.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Float.st,v 1.171 2009/11/05 16:25:22 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Float.st,v 1.172 2009/12/03 10:16:49 cg Exp §'
 ! !
 
 Float initialize!
--- a/FloatArray.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/FloatArray.st	Fri Dec 04 20:30:11 2009 +0000
@@ -64,30 +64,6 @@
     "
 !
 
-*= anObject
-    "multiply the argument into the receiver (destructive).
-     The argument may either be a scalar or another vector"
-
-    ^ anObject isNumber
-                ifTrue:[self primMulScalar: anObject asFloat]
-                ifFalse:[self primMulArray: anObject]
-
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f *= 3.
-     f         
-    "
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f *= #(1 2 3 4) asFloatArray.
-     f     
-    "
-!
-
 + anObject
     "return the sum of the receiver and the argument.
      The argument may either be a scalar or another vector"
@@ -100,30 +76,6 @@
     "
 !
 
-+= anObject
-    "add the argument into the receiver (destructive).
-     The argument may either be a scalar or another vector"
-
-    ^ anObject isNumber
-            ifTrue:[self primAddScalar: anObject asFloat]
-            ifFalse:[self primAddArray: anObject]
-
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f += 3.
-     f         
-    "
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f += #(1 2 3 4) asFloatArray.
-     f      
-    "
-!
-
 - anObject
     "return the difference of the receiver and the argument.
      The argument may either be a scalar or another vector"
@@ -138,32 +90,6 @@
     "Created: / 30-05-2007 / 17:41:46 / cg"
 !
 
--= anObject
-    "subtract the argument from the receiver (destructive).
-     The argument may either be a scalar or another vector"
-
-    ^ anObject isNumber
-            ifTrue:[self primSubtractScalar: anObject asFloat]
-            ifFalse:[self primSubtractArray: anObject]
-
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f -= 3.
-     f         
-    "
-    "
-     |f|
-
-     f := #(1 2 3 4) asFloatArray.
-     f += #(1 2 3 4) asFloatArray.
-     f      
-    "
-
-    "Created: / 30-05-2007 / 17:42:13 / cg"
-!
-
 / anObject
     "return the division of the receiver and the argument.
      The argument may either be a scalar or another vector"
@@ -178,17 +104,6 @@
     "Created: / 30-05-2007 / 17:46:05 / cg"
 !
 
-/= anObject
-    "divide the argument into the receiver (destructive).
-     The argument may either be a scalar or another vector"
-
-    ^ anObject isNumber
-        ifTrue:[self primDivScalar: anObject asFloat]
-        ifFalse:[self primDivArray: anObject]
-
-    "Modified: / 30-05-2007 / 17:45:46 / cg"
-!
-
 abs
     ^ self clone primAbs
 
@@ -581,6 +496,93 @@
     "Created: / 30-05-2007 / 17:43:06 / cg"
 ! !
 
+!FloatArray methodsFor:'arithmetic destructive'!
+
+*= anObject
+    "multiply the argument into the receiver (destructive).
+     The argument may either be a scalar or another vector"
+
+    ^ anObject isNumber
+            ifTrue:[self primMulScalar: anObject asFloat]
+            ifFalse:[self primMulArray: anObject]
+
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f *= 3.
+     f         
+    "
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f *= #(1 2 3 4) asFloatArray.
+     f     
+    "
+!
+
++= anObject
+    "add the argument into the receiver (destructive).
+     The argument may either be a scalar or another vector"
+
+    ^ anObject isNumber
+            ifTrue:[self primAddScalar: anObject asFloat]
+            ifFalse:[self primAddArray: anObject]
+
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f += 3.
+     f         
+    "
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f += #(1 2 3 4) asFloatArray.
+     f      
+    "
+!
+
+-= anObject
+    "subtract the argument from the receiver (destructive).
+     The argument may either be a scalar or another vector"
+
+    ^ anObject isNumber
+            ifTrue:[self primSubtractScalar: anObject asFloat]
+            ifFalse:[self primSubtractArray: anObject]
+
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f -= 3.
+     f         
+    "
+    "
+     |f|
+
+     f := #(1 2 3 4) asFloatArray.
+     f += #(1 2 3 4) asFloatArray.
+     f      
+    "
+
+    "Created: / 30-05-2007 / 17:42:13 / cg"
+!
+
+/= anObject
+    "divide the argument into the receiver (destructive).
+     The argument may either be a scalar or another vector"
+
+    ^ anObject isNumber
+            ifTrue:[self primDivScalar: anObject asFloat]
+            ifFalse:[self primDivArray: anObject]
+
+    "Modified: / 30-05-2007 / 17:45:46 / cg"
+! !
+
 !FloatArray methodsFor:'copying'!
 
 clone
@@ -697,6 +699,8 @@
     "
 ! !
 
+
+
 !FloatArray methodsFor:'queries'!
 
 absMax
@@ -751,8 +755,8 @@
 !
 
 length
-    "Return the length of the receiver 
-     (that is the length of teh vector from 0.0 @ 0.0 @ ... @ 0.0
+    "Return the length of the receiver interpreted as vector 
+     (that is the length of the vector from 0.0 @ 0.0 @ ... @ 0.0
       to the point in the n-dimensional space represented by the receiver)"
 
     ^ self squaredLength sqrt
@@ -929,8 +933,12 @@
     "
 !
 
+numFloats
+    ^ self size
+!
+
 squaredLength
-    "Return the squared length of the receiver"
+    "Return the squared length of the receiver interpreted as vector"
 
     ^ self dot: self
 ! !
@@ -986,5 +994,9 @@
 !FloatArray class methodsFor:'documentation'!
 
 version
-    ^ '$Id: FloatArray.st 10447 2009-06-14 13:09:55Z vranyj1 $'
+    ^ '$Id: FloatArray.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/FloatArray.st,v 1.26 2009/12/01 22:11:19 cg Exp §'
 ! !
--- a/GenericException.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/GenericException.st	Fri Dec 04 20:30:11 2009 +0000
@@ -1140,6 +1140,12 @@
     "
 ! !
 
+!GenericException methodsFor:'Compatibility-Squeak'!
+
+signalerContext
+    ^ self suspendedContext
+! !
+
 !GenericException methodsFor:'accessing'!
 
 catchInDebugger
@@ -2126,11 +2132,11 @@
 !GenericException class methodsFor:'documentation'!
 
 version
-    ^ '$Id: GenericException.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: GenericException.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.123 2009/11/19 11:52:09 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/GenericException.st,v 1.124 2009/12/01 20:03:39 cg Exp §'
 ! !
 
 GenericException initialize!
--- a/Integer.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Integer.st	Fri Dec 04 20:30:11 2009 +0000
@@ -1139,7 +1139,6 @@
     ^ self == Integer
 ! !
 
-
 !Integer methodsFor:'Compatibility-Dolphin'!
 
 & aNumber
@@ -2505,6 +2504,28 @@
 ! !
 
 
+!Integer methodsFor:'iteration'!
+
+to:stop collect:aBlock
+    "syntactic sugar; 
+     same as (self to:stop) collect:aBlock"
+
+    |n a|
+
+    n := stop - self + 1.
+    a := Array new:n.
+    self to:stop do:[:i |
+        a at:(i-self+1) put:(aBlock value:i).
+    ].
+    ^ a.
+
+    "
+     1 to:10 collect:[:i | i squared]
+     10 to:20 collect:[:i | i squared]  
+     (10 to:20) collect:[:i | i squared]
+    "
+! !
+
 !Integer methodsFor:'misc math'!
 
 acker:n
@@ -2917,6 +2938,43 @@
     "Modified: / 3.5.1999 / 14:27:18 / stefan"
 !
 
+integerSqrt
+    "newton's method to get the largest integer which is less or equal to the
+     receiver's square root. 
+     This might be needed for some number theoretic problems with large numbers
+     (ans also in cryptography)"
+
+    |guess prevGuess guessSquared|
+
+    guess := (1 bitShift:(self highBit // 2)).
+
+    [ 
+        prevGuess ~= guess
+        and:[ ((guessSquared := guess squared) - self) abs >= guess ]
+    ] whileTrue:[
+        prevGuess := guess.
+        guess := (guess + (self / guess)) // 2.
+    ].
+    guessSquared > self ifTrue:[
+        guess := guess - 1.
+    ].
+    "/ self assert:(guess squared <= self).
+    "/ self assert:((guess + 1) squared > self).
+
+    ^ guess.
+
+
+    "
+     333 integerSqrt          
+     325 integerSqrt          
+     324 integerSqrt          
+     323 integerSqrt          
+     10239552311579 integerSqrt
+     5397346292805549782720214077673687806275517530364350655459511599582614290 integerSqrt
+     1000 factorial integerSqrt 
+   "
+!
+
 inverseMod:n
     "find the modular inverse for myself to n.
      This is defined as the solution of: '1 = (self * x) mod n.
@@ -3844,7 +3902,6 @@
     "Modified: 15.10.1997 / 18:43:49 / cg"
 ! !
 
-
 !Integer methodsFor:'special access'!
 
 exponent
@@ -4471,11 +4528,11 @@
 !Integer class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Integer.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: Integer.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Integer.st,v 1.235 2009/11/05 16:25:26 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Integer.st,v 1.241 2009/12/03 10:52:55 cg Exp §'
 ! !
 
 Integer initialize!
--- a/Method.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Method.st	Fri Dec 04 20:30:11 2009 +0000
@@ -204,6 +204,7 @@
 ! !
 
 
+
 !Method class methodsFor:'queries'!
 
 isBuiltInClass
@@ -1119,6 +1120,7 @@
     "Modified: 16.1.1997 / 01:27:25 / cg"
 ! !
 
+
 !Method methodsFor:'error handling'!
 
 invalidCodeObject
@@ -2047,6 +2049,9 @@
 isExternalLibraryFunctionCall
     "Return true, if this is an externalLibraryFunction call."
 
+    "/ sigh - for now, stc-compiled code does not have it in the literal array
+    "/ to be fixed...
+
     ^ self externalLibraryFunction notNil
 !
 
@@ -2958,11 +2963,11 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Method.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: Method.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Method.st,v 1.340 2009/11/16 23:14:12 stefan Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Method.st,v 1.341 2009/11/30 16:57:29 cg Exp §'
 ! !
 
 Method initialize!
--- a/NameSpace.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/NameSpace.st	Fri Dec 04 20:30:11 2009 +0000
@@ -280,8 +280,8 @@
 defineNameSpace:nameSymbol private:private imports:imports category:category
     |newNameSpace|
 
-    private ifTrue:[self halt].     "/ what to do ?
-    imports withoutSeparators notEmpty ifTrue:[self halt].     "/ what to do ?
+    private ifTrue:[self shouldImplement].     "/ what to do ?
+    imports withoutSeparators notEmpty ifTrue:[self shouldImplement].     "/ what to do ?
     newNameSpace := NameSpace name:nameSymbol.
     newNameSpace setCategory:category.    
     ^ newNameSpace
@@ -638,6 +638,10 @@
 !NameSpace class methodsFor:'documentation'!
 
 version
-    ^ '$Id: NameSpace.st 10473 2009-10-24 15:48:19Z vranyj1 $'
+    ^ '$Id: NameSpace.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/NameSpace.st,v 1.69 2009/12/03 10:42:57 stefan Exp §'
 ! !
 
--- a/Number.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Number.st	Fri Dec 04 20:30:11 2009 +0000
@@ -399,7 +399,6 @@
     "Modified: / 19.11.1999 / 18:26:47 / cg"
 ! !
 
-
 !Number class methodsFor:'constants'!
 
 decimalPointCharacter 
@@ -544,6 +543,7 @@
      ^ self subclassResponsibility
 ! !
 
+
 !Number class methodsFor:'error reporting'!
 
 raise:aSignalSymbolOrErrorClass receiver:someNumber selector:sel arg:arg errorString:text 
@@ -705,7 +705,6 @@
     ^ self == Number
 ! !
 
-
 !Number methodsFor:'Compatibility-Squeak'!
 
 asSmallAngleDegrees
@@ -829,7 +828,6 @@
     ^ self rounded printString
 ! !
 
-
 !Number methodsFor:'coercing & converting'!
 
 i
@@ -1154,7 +1152,7 @@
 
 log
     "return log base 10 of the receiver.
-     Alias for log10."
+     Alias for log:10."
 
     ^ self log10
 !
@@ -2256,11 +2254,11 @@
 !Number class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Number.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: Number.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Number.st,v 1.127 2009/10/03 11:54:45 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Number.st,v 1.128 2009/12/03 10:16:58 cg Exp §'
 ! !
 
 
--- a/Object.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Object.st	Fri Dec 04 20:30:11 2009 +0000
@@ -478,6 +478,7 @@
     ^ WarningSignal
 ! !
 
+
 !Object class methodsFor:'info messages'!
 
 infoPrinting
@@ -566,6 +567,18 @@
     self becomeSameAs:anotherObject
 !
 
+caseOf:collectionOfKeyValuePairs otherwise:exceptionValue
+    "as this is not compiled inline (for now), this is slow and only present for
+     squeak compatibility"
+
+    collectionOfKeyValuePairs do:[:eachPair |
+        self = eachPair key value ifTrue:[
+            ^ eachPair value value
+        ].
+    ].
+    ^ exceptionValue value
+!
+
 clone
     ^ self shallowCopy
 !
@@ -2649,6 +2662,7 @@
     ^ aCopy
 ! !
 
+
 !Object methodsFor:'debugging'!
 
 assert:aBooleanOrBlock
@@ -7160,6 +7174,7 @@
     ^ self
 ! !
 
+
 !Object methodsFor:'secure message sending'!
 
 askFor:aSelector
@@ -9286,11 +9301,11 @@
 !Object class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Object.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: Object.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/Object.st,v 1.644 2009/10/26 09:34:04 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/Object.st,v 1.645 2009/11/28 00:23:53 cg Exp §'
 ! !
 
 Object initialize!
--- a/ProgrammingLanguage.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ProgrammingLanguage.st	Fri Dec 04 20:30:11 2009 +0000
@@ -130,10 +130,13 @@
 
 !ProgrammingLanguage class methodsFor:'enumerating'!
 
-allDo: aBlock
+allDetect:aBlock ifNone:exceptionValue
+    self allDo:[:each | (aBlock value:each) ifTrue:[^ each]].
+    ^ exceptionValue value
+!
 
-    ^self allSubclassesDo:
-        [:each|aBlock value: each instance]
+allDo: aBlock
+    ^ self allSubclassesDo: [:each | aBlock value: each instance]
 
     "Created: / 16-08-2009 / 14:07:40 / Jan Vrany <vranyj1@fel.cvut.cz>"
 ! !
@@ -351,15 +354,15 @@
 !ProgrammingLanguage class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ProgrammingLanguage.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ProgrammingLanguage.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ProgrammingLanguage.st,v 1.9 2009/10/08 12:00:30 fm Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ProgrammingLanguage.st,v 1.10 2009/12/04 11:21:32 cg Exp §'
 !
 
 version_SVN
-    ^ '$Id: ProgrammingLanguage.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ProgrammingLanguage.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 ! !
 
 ProgrammingLanguage initialize!
--- a/ProjectDefinition.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ProjectDefinition.st	Fri Dec 04 20:30:11 2009 +0000
@@ -310,6 +310,25 @@
     "
 !
 
+directory
+    "for packageId compatibility"
+
+    ^ self moduleDirectory
+
+    "
+     bosch_dapasx_datenbasis_Definition moduleDirectory
+     bosch_dapasx_parameter_system_Definition moduleDirectory
+     stx_libbasic3 moduleDirectory    
+     cg_croquet moduleDirectory    
+     cg_croquet package asPackageId module   
+     cg_croquet moduleDirectory   
+     stx_goodies_xml_vw moduleDirectory  
+    "
+
+    "Created: / 08-08-2006 / 20:25:39 / fm"
+    "Modified: / 18-08-2006 / 12:18:33 / cg"
+!
+
 initialClassNameForDefinitionOf:aPackageId
     "given a package-ID, return an appropriate class name for this package"
 
@@ -362,7 +381,8 @@
     "
        bosch_dapasx_datenbasis_Definition module
        DapasX_Datenbasis module
-       stx_libbasic3 module
+       stx_libbasic3 module 
+       stx_libbasic3 directory 
     "
 
     "Created: / 08-08-2006 / 20:24:53 / fm"
@@ -377,6 +397,10 @@
      bosch_dapasx_datenbasis_Definition moduleDirectory
      bosch_dapasx_parameter_system_Definition moduleDirectory
      stx_libbasic3 moduleDirectory    
+     cg_croquet moduleDirectory    
+     cg_croquet package asPackageId module   
+     cg_croquet moduleDirectory   
+     stx_goodies_xml_vw moduleDirectory  
     "
 
     "Created: / 08-08-2006 / 20:25:39 / fm"
@@ -536,6 +560,9 @@
      bosch_dapasx_hw_schnittstellen packageName
      bosch_dapasx_datenbasis packageName
      bosch_dapasx_parameter_system packageName 
+     cg_croquet packageName 
+     stx_goodies_xml_vw packageName  
+     stx_goodies_xml_vw packageDirectory  
     "
 
     "Created: / 08-08-2006 / 20:24:53 / fm"
@@ -3804,8 +3831,6 @@
     self projectIsLoaded ifTrue:[^ false].
     thisContext isRecursive ifTrue:[^ false].    "/ avoid endless loops
 
-    self checkPrerequisitesForLoading.
-
     newStuffHasBeenLoaded := false.
 
     (self infoPrinting and:[Smalltalk silentLoading not]) ifTrue:[
@@ -3827,6 +3852,9 @@
     Class withoutUpdatingChangesDo:[
         self activityNotification:'Loading prerequisities'.
         self loadPreRequisitesAsAutoloaded:asAutoloaded.
+
+        self checkPrerequisitesForLoading.
+
         asAutoloaded ifFalse:[
             self loadClassLibrary.
             "/ could have overloaded my first incarnation
@@ -4297,8 +4325,12 @@
             |eachPoolClass|
 
             eachPoolClass := Smalltalk classNamed:eachPoolName.
-            eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | 
-                addPackage value:(eachPoolSuperClass package)
+            eachPoolClass isNil ifTrue:[
+                Transcript showCR:('Warning: missing pool: %1 (required by %2)' bindWith:eachPoolName with:cls name)
+            ] ifFalse:[
+                eachPoolClass withAllSuperclassesDo:[:eachPoolSuperClass | 
+                    addPackage value:(eachPoolSuperClass package)
+                ]
             ]
         ].
     ].
@@ -5203,11 +5235,11 @@
 !ProjectDefinition class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ProjectDefinition.st 10480 2009-12-02 21:30:55Z vranyj1 $'
+    ^ '$Id: ProjectDefinition.st 10482 2009-12-04 20:30:11Z vranyj1 $'
 !
 
 version_CVS
-    ^ '§Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.290 2009/11/18 18:09:22 cg Exp §'
+    ^ '§Header: /cvs/stx/stx/libbasic/ProjectDefinition.st,v 1.293 2009/12/01 21:31:54 cg Exp §'
 ! !
 
 ProjectDefinition initialize!
--- a/ProtoObject.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/ProtoObject.st	Fri Dec 04 20:30:11 2009 +0000
@@ -48,6 +48,7 @@
 "
 ! !
 
+
 !ProtoObject methodsFor:'error handling'!
 
 doesNotUnderstand:aMessage
@@ -137,6 +138,14 @@
 
 !ProtoObject methodsFor:'testing'!
 
+ifNil:aBlock
+    ^ self
+!
+
+ifNotNil:aBlockOrValue
+    ^ aBlockOrValue value
+!
+
 isBehavior
     "return true, if the receiver is describing another objects behavior.
      False is returned here - the method is only redefined in Behavior."
@@ -175,5 +184,9 @@
 !ProtoObject class methodsFor:'documentation'!
 
 version
-    ^ '$Id: ProtoObject.st 10447 2009-06-14 13:09:55Z vranyj1 $'
+    ^ '$Id: ProtoObject.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/ProtoObject.st,v 1.13 2009/12/01 19:59:38 cg Exp §'
 ! !
--- a/Semaphore.st	Wed Dec 02 21:30:55 2009 +0000
+++ b/Semaphore.st	Fri Dec 04 20:30:11 2009 +0000
@@ -321,6 +321,14 @@
 
 isSignaled
     ^ self wouldBlock not
+!
+
+waitTimeoutMSecs:milliSeconds
+    ^ self waitWithTimeoutMs:milliSeconds
+!
+
+waitTimeoutSeconds:seconds
+    ^ self waitWithTimeout:seconds
 ! !
 
 !Semaphore methodsFor:'printing & storing'!
@@ -912,5 +920,9 @@
 !Semaphore class methodsFor:'documentation'!
 
 version
-    ^ '$Id: Semaphore.st 10447 2009-06-14 13:09:55Z vranyj1 $'
+    ^ '$Id: Semaphore.st 10482 2009-12-04 20:30:11Z vranyj1 $'
+!
+
+version_CVS
+    ^ '§Header: /cvs/stx/stx/libbasic/Semaphore.st,v 1.82 2009/12/03 11:09:04 stefan Exp §'
 ! !