marick / fp-oo

Code samples and exercise solutions for /Functional Programming for the Object-Oriented Programmer/
143 stars 50 forks source link

Confusing wording in Chapter 10 Exercise 6 #21

Closed benmoss closed 11 years ago

benmoss commented 12 years ago

You say

Suppose you wanted to set an atom’s value to 33. How would you do that? Keep in mind that swap! demands a function, not (say) an integer.

I assumed I just had to add 32 to the current number of 1, so I just did (swap! my-atom (partial + 32)). Only after reading the next exercise did I realize your true intention. I guess what's not clear is when you say "an atom" you mean any atom, not the one just referenced in the example code.

marick commented 11 years ago

Added "regardless of its current value"