Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobiasd committed Nov 17, 2013
1 parent e0a6d45 commit ca82e03
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions from_oop_to_fp_-_inheritance_and_the_expression_problem.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ During my currently running undertaking of learning
functional programming (FP) I stumbled upon a challange related to the
[expression problem](http://c2.com/cgi/wiki?ExpressionProblem).
Let's say you write a platform game with different types of enemies.
They all have respond to certain actions, like being jumped on,
in distinct ways etc. We want to be able to store them together
in a homogeneous list, so we give them a common base class.
The according class diagram to this could look as follows:
They all have to respond to certain actions, like being jumped on etc.,
in distinct ways. Also, we want to be able to store them together
in a homogeneous list, so we give them a common base class which defines
their interface. The according class diagram to this could look as follows:

```
---------
Expand All @@ -21,10 +21,10 @@ The according class diagram to this could look as follows:
| Boo | | Goomba | | Wiggler |
------- ---------- -----------
```
The functions every class derived from `Enemy` could be `walk`, `jumpedOn`,
`spinJumpedOn`, `getPosition`.
The functions every class derived from `Enemy` has to implement
could be `walk`, `jumpedOn`, `spinJumpedOn`, `getPosition`.
The first three would be non const member functions, they mutate the object.
The last one would be a const function, it only return a property.
The last one would be a const function, it only returns a property.

To make everything a bit easier,
let's say we just have two derived subclasses:
Expand Down

0 comments on commit ca82e03

Please sign in to comment.