<div dir="ltr"><div>This contract intends to check if the rest argument is a) a list of symbols and b) has an even number of elements.<br></div><div><br></div><div>The only difference (apparent to me) between proc1 and proc2 is the ordering of the contract predicates. Yet they give different results &mdash; proc1 seems to ignore the even? condition. Why would this be so?</div>
<div><br></div><div><br></div><div>#lang racket/base</div><div>(require racket/contract)</div><div><br></div><div>(define/contract (proc1 . items)</div><div>&nbsp; (() #:rest (and (ë(items) (even? (length items))) (listof symbol?)) . -&gt;* . symbol?)</div>
<div>&nbsp; &#39;proc1-finished)</div><div><br></div><div>(proc1 &#39;foo &#39;bar) ; gives &#39;proc1-finished</div><div>(proc1 &#39;foo) ; gives &#39;proc1-finished, but why? I would expect contract violation</div><div><br></div>
<div><br></div><div>(define/contract (proc2 . items)</div><div>&nbsp; (() #:rest (and (listof symbol?) (ë(items) (even? (length items)))) . -&gt;* . symbol?)</div><div>&nbsp; &#39;proc2-finished)</div><div><br></div><div>(proc2 &#39;foo &#39;bar) ; gives &#39;proc2-finished</div>
<div>(proc2 &#39;foo) ; gives contract violation</div><div><br></div><div><br></div><div><br></div></div>