Re: Beginner's question regarding implementing a constructor using gen-class

2010-05-11 Thread Gregg Williams
Okay...eleven days later and I've finally got something that works! You can find a fully working Clojure version of GraphEditor.java at http://gist.github.com/398198 Clojure beginners, there is a lot you can learn from comparing the Java and Clojure versions of this program (though Clojure progra

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-30 Thread Adrian Cuthbertson
> simple, you'd be embarrassed to admit that you didn't see WHAT WAS > STARING YOU IN THE FACE all along? Don't be too hard on yourself - it takes a while for the clojure patterns to sink in so you easily spot the simple errors. Best to throw it out there so someone else can help. Gen-class is a

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-30 Thread Meikel Brandmeyer
Hi, On 30 Apr., 08:16, Gregg Williams wrote: > And what's with the slashes in "[java/lang/Object]"--I've never seen > that before. Alex wrote you before: :extends does not take a vector. Ad your constructor question: see :post-init. Sincerely Meikel -- You received this message because you

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-29 Thread Antony Blakey
On 30/04/2010, at 3:46 PM, Gregg Williams wrote: > Have you ever wanted to abandon a simple program with a bug that has > been DRIVING YOU CRAZY because it's just got to be something SO > simple, you'd be embarrassed to admit that you didn't see WHAT WAS > STARING YOU IN THE FACE all along? Well,

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-29 Thread Gregg Williams
Have you ever wanted to abandon a simple program with a bug that has been DRIVING YOU CRAZY because it's just got to be something SO simple, you'd be embarrassed to admit that you didn't see WHAT WAS STARING YOU IN THE FACE all along? Well, this is mine: (ns org.InfoML.genclassObject (:gen-class

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-29 Thread Meikel Brandmeyer
Hi, On Thu, Apr 29, 2010 at 12:09:06PM -0700, Gregg Williams wrote: > Re: subclassing: Unless I'm missing something, I still want to > subclass PCanvas because the class adds another method, updateEdge, > which gets called within the drag event handler. Maybe you can make it a normal clojure fun

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-29 Thread Gregg Williams
Alex, thanks for your two posts and for taking the time to look at the original source code. Some comments: Re: Integer being final. Actually, I remembered that...and then forgot. Tired? Clueless? You decide. I'm going to fold your observations into a new test program to see what happens; thanks.

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-28 Thread Alex Osborne
Gregg Williams writes: > Now I'm working on > the "Graph Editor" program described at > http://www.piccolo2d.org/learn/grapheditor.html > . > > In this sample program (which you don't really need to look at) I need > to subclass a Piccolo2D class to create a class named GraphEditor , > but unlik

Re: Beginner's question regarding implementing a constructor using gen-class

2010-04-28 Thread Alex Osborne
Hi Gregg, Gregg Williams writes: > (ns genclassInteger > (:gen-class >:extends [java.lang.Integer]) > ;(:import (java.lang Integer)) ; < unnecessary, right? > ) > - > > This returns the error: > > Exception in thread "main" java.lang.ClassNotFoundException: > [java/lang/

Beginner's question regarding implementing a constructor using gen-class

2010-04-27 Thread Gregg Williams
Hi--another example, another failed attempt to do something that looks quite basic (grumble, grumble) ... I'm continuing on my path to learning how to use Clojure with the graphics library Piccolo2D (http://www.piccolo2d.org) by re- implementing some of Piccolo2D's sample programs. Now I'm working