

Component Based Software Architecture Using Clojure - tomh-
http://dublindan.posterous.com/component-software

======
onewland
Just 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
Thanks for the suggestion! I didn't know posterous supported github gists.

------
morphir
I know scheme (r5rs), but I can't figure out how this code works. Are there
any good introduction text for this lisp?

~~~
dkersten
Stuart 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>

