All good points Andy. Thanks. I'll continue working on it until I'm happy.

I am almost never happy with anonymous functions either. In this particular 
case, though, the function is so simple that I felt it would be overkill to 
externalize it into another function (unless I'm really going to use it 
somewhere else). The fact that we don't know what the parameters are didn't 
bother me too much:

(cond (<= %1 %2) %3))
I just wanted something that return the third parameter if parameter 1 <= 
parameter 2. It seemed too abstract to try to label the parameters.

About the Long/MAX_VALUE, I didn't like it and you're right that it will 
only work for integers (if I read correctly, they are actually long in 
Clojure) but that won't work for all other numerical types. I don't see any 
solution to my problem besides having to do a test that is different from 
all the other tests in the function.
I also like the function signature you came up with initially. It does make 
sense and it's probably more elegant than passing two collections.

But as you said, there are many ways to implement the same thing. I would 
like to follow best practices as much as possible.

-- 
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/groups/opt_out.

Reply via email to