#lang scheme/base
(provide
(all-defined-out))
(require
"../scat-tx.ss"
(for-template
"../scat.ss"
"macro-prim.ss"
scheme/base))
(define (macro-immediate im e) #`((lit #,im) #,e))
(define (macro-function fn e) #`(#,fn #,e))
(define (macro-map-identifier id)
(ns-prefixed #'(macro) id))
(define (macro-map-target-identifier id)
(ns-prefixed #'(target) id))
(define (with-macro-syntax thunk)
(parameterize
((rpn-immediate macro-immediate)
(rpn-function macro-function)
(rpn-lambda scat-lambda)
(rpn-map-identifier macro-map-identifier)
(rpn-map-target-identifier macro-map-target-identifier)
(rpn-context with-macro-syntax))
(thunk)))