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

Re: Settor functions and initialization



Harald wrote:
> I believe that during initialization, all variables should be initialized
> from the environment without trying to call settor functions.  Only
> afterwards should settors be looked for and called, for each variable that
> was initialized from the environment in the first place.

I think this is right.

Noah wrote:
> But I think in the average case, the environment is not changed from one
> invocation of the shell to the next, and you can't generally expect to know
> the right order in which to call settors anyway.  So calling them at shell
> startup is not particularly helpful.

I think I disagree.  Sometime you need to have them called, to ensure
the proper state in a subshell, especially, as Harald has noted, if
there are intervening non-es processes, such as su or emacs, that might
change the environment.

The ordering Harald suggested appears to me sufficiently deterministic
to be useful and predictable.

One thing that might help is to have a shell variable set dynamically to
some special value to indicate that the setters are being run from
startup rather than normal operation.

Paul