Skip to content

Instantly share code, notes, and snippets.

@pkothbauer
Created May 22, 2014 14:20
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save pkothbauer/b77dead2a024055c4dcf to your computer and use it in GitHub Desktop.
Transition from defrel and facts to pldb.
(defrel parent x y)
(facts parent ’[[dave kaylen]
[frank dave]])
(defn grandparent
[x y]
(fresh [z]
(parent x z)
(parent z y)))
;; In the REPL
user> (run* [q]
(fresh [x y]
(grandparent x y)
(== q [x y])))
;; Result
([frank kaylen])
@pkothbauer
Copy link
Author

Clojure noob here!
Would appreciate any help on how this code should be changed with regards to the deprecation of defrel and facts
and the move to pldb?

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment