[racket] Unbound identifier bug in contracts?

From: Brian Adkins (racketusers at lojic.com)
Date: Tue Jul 22 20:18:16 EDT 2014

On Jul 22, 2014, at 8:03 PM, Brian Adkins wrote:
> Does this seem like a bug? I'm running DRRacket 6.0.1 on Mac OSX 10.6.8.
> 
> Given:
> 
> (define (valid? a b)
>  (< a b))
> 
> Case 1 - works fine:
> 
> (define/contract (foo a b)
>  (->i ([x (z) (curry valid? z)] [z any/c]) any)
>  (+ a b))
> 
> Case 2 (adding a 3rd arg) - results in:
>  "z10: unbound identifier;
>    also, no #%top syntax transformer is bound in: z10"
> 
> (define/contract (foo a b c)
>  (->i ([x (z) (curry valid? z)] [y any/c] [z any/c]) any)
>  (+ a b))

Sorry, I included valid? because it was in my earlier test cases, I can simplify this to something nearly identical to the example in 8.2 of the Racket Reference:

(define/contract (foo a b c)
  (->i ([x (z) (>=/c z)] [y any/c] [z any/c]) any)
  (+ a b))

results in:

"z10: unbound identifier;
 also, no #%top syntax transformer is bound in: z10"

Remove c & y, and it works fine.




Posted on the users mailing list.