[plt-scheme] (require... ) expanded from a macro

From: Dan Muresan (danmbox at gmail.com)
Date: Sun Oct 22 02:29:51 EDT 2006

I found a "solution" to some of my problems: just edit
plt/collects/lang/plt-mzscheme.ss and add the SRFI-0 reference
implementation and Matthew Flatt's SRFI-55 require-extension code.
Change the (provide) clause accordingly.

Additionally, here's some preliminary code that emulates psyntax modules in PLT:

(define-syntax xmodule
  (syntax-rules ()
    ;; FIXME: need a (gensym)-ed name for anon modules
    ;; FIXME: (require) seems to be ignored
    ((_ (export ...) def ...)
     (begin (xmodule anon (export ...) def ...) (require anon)))
    ((_ name (export ...) def ...)
     (module name mzscheme (provide export ...) def ...))))

(define-syntax import
  (syntax-rules ()
    ((_ name) (require name))))

[For some reason (module (f) (define f 10)) doesn't automatically
import f, as it should given the (require anon) clause]

If I could just get the include-based require-library macro to work, I
could pretty much run my SISC and Chicken code directly (my
prelude.scm already binds xmodule to module for implementations that
support psyntax.)

-- Dan

Posted on the users mailing list.