clojuredesign-podcast

Discussions around the Functional Design in Clojure podcast - https://clojuredesign.club/
practicalli-john 2020-11-29T11:47:33.142800Z

Just listened to the branching out episode, another highly enjoyable one. As there is a talk of branches, I was wondering if function definitions with different arity branches are considered a conditional, or if they use a conditional under the covers (I assume they must do, I havent looked at the source code yet)

(defn hello
  ([] (hello "welcome to Clojure."))
  ([message] (str "Hello, " message))
  ([message & _] 
    (printlin "I can only cope with one message, sorry)
    (hello message)))

nate 2020-11-30T20:14:13.144Z

Hm, interesting idea. I took a quick glance and I can't see clearly how it maps to a conditional, but I would assume that it has to at some point.

practicalli-john 2020-12-01T18:06:48.144200Z

If I am reading this right, its just nested if statements 🙂 https://github.com/clojure/clojure/blob/clojure-1.10.1/src/clj/clojure/core.clj#L4523-L4535

nate 2020-12-01T21:05:18.144600Z

it does look like the right place

nate 2020-12-01T21:05:30.144800Z

that's quite a let block

nate 2020-12-01T21:06:14.145Z

a 46 line let block for a 5 line body

👀 1
practicalli-john 2020-12-02T01:24:28.145200Z

What happens to in Clojure core should sometimes stay in Clojure core :face_with_hand_over_mouth:

nate 2020-12-02T02:25:27.145600Z

Hahaha. Too true.