Skip to content

Commit

Permalink
Add animations for chapter 3
Browse files Browse the repository at this point in the history
  • Loading branch information
sjmog committed Nov 24, 2017
1 parent 81ee2b0 commit 5196fb1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions chapter3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,13 @@ Here's another example of optional parentheses:
## What happens when we send an object a message?

For every message that can be received by an object, that object has some sort of **procedure** defined on it. A procedure is a _set of instructions that is executed by the object, one after the other_. We'll go into much more detail about how to write these procedures later.
For every message that can be received by an object, that object has some sort of **procedure** defined on it. A procedure is a _set of instructions that is executed by the object, one after the other_.

Like many program objects, these procedures usually have names. A named procedure is called a **method**. Sending an object a message to execute a procedure is referred to as _calling a method_.
We'll go into much more detail about how to write these procedures later.

Like many program objects, these procedures usually have names. A named procedure is called a **method**. Sending an object a message to execute a procedure is referred to as _calling a method_:

![Zooming into an object's interface, and demonstrating the procedures](../images/3-interfaces.gif)

> An interface is a list of all the things an object can do: all the object's procedures. In other words, an interface is a list of object methods.
Expand Down Expand Up @@ -210,9 +214,9 @@ Here's a more realistic example from a real-life program:

Again, we can guess that `object` is probably some kind of 'calculator'.

The set of messages that can be sent to an object is called its **interface** (from _inter_ (between) and _face_ (form) – so literally the shape of the space 'between objects').
The set of messages that can be sent to an object is called its **interface** (from _inter_ (between) and _face_ (form) – so literally the shape of the space 'between objects'). Messages that can't be sent to an object simply won't have any way 'into' the object, which will throw an error:

<diagram of interfaces as holes on an object>
![Zooming into an object's interface, and sending it a message it doesn't understand](../images/3-interfaces-and-errors.gif)

## Investigating object interfaces

Expand Down
Binary file added images/3-interfaces-and-errors.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/3-interfaces.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5196fb1

Please sign in to comment.