-Hello, everyone.
In this video, we are going to look at the different shortcuts Pharo provides
in order to execute, print and inspect expressions.
The first thing we are going to do is to look at:
Pharo, Settings,
and when you are here, you type "shortcut reminder"
and press Enter.
And you will have to check that this checkbox is checked,
that basically, the Shortcut Reminder is enabled.
What is the Shortcut Reminder? I will show you right now.
We will open the Playground, go to Tools,
Playground.
From within this Playground,
let's write a simple expression, for example "1 + 2"
and we will try to print it, so right click,
"Print it", so this is 3.
But what you can see here is that for the action "Print it",
you can use the shortcut Cmd+P.
That is what we are going to do right now.
Press Cmd+P and this is...
the "Print it" command.
The shortcut reminder may show you how to do the things you do every time
but in a quicker way with a keyboard shortcut.
Let's look at the different commands.
"Print it", we just saw it,
it is Cmd+P.
This is 3.
If we look at the "Do it" command...
This one, "Do it", nothing happens.
But we can press Cmd+D.
What happens is that it will just compute the result
but without showing it to you.
For example, if we use another expression,
that is "Workspace open", this time if we do it,
the Workspace will open but if we printed it,
it would both open it
and print the results and the result is "a Workspace".
For the "Print it" command,
the shortcut is Cmd+P,
as you may have seen there while I was clicking on it.
We can do Cmd+P to print and Cmd+D to do it.
So, right here, Cmd+D.
If we look at the two other most interesting actions
you can do on your expression,
there is "Inspect it"
that will open an Inspector on the result of your expression.
Right here, 1 + 2 equals 3,
so we have an "Inspector on a Smallinteger (3)"
from which you can explore basically
also the row with the variable value.
You can go to Integer to have different information.
This is really useful if you want to explore the result of an expression.
We can even inspect this one, the shortcut is Cmd+I.
This is the Inspector on the Workspace,
so we have a lot of different things going on here.
Basically, this can help you explore your results
and show that what you are using is correct.
The last expression that I think is interesting
is when you right-click to the "Do it and go" or Cmd+G,
"Do it and go" will basically do the same thing as Inspect
but put it on a side panel like this one.
This is the same Inspector on a Smallinteger,
but this will put it there.
We can do the same thing on "Workspace open".
Either right-click there or you can press Cmd+G.
This will do it, so open the Workspace
but also open the Inspector on the side panel.
These are some interesting shortcuts
that may help you to inspect the results
or simply show the result of an expression.
But I think those are worth learning.
Remember to check the shortcut reminder
so for each task you do with your cursor and your mouse,
you can have the explanation
of how you can do it quickly at the bottom left.