Question

I am currently following the Squeak By Example book.

It shows that when looking for an unknown method one can search the method by the correspondance between its input and its output in the Method Finder (it opens a Selector Browser window).

For example if I enter 'aaa' . 'AAA' it finds both Character asUppercase and String asUppercase.

SBE teaches how to add a new method shout to the class String that puts a string in upper case and adds a final exclamation mark. Prior to the method addition, it also shows how to add a test to verify the new method via the Test Runner.

If I search 'aaa' . 'AAA!' I get a No single method does that function.

If I test (print) it in the workspace I get the expected 'thing' shout --> 'THING!'. Why? Is there something to refresh?

Was it helpful?

Solution

Method Finder only tries known methods, otherwise the system could easily crash. See MethodFinder>>initialize.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top