--- gforth/kernel/require.fs 2000/09/23 15:06:10 1.17 +++ gforth/kernel/require.fs 2003/01/19 23:35:35 1.22 @@ -1,6 +1,6 @@ \ require.fs -\ Copyright (C) 1995,1996,1997,1998,2000 Free Software Foundation, Inc. +\ Copyright (C) 1995-2003 Free Software Foundation, Inc. \ This file is part of Gforth. @@ -16,7 +16,7 @@ \ You should have received a copy of the GNU General Public License \ along with this program; if not, write to the Free Software -\ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. +\ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111, USA. \ Now: Kernel Module, Reloadable @@ -60,7 +60,7 @@ create image-included-files 4 , A, ( poi \G @file{./foo.fs} included-files 2@ 0 ?do ( c-addr u addr ) - dup >r 2@ 2over compare 0= + dup >r 2@ 2over str= if 2drop rdrop unloop true EXIT @@ -75,6 +75,13 @@ create image-included-files 4 , A, ( poi 2/ cell / included-files 2! 2! ; +has? new-input [IF] +: included1 ( i*x file-id c-addr u -- j*x ) \ gforth + \G Include the file file-id with the name given by @var{c-addr u}. + save-mem add-included-file ( file-id ) + included-files @ 1- ['] include-file2 catch + throw ; +[ELSE] : included1 ( i*x file-id c-addr u -- j*x ) \ gforth \G Include the file file-id with the name given by @var{c-addr u}. loadfilename# @ >r @@ -83,7 +90,8 @@ create image-included-files 4 , A, ( poi ['] include-file2 catch r> loadfilename# ! throw ; - +[THEN] + : included ( i*x c-addr u -- j*x ) \ file \G @code{include-file} the file whose name is given by the string \G @var{c-addr u}. @@ -154,7 +162,3 @@ create image-included-files 4 , A, ( poi : .included ( -- ) \ gforth \G list the names of the files that have been @code{included} included-files 2@ .strings ; - -\ contains tools/newrequire.fs -\ \I $Id: require.fs,v 1.17 2000/09/23 15:06:10 anton Exp $ -