*** empty log message ***
authorClaus Gittinger <cg@exept.de>
Wed, 10 Oct 2001 17:24:34 +0200
changeset 6089 a3710756f360
parent 6088 db3fc1ec9c1a
child 6090 77dfb33df61a
*** empty log message ***
Method.st
--- a/Method.st	Tue Oct 09 19:55:36 2001 +0200
+++ b/Method.st	Wed Oct 10 17:24:34 2001 +0200
@@ -273,6 +273,27 @@
     "Modified: 23.4.1996 / 15:59:50 / cg"
 !
 
+methodDefinitionTemplateForSelector:aSelector
+    "given a selector, return a prototype definition string"
+
+    aSelector numArgs > 0 ifTrue:[
+        aSelector isKeyword ifTrue:[
+            ^ String streamContents:[:stream |
+                        aSelector keywords 
+                            keysAndValuesDo:[:idx :part | stream nextPutAll:(part , 'arg' , idx printString , ' ')].
+                     ].
+        ].
+        ^ aSelector , ' arg'
+    ].
+    ^ aSelector
+
+    "
+     Method methodDefinitionTemplateForSelector:#foo         
+     Method methodDefinitionTemplateForSelector:#+           
+     Method methodDefinitionTemplateForSelector:#foo:bar:baz:
+    "
+!
+
 methodPrivacySupported
     "return true, if the system was compiled to support methodPrivacy.
      You should not depend on that feature being available."
@@ -2804,6 +2825,6 @@
 !Method class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.230 2001-10-04 09:23:55 cg Exp $'
+    ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.231 2001-10-10 15:24:34 cg Exp $'
 ! !
 Method initialize!