We should make sure the error here at least has define/contract in it (even

if it's the wrong shape due to leaving the contract out in the call), and we
_should_ check to see if we're in a expression context.  (Can't remember what
reasoning Ryan had about not doing this, but it seems to me that we still
need to check, since this expands into defines of various sorts.)

svn: r11660
This commit is contained in:
Stevie Strickland 2008-09-11 23:11:38 +00:00
parent e1f430df72
commit f4dd7e85fe

View File

@ -77,8 +77,8 @@ improve method arity mismatch contract violation error messages?
(define name expr0 expr ...))]
[(_ name+arg-list contract body0 body ...)
(let-values ([(name lam-expr)
(normalize-definition (datum->syntax #'stx (list* 'define #'name+arg-list #'body0 #'(body ...)))
#'lambda #f #t)])
(normalize-definition (datum->syntax #'define-stx (list* 'define/contract #'name+arg-list #'body0 #'(body ...)))
#'lambda #t #t)])
#`(define/contract #,name contract #,lam-expr))]
[(_ name contract-expr expr)
(raise-syntax-error 'define/contract "expected identifier in first position"