On 2 April 2010 15:00, Kevin <ke...@kelleysoft.com> wrote: >> Here's my best attempt so far: >> >> ------------------------------------------------------ >> (ns piccoloHello >> (:gen-class) >> (:import (edu.umd.cs.piccolo PCanvas PNode PLayer) >> (edu.umd.cs.piccolo.nodes PText) >> (edu.umd.cs.piccolox PFrame))) >> >> (defn create-frame >> "Creates the main PFrame used by the program." >> [] >> (proxy [PFrame] [] >> (initialize [] >> (let [aCanvas (PCanvas.) >> aFrame (PFrame. "Piccolo2D Hello World" false aCanvas) >> aNode (PText. "Hello World") >> aLayer (.getLayer aCanvas)] >> (. aLayer .addChild aNode))))) > > Too many dots: see http://clojure.org/java_interop for Java method call ref. > That last line should be: > > (.addChild aLayer aNode) > > I think.
Yes, it's either (. aLayer addChild aNode) or (.addChild aLayer aNode). The latter macroexpands to the former: user=> (macroexpand-1 '(.addChild aLayer aNode)) (. aLayer addChild aNode) People here seem mostly to prefer the (.method object args) form. -- Michael Wood <esiot...@gmail.com> -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en To unsubscribe, reply using "remove me" as the subject.