weavejester / medley

A lightweight library of useful Clojure functions
Eclipse Public License 1.0
865 stars 66 forks source link

Remove unnecessary if #14

Closed Hardikus closed 8 years ago

Hardikus commented 8 years ago

Replace if with when.

weavejester commented 8 years ago

Why?

Hardikus commented 8 years ago

I think 'if' should be idiomatically used when there are two conditions, and 'when' should be used in case of one condition, which is the case here.

weavejester commented 8 years ago

I think it's fine. If if wasn't idiomatic for one conditions, it wouldn't have that functionality in the first place. when is just if + do, so switching an if to a when just adds a superfluous do.

Hardikus commented 8 years ago

Okay, Thanks