-Hello, everyone.
In this video, we are going to look at a tool called the Finder.
We can find it under the Pharo menu, then Tools, then Finder.
This Finder helps you find methods or anything from within Pharo.
We can look for example at "match",
any method that would have a string "match" in its name.
We can look at that in Selectors, press Search.
Here, you can have all the methods that have "match" in their name.
"addMatchingExpression", etc.
You can see that between parentheses,
you have the name of the class that implements the method
with the name there.
For example,
this method "addMatchingExpression" is defined from within this class
and when you have the small triangle to the side,
this means that several classes implement the same method
or at least a method with the same name.
This is the case here.
We have two classes that implement the method there.
We can browse them.
By simply clicking here,
we can see the difference between the two methods
or we can even press the button Browse
to look at the method and class in detail from within the System Browser.
There, we are on the correct package, class
and on the same method as there.
While this is useful,
often we are looking for a behavior more than a name.
What I mean is that, for example,
if we want a string "ab*" and another string "abcd"
to be fed to a method and then obtain "true",
we can look at this from within the Examples tab.
There we have it, we have all the methods that,
with the given parameters, the two strings, have output "true".
For example, we might be interested in the "match" method.
If we look at all the classes that define "match",
There is one other small star on the left.
This is the one that, with the exact same arguments as the one we put there,
has output "true".
This might be the one we are interested in.
This string was an example
and we can look at it with another one,
for example "11", "2", and we want it to output "5".
If we search for that,
we can see that we have got this division there
that has been defined "Integer" and "Number" or "SmallInteger"
and that outputs the exact same result.
But then, if we write "5.5" and search for that,
we can see that only the classic division has been output
on "Fraction" or "Number".
This is where it has output something
with the exact same signature as the one we gave it.
Now, we can look for other things as well if we write "Menu" and look for pragmas.
These are all the different pragmas found.
If we look at, for example, the pragma "menuOrder"
and then go to any of those methods,
then we have the classes they are defined in.
So, pragmas are this type of strings
that are used by the system in another way
because we can do queries in them,
for example, for graphic interfaces or things like that,
we can look for that as well.
Finally, if we want to look at the String menu
from anywhere in the system,
we can press the Source button.
This will take a while
because it is inspecting the body, name, every method and class in the system.
But right now,
we can see that all these contain either the word "menu" in their name
or in their...
For example here, this is the name of a class, "PragmaMenu".
We can see the same thing here,
we can see that "menu" is called there.
So, this will look inside all the classes and all the methods of a system
and output everything that has "menu" in it.
This was the video for the Finder because it is an extremely powerful tool,
especially coupled with examples.
A last thing I would like to show you are executable commands.
Let's look at, for example, this one.
If we feed a parameter being an array, then 4,
it should output the first element.
This means that it will go 1, 2, 3 and then come back at the beginning
to get the first element.
Let's search for that by picking Examples.
We can see that this is the method "atWrap",
an "Array" or "SequenceableCollection".
From within the body of this method,
you can see that this is a normal command
and this one has another color because you can execute it.
This means that this expression there should output "22".
We can look at that by simply highlighting it
then pressing Cmd+P.
There, you can see that it output "22".
This is a good way to look inside methods
and see how they work
coupled with the examples.
That was a video on the Finder that I really encourage you to use.