Created
September 15, 2015 21:19
-
-
Save ebellani/a7398f5236d358b8081f to your computer and use it in GitHub Desktop.
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
(define-syntax (relation->set stx) | |
(syntax-case stx () | |
[(_ rel-name rel-size) | |
(with-syntax ([rel-vars (for/list ([x (in-range (syntax->datum #'rel-size))]) | |
(gensym 'X))]) | |
#`(datalog *db* (? (#,(syntax->datum #'rel-name) | |
#,@#'rel-vars))))])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
make-variable: contract violation
expected: (or/c #f (list/c any/c (or/c exact-positive-integer? #f) (or/c exact-nonnegative-integer? #f) (or/c exact-nonnegative-integer? #f) (or/c exact-positive-integer? #f)))
given: '(#f #f #f #f 0)
in: the 1st argument of
(->
(or/c
#f
(list/c
any/c
(or/c exact-positive-integer? #f)
(or/c exact-nonnegative-integer? #f)
(or/c exact-nonnegative-integer? #f)
(or/c exact-positive-integer? #f)))
symbol?
variable?)
contract from: /datalog/ast.rkt