Created
July 6, 2012 15:21
-
-
Save samth/3060835 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/load | |
| (module st racket | |
| (define state (box 0)) | |
| (provide state)) | |
| (module m1 racket | |
| (define l (list #'l)) | |
| (provide l)) | |
| (module m2 racket | |
| (require (for-syntax 'm1 'st)) | |
| (define-syntax (mac stx) | |
| #`(begin-for-syntax | |
| (module* sub #f | |
| (set-box! state (length #,(car l)))))) | |
| (provide mac)) | |
| (module m3 racket | |
| (require 'm2) | |
| (mac)) | |
| (module m4 racket | |
| (require 'm3 (for-syntax 'st)) | |
| (begin-for-syntax | |
| (dynamic-require '(submod 'm3 sub) #f) | |
| (displayln state))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment