Improve error messages.

svn: r17545
This commit is contained in:
Sam Tobin-Hochstadt 2010-01-07 20:16:05 +00:00
parent f9311ff9dc
commit a40d5c5569
2 changed files with 6 additions and 2 deletions

View File

@ -42,6 +42,7 @@
(define-syntax-class annotated-formal
#:description "annotated variable of the form [x : T]"
#:opaque
#:attributes (name ty ann-name)
(pattern [:annotated-name]))

View File

@ -170,8 +170,11 @@ This file defines two sorts of primitives. All of them are provided into any mod
(identifier? #'nm)
(with-syntax ([new-nm (syntax-property #'nm 'type-label #'ty)])
(syntax/loc stx (define new-nm body)))]
[(define: (vars:id ...) (f:id args ...) : ret body ...)
#'(pdefine: (vars ...) (f args ...) : ret body ...)]))
[(define: (tvars:id ...) (nm:id . formals:annotated-formals) : ret-ty body ...)
(with-syntax ([type (syntax/loc #'ret-ty (All (tvars ...) (formals.arg-ty ... -> ret-ty)))])
(syntax/loc stx
(define: nm : type
(plambda: (tvars ...) formals body ...))))]))
(define-syntax (lambda: stx)
(syntax-parse stx