Fork me on GitHub
#clojuredesign-podcast
<
2020-11-29
>
practicalli-johnny11:11:33

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)))

nate20:11:13

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.

nate21:12:18

it does look like the right place

nate21:12:30

that's quite a let block

nate21:12:14

a 46 line let block for a 5 line body

👀 3
practicalli-johnny01:12:28

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

nate02:12:27

Hahaha. Too true.