1 00:00:02,920 --> 00:00:03,720 -Hello, everyone. 2 00:00:04,040 --> 00:00:07,560 In this video, we are going to look at the different shortcuts Pharo provides 3 00:00:07,880 --> 00:00:11,320 in order to execute, print and inspect expressions. 4 00:00:11,640 --> 00:00:15,000 The first thing we are going to do is to look at: 5 00:00:15,320 --> 00:00:16,800 Pharo, Settings, 6 00:00:17,280 --> 00:00:22,320 and when you are here, you type "shortcut reminder" 7 00:00:22,640 --> 00:00:23,640 and press Enter. 8 00:00:24,520 --> 00:00:27,680 And you will have to check that this checkbox is checked, 9 00:00:28,000 --> 00:00:32,160 that basically, the Shortcut Reminder is enabled. 10 00:00:32,480 --> 00:00:34,920 What is the Shortcut Reminder? I will show you right now. 11 00:00:35,240 --> 00:00:36,840 We will open the Playground, go to Tools, 12 00:00:37,280 --> 00:00:38,160 Playground. 13 00:00:39,000 --> 00:00:41,120 From within this Playground, 14 00:00:42,000 --> 00:00:44,960 let's write a simple expression, for example "1 + 2" 15 00:00:45,880 --> 00:00:49,240 and we will try to print it, so right click, 16 00:00:49,800 --> 00:00:51,800 "Print it", so this is 3. 17 00:00:52,120 --> 00:00:56,400 But what you can see here is that for the action "Print it", 18 00:00:56,720 --> 00:00:58,800 you can use the shortcut Cmd+P. 19 00:00:59,240 --> 00:01:01,280 That is what we are going to do right now. 20 00:01:01,600 --> 00:01:03,440 Press Cmd+P and this is... 21 00:01:05,080 --> 00:01:06,120 the "Print it" command. 22 00:01:06,440 --> 00:01:11,320 The shortcut reminder may show you how to do the things you do every time 23 00:01:11,640 --> 00:01:14,560 but in a quicker way with a keyboard shortcut. 24 00:01:15,480 --> 00:01:17,080 Let's look at the different commands. 25 00:01:17,400 --> 00:01:21,000 "Print it", we just saw it, 26 00:01:21,800 --> 00:01:22,800 it is Cmd+P. 27 00:01:23,320 --> 00:01:24,320 This is 3. 28 00:01:24,640 --> 00:01:26,440 If we look at the "Do it" command... 29 00:01:26,760 --> 00:01:29,280 This one, "Do it", nothing happens. 30 00:01:30,400 --> 00:01:31,600 But we can press Cmd+D. 31 00:01:31,920 --> 00:01:35,560 What happens is that it will just compute the result 32 00:01:35,880 --> 00:01:37,080 but without showing it to you. 33 00:01:37,400 --> 00:01:41,320 For example, if we use another expression, 34 00:01:41,640 --> 00:01:44,520 that is "Workspace open", this time if we do it, 35 00:01:45,640 --> 00:01:49,440 the Workspace will open but if we printed it, 36 00:01:50,400 --> 00:01:52,240 it would both open it 37 00:01:52,560 --> 00:01:55,600 and print the results and the result is "a Workspace". 38 00:01:56,600 --> 00:01:58,960 For the "Print it" command, 39 00:01:59,280 --> 00:02:01,360 the shortcut is Cmd+P, 40 00:02:02,160 --> 00:02:05,480 as you may have seen there while I was clicking on it. 41 00:02:06,040 --> 00:02:10,480 We can do Cmd+P to print and Cmd+D to do it. 42 00:02:10,800 --> 00:02:12,880 So, right here, Cmd+D. 43 00:02:14,600 --> 00:02:19,920 If we look at the two other most interesting actions 44 00:02:20,240 --> 00:02:22,040 you can do on your expression, 45 00:02:22,360 --> 00:02:23,560 there is "Inspect it" 46 00:02:23,880 --> 00:02:28,120 that will open an Inspector on the result of your expression. 47 00:02:28,640 --> 00:02:30,840 Right here, 1 + 2 equals 3, 48 00:02:31,160 --> 00:02:33,680 so we have an "Inspector on a Smallinteger (3)" 49 00:02:34,360 --> 00:02:36,880 from which you can explore basically 50 00:02:37,200 --> 00:02:40,200 also the row with the variable value. 51 00:02:40,520 --> 00:02:42,800 You can go to Integer to have different information. 52 00:02:43,120 --> 00:02:46,600 This is really useful if you want to explore the result of an expression. 53 00:02:47,680 --> 00:02:51,680 We can even inspect this one, the shortcut is Cmd+I. 54 00:02:53,160 --> 00:02:55,040 This is the Inspector on the Workspace, 55 00:02:55,360 --> 00:02:57,640 so we have a lot of different things going on here. 56 00:02:58,960 --> 00:03:02,960 Basically, this can help you explore your results 57 00:03:03,600 --> 00:03:06,280 and show that what you are using is correct. 58 00:03:06,880 --> 00:03:09,280 The last expression that I think is interesting 59 00:03:09,600 --> 00:03:13,120 is when you right-click to the "Do it and go" or Cmd+G, 60 00:03:13,760 --> 00:03:16,640 "Do it and go" will basically do the same thing as Inspect 61 00:03:17,280 --> 00:03:20,560 but put it on a side panel like this one. 62 00:03:20,880 --> 00:03:22,960 This is the same Inspector on a Smallinteger, 63 00:03:23,280 --> 00:03:24,800 but this will put it there. 64 00:03:25,280 --> 00:03:27,720 We can do the same thing on "Workspace open". 65 00:03:29,600 --> 00:03:33,720 Either right-click there or you can press Cmd+G. 66 00:03:34,600 --> 00:03:37,520 This will do it, so open the Workspace 67 00:03:37,840 --> 00:03:40,320 but also open the Inspector on the side panel. 68 00:03:41,360 --> 00:03:43,720 These are some interesting shortcuts 69 00:03:44,040 --> 00:03:46,320 that may help you to inspect the results 70 00:03:46,640 --> 00:03:49,360 or simply show the result of an expression. 71 00:03:49,880 --> 00:03:53,040 But I think those are worth learning. 72 00:03:54,120 --> 00:03:57,200 Remember to check the shortcut reminder 73 00:03:57,520 --> 00:04:01,040 so for each task you do with your cursor and your mouse, 74 00:04:01,360 --> 00:04:04,280 you can have the explanation 75 00:04:04,600 --> 00:04:07,840 of how you can do it quickly at the bottom left.