A while back I showed how to use it for simplistic pattern matching too: 
http://spootnik.org/entries/2013/05/21/poor-mans-pattern-matching-in-clojure/

On Monday, July 17, 2017 at 3:10:14 AM UTC+2, lawrence...@gmail.com wrote:
>
> Thank you for all the responses. The examples of using juxt to sort among 
> results that are otherwise the same is a good example. 
>
>
> On Sunday, July 16, 2017 at 3:18:07 AM UTC-4, Boris V. Schmid wrote:
>>
>> I don't use juxt much, but the example that I did pick up is where juxt 
>> is used for sorting on one function first, and in the case of a tie, on the 
>> second function. That is quite useful to me.
>>
>> > 
>> (sort-by (juxt first second) (map vector (repeatedly 10 #(rand-int 3)) 
>> (shuffle (range 10))))
>> ([0 1] [0 4] [0 5] [0 6] [0 7] [0 8] [1 2] [1 3] [2 0] [2 9])
>>
>> On Sunday, July 16, 2017 at 5:52:44 AM UTC+2, lawrence...@gmail.com 
>> wrote:
>>>
>>>
>>>
>>> Does anyone use juxt in the real world, or is mostly for examples? 
>>>
>>>
>>>
>>  
>>
>

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