guile-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Recent guile-user related reversion in boot-9.scm


From: Rob Browning
Subject: Re: Recent guile-user related reversion in boot-9.scm
Date: 03 Jun 2001 12:29:49 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Marius Vollmer <address@hidden> writes:

> Thinking about this issue, I would say that `top-repl' might be moved
> into the (ice-9 script) module as well, and scm_shell would load that
> module and pass control to `guile-main' (right?).

It's the other way around -- scm_shell calls guile-main, guile-main
parses the args, builds a set of forms to perform the actions
specified on the command line, and then calls eval on the set of
forms.  The set of forms will contain, as the final action, a call to
top-repl iff -s and -c were not specified.

I've just done a fairly straightforward translation of script.c, so
this is more or less how it's been for a while.

So presuming we want the envt during argument execution (-c, -x, -l,
etc.) to be the normally populated guile-user module, then the actions
that are now in top-repl, need to be taken within guile-main before
the forms derived from the arguments are evaluated.  Is there any
reason that would be a bad idea?  Basically, I'd just need to move
some of the top part of top-repl to guile-main.

Alternately, if it's important for top-repl to be visible publically,
and to always ensure guile-user was properly setup, top-repl could be
broken up into two parts, top-init and top-execute (or whatever).
top-repl would just call both and guile-main would call top-init and
then eval the argument forms (which might include a call to
top-execute).

> Loading and accessing the module from C would look like this:
> 
>     SCM mod = scm_c_resolve_module ("ice-9 script");
>     SCM guile_main = scm_c_module_lookup (mod, "guile-main");
> 
>     scm_apply (guile_main, SCM_EOL, SCM_EOL);

Thanks.  This mostly worked, but I had to add a SCM_VARIABLE_REF to
guile_main.

-- 
Rob Browning <address@hidden> PGP=E80E0D04F521A094 532B97F5D64E3930



reply via email to

[Prev in Thread] Current Thread [Next in Thread]