|
From: Richard C. C. <co...@cc...> - 2004-08-17 16:16:16
|
Lo, on Tuesday, August 17, Noel Welsh did write:
> Add require/expose macro, aka glassbox testing. (I've lost the
> source to this, if you have it please send it to me)
;; Requires a module and exposes some of its unprovided (non-syntax!)
;; identifiers.
;; USAGE: (require/expose MODULE-NAME (IDS ...))
;; where MODULE-NAME is as in the MzScheme manual (i.e., a standard
;; module spec) and IDS are the un-provided identifiers that you wish to
;; expose in the current module.
;; Based on a macro by Raymond Racine (rr...@ad...) posted to
;; plt-scheme in Dec 2003.
(define-syntax require/expose
(syntax-rules ()
[(_ mod (ids ...))
(begin
(require mod)
(define-values (ids ...)
(let ([ns (module->namespace 'mod)])
(parameterize ([current-namespace ns])
(values
(namespace-variable-value 'ids)...)))))]))
There are some other comments I want to make, but I'll take the
discussion to schematics-development just as soon as I've subscribed.
Richard
|