Hi, In this particular case, his get-properties macros was a demonstration of how to write a macro, but could have been replaced with an out-of-the-box clojure.core/bean call.
2010/3/19 Per Vognsen <per.vogn...@gmail.com>: > My experience as a newcomer to Clojure is that one of the most > surprising things is the dichotomy between the Clojure and JVM world. > > I was reading one of Lau's blog posts on converting images to ASCII art: > > http://www.bestinclass.dk/index.php/2010/02/my-tribute-to-steve-ballmer > > His get-properties macro is only really needed because of this issue > with methods. If .methods were wrapped up as clojures, you could write > it directly like this: > > ;; General purpose function. Useful whenever you want to reverse the > sense of function and arguments. > (defn with-args [& args] > #(apply % args)) > > (map (with-args (.getRGB image 10 10)) [.getRed .getGreen .getBlue]) > > -Per > > On Fri, Mar 19, 2010 at 4:30 AM, Michael Gardner <gardne...@gmail.com> wrote: >> On Mar 18, 2010, at 10:55 AM, Per Vognsen wrote: >> >>> Is there any reason why a .method occurrence in non-operator position >>> doesn't just do the closure wrapping automagically? >> >> I'd like to know this as well. Smooth Java interop is one of Clojure's >> selling points, but having to wrap Java methods in lambdas to use them as >> first-class functions feels awkward. Especially if the method in question >> has multiple arguments! >> >> -Michael >> >> -- >> 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 >> >> To unsubscribe from this group, send email to >> clojure+unsubscribegooglegroups.com or reply to this email with the words >> "REMOVE ME" as the subject. >> > > -- > 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 > > To unsubscribe from this group, send email to > clojure+unsubscribegooglegroups.com or reply to this email with the words > "REMOVE ME" as the subject. > -- 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 To unsubscribe from this group, send email to clojure+unsubscribegooglegroups.com or reply to this email with the words "REMOVE ME" as the subject.