Thanks, Luc!
On Mar 17, 2014, at 11:08 AM, Luc Prefontaine <[email protected]>
wrote:
> Use (apply base-fun opts)
>
> Luc P.
>
>
>> I'm trying to define a couple of functions that support the same options,
>> but return different return types.
>>
>> I have one function that is the "base" function that provides the most raw
>> access, and some other functions that call this base function and do their
>> thing.
>>
>> I would like to make these keyword args available to all of these
>> functions, but I'm unsure how to do this.
>>
>> e.g.
>>
>> (defn base-fun[& {:keys [num-responses timeout] :or {:num-responses 1
>> :timeout 5000}}]
>> num-responses)
>>
>> (defn other-fun[required-arg & opts]
>> (base-fun opts))
>>
>>
>> (other-fun "fred" :num-responses 4) ;IllegalArgumentException No value
>> supplied for key: (:num-responses 4)
>>
>> Is there a way to define common keyword args among functions?
>>
>> --
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to [email protected]
>> Note that posts from new members are moderated - please be patient with your
>> first post.
>> To unsubscribe from this group, send email to
>> [email protected]
>> 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 [email protected].
>> For more options, visit https://groups.google.com/d/optout.
>>
> --
> Luc Prefontaine<[email protected]> sent by ibisMail!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Clojure" group.
> To post to this group, send email to [email protected]
> Note that posts from new members are moderated - please be patient with your
> first post.
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/clojure?hl=en
> ---
> You received this message because you are subscribed to a topic in the Google
> Groups "Clojure" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/clojure/WGHkr5UvrKQ/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> [email protected].
> 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 [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/d/optout.