original commit: 7647f7e3ded6f1db2d03c78581580712133418f3
This commit is contained in:
Matthew Flatt 2002-01-09 20:59:59 +00:00
parent f1f4edcc95
commit 8b0d80b8b5
3 changed files with 26 additions and 8 deletions

View File

@ -456,6 +456,7 @@
(syntax (old-id (make-direct-method-map
(quote-syntax the-finder)
(quote the-obj)
(quote-syntax old-id)
(quote new-id))))))
ids new-ids)
null)]
@ -703,27 +704,33 @@
(quote the-obj))
(make-field-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax all-field)
(quote-syntax field-accessor)
(quote-syntax field-mutator))
...
(make-rename-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax rename-orig)
(quote rename-temp))
...
(make-method-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax method-name)
(quote-syntax method-accessor))
...
(make-direct-method-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax private-name)
(quote private-temp))
...
(make-direct-method-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax public-final-name)
(quote public-final-temp))
...
(make-direct-method-map (quote-syntax the-finder)
(quote the-obj)
(quote-syntax override-final-name)
(quote override-final-temp))
...)])))]
[extra-init-mappings

View File

@ -1,23 +1,33 @@
(module unitidmap mzscheme
(define (make-id-mapper unbox-stx)
;; Help Desk binding info:
(define (binding binder bound stx)
(syntax-property
stx
'bound-in-source
(cons binder (syntax-local-introduce bound))))
(define (make-id-mapper unbox-stx the-binder)
(let ([set!-stx (datum->syntax-object unbox-stx 'set! #f)])
(make-set!-transformer
(lambda (sstx)
(cond
[(identifier? sstx) unbox-stx]
[(identifier? sstx)
(binding the-binder sstx
unbox-stx)]
[(module-identifier=? set!-stx (car (syntax-e sstx)))
(raise-syntax-error
'unit
"cannot set! imported or exported variables"
sstx)]
[else
(datum->syntax-object
set!-stx
(cons unbox-stx (cdr (syntax-e sstx)))
sstx)])))))
(binding
the-binder (car (syntax-e sstx))
(datum->syntax-object
set!-stx
(cons unbox-stx (cdr (syntax-e sstx)))
sstx))])))))
(provide make-id-mapper))

View File

@ -298,7 +298,8 @@
(lambda (varloc)
(with-syntax ([(var loc) varloc])
(syntax
(make-id-mapper (quote-syntax (unbox loc))))))
(make-id-mapper (quote-syntax (unbox loc))
(quote-syntax var)))))
varlocs)])
(syntax
([vars (values . rhss)]))))]