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: 09 Jun 2001 01:26:35 -0500
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7

Marius Vollmer <address@hidden> writes:

> Phfrr, don't know.  I'm using it in my simulator, which has its own
> way to set up the environment for the user, passing the buck to
> top-repl in the end.  So I would say, yes, there should be a
> advertised way to start the standard repl, but maybe it should not be
> top-repl but rather something more consciously designed.  For example
> (related to something you say in another post), there should be a way
> to not switch to (guile-user) for the repl, etc.

But what is it that you want out of top-repl?  Right now, it does the
following main things:

  1 populates guile-user with a bunch of "useful" modules.

  2 sticks the guile module back at the top of the "stack".

  3 loads the emacs interface if requested globally.

  4 sets the current module to guile-user

  5 sets up the right signal handlers, exit hooks, etc., and launches
    the repl.

When top-repl is being used from the normal startup code (i.e. when
firing up guile, parsing args, etc.), it actually has to be broken
into two pieces.  Between steps 2 and 3 we execute all of the code
generated by parsing the args (i.e. code from -x args, -l loads,
etc.), and the final result, in the interactive case looks something
like this:

  (begin
    (top-repl-init)    ;; steps 1-2
    (load-user-init)   ;; code generated from args
    ...                ;; more code generated from args
    (top-repl-execute) ;; steps 3-5

This split is necessary because the code generated by the args might
depend on the envt being set up properly by steps 1-2.  Actually, it's
a little more complicated than that since (for example) after we
finish parsing the args, we have to look and see if we're going to end
up in interactive mode (i.e. was -c or -s specified), and if not then
step 1 is mostly skipped.

In the end perhaps we should have two public repl functions, one which
just publishes the "normal repl".  If you call this function, you get
the same repl that you'd get when you run guile interactively.  The
other one would be a lower level repl function that mostly just did
step 5 for those people who want/need to set things up in a more
customized way.  Step 5 is really where the trickier bits are.

Thoughts?

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



reply via email to

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