[plt-scheme] How to dynamic-require a syntax?
File t1.ss:
#lang scheme
(require scheme/package)
(define-package p #:all-defined
(define x 1))
(provide p)
File t2.ss:
#lang scheme
(require scheme/package)
(define-syntax (load-package stx)
(syntax-case stx ()
((load-package p)
#`(open-package #,(dynamic-require '(file "t1.ss") (syntax->datum
#'p))))))
(load-package p)
-Chongkai
Jon Rafkind wrote:
> Chongkai Zhu wrote:
>> I tried something like
>>
>> (define-syntax (my-macro stx)
>> (syntax-case stx ()
>> ((my-macro p)
>> #`(... #,(dynamic-require '(file "t1.ss") (syntax->datum #'p))
>> ...))))
>>
> Works for me. Can you paste an entire example that segfaults?