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 JOGL, it's not at all obvious. I plan on
including one in future releases.

Anyway, thanks for checking it out!

Best,
Curran

On May 15, 3:28 pm, MikeM <[email protected]> wrote:
> Nice!
>
> I had to learn a bit about jogl to get it to work - had to add -
> Djava.library.path={path to my jogl lib directory} to my shell script.
>
> The following is in model.clj:
>
> (defn update [ref val]
>   (when (not (= @ref val)) (dosync (ref-set ref val))))
>
> I believe this is not right: the deref of ref should be inside the
> dosync. Although this may not matter for your application, this same
> pattern applied elsewhere could be trouble, since there's no guarantee
> that ref won't change between the deref and the dosync.
>
> Also, since ref is a core function, it's less confusing to give it
> another name, and you need to rename if you ever want to use the core
> ref function inside your function.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/clojure?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to