REQUIRES filename (NEEDS filename) 
Author Message
 REQUIRES filename (NEEDS filename)

Reading the proposal at
http://www.*-*-*.com/
I noticed the following issues:

1) include directories: some Forth systems support
one or multiple include directories, while the others
load from the current directory.

2) "REQUIRES filename" loads filename once.
should
        requires ./foo.fth
        requires foo.fth
load foo.fth once or twice?

3) My practice shows that it is not meaningful to
pass compiler parameters (such as include directories)
in environment strings
because what is ok for one project is irrelevant to the other.
Libraries are project-specific.



Wed, 31 Mar 2004 23:52:01 GMT  
 REQUIRES filename (NEEDS filename)


Quote:

>Reading the proposal at
>http://forth.sourceforge.net/wordset/environ-ext/index.html
>I noticed the following issues:

>1) include directories: some Forth systems support
>one or multiple include directories, while the others
>load from the current directory.

Note the difference between the current working directory and the
directory that the currently interpreted file is in. Consider:

Library file B wants to include file C in the same directory; File A
in another directory wants to include library B.  What should the
INCLUDEs/REQUIREs/NEEDSs look like?

The standard says nothing about directories, and thus nothing about
these issues.  In Gforth, B can include C (with a relative name), and
C will be found irrespective of what the current working directory is
(as long as you use the default search path; you can INCLUDE ./C to
force it).

Quote:
>2) "REQUIRES filename" loads filename once.
>should
>    requires ./foo.fth
>    requires foo.fth
>load foo.fth once or twice?

We will have to standardize directory handling before answering this
one.  In Gforth, the name is first expanded using the path handling
rules, and that name is then compared to the expanded names used
earlier, so with the default path this code will load foo.fth once.

- anton
--
M. Anton Ertl  http://www.complang.tuwien.ac.at/anton/home.html
comp.lang.forth FAQs: http://www.complang.tuwien.ac.at/forth/faq/toc.html



Thu, 01 Apr 2004 16:33:32 GMT  
 REQUIRES filename (NEEDS filename)
"Michael L.Gassanenko" schrieb:

Quote:
> 2) "REQUIRES filename" loads filename once.
> should
>         requires ./foo.fth
>         requires foo.fth
> load foo.fth once or twice?

IMHO a program collection can only rely on require[s] to load a file
once if it uses the same name throughout. However, using different names
that lead to the same path doesn't guarantee that the file is loaded
several times, either.

Gforth loads only once, but if you write down the current path (instead
of ./), it loads the file again. Why? Gforth performs a path search on
files without specific path settings (like ./foo.fth has), and remembers
the complete path that results of this search - foo.fth expands to
./foo.fth, since . is in the search path.

--
Bernd Paysan
"If you want it done right, you have to do it yourself"
http://www.jwdt.com/~paysan/



Thu, 01 Apr 2004 06:04:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. How to Specify Variable FileName(!FileName)In Report

2. Using variable filename(!FILENAME)

3. Long Filenames okay for physical filenames???

4. DOS 8.3 filenames (how to remove long filenames header)

5. Library os.path.isfile(filename) - long filenames error.

6. Adding PC Filename Extensions to Macintosh Filenames

7. Need advice on ObjectStudio: Filename length restrictions??

8. need help with splitting image sequence filenames

9. Help with Win95 long filenames needed...

10. need unique filename

11. Urgent Help on Deleting a filename using tcl (script) in an application (without using rm filename (in unix))

12. argv filename for J7

 

 
Powered by phpBB® Forum Software