racket/collects/lang/private/teach-shared.rkt
Matthew Flatt 0197902309 add var-ref->mod-decl-insp' and switch cur-code-insp' uses
Macros and other tools that need syntax privilege used
`(current-code-inspector)' at the module top-level to try to
capture the right code inspector at load time. It's more
consistent to instead use the enclosing module's declaration-time
inspector, and `var-ref->mod-decl-insp' provides that. The
new function works only on references to anonymous variables,
which limits access to the inspector.

The real function name is longer, of course.
2011-09-20 13:50:36 -06:00

24 lines
631 B
Racket

#lang scheme/base
(require syntax/stx
syntax/kerncase
syntax/struct
racket/struct-info
scheme/include)
(provide shared/proc)
(require (for-template
scheme/base
(only-in "teachprims.rkt" [advanced-cons the-cons])))
(define code-insp (variable-reference->module-declaration-inspector
(#%variable-reference)))
(define shared/proc
(lambda (stx make-check-cdr undefined-expr)
(with-syntax ([undefined undefined-expr])
;; Include the implementation.
;; See private/shared-body.rkt.
(include (lib "mzlib/private/shared-body.rkt")))))