#lang scheme/base
(require
"../rpn.ss"
"../ns.ss"
"rep.ss"
"stack.ss")
(provide scat
scat:
scat-apply
scat-push
scat->dictionary)
(define-syntax-rule (scat-push val p sub) (let ((p (stack-cons val p))) sub))
(define-syntax-rule (scat-apply fn p sub) (let ((p (fn p))) sub))
(define-syntax-rule (scat . form)
(ns (scat) . form))
(define-syntax-rule (scat: code ...)
(make-word (scat->dictionary rpn:-compile code ...)))
(define-syntax-rule (scat->dictionary compile-dict code ...)
(rpn-parse (compile-dict (scat) scat-apply scat-push scat-push scat: (rpn-lambda) ) code ...))