On Mon, Apr 6, 2009 at 10:40 AM, James Reeves <[email protected]> wrote: > > On Apr 6, 4:10 am, Stuart Sierra <[email protected]> wrote: >> I don't see an obvious way of combining them. > > What about something like: > > (defn- normalize-separator > [filepath] > (.. (str filepath) > (replace \\ File/separatorChar) > (replace \/ File/separatorChar)))
What? You mean I won't be able to use backslashes in my filenames anymore? :) (Yes, a backslash is perfectly legal in a filename on Unix filesystems, although I agree it's probably not a good idea to use them.) > (defn file > [filepath & more] > (reduce > (fn [parent path] (File. parent path)) > (File. (normalize-separator filepath)) > (map normalize-separator more))) -- Michael Wood <[email protected]> --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en -~----------~----~----~----~------~----~------~--~---
