improved error messge for register
svn: r14628
This commit is contained in:
parent
955f99fe41
commit
450bafcde4
|
@ -32,8 +32,12 @@
|
||||||
extra
|
extra
|
||||||
[_ (err tag p)])))]))
|
[_ (err tag p)])))]))
|
||||||
|
|
||||||
(define (err spec p)
|
(define (err spec p . extra-spec)
|
||||||
(raise-syntax-error #f "illegal specification" #`(#,spec . #,p) p))
|
(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)
|
;; Symbol (Symbol X -> X) -> (X -> X)
|
||||||
(define (check-flat-spec tag coerce>)
|
(define (check-flat-spec tag coerce>)
|
||||||
|
|
|
@ -117,7 +117,7 @@
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(syntax-case p ()
|
(syntax-case p ()
|
||||||
[(host) #`(ip> #,tag host)]
|
[(host) #`(ip> #,tag host)]
|
||||||
[_ (err tag p)])))]
|
[_ (err tag p "expected a host (ip address)")])))]
|
||||||
[name (lambda (tag)
|
[name (lambda (tag)
|
||||||
(lambda (p)
|
(lambda (p)
|
||||||
(syntax-case p ()
|
(syntax-case p ()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user