This one threw me, hard. I do all my development with a long running
process (as, I'm sure, most people do). Is there some way we can tweak
the implementation to avoid this problem?
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group
Yeah, I'm new to clojure, but your code seems a tad wonky. I just gave
dining philosophers a shot in clojure, and it was 32 non-empty non-
comment lines (though the printing blocks are non-atomic, so the
printout, while readable, is slightly bizarre at moments).
Okay, the first thing I have to say
Edit: Mine has a minor bug: The conditional in eat should be inside
the same dosync as the result, so it should be:
(if (not (dosync (let [first-fork @(nth...) second-fork @(nth...)]
(if (and first-fork second-fork)
(do (ref-set ...) (ref-set ...)))
(and first