Nice use of 'import-static' and multimethods for 'paint' ;-)
Personally, I would move (def timer (Timer. turn-millis panel)) to the
end:
(doto panel
(.setFocusable true)
(.addKeyListener panel))
(doto frame
(.add panel)
(.setSize (* width point-size) (* height point-size))
(.setVisible true))
(def timer (Timer. turn-millis panel))
(.start timer)
.... and you can also use (in my opinion maybe less readable) form:
(def timer
(doto (Timer. turn-millis panel)
(.start)))
Greetings, Frantisek
On Jan 5, 9:54 pm, Stuart Halloway <[email protected]> wrote:
> Since there has been so much back-and-forth about the Clojure snake, I
> decided to write one [1]. Like Mark, my goal is to create a readable
> version, but the details are quite different.
>
> I plan to use this as the code example for the Swing section in the
> book. Feedback welcome.
>
> Stuart
>
> [1]http://github.com/stuarthalloway/programming-clojure/tree/master/exam...
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---