From 450bafcde43da177eca72c8f53fc67d39ef282a8 Mon Sep 17 00:00:00 2001 From: Matthias Felleisen Date: Mon, 27 Apr 2009 19:09:37 +0000 Subject: [PATCH] improved error messge for register svn: r14628 --- collects/2htdp/private/syn-aux.ss | 8 ++++++-- collects/2htdp/universe.ss | 2 +- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/collects/2htdp/private/syn-aux.ss b/collects/2htdp/private/syn-aux.ss index 0c49229bec..4ec77bc47d 100644 --- a/collects/2htdp/private/syn-aux.ss +++ b/collects/2htdp/private/syn-aux.ss @@ -32,8 +32,12 @@ extra [_ (err tag p)])))])) -(define (err spec p) - (raise-syntax-error #f "illegal specification" #`(#,spec . #,p) p)) +(define (err spec p . extra-spec) + (raise-syntax-error (cadr spec) + (if (null? extra-spec) + "illegal specification" + (string-append "illegal specification: " (car extra-spec))) + #`(#,spec . #,p) p)) ;; Symbol (Symbol X -> X) -> (X -> X) (define (check-flat-spec tag coerce>) diff --git a/collects/2htdp/universe.ss b/collects/2htdp/universe.ss index 4cbf53f8e8..de4f119734 100644 --- a/collects/2htdp/universe.ss +++ b/collects/2htdp/universe.ss @@ -117,7 +117,7 @@ (lambda (p) (syntax-case p () [(host) #`(ip> #,tag host)] - [_ (err tag p)])))] + [_ (err tag p "expected a host (ip address)")])))] [name (lambda (tag) (lambda (p) (syntax-case p ()