may be we should add it somewhere in symbol because this is handy when
you want to generate methods on the fly.
signatureFromSelector: aSelector
"self new signatureFromSelector: #foo:bar: "
"self new signatureFromSelector: #foo"
"self new signatureFromSelector: #foo:"
| count |
^ String streamContents: [:str|
count := 1.
(ReadStream on: aSelector) do: [:each |
each = $:
ifTrue: [ str nextPut: each.
str nextPutAll:
' arg', count printString, ' '.
count := count
+ 1]
ifFalse: [str nextPut: each]
]]
On Mar 1, 2009, at 7:18 PM, Stéphane Ducasse wrote:
> Hi
>
> does one of you get to know a method for doing that?
>
> #foo:bar:
>
> -> foo: arg1 bar: arg2
>
> Stef
>
> _______________________________________________
> Pharo-project mailing list
> [email protected]
> http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
>
_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project