Re: Implementation of min-key inefficient?

2015-02-09 Thread Frank Schmidt
Thanks a lot. I voted :) -- 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 g

Implementation of min-key inefficient?

2015-02-09 Thread Frank Schmidt
Hi, the min-key function is implemented recursively. Therefore in (min-key #(.length ^String %) "a" "aa" "aaa") the .length function is evaluated 4 times instead of 3 times. What are the reasons for this nice but inefficient implementation? Best wishes, Frank