Smalltalk.st
changeset 19681 ec20967ae600
parent 19597 435f19b58541
child 19691 5e613f6255d9
child 19788 5b67ddd14655
--- a/Smalltalk.st	Sat Apr 30 17:14:06 2016 +0200
+++ b/Smalltalk.st	Sat Apr 30 17:40:02 2016 +0200
@@ -1,5 +1,3 @@
-"{ Encoding: utf8 }"
-
 "
  COPYRIGHT (c) 1988 by Claus Gittinger
 	      All Rights Reserved
@@ -2955,22 +2953,35 @@
     |implementors|
 
     implementors := OrderedCollection new.
+    self allImplementorsOf:aSelector do:[:cls | implementors add:cls].
+    ^ implementors
+
+    "
+     Smalltalk allImplementorsOf:#isNil   
+     (Smalltalk allImplementorsOf:#add:) size 
+    "
+
+    "Modified: / 30-04-2016 / 17:37:39 / cg"
+!
+
+allImplementorsOf:aSelector do:aBlock
+    "enumerate all classes which implement the given selector"
+
     self allClassesDo:[:cls |
-	(cls includesSelector:aSelector) ifTrue:[
-	    implementors add:cls.
-	].
-	(cls class includesSelector:aSelector) ifTrue:[
-	    implementors add:cls class.
-	].
-    ].
-    ^ implementors
-
-    "
-     Smalltalk allImplementorsOf:#isNil
-     (Smalltalk allImplementorsOf:#add:) size
-    "
-
-    "Modified: / 07-05-2010 / 10:56:09 / cg"
+        (cls includesSelector:aSelector) ifTrue:[
+            aBlock value:cls.
+        ].
+        (cls class includesSelector:aSelector) ifTrue:[
+            aBlock value:cls class.
+        ].
+    ].
+
+    "
+     Smalltalk allImplementorsOf:#isNil do:[:cls | Transcript showCR:cls]
+     Smalltalk allImplementorsOf:#add: do:[:cls | Transcript showCR:cls]
+    "
+
+    "Created: / 30-04-2016 / 17:36:45 / cg"
 !
 
 allLoadedPackageIDs
@@ -3543,6 +3554,21 @@
 
     "Modified: / 7.6.1996 / 08:44:33 / stefan"
     "Modified: / 14.6.1998 / 15:54:03 / cg"
+!
+
+someImplementorOf:aSelector
+    "return any class, which implement the given selector. Nil if there is none.
+     (useful to search, if there is one at all)"
+
+    self allImplementorsOf:aSelector do:[:cls | ^ cls].
+    ^ nil.
+
+    "
+     Smalltalk someImplementorOf:#isNil
+     Smalltalk someImplementorOf:#add:
+    "
+
+    "Created: / 30-04-2016 / 17:39:19 / cg"
 ! !
 
 !Smalltalk class methodsFor:'queries-system'!
@@ -8211,13 +8237,13 @@
     (lang == #de) ifTrue:[
         proto := 'Willkommen bei %1 (%4Version %2 von %3)'. bit := 'Bit'.
     ] ifFalse:[ (lang == #fr) ifTrue:[
-        proto := 'Salut, Bienvenue à %1 (%4version %2 de %3)'
+        proto := 'Salut, Bienvenue à %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #it) ifTrue:[
         proto := 'Ciao, benvenuto al %1 (%4versione %2 di %3)'
     ] ifFalse:[ (lang == #es) ifTrue:[
         proto := 'Hola, bienvenida a %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #pt) ifTrue:[
-        proto := 'Olá!!, mem-vindo a %1 (%4version %2 de %3)'
+        proto := 'Olá!!, mem-vindo a %1 (%4version %2 de %3)'
     ] ifFalse:[ (lang == #no) ifTrue:[
         proto := 'Hei, verdenmottakelse til %1 (%4versjon %2 av %3)'
     ]]]]]].