Hi, I ran it with the changes and got the message: java.lang.IllegalArgumentException: Don't know how to create ISeq from: Symbol (NO_SOURCE_FILE:22)
What can be the problem? thanks sun On Dec 23, 6:08 pm, "Stephen C. Gilardi" <squee...@mac.com> wrote: > On Dec 23, 2008, at 5:19 PM, MattyDub wrote: > > > On the Java Interop page (http://clojure.org/java_interop), the proxy > > macro is described as creating "...a instance of a proxy class that > > implements the named class/interface(s)...". Is this done using Java > > Dynamic Proxy Classes (http://java.sun.com/j2se/1.5.0/docs/guide/ > > reflection/proxy.html)? > > That seems likely but I don't know for sure. The implementation is in > the Clojure distribution in src/clj/clojure/core_proxy.clj and > supporting classes in src/jvm/clojure/lang. > > > Background to this question: I came across a blog post (http:// > >www.plt1.com/1070/even-smaller-snake/) which claims to implement the > > game "Snake" in 35 lines of clojure. However, it doesn't run; for one > > thing, in line 26, the syntax for doseq is wrong. Another problem has > > to do with calling methods from the JPanel class on the proxied JPanel > > object created in the run-snake function. It looks like you shouldn't > > call methods on proxied classes that aren't the ones you supplied when > > creating the proxy - is that true? > > It's not true. In addition to the update to doseq's syntax, the code > there also needs an update to the new "doto" syntax. Now, when calling > methods on a Java object instance inside a "doto" form, the method > names need to be prefixed with ".": > > (doto panel (.setFocusable true) (.addKeyListener panel)) > (doto (new JFrame "Snake") (.add panel) (.setSize 800 600) > (.setVisible true)) > > The code in the blog post worked for me with today's Clojure after I > made those two updates. > > --Steve > > smime.p7s > 3KViewDownload --~--~---------~--~----~------------~-------~--~----~ 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 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 -~----------~----~----~----~------~----~------~--~---