Skip to content

Instantly share code, notes, and snippets.

@stoeffel
Last active August 29, 2015 14:14
Show Gist options
  • Select an option

  • Save stoeffel/39d608e4a626c65a1329 to your computer and use it in GitHub Desktop.

Select an option

Save stoeffel/39d608e4a626c65a1329 to your computer and use it in GitHub Desktop.
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
);
@stoeffel
Copy link
Copy Markdown
Author

stoeffel commented Feb 1, 2015

Which api is the best?

ref: https://clojuredocs.org/clojure.core/cond

@hemanth
Copy link
Copy Markdown

hemanth commented Feb 2, 2015

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