Fork me on GitHub
#code-reviews
<
2015-06-30
>
meow03:06:57

@clojuregeek: there is also reset! for mutating an atom when passing in a function doesn't make sense, though your use of swap! and inc looks just fine https://clojuredocs.org/clojure.core/reset!

meow03:06:16

I'm too tired to give it a serious code review, but I did want to point out one thing. I think your blog post lacks confidence and maybe you aren't giving yourself enough credit. Here's one example from your post:

6: Return the recipe. Maybe not needed? but it seemed like a good idea at the time.
It seemed like a good idea at the time because it is a good idea. The other atom mutating functions like reset! and swap! also return their new values, so it makes total sense to carry on that tradition with your custom add! function. So I say own those instincts, clarify anything you aren't quite sure about here on slack, and write with more authority - you're better than you're giving yourself credit for. Keep up the good work. simple_smile

danielcompton04:06:38

@clojuregeek: simpliest -> simplest

clojuregeek14:06:53

@meow: got it, thanks! simple_smile

meow14:06:04

@clojuregeek: you're welcome simple_smile

clojuregeek14:06:04

fixed typo, added reset, removed apologetic wording simple_smile … seems like in my add! function, all the work is done in the let, is that cool?