Add new syntax for inst and ann, add define-struct:

svn: r10131

original commit: 9c4ab9014f3ef36e63d9805ddfbacea48d0f8b32
This commit is contained in:
Sam Tobin-Hochstadt 2008-06-04 20:15:54 +00:00
parent 7a1d6f66dc
commit 6391dfbda9

View File

@ -19,7 +19,8 @@ This file defines two sorts of primitives. All of them are provided into any mod
|#
(provide (all-defined-out))
(provide (all-defined-out)
(rename-out [define-typed-struct define-struct:]))
(require (for-syntax
scheme/base
@ -136,7 +137,8 @@ This file defines two sorts of primitives. All of them are provided into any mod
(define-syntax (ann stx)
(syntax-case stx (:)
[(_ arg : ty)
#;#'(let: ([id : ty arg]) id)
(syntax-property #'arg 'type-ascription #'ty)]
[(_ arg ty)
(syntax-property #'arg 'type-ascription #'ty)]))
(define-syntax (: stx)
@ -162,6 +164,8 @@ This file defines two sorts of primitives. All of them are provided into any mod
(define-syntax (inst stx)
(syntax-case stx (:)
[(_ arg : tys ...)
(syntax-property #'arg 'type-inst #'(tys ...))]
[(_ arg tys ...)
(syntax-property #'arg 'type-inst #'(tys ...))]))
(define-syntax (define: stx)