> Posted by: "Anton Ertl" anton@...
> > IMHO it is really important to consider application programmers.
>
> I do.
>
> > They are the people who use what toolmakers produce. Remember
> > also that Forth is an interactive language and we should make
> > our primary tools available at run time.
>
> They are.
>
> In Forth, there is no hard boundary between application programmer and
> tool maker, and no boundary between compile time and run time.
You miss the point. These days, file names often come from
dialog boxes, databases and so on. The application programmer is
presented with
a) a filename string
b) knowledge of how to use it.
My TransFileName word is simply an attempt to factor some of the
requirements for easy implementation without having to litter
the spec with other words and plug into the carnality of OPEN-
FILE. Other file name manipulators that are commonly used are
a) from the load path, i.e. from the directory containing the
executable, e.g. for system-wide configuration.
b) from the home directory, e.g. for user configuration
c) from user's data directory.
The list goes on and on. By the time you have built all the
tools for a hosted application (not an embedded app), you might
just as well implement a text macro solution, which solves all
these issues except for the search path. I've been bitten often
enough by words of the same name with incompatible behaviour
that I treat search paths with deep suspicion.
Note also that something like the text macro solution is
required for the internationalisation proposal to overcome word
order problems in spoken languages. Text macros have been in
wide use at MPE for a very long time. The 2001 version is
available from:
http://www.mpeforth.com/arena/international.fth
with minimal copyright requirements.
This proposal is just too limited to deal with application
requirements. The real problem is how an application takes a
simple file name and converts it to a full path based on one of
a number of different base directories, including but not
limited to:
a) current working directory
b) directory of current include file
c) load path
d) home directory
e) data directory
f) Forth tools directory
g) application source base directory
I am prepared to support a search path mechanism because a lot
of people like it.
Stephen
--
Stephen Pelc, stephen@...
MicroProcessor Engineering Ltd - More Real, Less Time
133 Hill Lane, Southampton SO15 5AF, England
tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691
web: http://www.mpeforth.com - free VFX Forth downloads