improved error messge for register

svn: r14628
This commit is contained in:
Matthias Felleisen 2009-04-27 19:09:37 +00:00
parent 955f99fe41
commit 450bafcde4
2 changed files with 7 additions and 3 deletions

View File

@ -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>)

View File

@ -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 ()