﻿WEBVTT

00:00:00.160 --> 00:00:02.960 align:middle
Hello. This course is a bit unusual.

00:00:03.120 --> 00:00:06.680 align:middle
I will present questions
to prepare exercises for next week.

00:00:06.840 --> 00:00:09.840 align:middle
This session is the first session

00:00:10.000 --> 00:00:13.000 align:middle
about the way we want you to think
about OOC.

00:00:13.160 --> 00:00:15.960 align:middle
Do the exercises.
They're quite interesting.

00:00:16.120 --> 00:00:18.400 align:middle
What are they? There are three of them.

00:00:19.120 --> 00:00:22.440 align:middle
We'll ask you to implement not,
to implement or,

00:00:22.600 --> 00:00:26.480 align:middle
and, most importantly,
to wonder why these exercises.

00:00:26.640 --> 00:00:28.480 align:middle
Let's take a look at them.

00:00:28.640 --> 00:00:31.960 align:middle
First, you have the Booleans
true and false.

00:00:32.120 --> 00:00:35.080 align:middle
You have messages and objects.
How to implement not?

00:00:35.240 --> 00:00:36.680 align:middle
It's quite easy.

00:00:36.840 --> 00:00:41.720 align:middle
If you have false and send
the message not, it returns true.

00:00:41.880 --> 00:00:46.400 align:middle
If you have true and send
the message not, it returns false.

00:00:46.560 --> 00:00:49.840 align:middle
It's not so hard.
But how to implement this?

00:00:50.720 --> 00:00:52.960 align:middle
The second question is about or.

00:00:53.120 --> 00:00:57.240 align:middle
Or in Pharo is |. We took examples
from the Pharo implementation.

00:00:57.400 --> 00:01:00.840 align:middle
Don't cheat. Do it without checking
how it's implemented.

00:01:01.000 --> 00:01:03.920 align:middle
Once again, you have Booleans:
true and false.

00:01:04.080 --> 00:01:05.880 align:middle
You have objects and messages.

00:01:06.040 --> 00:01:09.160 align:middle
You have true | true returns true.

00:01:09.320 --> 00:01:12.480 align:middle
true | false returns true.
true | anything returns true.

00:01:12.640 --> 00:01:14.920 align:middle
It's the same with false.

00:01:15.080 --> 00:01:18.280 align:middle
How to implement this?
That's the two questions.

00:01:18.440 --> 00:01:22.720 align:middle
Take a piece of paper and try to answer.

00:01:23.840 --> 00:01:27.560 align:middle
The third question:
"Why are you guys asking me this?"

00:01:27.720 --> 00:01:31.600 align:middle
You must be thinking: "I'll never
implement Booleans in my life."

00:01:31.760 --> 00:01:33.760 align:middle
You're right.

00:01:33.920 --> 00:01:36.640 align:middle
Except if you have
to use three-valued logic:

00:01:36.800 --> 00:01:39.680 align:middle
true, false, and unknown.

00:01:39.840 --> 00:01:41.200 align:middle
How do you do this?

00:01:41.360 --> 00:01:46.160 align:middle
You must wonder why we're wasting film
to ask you this question.

00:01:46.320 --> 00:01:50.520 align:middle
It's the crucial question we ask
whenever we teach advanced programming.

00:01:50.680 --> 00:01:55.360 align:middle
There must be a reason. We'll explain
next week what that reason is.

00:01:55.520 --> 00:01:56.720 align:middle
Enjoy.