[racket] question about macro failing due to hygiene(?)

From: Eli Barzilay (eli at barzilay.org)
Date: Fri Jan 13 15:24:02 EST 2012

Three hours ago, Marijn wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Why doesn't this work (expand: unbound identifier in module in: a):
> [...]

Similar to the reason that this:

  (define-syntax make-store
    (syntax-rules ()
      [(_ _id_ _E_)
       (let ()
         (define-syntax-rule (make-variable __E__)
           (lambda () (let ([_id_ 1]) __E__)))
         (define store (let ([_id_ 2]) (make-variable _E_)))
         store)]))
  ((make-store a a))

returns 2 and not 1.

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!


Posted on the users mailing list.