[FIX][ENH] Selector finder

Doug Way dway at mat.net
Wed Oct 13 18:33:07 UTC 1999


On Wed, 13 Oct 1999, Bert Freudenberg wrote:

> * Makes the Selector Finder display code examples (data1 + data2) instead
> of just the selector in the message list
> * Fixes the bug where 'a'.'b'.'ab' didn't find anything
> * Fixes the bug where no binary selectors where found

Thanks, Bert.  (That was pretty fast service! :-) )

Sorry about continuing to complain, but I was just thinking about how I
didn't like the "data1" notation quite as much, and then I had a
brainstorm:

Since you can only type a single example in the upper left pane, why not
simply include the values themselves in the output!  (instead of data1,
data2, etc.)  For example, typing:

3. 4. 7

in the upper left pane would cause this to appear in the pane below:

3 + 4  -->  7
3 bitOr: 4  -->  7
3 bitXor: 4  -->  7

(Might as well include the answers, too.)


Or, typing:

'abcdef'. $a. 1

results in:

'abcdef' identityIndexOf: $a  -->  1
'abcdef' indexOf: $a  -->  1
'abcdef' occurencesOf: $a  -->  1


Suddenly you're now looking at real Smalltalk expressions with the values
you just entered.  I think this would help make the Selector Finder a
better tool for learning Smalltalk... it now has an immediacy which kind
of makes it "come alive"!

To implement this, you could just parse the values in the upper left pane
and match them up with the "data1", "data2" values, etc.  I guess the
"data1" type of output is still more appropriate when using
MethodFinder>>methodFor: doits in the lower pane, though, since you can
give it multiple examples.

(I randomly picked "-->" as an "answers" symbol, since there's no right
arrow character... it seems as good as anything.  I didn't want something
that could be confused for a selector.)

- Doug Way
  EAI/Transom Technologies, Ann Arbor, MI
  http://www.transom.com
  dway at mat.net, @eai.com





More information about the Squeak-dev mailing list