[racket] free-id-table. Is it a bug?

From: Roman Klochkov (kalimehtar at mail.ru)
Date: Thu Apr 3 01:26:26 EDT 2014

 #lang racket
(require (for-syntax syntax/id-table))
(define-for-syntax table (make-free-id-table))
(define-syntax (save-and-define stx)
  (syntax-case stx ()
     [(_ ID) (free-id-table-set! table #'ID 1) #'(define ID 1)]))
(define-syntax (load stx)
  (syntax-case stx ()
     [(_ ID2)
       (if (free-id-table-ref table #'ID2 #f) #''ok #''different)]))
(module+ test
  (save-and-define a)
  (displayln (load a))) ---------

Gives 'different. Expected 'ok

P.S. If I change last sexp to

;(module+ test
(save-and-define a)
(displayln (load a)) then gives 'ok as expected.

Please, help.

-- 
Roman Klochkov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.racket-lang.org/users/archive/attachments/20140403/d8aec206/attachment.html>

Posted on the users mailing list.