From 8298feacb247eb6b5de309c06a9faadbc08b0eb0 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Mon, 16 Feb 2009 00:48:13 +0000 Subject: [PATCH] * There's no need to do the syntactic checks of identifiers for `chunk', if there's an error, then people will get it anyway when they run the code. This means that `chunk' can be a simple syntax-rule. * Removed some redundant requires. svn: r13634 --- collects/games/chat-noir/chat-noir-doc.ss | 25 ++++------------------- 1 file changed, 4 insertions(+), 21 deletions(-) diff --git a/collects/games/chat-noir/chat-noir-doc.ss b/collects/games/chat-noir/chat-noir-doc.ss index 63ce861150..2a484a6b22 100644 --- a/collects/games/chat-noir/chat-noir-doc.ss +++ b/collects/games/chat-noir/chat-noir-doc.ss @@ -2,29 +2,12 @@ @(begin -(require (for-syntax scheme/base - syntax/boundmap - scheme/list - compiler/cm-accomplice) - scribble/manual - scribble/struct - scribble/basic - scribble/decode - scheme/include) +(require scribble/manual scribble/decode scheme/include) ;; define `chunk' as a macro that typesets the code -(define-syntax (chunk stx) - (syntax-case stx () - [(_ name expr ...) - (cond - [(not (identifier? #'name)) - (raise-syntax-error #f "expected a chunk name" stx #'name)] - [(not (regexp-match? #rx"^<.*>$" (symbol->string (syntax-e #'name)))) - (raise-syntax-error - #f "chunk names must begin and end with angle brackets, <...>" - stx #'name)] - [else #`(make-splice (list (emph (scheme name) " ::=") - (schemeblock expr ...)))])])) +(define-syntax-rule (chunk name expr ...) + (make-splice (list (emph (scheme name) " ::=") + (schemeblock expr ...)))) (define-syntax module (syntax-rules () [(module name base body ...) (begin body ...)]))