Skip to content

Instantly share code, notes, and snippets.

@ayal
Created December 3, 2009 16:25
Show Gist options
  • Save ayal/248298 to your computer and use it in GitHub Desktop.
Save ayal/248298 to your computer and use it in GitHub Desktop.
(defn-log match-rep-loc
"in this context rep-op is the incoming rep-op, rep-loc is what is for comparison from the rep-class from rep-rules"
[rep-op rep-class]
(for [rep-loc rep-class
:when
(cond
(and (:blip-id rep-loc)
(= (:rep-loc rep-op) rep-loc))
false
(and (:subcontent rep-loc) ; replication is by subcontent
(and
(= (dissoc (:rep-loc rep-op) :blip-id) (dissoc rep-loc :blip-id :subcontent))
(.contains (:content rep-op) (:subcontent rep-loc))))
false
(and (:annotation-name rep-loc) ; replication is by annotation
(has-annotation rep-op (:annotation-name rep-loc) (:annotation-value rep-loc)))
false
:else
true
)]
rep-loc))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment