How come this is so debated, but normal variadic functions are not? Is it 
only because there's nothing equivalent to apply for kwarg functions? Would 
it really be such a huge addition to clojure.core to add a simple mapply 
function, especially given that the core API have kwarg functions? (this 
might not be the right forum to discuss language additions, but might be 
interesting to see if anyone else agrees)


Den tisdag 24 mars 2015 kl. 01:25:51 UTC+1 skrev solussd:
>
> I believe the current behavior with apply is the correct behavior as a map 
> can be treated as a sequence of "MapEntry"s. 
>
> --
>
>
> On Mar 23, 2015, at 19:15, Mark Engelberg <mark.en...@gmail.com 
> <javascript:>> wrote:
>
> Yes, I thought that technique worked, but I just conducted the same 
> experiment as you did and confirmed that it doesn't.  I must have been 
> misremembering.  You are correct that passing a map to a keyword-arg 
> function is more of a nuisance than it should be.
>
> On Mon, Mar 23, 2015 at 4:36 PM, Matching Socks <phill...@gmail.com 
> <javascript:>> wrote:
>
>> Could you give an example demonstrating this?
>>
>> user> (defn a [& {x :x y :y}] (vector x y))
>> #'user/a
>>
>> user> (a :y 7 :x 3)
>> [3 7]
>>
>> user> (apply a {:x 3 :y 7})
>> [nil nil] 
>>
>>
>>
>> On Monday, March 23, 2015 at 6:13:55 AM UTC-4, puzzler wrote:
>>>
>>> It's been a while since I've tested this, but I believe that if a map is 
>>> passed as the last argument to apply, Clojure "does the right thing" and 
>>> passes the map in as keyword args.
>>>
>>>  -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> 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+u...@googlegroups.com <javascript:>.
>> 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 clo...@googlegroups.com <javascript:>
> Note that posts from new members are moderated - please be patient with 
> your first post.
> To unsubscribe from this group, send email to
> clojure+u...@googlegroups.com <javascript:>
> 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+u...@googlegroups.com <javascript:>.
> 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