[plt-scheme] question about "module: initial import not well formed"

From: Rohan Drape (rohan.drape at gmail.com)
Date: Mon Mar 17 22:34:28 EDT 2008

dvanhorn:
> > You need to provide (at least) #%app, #%top, #%datum, and
> > #%module-begin, plus whatever else you want.

eli:
> Actually, I think that only `require' is really needed.  (And
> reproviding `#%plain-module-begin' as `#%module-begin'.)  The
> resulting language would be useless until you require stuff in,
> including the above.

thanks, the below seems to work.  perhaps an official empty
module would be useful (short as it is, it's not entirely obvious).

empty.ss:
(module empty scheme/base
  (provide #%app #%top #%datum #%module-begin require only-in provide))

x.ss:
(module x "empty.ss"
  (require (only-in scheme/base define lambda +))
  (provide succ)
  (define succ (lambda (n) (+ n 1))))

y.ss:
(module y "empty.ss"
  (require "x.ss" (only-in scheme/base display newline))
  (display (succ 1))
  (newline))


Posted on the users mailing list.