Message info From:Aaron Cohen Subject:Re: why can i not shut-down my pc from Java? Date:Mon, 7 May 2012 16:59:00 -0400

On Mon, May 7, 2012 at 4:53 PM, Jim - FooBar(); <> wrote:
Following my earlier post, i tried converting the working shutdown
function into a multi-method in order to make it cleaner to read... However for some reason the compiler is complaining and i can't pinpoint wheere the problem is! This is the multi-method:
(defmulti halt
(fn []

Your dispatch function takes 0 arguments.
(let [os (System/getProperty "")]
(if (.startsWith os "Mac OS") :Linux (keyword os)))))
when calling (halt "some-password" 1) i'm getting this:

You invoke your multimethod with 2 arguments. You need to change your dispatch function to take 2 arguments (it can ignore them if you don't need them).

Also... do you actually find this easier to read? How many OSes are you eventually planning to support?


You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to
Note that posts from new members are moderated - please be patient with your first post.
To unsubscribe from this group, send email to
For more options, visit this group at