Created
September 4, 2012 16:10
-
-
Save zane/3622904 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (let [subquery (<- [?set ?best-x ?best-y] | |
| (tap ?label ?set ?x ?y) | |
| (score-fn-1 ?x ?y :> ?score-1) | |
| (score-fn-2 ?x ?y :> ?score-2) | |
| (:sort ?score-1 ?score-2) | |
| (:reverse true) | |
| (c/limit [1] :< ?x ?y :> ?best-x ?best-y))] | |
| (?<- [?label ?set ?best-x ?best-y] | |
| (tap ?label ?set _ _) | |
| (subquery ?set ?best-x ?best-y))) |
meh, code in comments doesn't work as I expected
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
;; just a guess, but would cascalog.ops/max do the trick?
(<- [?a ?b ?c ?max-score](tap ?a ?b ?c)
(score-fn ?a ?b :> ?score)
(cascalog.ops/max ?score :> ?max-score))