[plt-scheme] SchemeUnit redevelopment

From: Richard C. Cobbe (cobbe at ccs.neu.edu)
Date: Tue Aug 17 11:24:24 EDT 2004

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 (rracine at adelphia.net) 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


Posted on the users mailing list.