rlm@1: (ns clojureDemo.WiredDemo rlm@1: ( rlm@1: :gen-class rlm@1: :implements [connections.WiredBox] rlm@1: :methods [ [process [Object] void]] rlm@1: :post-init register rlm@1: ) rlm@1: ) rlm@1: rlm@1: rlm@1: (defn -register [this] rlm@1: rlm@1: ; translate: rlm@1: ; Connections.getPorts(this).addSignalProcessor("process"); rlm@1: ; ---- to ----- rlm@1: rlm@1: (println "ClojureBox (register) : Register is run only when the object is created, like a constructor.") rlm@1: rlm@1: (. (connections.Connections/getPorts this) addSignalProcessor "process") rlm@1: rlm@1: rlm@1: ) rlm@1: rlm@1: rlm@1: (defn -process [ _ _ ] rlm@1: (println "ClojureBox (process) : This is a LISP function, being called through Java, through the wiredBox metaphor.") rlm@1: ) rlm@1: rlm@1: rlm@1: rlm@1: rlm@1: ( rlm@1: defn -getName [_] "ClojureBox" rlm@1: rlm@1: ; the [_] means that the function gets an explicit "this" argument, like python, rlm@1: ; but we don't care about it. rlm@1: rlm@1: ) rlm@1: rlm@1: