Last active
December 30, 2015 12:59
-
-
Save ajorgensen/7833049 to your computer and use it in GitHub Desktop.
Pass predicate
This file contains 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
(def predicate `(< 3 "?a")) | |
(def data [[1] [2] [3] [4]]) | |
(defmacro foo | |
[data predicate] | |
`(<- ["?a"] | |
(data :> "?a") | |
(~@predicate))) | |
(?- (stdout) (foo data (eval predicate))) ;doesn't work | |
(?- (stdout) (foo data (< 3 "?a"))) ;works |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
also, just do
Or use construct: