This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: the default script environment


On 22 Nov 1998, Mikael Djurfeldt wrote:

> To me, your arguments for alternative 2 seems stronger.  I vote for
> this alternative (that the REPL environment should be different from
> the script environment and that the script environment should be
> slim).

I agree that the REPL environment may be different from the script
environment, but _I_ want control over the difference. At least, I want the
possibility to get an ASAP (as slim as possible) REPL environment as well.

> > However, a script is something meant to be used many times.  We can
> > only give the user the misleading illusion of control over the initial
> > environment a script runs in; she can't actually affect how behaves on
> > the other systems on which her script might run.
> 
> There might be a way to have the cake and eat it too: For example, we
> could copy the behaviour of the great shells:
> 
> Introduce an environment variable GUILE_ENV.  When Guile is started
> non-interactively, it checks if this exists.  In that case it loads
> the file $GUILE_ENV.  Unlike the shell behaviour, I think this file
> should be loaded also during interactive use, before .guile.

Loading .guile at every startup and then conditionally executing some code
only for interactive mode is basically the same thing, just the other way
around. It's like providing two startup scripts: .guile and .guile-repl.

Although I think that such a split is unnecessary if guile provides sufficient
customizability when loading .guile (via hooks for example), it is an
acceptable solution. It will not completely solve the problem that misuse
of the .guile script may lead to incompatibilities for scripts run on
different accouts, but it may make the distinction clearer for users.

Best regards, 
Dirk Herrmann