On Thu, Oct 8, 2009 at 10:25 AM, Robert Stehwien <rstehw...@gmail.com>wrote:
> (defn mv2 [from to] > (let [f (if (= (class from) File) from (File. from)) > t (if (= (class to) File) from (File. to))] > (println "transformed to File"))) > ITYM t (if (= (class to) File) to (File. to))] for that third line. I have a function as-file I would use for this: (defn as-file [file-or-name] (if (instance? file-or-name java.io.File) file-or-name (File. file-or-name))) Then the above simplifies to: (let [f (as-file from) t (as-tile to)] --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---