--- a/Method.st Wed Jun 07 17:37:28 2006 +0200
+++ b/Method.st Wed Jun 07 17:45:06 2006 +0200
@@ -300,9 +300,11 @@
aSelector numArgs > 0 ifTrue:[
aSelector isKeyword ifTrue:[
^ String streamContents:[:stream |
- aSelector keywords
- keysAndValuesDo:[:idx :part | stream nextPutAll:(part , (argNames at:idx) , ' ')].
- ].
+ aSelector keywords with:argNames do:[:eachKeyword :eachArgName|
+ stream nextPutAll:eachKeyword; nextPutAll:eachArgName; space.
+ ].
+ stream backStep. "remove the last space"
+ ].
].
^ aSelector , ' ' , (argNames at:1)
].
@@ -2325,6 +2327,16 @@
"
!
+methodDefinitionTemplate
+ "return the string that defines the method and the arguments"
+
+ ^ Method methodDefinitionTemplateForSelector:self selector andArgumentNames:self methodArgNames
+
+ "
+ (self compiledMethodAt:#printOn:) methodDefinitionTemplate
+ "
+!
+
methodVarNames
"return a collection with the methods local-variable names.
Uses Parser to parse methods source and extract the names."
@@ -2973,7 +2985,7 @@
!Method class methodsFor:'documentation'!
version
- ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.290 2006-03-16 14:50:35 cg Exp $'
+ ^ '$Header: /cvs/stx/stx/libbasic/Method.st,v 1.291 2006-06-07 15:45:06 stefan Exp $'
! !
Method initialize!