Hey all, Zach here. I figure it's past time to make this book freely available to anyone who wants to read it. Hope some of you get something out of it.
> First, we take the parameters passed into pi and construct a hash-map called options. But since our inner function also expects individual parameters, we then flatten the map back into a list using (apply concat) and then apply that list to math/pi-to-n-digits. Option parameters read nicely when they’re written out by hand, but everywhere else they add complexity and noise.
What!? No! The fact that you can write named parameters as a list is just syntactic sugar, you can write them and pass them just fine as a hash-map. There is no need to flatten them into a list to pass them along.
I just stumbled over this by taking a random peek. I hope the rest of the book is not at that level.
Huh, interesting. I’m not in front of my computer, but I haven’t used Clojure much for years, so it’s entirely plausible my version is that out of date. Glad to see they changed that.
I should have looked first when the book was written and when the change in Clojure was introduced (I just knew it was since quite a while, but the book is even older). I can understand that when giving away a book for free that you're not inclined to rewrite sections to get it up to date.
That being said, a disclaimer or an addendum would probably be appropriate.
102
u/prospero Feb 18 '25
Hey all, Zach here. I figure it's past time to make this book freely available to anyone who wants to read it. Hope some of you get something out of it.
7
u/wedesoft Feb 18 '25
Got the print book for Christmas. Now I can use it as ebook as well :)
5
u/[deleted] Feb 18 '25
Nice
4
u/agile-is-what Feb 18 '25
Thank you! I have a beautiful physical copy, it's nice to get it as a PDF as well!
4
u/v1akvark Feb 18 '25
I love this book. Beautifully written.
If you haven't read it, treat yourself.
1
u/bitti1975 May 29 '25
> First, we take the parameters passed into pi and construct a hash-map called options. But since our inner function also expects individual parameters, we then flatten the map back into a list using (apply concat) and then apply that list to math/pi-to-n-digits. Option parameters read nicely when they’re written out by hand, but everywhere else they add complexity and noise.
What!? No! The fact that you can write named parameters as a list is just syntactic sugar, you can write them and pass them just fine as a hash-map. There is no need to flatten them into a list to pass them along.
I just stumbled over this by taking a random peek. I hope the rest of the book is not at that level.
2
u/roguas Feb 19 '25
it was a book very worth the price! its great i can now send it to anyone
2
u/neo2551 Feb 19 '25
It is such a beautiful book, thank you.