[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

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

> 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).

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

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

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

Posted on the users mailing list.