#lang scheme/base
(provide (all-defined-out))
(require scheme/unit
(for-syntax
scheme/base))
(define-syntax (define-sigdict stx)
(syntax-case stx ()
((_ name (sig^ ...))
#`(define-syntax name #'(sig^ ...)))))
(begin-for-syntax
(define (re-syntax context stx)
(datum->syntax context (syntax->datum stx))))
(define-syntax (define/invoke-sigdict stx)
(syntax-case stx ()
((_ dict^^ (unit@ ...))
(let ((sigs (re-syntax stx (syntax-local-value #'dict^^))))
#`(begin
(define-compound-unit/infer combined@
(import)
(export #,@sigs)
(link unit@ ...))
(define-values/invoke-unit combined@
(import)
(export #,@sigs)))))))