[racket] free-id-table. Is it a bug?
#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>