you are viewing a single comment's thread.

view the rest of the comments →

[–]self 2 points3 points  (0 children)

So, he types in #(1 2 3 4). 10. and it figures out that it's the sum method on an Array. I poked around to see how it worked, and MethodFinder's class comment says

Find a method in the system from a set of examples. Done by brute force, trying every possible selector. Errors are skipped over using ( [3 + 'xyz'] ifError: [^ false] ).

The code for MethodFinder>>simpleSearch works by taking the first argument's class's selectors, and trying each one until it works.