Earlier quoted context omitted.
Some Smalltalks (Squeak and Pharo) have a wonderful tool called a "Method Finder". The way it works is you write a sequence of arguments and an expected result , and it suggests a method to call. For example, I just now tried it, entering 3. 4. 7 in the input. It suggested the following methods: 3 + 4 --> 7 3 bitOr: 4 --> 7 3 bitXor: 4 --> 7 Clicking on any of these opens a browser on the class and method concerned.…
That's pretty cool. Is the technique for this documented somewhere, or do I have to read the Squeak or Pharo source?
In Smalltalk everything is an object, that is including numbers, characters etc. The standar method-lookup searches from the innermost class methods to the outermost class methods.
The method finder could simply iteratively go through all applicable methods that return the class requested and match results.
[1]: http://esug.org/data/Old/vw-tutorials/vw25/vw25ug.pdf (page 42 method-lookup)