Skip to content

Instantly share code, notes, and snippets.

@ebellani
Created September 15, 2015 21:19
Show Gist options
  • Save ebellani/a7398f5236d358b8081f to your computer and use it in GitHub Desktop.
Save ebellani/a7398f5236d358b8081f to your computer and use it in GitHub Desktop.
(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))))]))
@ebellani
Copy link
Author

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

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