I'm in the process of working on a *nix system library that will be
able to perform tasks based on OS type (Linux, Solaris, AIX, etc.) and
possibly filesystem type in the future.  While doing this commands
vary across the operating systems.  To get around this I plan on
writing a dispatch function and thought this would be a nice time to
work with multimethods.  I will need to be able to pass multiple
arguments to these methods.

I was thinking something similar to below (though it doesn't work
properly due to multiple arguments to something?).

(defn system-info [] {:os-type (System/getProperty "os.name")})

(def *os* (system-info))

(defmulti something :os-type)

(defmethod something "Mac OS X" [os x y]
  (+ x y))

(something *os* 1 2)

Any ideas... suggestions?

Thanks,
Brandon

--~--~---------~--~----~------------~-------~--~----~
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
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to