Fork me on GitHub
#clara
<
2017-01-14
>
skuro13:01:06

I’m just exploring clara these days, and I had a question

skuro13:01:43

in my model, some of the facts have a timestamp property, which can be used to let facts expire when they become too old

skuro13:01:55

so far I have this in my little experiment:

(defrecord Fact [timestamp ...])

(defn too-old [t]
  (< max-age (- (now) t)))

(defrule ignore-old-facts
  [?fact <- Fact (too-old timestamp)]
  =>
  (retract! ?fact))

skuro13:01:01

is it the right strategy? I guess facts won’t be re-evaluated over time in a given session, so if I go for this I would have to recreate it periodically

skuro13:01:15

but maybe I’m not understanding clara yet 🙂