[FIX][ENH] Selector finder

Bert Freudenberg bert at isgnw.CS.Uni-Magdeburg.De
Thu Oct 14 12:02:17 UTC 1999


On Wed, 13 Oct 1999, Doug Way wrote:

> 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.) 

If you want to try it, insert the following code into
SelectorBrowser>>quickList: just before the return:

    resultArray _ resultArray collect: [:expression |
      | newExp |
      newExp _ expression.
      array first withIndexDo: [:lit :i |
         newExp _ newExp copyReplaceAll: 'data', i printString
           with: lit storeString].
      newExp, ' --> ', array last storeString].

I personally don't like it, although it looks good for small number
arguments. But it isn't bullet-proof, and the result can get quite long
(try "Date today. 1999"). Also, it breaks my selector extraction code in
SelectorBrowser>>selectedMessageName.

One side note: I wanted the above code to check for literals, but in
Squeak, nil, true and false are not! Anyone bothered by this, too?

  /bert





More information about the Squeak-dev mailing list