Re: 3D Grapher in Clojure

2009-05-16 Thread Curran Kelleher
Ah yes, good point! I'll change that code to dereference inside the transaction (you're totally right, that's the whole point of transactions!) and not use "ref" as a local binding. Thanks for the tips! Sorry, I should have included a run script or something, or at least instructions on using JOG

3D Grapher in Clojure

2009-05-14 Thread Curran Kelleher
Greetings, I have had success writing a 3D graphing program in Clojure, which parses a user defined parametric function (of the form (x,y,z) = f (u,v)) and renders it as a freely rotatable 3D surface (using OpenGL). The full source code is posted here (public domain, feel free to use, copy, etc)

Documentation Flaw for "binding"

2009-05-12 Thread Curran Kelleher
Hello, Clojure's documentation is incredible, kudos to Rich Hickey! However I'd like to bring attention to one sentence in the docs which definitely needs revision: "Bindings created with binding can be assigned to, which provides a means for nested contexts to communicate with code before it th

Re: Yet Another Swing Example

2009-05-11 Thread Curran Kelleher
Aha! I discovered a solution to the window-closing problem mentioned above: calling (.dispose frame) on the window closing event will cause the application to exit when running independently (I guess because it causes everything to be garbage collected thus the VM terminates (?) ) , but doesn't ki

Re: Yet Another Swing Example

2009-05-11 Thread Curran Kelleher
d somehow, but for now has led me to just use (load-file) instead of having real namespaces. I think it should (ideally) be possible to reference namespaces that are currently loaded, without the need to have them on the classpath. Have a great day! Curran On May 11, 7:26 am, fendres <198...@web.

Yet Another Swing Example

2009-05-07 Thread Curran Kelleher
Hello, I've posted an example of a simple model-view-controller GUI skeleton in Clojure here: http://lifeofaprogrammergeek.blogspot.com/2009/05/model-view-controller-gui-in-clojure.html The GUI has a text box and a panel which draws what you type. It's not much, but I learned a lot doing it, and

Re: Every function is a thread in Clojure?

2009-04-04 Thread Curran Kelleher
Indeed! this is a perfect discussion - great clarifications to a worthy question On Apr 4, 9:14 am, Rayne wrote: > Never be sorry about being curious. > > On Apr 3, 10:06 am, Berlin Brown wrote: > > > On Apr 3, 10:09 am, Stuart Halloway wrote: > > > > No threads: > > > > (ancestors (class (fn[

Re: The Game Loop ... the Clojure way?

2009-04-03 Thread Curran Kelleher
). In case anyone's interested, here's a Clojure port of the JOGL demo on Wikipedia (http://en.wikipedia.org/wiki/Jogl). ;This is a Clojure port of the JOGL example in Wikipedia ;Author: Curran Kelleher ;License: Public Domain ;jar dependencies: jogl.jar, gluegen-rt.jar ;for the REPL (use C

The Game Loop ... the Clojure way?

2009-04-03 Thread Curran Kelleher
d-off? why? (send-off animator animation)) (defn stop-animation [] (send animator (fn [x] false))) ;for SLIME (comment (start-animation) (stop-animation) ) Thanks a lot! Clojure is a blast! Best, Curran Kelleher --~--~-~--~~~---~--~~ You received this

Re: Fresh Clojure Tutorial

2009-03-31 Thread Curran Kelleher
Glad to hear it is a usable tutorial! It seems like lots of people coming to Clojure not coming from Java are having difficulties with GUI coding. I think a big list of GUI examples in Clojure would be the perfect remedy. @Krešimir - I think blogger was down for a bit that day, the link should b

Fresh Clojure Tutorial

2009-03-29 Thread Curran Kelleher
Hello, I've created an introductory tutorial for Clojure and Emacs here: http://lifeofaprogrammergeek.blogspot.com/2009/03/learning-clojure-and-emacs.html I just wanted to let the community know, maybe it should be linked to in the wiki? Best, Curran --~--~-~--~~~---

Slime bug

2009-03-27 Thread Curran Kelleher
entation. Is this the right place to report this bug? I installed SLIME for Clojure following the instructions at http://riddell.us/tutorial/slime_swank/slime_swank.html I'm a Java programmer trying to grok Clojure, so far I am very very impressed. Many kudos to the Clojure folks! Best re