Skip to content

Instantly share code, notes, and snippets.

@svdberg
Created April 10, 2011 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save svdberg/912494 to your computer and use it in GitHub Desktop.
Save svdberg/912494 to your computer and use it in GitHub Desktop.
how do we handle static methods?
; (to-html (number-a-sequence (map track-to-str (top-tracks lastfm-user-name (lastfm-api-key))))))
(defmacro with-error-handling
[func return_on_ok return_on_fail & args]
`(let [result# (apply func ~args)]
(if (.isSuccessful result#)
~return_on_ok
~return_on_fail)))
;(with-error-handling (fn [a b] (Library/addArtist a b)) "OK" "FAIL" "Murk" (get-session))
;how do we handle Library/addArtists?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment