The code for dmirylenka's release-sharks form
tdsl.search> (defn release-sharks [n & {:keys [laser-beams]}]
(if (boolean laser-beams) (repeat (int n) :shark)))
#'tdsl.search/release-sharks
tdsl.search> (release-sharks 2 :laser-beams 1)
(:shark :shark)
(if (boolean laser-beams) (repeat (int n) :shark)))
#'tdsl.search/release-sharks
tdsl.search> (release-sharks 2 :laser-beams 1)
(:shark :shark)
18.06.2013, 14:32, "dmirylenka" <daniilmirile...@gmail.com>:
According, to the library coding standards, the first is better:--
(release-sharks
2
:laser-beams
true
) ; good
(release-sharks
2
{:laser-beams
true
}) ; bad
http://dev.clojure.org/display/design/Library+Coding+Standards
On Tuesday, June 18, 2013 5:26:15 PM UTC+12, Omer Iqbal wrote:Hey folks,What'c considered more idiomatic when having multiple, optional arguments?(defn foo1 [a b & args](let [opts (apply hash-map args]...))or(defn foo2 [a b opts]...)Cheers,Omer--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
---
You received this message because you are subscribed to the Google Groups "Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.