Definition of unique relation no longer works with racket 6.9
cocreature opened this issue · comments
First of all let me thank you for this awesome tutorial!
When I try to define the unique
relation as shown in the tutorial
(define-relation REDEX
unique ⊆ any × ...
[(unique any_!_1 ...)])
racket complains with define-relation: found an ellipsis outside of a sequence
. I tried wrapping it in parenthesis hoping to fix the error and indeed the definition is then accepted. However, when I try to use it via
(judgment-holds (unique 1 2))
I get
unique: relation values do not match the contract;
contract: (unique (any × ...))
values: (unique 1 2)
Any ideas how to update this for the new version? I took a look at the docs but I couldn’t find anything helpful (I’m new to both racket and redex).
I found a workaround by using a relation over a list instead of an n-ary relation, i.e.,
(define-judgment-form REDEX
#:mode (unique I)
#:contract (unique (any ...))
[------------------
(unique (any_!_1 ...))])
I’m still not sure how to define n-ary relations or if this is simply no longer possible.
Thanks!!