scheme/class: fix local member names to provide an better message on misuse, and to declare itself as an expression form

svn: r13050
This commit is contained in:
Matthew Flatt 2009-01-09 21:00:50 +00:00
parent 72d904d2d9
commit a58010fd0d

View File

@ -291,7 +291,14 @@
[else
(reverse (cons args accum))])))
(define-struct private-name (orig-id gen-id))
(define-struct private-name (orig-id gen-id)
#:property prop:procedure (lambda (self stx)
(if (not (eq? (syntax-local-context) 'expression))
#`(#%expression #,stx)
(raise-syntax-error
#f
"unbound local member name"
stx))))
(define (do-localize orig-id validate-local-member-stx)
(let loop ([id orig-id])