[racket] How does free-identifier=? and bound-identifier=? works?

From: Veer (diggerrrrr at gmail.com)
Date: Sun Apr 10 02:31:03 EDT 2011

Hello,

I am unable to understand how free-identifier=? and bound-identifier=? works?

For example suppose I have a code :
   (lambda (x y) (let ([x 2]) x))

then how do I determine if last x in the body of let is not bound by first
parameter to lambda? , using either free-identifier=? or bound-identifier=? .

When I use them ,they both produces #t .

(define-syntax check
  (lambda (stx)
    (syntax-case stx (lambda let)
      [(_ (lambda (x y ...) (let ([a b]) c)))
       #'(values (free-identifier=? #'x #'c)
                 (bound-identifier=? #'x #'c))])))


(check (lambda (x y) (let ([x 2]) x)))


Posted on the users mailing list.