Fork me on GitHub
#clojuredesign-podcast
<
2020-07-15
>
genekim23:07:34

@nate So incredibly pleased with myself for using partial today — I used it to get rid of an unsightly bit of repeated code, which I would have found so tolerable a year ago. I can’t wait to use juxt!!!

👍 3
genekim23:07:36

FWIW — I’m using it in my first clojure-lanterna program, to gain an understanding of getting keystrokes:

(defn loop-until-esc []
  " get key, print, until you hit ESC key"
  (let [get-key (partial s/get-key-blocking scr)]
    (loop [k (get-key)]
      (if-not (= k :escape)
        (do
          (println k)
          (recur (get-key)))
        nil))))

genekim23:07:31

Once upon a time, that (s/get-key-blocking scr) would never have bothered me — now, it seems intolerable. 🙂

nate23:07:37

Oh yes. Tidied that up quite nicely.

genekim23:07:56

@nate So thank you for your awesome podcasts! Keep up the amazing work — I learn so much!!

nate23:07:23

@genekim awesome! So glad to hear you improving your code. I've really enjoyed these function-focused episodes. There's so much power and depth to the core of Clojure.