Skip to content

Instantly share code, notes, and snippets.

@KirinDave
Created November 19, 2009 01:18
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 KirinDave/238447 to your computer and use it in GitHub Desktop.
Save KirinDave/238447 to your computer and use it in GitHub Desktop.
; Rule #1, fuck pastebin.
(declare get-rmi lookup-rmi MyMessage)
(defmacro invoke-rmi[hostname port nm iface mthd & args]
`(let [r# (get-rmi ~hostname ~port)]
(let [z# (lookup-rmi r# ~iface ~nm)]
(. z# ~mthd ~@args))))
; and now use that macro
; This shouldn't eof.
(defn act
[dd]
(let [hh (:host dd) pp (:port dd)]
(invoke-rmi hh pp "name" MyMessage saySomething "good")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment