Fork me on GitHub
#clojure-losangeles
<
2019-11-14
>
kyle.burton01:11:09

Just to let y’all know I am on my way, looks like I’ll be there just about 6, though may a few minutes after.

fiddlerwoaroof05:11:58

The tricks I mentioned were: juxt instead of a hash function. E.g. (juxt count identity) instead of #(list (count %) %) (doto println) (or (doto tap>)) for temporarily logging the value of an expression, this is especially useful with the thread first macro:

(-> it ... (doto println) ...)

👍 8
fiddlerwoaroof06:11:58

It was great to meet everyone, I need to come down more often

nate06:11:34

Yes, it was great to meet you too.

nate06:11:31

And for anyone interested in the podcast I'm one half of, head to https://clojuredesign.club (or look in your local podcast directory)

nate06:11:09

We have a channel on here too: #clojuredesign-podcast

bocaj15:11:27

@fiddlerwoaroof (Missed the meeting, no sitter last night, hi I’m Jacob 🙂 ) I’m curious about the hash function! How did hash functions come up? I use these to avoid duplicate work on the edges of my system. I recently found a thorough one here https://github.com/replikativ/hasch

fiddlerwoaroof15:11:24

@bocaj by hash function I meant the #(...) syntax for lambdas

👍 4
kyle.burton15:11:56

This "thread last" example was in the slides (sorts a list of strings by its length):

(->>
   ["sort" "this" "by" "length"]
   (map #(list (count %) %))
   (sort-by first)
   (mapv second))
Ed pointed out that the #(list (count %) %) could be written using juxt:
(->>
   ["sort" "this" "by" "length"]
   (map (juxt count identity))
   (sort-by first)
   (mapv second)

👍 4