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

svn: r10131
This commit is contained in:
Sam Tobin-Hochstadt 2008-06-04 20:15:54 +00:00
parent bbf0da5ea5
commit 9c4ab9014f

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 (require (for-syntax
scheme/base 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) (define-syntax (ann stx)
(syntax-case stx (:) (syntax-case stx (:)
[(_ arg : ty) [(_ arg : ty)
#;#'(let: ([id : ty arg]) id) (syntax-property #'arg 'type-ascription #'ty)]
[(_ arg ty)
(syntax-property #'arg 'type-ascription #'ty)])) (syntax-property #'arg 'type-ascription #'ty)]))
(define-syntax (: stx) (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) (define-syntax (inst stx)
(syntax-case stx (:) (syntax-case stx (:)
[(_ arg : tys ...) [(_ arg : tys ...)
(syntax-property #'arg 'type-inst #'(tys ...))]
[(_ arg tys ...)
(syntax-property #'arg 'type-inst #'(tys ...))])) (syntax-property #'arg 'type-inst #'(tys ...))]))
(define-syntax (define: stx) (define-syntax (define: stx)