I'm not sure you read the whole question. I want to know how to delegate 
optional arguments to other functions with the same method signatures.

On Friday, June 15, 2012 12:04:00 AM UTC-7, Vinzent wrote:
>
> TL;DR: I want to know best practices for designing functions with multiple 
>> optional arguments.
>>
>
> Use destructing:
>
> (defn f [required & {:keys [foo bar] :or {foo :default}}]
>   [required foo bar])
>
> (f 3 :bar 1 :foo 2) ;=> [3 2 1]
> (f 3 :bar 1)          ;=> [3 :default 1]
>

-- 
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

Reply via email to