Re: How does Require deal with multiple files of the same name in different directories



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
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
[ ... etcetera. ]

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:
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
It may reload the same file and execute MARKERS and ANEW with probably
fatal consequences. REQUIRE doesn't.

--
Coos

CHForth, 16 bit DOS applications
http://home.hccnet.nl/j.j.haak/forth.html
.



Relevant Pages

  • Re: How does Require deal with multiple files of the same name in different directories
    ... include would fail anyway) a check could be made for any file and if ... one exists assume it's correct (pssibly issuing a warning). ... Re-loading the file may have unexpected consequences e.g. ... search path that matches a relative path is loaded, ...
    (comp.lang.forth)
  • Re: How does Require deal with multiple files of the same name in different directories
    ... include would fail anyway) a check could be made for any file and if ... one exists assume it's correct (pssibly issuing a warning). ... A relative path is specified and more than one path in the paths ... the loaded file isn't in the search path (probably as a result of ...
    (comp.lang.forth)
  • Re: gcc-4 ?
    ... FAIL: gcc.dg/builtins-20.c (test for excess errors) ... WARNING: Couldn't find the global config file. ... FAIL: externs-12 execution ...
    (freebsd-questions)
  • Re: 3^n and primes
    ... Now, as you showed, when p=60, one of the "triples" for 3 is divisible ... Of course, it could fail at 351, etc. ... Someone was nice enough to run the following Mathematica code that I ... turned into this file -- Warning! ...
    (sci.math)
  • Re: Million Illegals March today.
    ... Are your essays as truthful and thoughtful as the unthinking lie "Under the DMCA legislation I can prosecute you for electronic trespassing if you fail to obey this warning" you just posted? ...
    (alt.politics.bush)