May 2018
Beginner to intermediate
290 pages
6h 43m
English
Unfortunately, along with the do stuff at the same time magic there is the inevitable hair on fire complication: without some kind of positive control mechanism, we know nothing about how fast a thread will run. The implications of this ignorance are deep and pervasive. To see these implications in action we’re going to break the rules a bit and embed some def expressions in a couple of functions:
| | (def fav-book "Jaws") |
| | |
| | (defn make-emma-favorite [] (def fav-book "Emma")) |
| | |
| | (defn make-2001-favorite [] (def fav-book "2001")) |
As we saw in back in Chapter 8, Def, Symbols, and Vars, this is not a great idea: sticking a def inside of a function creates a more or less hidden side effect, making your ...
Read now
Unlock full access