Skip to content

Instantly share code, notes, and snippets.

@michaelballantyne
Created April 14, 2019 20:18
Show Gist options
  • Save michaelballantyne/0e685002f57d8cc94cac8f571a464bee to your computer and use it in GitHub Desktop.
Save michaelballantyne/0e685002f57d8cc94cac8f571a464bee to your computer and use it in GitHub Desktop.
submodule problem
#lang racket
(module A racket
(provide m)
(require (for-syntax syntax/parse syntax/location))
(module empty racket
(provide #%module-begin))
(define-syntax (m stx)
(syntax-parse stx
[(_ arg ...)
(with-syntax ([racket-use-site (datum->syntax stx 'racket)])
#`(module foo #,(quote-module-path empty)
(#%module-begin
(require racket-use-site)
(define x 5)
(println x)
arg ...)))])))
(module B racket
(require (submod ".." A))
(m #;(+ 1 2)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment