coma/macro-forth-unit.ss
#lang scheme/unit
(require
 "../macro.ss"
 "macro-forth-sig.ss"
 "../sig.ss"
 "../label-sig.ss")

;; Here we just piggyback on top of the label^ signature.  Eventually
;; the forth expander should also expand in terms of the `words',
;; `macros' and `variables' form instead of doing the distorted
;; trickery it does now.

(import label^ compiler^)
(export macro-forth^)

(define-syntax-rule (wrap-functions (mf:x label:x) ...)
  (begin (define (mf:x . args) (apply label:x args)) ...))

(wrap-functions
 (mf:compile!      compile!)
 (mf:reg           label:append!)
 (mf:wrap-macro    label:wrap-macro)
 (mf:wrap-word     label:wrap-word))
; (mf:wrap-variable label:wrap-variable)
; (mf:allot         label:allot)


;; Hack around trouble with syntax certificats for allot.
(define (mf:wrap-variable n l c)
  (label:wrap-variable n l (macro: ,c ,label:allot)))