Re: module interface changed or changing?

Jost Boekemeier (jostobfe@calvados.zrz.TU-Berlin.DE)
Sun, 21 Jun 1998 12:36:39 +0200

> It's not there becuase the module system is going to be changed RSN

What about:

(define m (module ((<import-Module> (<import-features>)))
(<export-features>)))

where <import-features> may be

1.) empty -> all features from module "M" are imported and are renamed to
something like <M>.<feature name> or <M>-<feature name>

2.) a list of symbols -> only the listed features are included.

3.) a list of pairs -> only the listed features are included, but renamed
to the CDR of the pair.

So for example:

(define expect (module
((regex () ))
(port timeout timeout-proc eof-proc char-proc)))

(define port #f) ; define features (no "define-public" neccesary)
(define timeout #f)
...
<EOF>

defines the interface of the module "expect".

You can use and redefine some features of expect as follows

(define my-expect (module
((expect (port . base) timeout))
(features i want to export)))
; do something usefull with "port", now named "base" and "timeout"
...
<EOF>

Or you can simply import all features

(define mymod (module
((expect () ) ; import all features and rename them to
; mymod.port, mymod.timeout etc.

; do something usefull with "mymod.port", "mymod.timeout" etc.

...
<EOF>

Jost