Add error checking for contracted form, also added documentation in reference

svn: r13135

original commit: dbe366c6a0855abc117d7be2f160be058b882ec8
This commit is contained in:
Stevie Strickland 2009-01-15 00:42:49 +00:00
commit 855492f109
2 changed files with 9 additions and 2 deletions

View File

@ -85,4 +85,4 @@
(define (flat-contract/predicate? pred)
(or (flat-contract? pred)
(and (procedure? pred)
(procedure-arity-includes? pred 1))))
(procedure-arity-includes? pred 1))))

View File

@ -17,7 +17,7 @@
(provide define-signature-form struct open
define-signature provide-signature-elements
only except rename import export prefix link tag init-depend extends
only except rename import export prefix link tag init-depend extends contracted
unit?
(rename :unit unit) define-unit
compound-unit define-compound-unit compound-unit/infer define-compound-unit/infer
@ -252,6 +252,13 @@
val-defs
stx-defs
(append (syntax->list #'(z ...)) ctcs)))
((x . z)
(and (identifier? #'x)
(module-identifier=? #'x #'contracted))
(raise-syntax-error
'define-signature
"expected a list of [id contract] pairs after the contracted keyword"
(car sig-exprs)))
((x . y)
(and (identifier? #'x)
(or (module-identifier=? #'x #'define-values)