[R6RS] Scripts

Michael Sperber sperber at informatik.uni-tuebingen.de
Wed Jul 19 13:36:02 EDT 2006

dyb at cs.indiana.edu writes:

>> > There's no reason why the script must run when it's loaded into an
>> > interactive environment.  The interactive environment can easily provide
>> > the following two procedures:
>> >
>> >   (load-script <script-name>) => <script-object>
>> >   (invoke-script <script-object> <command-name> <argument> ...)
>> I dislike this, because it doesn't fit the model of some interactive
>> REPLs like that of Scheme 48 (which allows you to inject code into a
>> module after it's been created).
> I don't know the how Scheme-48's interactive environment works, but I
> don't see any inherent problem doing that with the model I suggest. 
> Perhaps you can elaborate.

For an existing module (called "structure" in Scheme 48), you can say

,in foo

at the REPL, and everything you type into the REPL will be evaluated
in the environment of the `foo' structure.  This means you can
do stuff "inside the structure" interactively without having to
re-evaluate or re-load the entire structure.  If your script has a
procedure as an entry point, this means I can re-apply it.
Specifically, I can apply it to any command-line arguments I can think
of without having to introduce a mechanism for controlling what
(command-line-argument) returns.

> Sorry, I missed that.  I'm not happy to lift that restriction with your
> model, unless the script header identifies the name of the module.  

That would also be OK with me.  If it helps, even identifying the name
of the procedure within the module in the script header would be OK
with me.

Cheers =8-} Mike
Friede, Völkerverständigung und überhaupt blabla

More information about the R6RS mailing list