Re: rcfiles cascade - wow!

1998-11-30 22:34:53
On November 29, 1998 at 17:36, Jeff Breidenbach wrote:

I just
checked to see if rcfiles would cascade, i.e.

mhonarc -rcfile a -rcfile b mbox

It appears to work just like cacading stylesheets; i.e rcfile a is
used, except where augmented or overridden by rcfile b. I am totally,
totally impressed.

The benefits of lazy programming ;^)  I.e.  It would be harder to
not do "cascading" and less efficient.

The example you give is basically the same as if rcfile "a" included
rcfile "b" at the very end:

<!-- rcfile "a" -->
...Bunch of stuff here...
<!-- End of "a" -->

Note, the "cascading" behavior can be annoying when dealing with
OTHERINDEXES since the settings of the main rcfile will be in effect
within otherindexes rcfiles unless overridden (or augmented).  This can
be a problem if the desire is to have an otherindexes rcfile to be
a separate entity working off of MHonArc default settings.

However, cascading behavior can be a benefit since the user does not
have to redefine resources if the same values are to be used from
the main resource file.  I figure this is the more common/preferred
behavior since otherindexes rcfiles tend to already have some
relationship (linkage) between the main rcfile and other otherindexes
rcfiles of the same archive.

Note 2 about OTHERINDEXES: the "cascading" occurs in all listed
OTHERINDEXES.  Take the following example:

<!-- main rcfile -->

otherindex1 will "inherit" any settings from main.  otherindex2
will inherit from main and otherindex1.  otherindex3 inherits from
main, otherindex1, and otherindex2.  So on and so forth...

The exception is that the THREAD and MAIN resources are always reset
before parsing each OTHERINDEXES rcfile so MHonArc can determine the
type of index to generate from what is specified.

Therefore, when dealing with OTHERINDEXES, and even regular rcfiles
(due to DEFRCFILE and environment variables) you cannot completely
rely on the default resource values being in effect even if you do
not modify them in a given resource file.

A nice thing that MHonArc does do (unless QUIET is set) is output
what rcfiles are being parsed.  This way you can confirm the order
rcfiles are parsed.


Earl Hood

<Prev in Thread] Current Thread [Next in Thread>
  • Re: rcfiles cascade - wow!, Earl Hood <=