Skip to content

Instantly share code, notes, and snippets.

@samth
Created August 13, 2012 20:35
Show Gist options
  • Select an option

  • Save samth/3343933 to your computer and use it in GitHub Desktop.

Select an option

Save samth/3343933 to your computer and use it in GitHub Desktop.
#lang racket/load
(module lang racket/base
(require (for-syntax racket/base))
(provide (rename-out [mb #%module-begin]) (except-out (all-from-out racket/base) #%module-begin))
(define-syntax (mb stx)
(syntax-case stx ()
[(_ rest ...)
(local-expand #'(#%plain-module-begin rest ...) 'module-begin null)])))
(module lang2 racket/base
(require (for-syntax racket/base))
(provide (rename-out [mb #%module-begin]) (except-out (all-from-out racket/base) #%module-begin))
(define-syntax (mb stx)
(syntax-case stx ()
[(_ rest ...)
#'(#%plain-module-begin (begin-for-syntax (module* foo #f)) rest ...)])))
(module n 'lang
(module m 'lang2))
; module*: unbound identifier in the transformer environment;
; also, no #%app syntax transformer is bound in: module*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment