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




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.

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.

The problem I sometimes encounter is a multifile project where a main file
uses NEEDS to include the others. If I modify a file in this project,
it won't reload automatically when I include the main file. In that case
I must do ANEW, execute a MARKER, or FORGET the first word in the project
before trying to INCLUDE. (Here timestamping would help.) Naming a file
the same as an existing library file is not possible, but I consider that
a programming error that should be fixed.


I agree that naming a file with the same name as an existing library
file shouldn't
be done; the problem is how to avoid naming it the same as a future
one?

What is the problem you are trying to solve? It is still not clear to me.

I think we're trying to solve 2 problems.
1) A program written for older W32F versions is available somewhere. It
contains
some library files which weren't at the time distributed with the
system (though
was in common use). Quite a few of these files are now included in the
lib directory
of the newer W32F systems (i.e. V6.xx), however in some cases the
libaries have
been revised to take account of implementation changes (especially
separate code
and data spaces and multi-tasking) so the newer libary must be used
(this is likely
to be even more important with the STC version since any library that
assumes ITC
will need updating). Sometimes it's useful to be able to test the
application in different
versions of W32F (perhaps to test compatibility) and if the file uses
NEEDS it can be
done by pre-loading the required libraries, provided the program
doesn't load the file
of the same name in the current directory when that's the case. The
alternative (which
must be done if the application uses FLOAD or INCLUDE anyway) is to
have 2 copies
of the application source, with the version for the later W32F modified
by removing the
libary files (or copying the system libraries over the older versions)
which is annoying
2) Win32Forth V4.2 only stored the name (i.e. w/o path) of files that
are loaded so would
always sayt that file is loaded, whereas V6.xx stores the path and only
says that the
file is loaded if it's the first matching file the search path (for
relative paths) or an exact
match (absolute paths), leading to problems (which didn't exist with
V4.2) when the
current directory is changed, so the directory containing the loaded
version of the file
is no longer in the search path, which leads to an incompatibility
between versions.

-marcel

George Hubert

.



Relevant Pages

  • Re: Compile GNU Octave with SunStudio
    ... defining man1dir to be $/man1 ... Fortran libraries: -lz -lm -lf77compat ... configure: WARNING: command editing and history features require GNU Readline ... This will result in some lack of functionality for sparse matrices. ...
    (comp.unix.solaris)
  • Re: How does Require deal with multiple files of the same name in different directories
    ... IMHO, once it is decided to load the file, this is required to happen, so it is not ... A program written for older W32F versions is available somewhere. ... As the old libraries won't work with the new W32F anyway, ... downloaded apps, which means checking any downloadable apps I (and ...
    (comp.lang.forth)
  • Re: How does Require deal with multiple files of the same name in different directories
    ... the recompilation takes a few milliseconds ... IMHO, once it is decided to load the file, this is required to happen, so it is not ... A program written for older W32F versions is available somewhere. ... As the old libraries won't work with the new W32F anyway, ...
    (comp.lang.forth)
  • databases/clip doesnt build
    ... creating cache ./config.cache ... checking whether the linker supports shared libraries... ... gtkcombobox.h:50: warning: data definition has no type or storage class ...
    (freebsd-questions)
  • Re: Word template - Workflow System - Event Handler problem
    ... "Disable Macros" option and this too would fail. ... Thanks for the suggestion Fernando, ... >> libraries as staging areas. ...
    (microsoft.public.sharepoint.portalserver.development)