3 ms·
Component Based Software Architecture Using Clojure
- morphir 17y agoI know scheme (r5rs), but I can't figure out how this code works. Are there any good introduction text for this lisp?
- dkersten 17y agoStuart Halloway's Programming clojure book is exceptionally good[1] The basic idea is to map (using Clojures parallel pmap) over each component and call the event handler for the event being processed, if the component has one. The code is slightly complicated by wanting a non-global event queue and async event sending, so I use a dynamic binding to rebind the event function so that it can access the local event queue (which is the only mutable variable I use). I'm sure theres better/simpler/more idiomatic ways of achieving this, but whatever. [1] http://pragprog.com/titles/shcloj http://pragprog.com/titles/shcloj
- onewland 17y agoJust a suggestion: Use github gists for Clojure code if you want to embed in posterous. For other languages, posterous has a code tag that automatically highlights/formats for you. They just don't support Clojure very well.
- dkersten 17y agoThanks for the suggestion! I didn't know posterous supported github gists.