On Fri, Jul 3, 2009 at 00:50, Laurent PETIT<laurent.pe...@gmail.com> wrote: > > Hey, how come we did not see this even more concise version sooner ? :-): > > ;; using just clojure 1.0.0 without any additional library :-) > ;; from command line: > ;; java -cp clojure.jar /path/to/challenge2.clj "()" "((([[]])))" ... ... > (ns challenge2) > > (defn balanced? [s] > (and > (every? #{ \( \) \[ \] } s) > (try (read-string s) true (catch java.lang.RuntimeException e false)))) > > (defn main [] (apply print (map balanced? *command-line-args*))) > > (when *command-line-args* (main)) > > Hehe
ROFL. :-D Brilliantly punny solution. // Ben --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---