Leanpub Header

Skip to main content

Clojure Goodness Notebook

Experience the Clojure programming language through code snippets

Learn more about (hidden) Clojure features with code snippets and short articles. The articles and code will get you started quickly and will give more insight in Clojure.

The author is letting you choose the price you pay for this book!

Pick Your Price...
PDF
EPUB
WEB
About

About

About the Book

In 2020 I started to write small blog posts about Clojure at Messages from mrhaki. The posts contain code samples of cool Clojure features I just didn't want to forget.

The Clojure Goodness Notebook contains the blog posts about Clojure previously mentioned on my blog. The posts have been edited slightly so they can be used for the book. The book gives a broad overview of all the great features we can find in the Clojure language.

Share this book

Categories

Price

Pick Your Price...

Minimum price

Free!

$7.99

You pay

$0.00

Author earns

$0.00
$

All prices are in US $. You can pay in US $ or in your local currency when you check out.

EU customers: prices exclude VAT, which is added during checkout.

...Or Buy With Credits!

Number of credits (Minimum 0)

0
The author will earn $0.00 from your purchase!
You can get credits monthly with a Reader Membership

Author

About the Author

Hubert A. Klein Ikkink (mrhaki)

Hello. I am a passionate Groovy and Java developer based in Tilburg, The Netherlands. My goal is to write software, like Pixar makes movies, BMW makes cars, Bang & Olufsen makes audio and TV systems and Apple makes computers and devices: clean, elegant, user-centered and high quality.

Contents

Table of Contents

About Me

Introduction

  1. Code samples

Core

  1. There Is Truth In Many Things
  2. Get Clojure Version
  3. Keyword As Function
  4. Using Sets As Functions
  5. Destructure Sequences
  6. Destructuring Maps

Functions

  1. Create New Function Complementing Other Function
  2. Repeating A Value Or Function Invocation
  3. Composing Functions With comp
  4. Set Default Value For nil Function Argument With fnil
  5. Getting Results From Multiple Functions With Juxt Function
  6. Pure Function Sample Buying Coffee From FP Programming In Scala Written In Clojure

Strings

  1. Formatting With Java Format String
  2. Trimming Strings
  3. Check Substring Is Part Of String
  4. Splitting Strings
  5. Joining Elements in a Collection
  6. Replacing Characters In A String With escape Function
  7. Replacing Matching Values In String

Collections

  1. Merge Maps With Function To Set Value Duplicate Keys
  2. Split Collection With Predicate
  3. Concatenation Of Map Function Results With mapcat
  4. Transforming Collection Items With Index
  5. Repeat Items In A Collection As Lazy Sequence With cycle
  6. Interleave Keys And Values Into A Map With zipmap
  7. Using The range Function
  8. Combine First And Next Functions Multiple Times
  9. Get Random Item From A Sequence
  10. Query Set Of Maps With index Function
  11. Creating Union Of Sets
  12. Find Differences In Sets
  13. Getting But The Last Element(s) From A Collection
  14. Remove Duplicates From A Collection With distinct
  15. Remove Consecutive Duplicate Elements From Collection
  16. Getting Part Of A Vector With subvec
  17. Shuffle A Collection
  18. Finding The Maximum Or Minimum Value
  19. Taking Or Dropping Elements From A Collection Based On Predicate
  20. Partition Collection Into Sequences
  21. Counting Frequency Of Items In A Collection
  22. Reapply Function With Iterate To Create Infinite Sequence
  23. Checking Predicate For Every Or Any Element In A Collection
  24. Keep Non-Nil Function Results From Collection
  25. Flatten Collections
  26. Getting Intersections Between Sets

Files

  1. Writing Text File Content With spit
  2. Reading Text File Content With slurp
  3. Create All Parent Directories For A File

Java Interoperability

  1. Create New Instance Of Java Class
  2. Create And Initialize Object Based On Java Class With doto
  3. Use .. For Invocation Java Method Chaining
  4. Invoke Java Method With Varargs Parameter
  5. Turn Java Object To Map With bean Function

Get the free sample chapters

Click the buttons to get the free sample in PDF or EPUB, or read the sample online here

The Leanpub 60 Day 100% Happiness Guarantee

Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.

Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.

You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!

So, there's no reason not to click the Add to Cart button, is there?

See full terms...

Earn $8 on a $10 Purchase, and $16 on a $20 Purchase

We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.

(Yes, some authors have already earned much more than that on Leanpub.)

In fact, authors have earned over $14 million writing, publishing and selling on Leanpub.

Learn more about writing on Leanpub

Free Updates. DRM Free.

If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).

Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.

Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.

Learn more about Leanpub's ebook formats and where to read them

Write and Publish on Leanpub

You can use Leanpub to easily write, publish and sell in-progress and completed ebooks and online courses!

Leanpub is a powerful platform for serious authors, combining a simple, elegant writing and publishing workflow with a store focused on selling in-progress ebooks.

Leanpub is a magical typewriter for authors: just write in plain text, and to publish your ebook, just click a button. (Or, if you are producing your ebook your own way, you can even upload your own PDF and/or EPUB files and then publish with one click!) It really is that easy.

Learn more about writing on Leanpub