Fork me on GitHub
#clojure-europe
<
2021-07-18
>
pez09:07:36

Morning!

reefersleep18:07:17

Good morning :hugging_face:

dominicm19:07:03

Sometimes clojure looks weird (inc ('+ 1 1)) ;;=> 2

greg14:07:18

What actually happens here? Why ('+ 1 1) returns the second arg?

dominicm19:07:41

Symbols are like keywords, they can be used to "get" from something, e.g. (:foo 1 2) ,

dominicm19:07:59

Because 1 doesn't contain the key '+, it uses the "else" parameter of 1.

greg21:07:31

makes sense, thanks