Re: clojure.contrib.sql insert id

2010-04-21 Thread Saul Hazledine
On Apr 20, 8:51 pm, Remco van 't Veer wrote: > I am doing the following after an insert for a Derby database: > >   (sql/with-query-results res >     ["VALUES IDENTITY_VAL_LOCAL()"] >     (first (vals (first res > > For MySQL it would be something like: > >   (sql/with-query-results res >    

Re: clojure.contrib.sql insert id

2010-04-21 Thread Remco van 't Veer
Nice! That's a lot better than depending on some quirky sql construct. Thanks, Remco Saul Hazledine writes: > On Apr 20, 8:51 pm, Remco van 't Veer wrote: >> I am doing the following after an insert for a Derby database: >> >>   (sql/with-query-results res >>     ["VALUES IDENTITY_VAL_LOCAL(

Re: clojure.contrib.sql insert id

2010-04-21 Thread Joost
On Apr 21, 11:48 am, Remco van 't Veer wrote: > Nice!  That's a lot better than depending on some quirky sql construct. Agreed. There's just one potential issue (which is the same issue I have with clojure.contrib.sql): it doesn't quote the column or table names, meaning you can't use such nice c

Try + finally question

2010-04-21 Thread ka
Hi, I'm using an API to connect to a server which does not provide constructors, just static methods to get & close connections. How can I do something like ... (try (let [conn (API/getConnection ..)] ()) (catch ..) (finally (if conn (API/closeConnection conn Problem is that c

duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Neal
Hi, I'm new to Clojure. I've been trying to go through the Programming Clojure book and have run into a problem that I hope someone can fix. I'm trying to use duck-streams, but it is missing from the clojure- contrib JAR file (at least in build #81). I have listed the contents of the JAR file a

Arguments for < and > et al

2010-04-21 Thread Bill Allen
I've been writing a program that requires the use of java.util.Calendar and its descendent java.util.GregorianCalendar. One thing I'd hoped to do was compare two Calendar objects with <, but the compiler complained that the arguments to < didn't inherit from Number which was a surprise to me becaus

Re: Interesting Facebook blog post on Concurrency (mentions Clojure)

2010-04-21 Thread Carlos Bueno
H! :D -- Clojure uses MVCC, which may help with this. http://en.wikipedia.org/wiki/Multiversion_concurrency_control But as Hickey points out, no one really knows yet because there aren't enough high-core machines doing real work in the field. http://groups.google.com/group/clojure/msg/cd3e77afb754

Re: Try + finally question

2010-04-21 Thread Alex Osborne
ka writes: > How can I do something like ... > > (try > (let [conn (API/getConnection ..)] > ()) > (catch ..) > (finally (if conn (API/closeConnection conn > > Problem is that conn is unavailable in the finally context. Why not just have two try blocks? (try (let [conn (API/g

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Meikel Brandmeyer
Hi, On 21 Apr., 01:37, Neal wrote: > All the documentation that I read seems to indicate that duck-streams > is not deprecated. c.c.ducks-streams is now named c.c.io. Sincerely Meikel -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to thi

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Alex Osborne
Hi Neal, Neal writes: > I'm trying to use duck-streams, but it is missing from the clojure- > contrib JAR file (at least in build #81). I have listed the contents > of the JAR file and confirmed that it is not in there. It sounds like you're using a 1.2 pre-release snapshot build of clojure-co

Slides for short (45 minutes) presentation of clojure for java devs

2010-04-21 Thread Laurent PETIT
Hello, I've consulted a lot of already made presentations of clojure. They are great, but I guess they may not suit my needs because it seems to me that either: * they are more 1 1/2 to 2 hours talks than 45 minutes * they assume the "public" will not be relunctant to some terms like "Lisp", "

Re: Arguments for < and > et al

2010-04-21 Thread Stuart Halloway
The built-in Java comparison operators don't honor Comparable either. In Clojure, it's about keeping (pure number) math fast. If you are doing any nontrivial date work, I recommend you look at clj- time (http://github.com/clj-sys/clj-time), a Clojure wrapper for Joda Time. Then, if you real

Re: Try + finally question

2010-04-21 Thread ka
Thanks for the reply Alex, I thought of 2 try blocks, but seems over engineering doesn't it ? I actually need to open 2 connections simultaneously, which would amount to 3 nested try blocks. The whole code gets cluttered with all these try finally (and one catch) statements. (try (let [con

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Douglas Philips
On 2010 Apr 21, at 8:11 AM, Alex Osborne wrote: I suggest you use the stable 1.1 releases of both Clojure and contrib for your initial learning as it will better match the book. When 1.2 is released stable I'm sure there will be a document written that explains the differences. That isn't

Re: Try + finally question

2010-04-21 Thread Mark J. Reed
On Wed, Apr 21, 2010 at 9:06 AM, ka wrote: > Connection1 conn1 = null; > Connection2 conn2 = null; > try { > conn1 = API1.getConnection ..; > conn2 = API2.getConnection ..; > ... > } You can't do that without using atoms or something, because you're assigning to conn1 and conn2 twice. That'

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Stuart Halloway
The second level header tells you the branch (e.g. master). On the left hand side is a list of branches (so you can click on e.g. 1.1.x). Some ways I see this might be better: (1) make clear what master currently equals (right now it is 1.2 alpha) (2) highlight the branch info more with css (3

Re: Try + finally question

2010-04-21 Thread Laurent PETIT
Hi, Something I don't understand: if the call to (API/getConnection ...) fails, there is nothing to close, right ? So for the problem of ensuring that any open connection is always closed, the following pattern seems enough: (try (let [conn (API/getConnection ..)] XXX) (finally (API/clo

Re: Try + finally question

2010-04-21 Thread Laurent PETIT
Oh, also see the source code for with-open : http://github.com/richhickey/clojure/blob/master/src/clj/clojure/core.clj#L2542 and also note that it allows you to declare bindings for opening connections in sequence, and will take care of closing them in the reverse order. And to answer your questi

Re: Try + finally question

2010-04-21 Thread Mark J. Reed
On Wed, Apr 21, 2010 at 9:37 AM, Laurent PETIT wrote: > Hi, > > Something I don't understand: if the call to (API/getConnection ...) > fails, there is nothing to close, right ? > > So for the problem of ensuring that any open connection is always > closed, the following pattern seems enough: > > (

Re: Try + finally question

2010-04-21 Thread Laurent PETIT
2010/4/21 Mark J. Reed : > On Wed, Apr 21, 2010 at 9:37 AM, Laurent PETIT > wrote: >> >> Hi, >> >> Something I don't understand: if the call to (API/getConnection ...) >> fails, there is nothing to close, right ? >> >> So for the problem of ensuring that any open connection is always >> closed, th

Re: Try + finally question

2010-04-21 Thread Alex Osborne
ka writes: > The whole code gets cluttered with all these try finally (and one > catch) statements. > > (try > (let [conn1 (API1/getConnection ..)] > (try > (let [conn2 (API2/getConnection ..)] > (try > ( ... Do something with conn1 conn2

Re: Try + finally question

2010-04-21 Thread Tassilo Horn
On Wednesday 21 April 2010 15:06:40 ka wrote: Hi! > The macro solution looks good. But with 2 different APIs for 2 > connections, I would need to write 2 macros right? No, not really. You could also make the symbols for the API class an additional arg to the macro, like: (defmacro with-api-c

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Alex Osborne
Stuart Halloway writes: > The second level header tells you the branch (e.g. master). On the > left hand side is a list of branches (so you can click on e.g. 1.1.x). > > Some ways I see this might be better: > > (1) make clear what master currently equals (right now it is 1.2 alpha) > (2) highlig

Re: duck-streams missing from clojure-contrib.jar file

2010-04-21 Thread Laurent PETIT
2010/4/21 Alex Osborne : > Stuart Halloway writes: > >> The second level header tells you the branch (e.g. master). On the >> left hand side is a list of branches (so you can click on e.g. 1.1.x). >> >> Some ways I see this might be better: >> >> (1) make clear what master currently equals (right

Re: Try + finally question

2010-04-21 Thread ka
Thanks all for replies. Laurent, Alex you guys are right, the problem is only with aesthetics of nesting / boilerplate. The nesting implementation semantically expresses exactly what is required. The with-cleanup macro seems really neat. Guess I'll learn macros first and try to implement one.

Re: Try + finally question

2010-04-21 Thread Laurent PETIT
Hi, I don't know for sure, but it seems to me that perl 6 way of "writing" exception handling is just a syntactic difference. For an interesting shift in the possibilities of exception handling/recovery, have a look at how Common Lisp does this with conditions/restart : http://www.gigamonkeys.com

Re: Try + finally question

2010-04-21 Thread Mark J. Reed
The main thing about Perl6 in this case is that the catch/finally blocks are inside the same scope as the try. But that's true in Clojure as well! The difference is that Clojure's try is not itself a lexical binding scope; you have to wrap one around it or within it via let. That's why I thought

Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
Hey everyone, I've had to code these guys up a few times: (defn rotate "Take a collection and left rotates it n steps. If n is negative, the collection is rotated right. Executes in O(n) time." [n coll] (let [c (count coll)] (take c (drop (mod n c) (cycle coll) (defn rotate-while

Coordinated, asynchronous modification of state?

2010-04-21 Thread Garth Sheldon-Coulson
Hi All, This e-mail is the product of some musing about refs, agents, and atoms. I would like to offer some thoughts on a possible fourth reference type that allows coordinated, asynchronous modification of state. I would greatly appreciate comments from the community. Maybe some of these ideas h

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 21 April 2010 17:23, Sean Devlin wrote: > I've had to code these guys up a few times: Nice functions! I'd replace "collection" with "sequence" in the docstrings, though. (And rename the args accordingly.) You can also rewrite rotate as (defn rotate [n s] (lazy-cat (drop n s) (

Documentation (was: Re: duck-streams missing from clojure-contrib.jar file)

2010-04-21 Thread Douglas Philips
On 2010 Apr 21, at 9:31 AM, Stuart Halloway wrote: The second level header tells you the branch (e.g. master). On the left hand side is a list of branches (so you can click on e.g. 1.1.x). Wow, that is quite subtle. As you click into contrib from clojure.org it isn't very noticeable. It als

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
You're right about changing the docstring to read ""sequence" I think the lazy-cat version looses the ability to rotate in reverse, which I've come to love from Ruby. Also, I have found use cases where I want to rotate a period longer than the sequence length. Thanks for the feedback, though. Se

Re: Coordinated, asynchronous modification of state?

2010-04-21 Thread Garth Sheldon-Coulson
Hi All, The moment one sends a post one starts thinking about it from a critical perspective. I think I may have grown so used to the idea that nothing in Clojure can deadlock that I completely overlooked the possibility of deadlock in the idea I proposed. If two serfs are the targets of two diff

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 21 April 2010 17:46, Sean Devlin wrote: > I think the lazy-cat version looses the ability to rotate in reverse, > which I've come to love from Ruby.  Also, I have found use cases where > I want to rotate a period longer than the sequence length. Right. I don't mind rotate being strict, actuall

Re: sharing multiple jogl opengl contexts in clojure

2010-04-21 Thread Joel Gluth
On Apr 20, 4:46 pm, Josh Stratton wrote: > But I can't seem to call createGLPbuffer w/o getting an exception. > Caused by: java.lang.IllegalArgumentException: No matching method: > createGLPbuffer This one is because the createGLPbuffer method is not static; you need to have created a GLDrawable

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Mark Engelberg
On Wed, Apr 21, 2010 at 8:46 AM, Sean Devlin wrote: > You're right about changing the docstring to read ""sequence" > > I think the lazy-cat version looses the ability to rotate in reverse, > which I've come to love from Ruby.  Also, I have found use cases where > I want to rotate a period longer

How do I destructure this?

2010-04-21 Thread Base
Hi All - I am having a hard time destructuring a nested data structure. I am starting out with: {:tag :column, :attrs nil, :content [{:tag :name, :attrs nil, :content ["agecat"]} {:tag :value, :attrs nil, :content ["nil"]} {:tag :threshold, :attrs nil, :content ["0.05"]}]} and am looking

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
Hmmm... good point. Now that I think about it, cycle is an artifact of an early implementation. On Apr 21, 1:01 pm, Mark Engelberg wrote: > On Wed, Apr 21, 2010 at 8:46 AM, Sean Devlin wrote: > > You're right about changing the docstring to read ""sequence" > > > I think the lazy-cat version l

Re: How do I destructure this?

2010-04-21 Thread Sean Devlin
Hmmm... I'm not sure destructuring is possible here. Would it be easier to put an extractor fn in place? (defn extract [arg] (apply hash-map (map (juxt :tag :content) (:content arg Just a thought. I'm sure someone will have a better idea, though. On Apr 21, 1:02 pm, Base wrote: > Hi All

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
One could also do (defn rotate [n s] (let [[front back] (split-at (mod n (count s)) s)] (concat back front))) I was hoping for a moment to avoid calculating (count s) up front, but that definitely does interfere with negative / large shifts, so never mind that. Sincerely, Michał -- You r

Re: Examples of Clojure in production?

2010-04-21 Thread Heinz N. Gies
On Apr 19, 2010, at 5:55 , Daniel Glauser wrote: > I would like to start a thread about Clojure use in production. Who > is using it? And for what? What kind of load do you have on the > system in terms of approximate transactions per day? Would you mind > if your example was featured in a pr

Re: How do I destructure this?

2010-04-21 Thread Base
Damn! This looks pretty good to me. BTW - Love your blog and tutorial videos. they are incredibly helpful and instructive. I have watched many of them more than once. I really appreciate them. Thanks Sean!!! Bassel On Apr 21, 12:07 pm, Sean Devlin wrote: > Hmmm... I'm not sure destructuring

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
I like that version :) On Apr 21, 1:11 pm, Michał Marczyk wrote: > One could also do > > (defn rotate [n s] >   (let [[front back] (split-at (mod n (count s)) s)] >     (concat back front))) > > I was hoping for a moment to avoid calculating (count s) up front, but > that definitely does interfer

Re: How do I destructure this?

2010-04-21 Thread Michał Marczyk
On 21 April 2010 19:02, Base wrote: > I am having a hard time destructuring a nested data structure. > > I am starting out with: > > {:tag :column, >  :attrs nil, >  :content >  [{:tag :name, :attrs nil, :content ["agecat"]} >  {:tag :value, :attrs nil, :content ["nil"]} >  {:tag :threshold, :attr

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 21 April 2010 19:35, Sean Devlin wrote: > I like that version :) :-) In this case, rotate-while could be rewritten like so: (defn rotate-with [pred s] (let [[front back] (split-with pred s)] (concat back front))) And to round it off with ridiculous overengineering ;-) -- (defn rotate

wget replacement code review

2010-04-21 Thread Brent Millare
Hey all, I wrote a clojure version of the simplest functionality of wget. I basically translated the java version into clojure code, but I'm not quite happy with the wget-binary function because I use a loop, and I feel like someone else has a more idiomatic solution to iterating through a java-ar

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
If you're gonna over engineer use a protocol :-p On Apr 21, 1:43 pm, Michał Marczyk wrote: > On 21 April 2010 19:35, Sean Devlin wrote: > > > I like that version :) > > :-) > > In this case, rotate-while could be rewritten like so: > > (defn rotate-with [pred s] >   (let [[front back] (split-wit

Re: wget replacement code review

2010-04-21 Thread Sean Devlin
At first glance, you should be requiring c.c.string, and don't write your own blank? fn. That's the only low hanging fruit I see. On Apr 21, 1:47 pm, Brent Millare wrote: > Hey all, > > I wrote a clojure version of the simplest functionality of wget. I > basically translated the java version int

Re: wget replacement code review

2010-04-21 Thread Brent Millare
Technically I didn't write my own cause I just copied pasted it ;) For the purposes of this review, just consider that library code or a reference so everyone knows what it does. :) Sean Devlin wrote: > At first glance, you should be requiring c.c.string, and don't write > your own blank? fn. Th

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Mark Engelberg
In some languages, split-at is more performant than doing take and drop separately. But in Clojure, split-at is simply defined as: (defn split-at "Returns a vector of [(take n coll) (drop n coll)]" [n coll] [(take n coll) (drop n coll)]) So by using split-at, you gain nothing other than t

Re: Coordinated, asynchronous modification of state?

2010-04-21 Thread Kevin Livingston
What you are talking about is commonly referred to as a "barrier" in parallel processing. All processes coordinated on a given barrier must each reach the barrier before any one may cross it. Simply putting a barrier check into the message queue of an Clojure agent would not be sufficient as I un

Re: How do I destructure this?

2010-04-21 Thread Base
Thanks Michal - I have done a little digging into juxt (reading the great write up that Sean previously posted here - great post by the way) and it is a very slick way to deal with this issue. I am always amazed at the createive and concise solutions that Clojure enables. Thanks much for all of

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Sean Devlin
Hmmm... we could talk about what's faster or measure it. Time to eat my own damn dog food, I guess :) Traveling now, I'll run the experiments in a few days when I get back to my normal setup. Sean On Apr 21, 2:09 pm, Mark Engelberg wrote: > In some languages, split-at is more performant than

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 21 April 2010 19:57, Sean Devlin wrote: > If you're gonna over engineer use a protocol :-p You're absolutely right, of course; I stand corrected! Here's my new attempt at overengineering then: (defprotocol Rotator (rotate [self s])) (extend-protocol Rotator Number (rotate [self s]

Re: Arguments for < and > et al

2010-04-21 Thread ataggart
== < <= > >= are all numeric equality/comparison functions. = and 'compare are object equality/comparison functions. On Apr 20, 6:47 pm, Bill Allen wrote: > I've been writing a program that requires the use of java.util.Calendar and > its descendent java.util.GregorianCalendar. One thing I'd h

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 21 April 2010 20:09, Mark Engelberg wrote: > In some languages, split-at is more performant than doing take and > drop separately.  But in Clojure, split-at is simply defined as: > (defn split-at >  "Returns a vector of [(take n coll) (drop n coll)]" >  [n coll] >    [(take n coll) (drop n coll

Re: request for comments/code-review - clojure implementation of unifier

2010-04-21 Thread Kevin Livingston
Thank you for taking the time to provide feedback. > I can't think of a direct equivalent now, but it's straightforward > enough to supply your own equivalent, like my compound? function > (basically #(and (seq? %) (seq %))). This won't work on arrays and > other things which seq can operate upon,

Re: Documentation (was: Re: duck-streams missing from clojure-contrib.jar file)

2010-04-21 Thread Tom Faulhaber
Hi all, (For those who don't know, I'm the one who maintains the autodoc API documentation.) There are some great suggestions here and I'll try to pick up as many as I can. More useful branch names and having the branch in the title are no brainers and I'll try to get them in soon. One resource

Re: request for comments/code-review - clojure implementation of unifier

2010-04-21 Thread Alex Osborne
Kevin Livingston writes: >> Not at all. next is basically #(seq (rest %)); you might want to use >> it when the extra bit of strictness is beneficial to your code and you >> shouldn't use it when it isn't. > > oh, ok. I saw some posts on using the new super-lazy lists / code and > it implied tha

Re: getting compiler-like meta data from read

2010-04-21 Thread Kevin Livingston
Thank you the LineNumberingPushbackReader is exactly what is needed. The other metadata I can add fairly straightforwardly so good, this is *far* more sane than that monstrosity I conjured up. Kevin On Apr 20, 3:15 am, Ilia Ablamonov wrote: > I've encountered the same problem (as far as I unde

Re: Documentation (was: Re: duck-streams missing from clojure-contrib.jar file)

2010-04-21 Thread Glen Stampoultzis
On Thursday, April 22, 2010, Tom Faulhaber wrote: > > A couple things I've also been thinking about are building in a search > capability and building a "super-index" of not only core and contrib > but various other external libraries that would link back to their > doc. I think building a super

Which version of Netbeans to use Compojure on OSX?

2010-04-21 Thread Sophie
I see downloads named - Java SE (45MB) - Java FX (76MB) - Java (146MB) - apparently includes Sun Glassfish Server & what-not I'm using OSX 10.5.8, and just want to install the easiest Netbeans (with Enclojure) to for development with Compojure. Would I use Compojure with Jetty? Apache (buil

Re: Which version of Netbeans to use Compojure on OSX?

2010-04-21 Thread Sean Devlin
If you've got the HD space, grab the most inclusive options. I *think* the SE one will work, but I haven't tested it. Space is cheap and all that. On Apr 21, 7:55 pm, Sophie wrote: > I see downloads named >   - Java SE (45MB) >   - Java FX (76MB) >   - Java (146MB) - apparently includes Sun Gla

Re: Which version of Netbeans to use Compojure on OSX?

2010-04-21 Thread Antony Blakey
On 22/04/2010, at 10:48 AM, Sean Devlin wrote: > I think* the SE one will work, but I haven't tested it. Yes it does. Antony Blakey -- CTO, Linkuistics Pty Ltd Ph: 0438 840 787 If at first you don’t succeed, try, try again. Then quit. No use being a damn fool about it

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Per Vognsen
Yet another variation: (defn conjugate [f g & [g-inv]] (comp (or g-inv g) f g)) (defn composite [f f-inv n x] (nth (iterate (if (pos? n) f f-inv) x) (abs n))) (defn rotate-left [xs] (when (seq xs) (concat (rest xs) [(first xs)]))) (def rotate-right (conjugate rotate-left reverse)) (defn

Re: request for comments/code-review - clojure implementation of unifier

2010-04-21 Thread Michał Marczyk
On 21 April 2010 22:58, Kevin Livingston wrote: > Thank you for taking the time to provide feedback. Thank you for the insightful response! I've posted the current state of my code -- which uses clojure.zip and clojure.walk, among other things -- here: http://gist.github.com/374764 > intention

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Michał Marczyk
On 22 April 2010 03:51, Per Vognsen wrote: > Yet another variation: > > [...] > > Food for thought. :) This is absolutely beautiful. I feel a tremendous joy now. :-) Sincerely, Michał -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this

Re: Which version of Netbeans to use Compojure on OSX?

2010-04-21 Thread Brian Schlining
Get the SE version. You can add other parts that are included in the other versions (JavaFX, JEE, etc) using the NetBean's plugin mechanism if you find that you need them. (In the menu bar select Tools -> Plugins) On Wed, Apr 21, 2010 at 18:18, Sean Devlin wrote: > If you've got the HD space, gr

Re: Documentation (was: Re: duck-streams missing from clojure-contrib.jar file)

2010-04-21 Thread Douglas Philips
On 2010 Apr 21, at 5:04 PM, Tom Faulhaber wrote: (For those who don't know, I'm the one who maintains the autodoc API documentation.) Cool, thank you! One resource to use is the index included with each API. (See the index link in the left sidebar.) I saw that, but you know, after finding

Re: Missing fns: rotate & rotate-while

2010-04-21 Thread Per Vognsen
By the way, once you start looking for conjugation in common code patterns, you see it everywhere. A less trivial example is the Schwartzian transform for caching sorting keys: (defn schwartz [key-fn] #(map (fn [x] [(key-fn x) x]) %)) (def unschwartz #(map second %)) (defn schwartz-sort [key-fn]