Fork me on GitHub
#clojurescript
<
2023-08-16
>
itaied08:08:55

hey all, just want to make sure a weird behavior in my app. Does cond evaluates :else in any case?

thheller08:08:50

if its the first true-ish match? this is not an actual :else branch, just a branch that is always true-ish and taken if reached

thheller08:08:17

(cond :else (prn "always taken") (other? x) :never)

thheller08:08:59

any keyword works, :else has no special meaning whatsoever here

itaied08:08:11

yea I understand.. I'm just facing a weird bug and I thought that maybe I misunderstood cond. I'll keep digging, thanks

delaguardo08:08:04

cond is a macro. you can macroexpand it to see what will be executed to dig deeper into the problem