[R6RS] modules?
Matthew Flatt
mflatt
Mon May 24 19:55:21 EDT 2004
At Sat, 22 May 2004 17:32:40 +0200, Michael Sperber wrote:
> Matthew> I remain convinced that MzScheme's `module' is compatible with a
> Matthew> low-overhead component system, but I can't point to an implementation.
>
> Could you provide just the barest hint on how this would look like?
> (Just enough for me to be confident it's possible.)
I imagine a language that turns the body of a module into a unit, and
automatic linking of units when there's no ambiguity.
Something like this:
(module foo (lib "unit.ss")
(import "baz-sig.ss")
(export "foo-sig.ss")
(define make-foo ...)
...)
;; A compound unit:
(module foo+baz (lib "unit.ss")
(import ...)
(link "baz.ss")
(link "foo.ss")
;; because baz.ss provides the only local implementation of
;; "baz-sig.ss", ad imported by "foo.ss", then it's automatically
;; linked with "foo.ss"
;; Actually, I imagine getting rid of the "atomic" and
;; "compound" distinction. So you can add more defns here.
(define more ...)
(export ...) )
;; An alternate linking
(module foo+baz-alt (lib "unit.ss")
(link "baz.ss")
(link "baz-wrapper.ss" to "baz.ss")
(link "foo.ss" to "baz-wrapper.ss")
;; Since there's more than one implementation of
;; "baz-sig.ss", not we have to be more explicit
;; about the linking. Maybe a lot of other links are
;; still implicit.
...)
Matthew
More information about the R6RS
mailing list