Re: How does Require deal with multiple files of the same name in different directories
- From: "George Hubert" <georgeahubert@xxxxxxxxxxx>
- Date: 12 Aug 2006 05:58:16 -0700
Coos Haak wrote:
Op 10 Aug 2006 01:34:56 -0700 schreef George Hubert:
Marcel Hendrix wrote:
"George Hubert" <georgeahubert@xxxxxxxxxxx> writes Re: How does Require deal with multiple files of the same name in
[..]
I tend to agree if no file in the search path can possibly match (so[ ... etcetera. ]
include would fail anyway) a check could be made for any file and if
one exists assume it's correct (pssibly issuing a warning). The problem
Please, isn't REQUIRE a tool for development? If REQUIRE reloads a file
that actually is loaded already, the recompilation takes a few milliseconds
longer than it should. If it fails to load a new version of a file already
loaded, why not explicitly forget the old code and recompile from scratch?
Re-loading the file may have unexpected consequences e.g.
The function of REQUIRE is one-time loading. So the following doesn't
occur:
REQUIRE tests if the file is loaded. There are ambiguous conditions
such as;
1) A fully qualified path is used where a file of the same name but
with a different
path is loaded.
2) A relative path is specified and more than one path in the paths
list results in
a valid file where one of those files other than the first is loaded
(for the first matching
path the system should always say the file is loaded).
3) A relative path is specified that matches a file that is loaded, but
the path for
the loaded file isn't in the search path (probably as a result of
changing the search
path or the current directory).
It's those ambiguous conditions I'm trying to find the most reasonable
way to deal
with.
1) The file begins with an ANEW MyMarker so all code between the first
load
and the re-load is forgotten.
2) A list of re-definition warnings.
3) Some files re-initialise certain things when loaded (and in those
cases add
code to do this at start-up to the initialisation chain) which can
cause problems.
You're describing the function of INCLUDE
Where the file is deamed not to be loaded then REQUIRE performs the
action of
INCLUDE; the problem is handling those cases for relative files where
more than
one file could be deamed to be the one REQUIREd.
It may reload the same file and execute MARKERS and ANEW with probablyNot necessarily; if the programmers intends to reload the file
fatal consequences. REQUIRE doesn't.
(possibly after
editing) then that's precisely the action they want.
--
Coos
CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html
George Hubert
.
- References:
- How does Require deal with multiple files of the same name in different directories
- From: George Hubert
- Re: How does Require deal with multiple files of the same name in
- From: George Hubert
- Re: How does Require deal with multiple files of the same name in different directories
- From: Marcel Hendrix
- Re: How does Require deal with multiple files of the same name in different directories
- From: George Hubert
- Re: How does Require deal with multiple files of the same name in different directories
- From: Coos Haak
- How does Require deal with multiple files of the same name in different directories
- Prev by Date: Re: Forth fibonacci shootout
- Next by Date: Re: How does Require deal with multiple files of the same name in different directories
- Previous by thread: Re: How does Require deal with multiple files of the same name in different
- Next by thread: Re: How does Require deal with multiple files of the same name in different directories
- Index(es):
Relevant Pages
|