hello, I’d like to show you how to use
the Finder to find information.
The Finder is a tool you will find in
the Tools menu, here Finder.
Let’s imagine I want to look for a method
called match. I write its name, match.
Here I choose Selectors.
Now I see all methods containing
the word match, with the code here.
As I set up big fonts, we wil
resize a little bit.
You see that when there is a little
triangle, it means the method
is defined over several classes, and I can read that kind of thing.
So that was for methods, and there is quite a lot.
You can look for things but that’s not ideal.
Now we can search for
classes containing match, here we see all our classes.
The best way is to unbrowse using the code browser.
Now there a far better way.
Often we know what we are looking for
but we don’t know how to express it.
So here, I know that I’d like to know if there
is a method matching ab,
abcd, for instance, I write ab*abcd
and if something matches it returns true.
And I choose Examples, and I get all
the methods returning True.
I’m going to explain what we see.
Here I see that superior works as well.
Ah, match seems interesting.
The system shows me all
the classes defining the match method, but
in particular the one with the little star is the one
which method has returned true.
So now, we can try other examples.
For example, given 11, 2
what methods returns 5. Here I will have
// and I see what has
returned true, it’s defined on Integer, so it is
this method or on aNumber which is this method there.
So I do the same, in the same way:
Now I want 5.5. Then I only get Diviser.
So it’s very useful.
There another way to do it:
you can look for
all the Pragmas, Pragmas are the annotations
in the system. So if I look what is an
annotation, for instance it is this.
Here it is, I have annotated my method with a pragma named
Menu, and the system can make queries on it
to build menus. Here by typing Menu, and
selecting Pragma, I can access to all the system’s
pragmas containing the menu word.
So here, we see that there are 2 for instance, 2 pragmas.
The worldMenu, the one which is displayed
when you are here, is defined by the Pragma menu.
You see worldMenu.
The screenShotCommand for example. HelpOn.
You see all these menus.
So know, with the Finder we can also
look for methods
containing the “Menu” string, wherever they are.
I’m gonna do it: it takes a little time.
What happens is that the system scans
really all the body of all the methods, there are
80 000 in Pharo, or a little bit more, and it displays the result.
So here, it’s really a textual search.
What’s interesting sometimes, when you see
a menu or something graphical you can find it back.
So here, you have all the methods containing the
Menu word, in their names as well as
elsewhere, here or there.