SHARE
TWEET

Untitled

a guest Apr 24th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #lang racket
  2.  
  3. (module A racket
  4.   (provide m)
  5.   (require (for-syntax syntax/parse syntax/location))
  6.  
  7.   (module empty racket
  8.     (provide #%module-begin))
  9.  
  10.   (define-syntax (m stx)
  11.     (syntax-parse stx
  12.       [(_ arg ...)
  13.        (with-syntax ([racket-use-site (datum->syntax stx 'racket)])
  14.          #`(module foo #,(quote-module-path empty)
  15.              (#%module-begin
  16.               (require racket-use-site)
  17.               (define x 5)
  18.               (println x)
  19.               arg ...)))])))
  20.  
  21. (module B racket
  22.   (require (submod ".." A))
  23.   (m #;(+ 1 2)))
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top