Thanks James, that's a useful version to experiment with :)

On Wed, Apr 30, 2014 at 12:04 AM, Colin Fleming <colin.mailingl...@gmail.com
> wrote:

> After posting this last week I decided to go down the explicit map route,
> and I'm already really glad I did. Amongst other things, it has allowed me
> to have two similar calls easily share their common options and merge in
> the differences. I'm generally a fan of maintaining fairly minimal APIs, I
> don't think I'll be duplicating functions, I don't really see a need - two
> extra braces are just not that much noise for me. I'd rather use Alex's
> last example with the optional map arg than have my-function and
> my-function-from-map everywhere.
>
>
> On 30 April 2014 17:55, James Reeves <ja...@booleanknot.com> wrote:
>
>>
>> On 30 April 2014 06:07, Alex Baranosky <alexander.barano...@gmail.com>wrote:
>>
>>> I especially dislike that my non-kwarg fns no-longer can elegantly
>>> accept no options.  Let me illustrate:
>>>
>>> (defn foo [& {:keys [a b]}]
>>>   [a b])
>>>
>>> (foo :a 1 :b 2)
>>> (foo)
>>>
>>
>> You could write:
>>
>> (defn foo [& [{:keys [a b]}]]
>>   [a b])
>>
>> (foo {:a 1 :b 2})
>> (foo)
>>
>> - James
>>
>> --
>> 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/d/optout.
>>
>
>  --
> 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/d/optout.
>

-- 
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/d/optout.

Reply via email to