From 5a80a3b6e4bbd47731d749320c1d746def0b5a7e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sun, 11 Dec 2011 17:14:14 -0700 Subject: [PATCH] add `datum-case', etc. as `syntax/datum' This library is used by Redex, which wants a `syntax'-like template language, but for datum values instead of syntax objects. Using `datum-case' and `datum' generates much less code. Redex uses only a small part of the general functionality, so adding `syntax/datum' could be overkill. It's implemented by generalizing the `syntax-case' and `syntax' pattern matching and template constructing code, though; it's not a lot of extra code, and it's easiest to generalize completely. We may find other uses for datum templates, too. original commit: 25dd8727cb8aca54dc7c5cbf1814f2049234ad1d --- collects/racket/private/old-ds.rkt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/collects/racket/private/old-ds.rkt b/collects/racket/private/old-ds.rkt index 4a4e045..e0b35a7 100644 --- a/collects/racket/private/old-ds.rkt +++ b/collects/racket/private/old-ds.rkt @@ -4,7 +4,7 @@ (for-syntax '#%kernel "stxcase-scheme.rkt")) - (#%provide define-struct let-struct datum) + (#%provide define-struct let-struct old-datum) (define-syntaxes (define-struct) (lambda (stx) @@ -28,6 +28,6 @@ (define-struct base (field ...)) body1 body ...)])) - (define-syntaxes (datum) + (define-syntaxes (old-datum) (syntax-rules () [(_ . any) (quote any)])))