version 1.2, 1997/05/29 19:43:39
|
version 1.3, 1997/06/01 20:55:22
|
Line 79 create image-included-files 1 , A, ( po
|
Line 79 create image-included-files 1 , A, ( po
|
throw ; |
throw ; |
|
|
: included ( i*x addr u -- j*x ) \ file |
: included ( i*x addr u -- j*x ) \ file |
open-fpath-file included1 ; |
open-fpath-file throw included1 ; |
|
|
: required ( i*x addr u -- j*x ) \ gforth |
: required ( i*x addr u -- j*x ) \ gforth |
\G include the file with the name given by addr u, if it is not |
\G include the file with the name given by addr u, if it is not |
Line 90 create image-included-files 1 , A, ( po
|
Line 90 create image-included-files 1 , A, ( po
|
\G problems with several paths to the same file (e.g., due to |
\G problems with several paths to the same file (e.g., due to |
\G links) and we would catch files included with include-file and |
\G links) and we would catch files included with include-file and |
\G write a require-file. |
\G write a require-file. |
open-fpath-file 2dup included? |
open-fpath-file throw 2dup included? |
if |
if |
2drop close-file throw |
2drop close-file throw |
else |
else |
Line 100 create image-included-files 1 , A, ( po
|
Line 100 create image-included-files 1 , A, ( po
|
\ INCLUDE 9may93jaw |
\ INCLUDE 9may93jaw |
|
|
: include ( "file" -- ) \ gforth |
: include ( "file" -- ) \ gforth |
|
\G includes a file and keeps in mind that this file is loaded |
name included ; |
name included ; |
|
|
: require ( "file" -- ) \ gforth |
: require ( "file" -- ) \ gforth |
|
\G load a file only when it is not included already |
name required ; |
name required ; |
|
|
0 [IF] |
0 [IF] |