~ chicken-core (master) /tests/meta-syntax-test.scm
Trap1;;;; meta-syntax-test.scm23;;4;; A module's syntax definitions should be accessible through either of5;; the following import forms:6;;7;; (import-syntax-for-syntax (foo)) ; meta environment8;;9;; (begin-for-syntax ; compiler environment10;; (import-syntax (foo))) ; note that `import` will not work here11;;1213(module foo (bar listify)14 (import scheme chicken.syntax)15 (begin-for-syntax16 (define (baz x)17 (list (cadr x))))18 (define-syntax bar19 (er-macro-transformer20 (lambda (x r c)21 `(,(r 'list) (baz (list 1 ,(cadr x)))))))22 (begin-for-syntax23 (define-syntax call-it-12324 (syntax-rules ()25 ((_ x)26 '(x 'x 1 2 3)))))27 (define-syntax listify28 (er-macro-transformer29 (lambda (e r c)30 (call-it-123 list)))))3132(module test-import-syntax-for-syntax (test)33 (import scheme chicken.syntax)34 (import-syntax-for-syntax (prefix foo foo:))35 (define-syntax test-import-syntax-for-syntax36 (er-macro-transformer37 (lambda (x r c)38 `(,(r 'quote) ,@(foo:bar 1 2)))))39 (define (test)40 (test-import-syntax-for-syntax)))4142(module test-begin-for-syntax (test)43 (import scheme chicken.syntax)44 (begin-for-syntax45 (import-syntax (prefix foo foo:)))46 (define-syntax test-begin-for-syntax47 (er-macro-transformer48 (lambda (x r c)49 `(,(r 'quote) ,@(foo:bar 1 2)))))50 (define (test)51 (test-begin-for-syntax)))