Smalltalk.st
changeset 5406 4a6995b61c0e
parent 5400 af8fdc4d3e02
child 5410 859c010edb47
--- a/Smalltalk.st	Tue Jun 20 20:20:02 2000 +0200
+++ b/Smalltalk.st	Fri Jun 23 10:18:11 2000 +0200
@@ -181,12 +181,16 @@
 
     |envString i langString terrString|
 
+    StandAlone isNil ifTrue:[
+        StandAlone := false.
+    ].
+
     "
      extract Language and LanguageTerritory from LANG variable.
      valid are for example: english_us / us_us / us
-			    english / en_en / en
-			    german / de_de / de
-			    german_austria
+                            english / en_en / en
+                            german / de_de / de
+                            german_austria
     "
 
     Language := #english.
@@ -194,16 +198,16 @@
 
     envString := OperatingSystem getEnvironment:'LANG'.
     envString size > 0 ifTrue:[
-	i := envString indexOf:$_.
-	(i == 0) ifTrue:[
-	    langString := envString.
-	    terrString := envString
-	] ifFalse:[
-	    langString := envString copyTo:(i - 1).
-	    terrString := envString copyFrom:(i + 1)
-	].
-	Language := langString asLowercase asSymbol.
-	LanguageTerritory := terrString asLowercase asSymbol
+        i := envString indexOf:$_.
+        (i == 0) ifTrue:[
+            langString := envString.
+            terrString := envString
+        ] ifFalse:[
+            langString := envString copyTo:(i - 1).
+            terrString := envString copyFrom:(i + 1)
+        ].
+        Language := langString asLowercase asSymbol.
+        LanguageTerritory := terrString asLowercase asSymbol
     ].
 
     "
@@ -601,7 +605,8 @@
 
 %{  /* NOCONTEXT */
     RETURN ( __GLOBAL_GET(aKey) );
-%}
+%}.
+    self primitiveFailed
 !
 
 at:aKey ifAbsent:aBlock
@@ -1379,6 +1384,31 @@
     "
 !
 
+allClassesInOrderDo:aBlock
+    "evaluate the argument, aBlock for all classes in the system;
+     Evaluation order is by inheritance: superclasses come first."
+
+    |already|
+
+    already := IdentitySet new.
+    self allBehaviorsDo:[:aClass |
+        (already includes:aClass) ifFalse:[
+            aClass allSuperclasses reverseDo:[:cls |
+                (already includes:aClass) ifFalse:[
+                    already add:cls.
+                    aBlock value:cls.
+                ].
+            ].
+            already add:aClass.
+            aBlock value:aClass.
+        ]
+    ].
+
+    "
+     Smalltalk allClassesInOrderDo:[:aClass | aClass name printCR]
+    "
+!
+
 allKeysDo:aBlock
     "evaluate the argument, aBlock for all keys in the Smalltalk dictionary"
 
@@ -1396,6 +1426,18 @@
     "Smalltalk associationsDo:[:assoc | assoc printCR]"
 !
 
+basicKeys
+    "for rel > 5 only"
+
+    self primitiveFailed
+
+
+
+
+
+
+!
+
 do:aBlock
     "evaluate the argument, aBlock for all values in the Smalltalk dictionary"
 
@@ -1403,7 +1445,11 @@
 
 %{  /* NOREGISTER - work may not be placed into a register here */
     __GLOBALS_DO(&aBlock, &work);
-%}
+    RETURN (self);
+%}.
+    self keysDo:[:aKey |
+        aBlock value:(self at:aKey)
+    ]
 !
 
 keysAndValuesDo:aBlock
@@ -1420,7 +1466,11 @@
 
 %{  /* NOREGISTER - work may not be placed into a register here */
     __GLOBALKEYS_DO(&aBlock, &work);
-%}
+    RETURN (self);
+%}.
+    self basicKeys do:[:aKey |
+        aBlock value:aKey
+    ]
 ! !
 
 !Smalltalk class methodsFor:'inspecting'!
@@ -1626,7 +1676,8 @@
 
 %{  /* NOCONTEXT */
     RETURN ( __GLOBAL_GETCELL(aName) );
-%}
+%}.
+    self primitiveFailed
 !
 
 classNamed:aString
@@ -5243,7 +5294,8 @@
     extern char *__getConfigurationString();
 
     RETURN (__MKSTRING(__getConfigurationString() COMMA_SND));
-%}
+%}.
+    ^ 'unknown/unknown'
 
     "
      Smalltalk configuration
@@ -5565,5 +5617,5 @@
 !Smalltalk class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.449 2000-06-19 12:04:09 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Smalltalk.st,v 1.450 2000-06-23 08:18:11 cg Exp $'
 ! !