I sent this mail to hugs-bugs some time ago, but haven't heard
anything. I am not subscribed to hugs-bugs, so maybe that's the reason
I missed the reply. Is hugs-bugs archived anywhere?

Marko

------- Start of forwarded message -------
To: [EMAIL PROTECTED]
Subject: Q: Motivation for not following the path set when importing?
Mime-Version: 1.0 (generated by tm-edit 7.106)
Content-Type: text/plain; charset=NIL
From: Marko Schuetz <[EMAIL PROTECTED]>
Date: 07 Jul 1999 22:32:54 +0200
Message-ID: <[EMAIL PROTECTED]>

Ok, I think this behavior is a bug (or I cannot see it's motivation):

I have a module A importing module I. Module B also imports I. I have
a baseline of modules and modules in my working area which are
supposed to take precedence over the modules in the baseline. So I set
the path accordingly: the (sub)directories of the working area preceed
the (sub)directories of the baseline. If modules I, A and B are in the
baseline and more up to date versions of A and I are in the working
area then chasing the imports from module A will load module I from
the working area and module B from the baseline. Then module I is
loaded *again* this time from the baseline, although it a) is already
loaded and b) the path is set so that it can be found in the working
area before searching the directories of the baseline.

Is there a reason to this behavior?

I narrowed it down to this in machdep.c


String findMPathname(along,nm,path)/* Look for a file along specified path   */
String along;                   /* If nonzero, a path prefix from along is */
String nm;                      /* used as the first prefix in the search. */
String path; {
    String pathpt = path;

    searchReset(0);
    if (along) {                /* Was a path for an existing file given?  */
        Int last = (-1);
        Int i    = 0;
        for (; along[i]; i++) {
            searchChr(along[i]);
            if (isSLASH(along[i]))
                last = i;
        }
        searchReset(last+1);
    }
    if (tryEndings(nm))
        return normPath(searchBuf);



Marko
------- End of forwarded message -------

I have since commented out the lines from `if (along)..` to `return
normPath(searchBuf);` inclusive and that has had the desired effect,
i.e. I can now have a working area of files belonging to a change, a
baseline (and baselines thereof) without conflicting loads of
modules. 

I think as the default imported modules should be chased along the
search path without including the path a module was found as the first
choice when chasing imports from this module.

Marko

-- 
Marko Schütz            [EMAIL PROTECTED]
http://www.ki.informatik.uni-frankfurt.de/~marko/


Reply via email to