DSL support

This commit is contained in:
Tony Garnock-Jones 2015-05-12 20:11:47 -04:00
parent 95bdd892f6
commit 2a6393f88b
1 changed files with 12 additions and 0 deletions

12
prospect/support/dsl.rkt Normal file
View File

@ -0,0 +1,12 @@
#lang racket/base
(require (for-syntax racket/base))
(provide define&provide-dsl-helper-syntaxes)
(define (illegal-use id context stx)
(raise-syntax-error #f (format "Illegal use of ~a outside ~a" id context) stx))
(define-syntax-rule (define&provide-dsl-helper-syntaxes context (identifier ...))
(begin (provide identifier ...)
(define-syntax (identifier stx) (illegal-use 'identifier context stx))
...))