Sorry for the delayed response - I was out of town visiting a doctor and 
wishing I was at ClojureWest.

Yes, exactly. That is the basic idea, data and events flow into the "session" 
and after each update you fire the rules, which is a kind of polling depending 
on how you look at it. It is more like a small loop that fires rules until 
there aren't any that qualify (on the agenda, as it were.) If no rules matched, 
nothing happens.

If you just want to see Clara in action in the browser you can look at clara's 
example project:

https://github.com/rbrush/clara-examples

The examples are fairly short and don't show you how to organize everything - 
the session is built, data is inserted, rules are fired, dom is updated all in 
one function. It all works but isn't how you'd set things up for an app. That 
is what I've been working on with the various libraries like reagent, om, 
quiescent, rum, etc. I will post an example shortly, it is on my other system.

Also, Clara itself has some unit tests for basic features so you can take a 
look at those.

My biggest hang up at the moment is the truth maintenance. I talked to Ryan and 
he suggested using accumulators to model transient events/data (such as 
browser/user events.) The problem is that if you retract data any other facts 
that were inserted as a result of rules firing also get automatically retracted 
(the truth basis is transitive for the related facts.) So that is what I'm 
working on - trying the accumulator approach.

Other rule engines that I've used didn't do truth maintenance, which if you 
need it is a super powerful feature. I suppose I'm mis-using Clara in this way 
but it worked great using Jess (a super nice Java based rule engine.)

Anyway, I'm sure there is a way to make Clara work. If not there is another 
engine posted to this mailing list that I've intended to take a look at. It 
doesn't take the as-a-value approach and is mutation oriented like Jess and 
CLIPS. I really want to see if I can get Clara to work because I like the 
elegance of the value approach... TBD.

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to