WEBVTT

00:00:01.080 --> 00:00:03.400 align:middle
In this video, 
I'd like to show you how an

00:00:03.400 --> 00:00:06.950 align:middle
object can define tabs displayed
in the inspector.

00:00:08.430 --> 00:00:10.280 align:middle
How will we see that?

00:00:10.580 --> 00:00:12.240 align:middle
We're going to use Spotter to do this.

00:00:14.410 --> 00:00:18.240 align:middle
In Spotter I remember
that I search for

00:00:18.240 --> 00:00:22.910 align:middle
a #pragma, a method annotation,
beginning with gt.

00:00:22.910 --> 00:00:27.440 align:middle
I know there is "inspector" inside
so I'm going to look at this.

00:00:30.190 --> 00:00:32.040 align:middle
In my inspector I can see there
are #Pragmas and

00:00:32.040 --> 00:00:34.080 align:middle
#Senders, I keep the
#Pragma.

00:00:35.760 --> 00:00:39.250 align:middle
Now I can look for instance at

00:00:39.250 --> 00:00:41.210 align:middle
Morph's one.

00:00:41.280 --> 00:00:43.180 align:middle
We open the code.

00:00:43.180 --> 00:00:47.450 align:middle
This is the one corresponding to..
You remember, if I do 

00:00:47.450 --> 00:00:51.320 align:middle
"Inspect", an inspector opens
and

00:00:52.090 --> 00:00:56.970 align:middle
this inspector has this tab,

00:00:57.910 --> 00:00:59.070 align:middle
let's compare.

00:01:08.100 --> 00:01:11.240 align:middle
You see we create a 'Morph'
composite, there is 

00:01:11.240 --> 00:01:16.170 align:middle
a title and there'll be an
action done with

00:01:16.310 --> 00:01:18.950 align:middle
an error management in case
the 'Morph' wouldn't display well.

00:01:19.290 --> 00:01:21.990 align:middle
We convert and display a 'Morph'.

00:01:21.990 --> 00:01:26.840 align:middle
You also have "act" which is 
the way for

00:01:28.880 --> 00:01:31.390 align:middle
associating operations to

00:01:36.410 --> 00:01:37.060 align:middle
this tab.

00:01:37.440 --> 00:01:38.700 align:middle
Let's look at another example.

00:01:43.660 --> 00:01:47.980 align:middle
Here and there.

00:01:49.270 --> 00:01:50.210 align:middle
I want to see "Date".

00:01:56.080 --> 00:01:59.530 align:middle
If you remember, we had 
"date today inspect".

00:02:05.220 --> 00:02:07.690 align:middle
We had Details and Calendar.

00:02:09.130 --> 00:02:11.740 align:middle
How to create this 'Morph'?

00:02:11.740 --> 00:02:16.520 align:middle
You just create the 'Morph'
by using this message.

00:02:17.570 --> 00:02:20.000 align:middle
And Details, how does it work? 

00:02:26.990 --> 00:02:29.250 align:middle
I ask for the creation of a table, 
I assign it a

00:02:29.250 --> 00:02:34.010 align:middle
title, key value, evaluate, 
return

00:02:36.190 --> 00:02:38.730 align:middle
the key and compute
the value.

00:02:41.150 --> 00:02:43.080 align:middle
The last example I wanted 
to show you was:

00:02:43.990 --> 00:02:48.990 align:middle
what happens when you do the job
done

00:02:48.990 --> 00:02:53.470 align:middle
by a method inspector?

00:02:55.200 --> 00:02:57.930 align:middle
You remember, we had a method
which was

00:02:57.930 --> 00:03:02.200 align:middle
Bytecode, at least a table 
containing Bytecode and

00:03:02.200 --> 00:03:05.970 align:middle
we hab the Source or the
AST or Bytecode.

00:03:06.150 --> 00:03:10.680 align:middle
Let's look at AST. I'm gonna
ask to my dear 

00:03:10.910 --> 00:03:15.640 align:middle
Spotter. I'm gonna look for
Compiled

00:03:15.640 --> 00:03:19.470 align:middle
method. Let's consider the Source,

00:03:21.290 --> 00:03:21.970 align:middle
it seems good.

00:03:26.410 --> 00:03:28.300 align:middle
For the Source, which is this 
panel here, we can

00:03:34.330 --> 00:03:37.240 align:middle
see that we define the Source
and here there is a pharoMethod.

00:03:37.240 --> 00:03:39.450 align:middle
I don't know exactly what it 
is but it must tell

00:03:39.450 --> 00:03:42.920 align:middle
that it has to create an object
able to display

00:03:42.920 --> 00:03:45.940 align:middle
a Pharo method, by calling 
the Syntaxhighlighter or

00:03:45.940 --> 00:03:50.600 align:middle
something like this.
And if I look at AST, 

00:03:50.900 --> 00:03:53.100 align:middle
it returns

00:03:56.060 --> 00:03:56.400 align:middle
a tree,

00:04:01.340 --> 00:04:04.270 align:middle
it returns the AST which will
be displayed in the tree.

00:04:04.800 --> 00:04:06.710 align:middle
The aim is not for you to understand
precisely

00:04:06.710 --> 00:04:09.480 align:middle
how it works, it is to show you
a little bit

00:04:09.480 --> 00:04:12.020 align:middle
the complexity of this thing.

00:04:12.310 --> 00:04:14.820 align:middle
You see that in general
it is not very complicated.

00:04:15.180 --> 00:04:19.060 align:middle
Here, it is for the Bytecode, 
the ir is something else.

00:04:19.060 --> 00:04:23.010 align:middle
Besides, there is job-related
logic inside because you

00:04:23.010 --> 00:04:26.890 align:middle
have to think about how
you compute the intermediary

00:04:26.890 --> 00:04:30.630 align:middle
representation, etc.
But it is still something manageable.

00:04:31.990 --> 00:04:33.910 align:middle
I wanted to show you this because
it is nice, you

00:04:33.910 --> 00:04:37.170 align:middle
can sometimes do it on your 
job-related objects and

00:04:37.170 --> 00:04:38.260 align:middle
it enables you to go faster.

