numArgs for #, and #->

Alejandro F. Reimondo aleReimondo at
Tue Sep 9 00:15:28 UTC 1997


I've found the message #numArgs for strings (and Symbols)
 that returns the number of arguments spected for aSelector.
It works fine for normal selectors, but have problems
 with #, and #-> selectors.

They are not recognized as valid selector names
 and return value is -1

Evaluating this code returns all the "invalid selectors" used
 in the system

| unKnown |
unKnown := Set new.
Smalltalk allClasses do: [:each|
	unKnown addAll: (
		each selectors
			select: [:selector| selector numArgs < 0 ] )
unKnown asArray

Looking in the String>>#numArgs method I've found
 that the #- selector is handled returning ^1,
 I think that #, and #-> must also return 1.


More information about the Squeak-dev mailing list