original commit: 02c69a94d1f2ae5ba007260fbf96ba32b4f4d6a3
This commit is contained in:
Matthew Flatt 2001-04-20 13:02:56 +00:00
parent 432a33c3e7
commit de1b2e8367
3 changed files with 10 additions and 6 deletions

View File

@ -550,10 +550,11 @@
(syntax #f)
(with-syntax ([defexp (stx-car (stx-cdr idp))])
(syntax (lambda () defexp)))))
(syntax->list (syntax (idp ...))))])
(syntax->list (syntax (idp ...))))]
[class-name class-name])
(syntax/loc e
(begin
(set! id (extract-arg 'idpos init-args defval))
(set! id (extract-arg 'class-name 'idpos init-args defval))
...))))]
[(field idp ...)
(syntax/loc e (begin
@ -1403,14 +1404,15 @@
(for-class (class-name c))))))))
o))
(define (extract-arg name arguments default)
(define (extract-arg class-name name arguments default)
(if (symbol? name)
;; Normal mode
(let ([a (assq name arguments)])
(cond
[a (cdr a)]
[default (default)]
[else (obj-error "make-object" "no argument for required init variable: ~a" name)]))
[else (obj-error "make-object" "no argument for required init variable: ~a~a" name
(if class-name (format " in class: ~a" class-name) ""))]))
;; By-position mode
(cond
[(< name (length arguments))

View File

@ -486,6 +486,7 @@
(eof-object? line))
(values lines body vars)]
[(and (stx-pair? line)
(identifier? (stx-car line))
(module-identifier=? (stx-car line) dv-stx))
(syntax-case line ()
[(_ (id ...) expr)
@ -500,6 +501,7 @@
"improper `define-values' clause form"
line)])]
[(and (stx-pair? line)
(identifier? (stx-car line))
(module-identifier=? (stx-car line) begin-stx))
(let ([line-list (stx->list line)])
(unless line-list

View File

@ -299,8 +299,8 @@
(let ([flattened (flatten-signature #f sig)])
(with-syntax ([flattened (map (lambda (x) (datum->syntax-object (syntax signame) x #f))
flattened)])
(syntax
(provide . flattened)))))]))))
(syntax/loc stx
(provide . flattened)))))]))))
(provide define-signature
let-signature