Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

ch01.md Flock example #614

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ch01.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class Flock {
}

breed(other) {
this.seagulls = this.seagulls * other.seagulls;
this.seagulls = this.seagulls + other.seagulls + other.seagulls;
return this;
}
}
Expand All @@ -43,7 +43,7 @@ const result = flockA
.breed(flockB)
.conjoin(flockA.breed(flockB))
.seagulls;
// 32
// 24
```

Who on earth would craft such a ghastly abomination? It is unreasonably difficult to keep track of the mutating internal state. And, good heavens, the answer is even incorrect! It should have been `16`, but `flockA` wound up permanently altered in the process. Poor `flockA`. This is anarchy in the I.T.! This is wild animal arithmetic!
Expand Down