Mercurial > lasercutter
view src/clojureDemo/VisionReader.clj @ 6:4ae2497acf7d
saving progress
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Fri, 20 Aug 2010 03:18:05 -0400 |
parents | 6d9bdaf919f7 |
children |
line wrap: on
line source
1 (ns clojureDemo.VisionReader2 (:gen-class3 :implements [connections.WiredBox]4 :methods [ [process [Object] void] [setFile [Object] void] ]5 :post-init register))7 (import '(davidNackoul PlotUnitMatchAlgorithm StoryGraph PlotUnit))8 (import '(bridge.reps.things Sequence Thing))11 (defn -setFile12 [this file]13 (println "file is " file))15 (defn -register16 "equivalent to Connections.getPorts(this).addSignalProcessor(\"process\"); in Java"17 [this]18 (println "ClojureBox (register) : Register is run19 only when the object is created, as if it were in every constructor.")20 (. (connections.Connections/getPorts this) addSignalProcessor "process"))22 (defn -process [ _ _ ]23 (println "ClojureBox (process) : This is a LISP function,24 being called through Java, through the wiredBox metaphor."))26 (defn -getName27 "the [_] means that the function gets an explicit 'this'28 argument, just like python. In this case we don't care about it."29 [_] "VisionReader")