Last active
August 29, 2015 14:14
-
-
Save stoeffel/39d608e4a626c65a1329 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| cond([ | |
| [isTrue(foo), doStuffFoo], | |
| [isTrue(bar), doStuffBar], | |
| [always(true), otherwise] | |
| ]); | |
| //or | |
| cond( | |
| [isTrue(foo), doStuffFoo], | |
| [isTrue(bar), doStuffBar], | |
| [always(true), otherwise] | |
| ); | |
| //or | |
| cond( | |
| isTrue(foo), doStuffFoo, | |
| isTrue(bar), doStuffBar, | |
| always(true), otherwise | |
| ); | |
| //or | |
| cond( | |
| isTrue(foo), doStuffFoo, | |
| isTrue(bar), doStuffBar, | |
| otherwise | |
| ); |
Author
I would vote for the second one.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Which api is the best?
ref: https://clojuredocs.org/clojure.core/cond