![]() |
||
| Home | SwiftForth Archive | SwiftX Archive | |

Hello Gene,
You propose:
> ..INCLUDE
> or ..\INCLUDE
But my request is _not_ to have only the following
> PUSHPATH
> CD ..
> INCLUDE A.F <-- now, it can INCLUDE B.F
> POPPATH
My request is to have a more convenient INCLUDE, (in fact the traditional one)
FLOAD RELABSDIR\FILE
---------------------------------
1) Change directory to RELABSDIR
2) INCLUDE FILE
3) Restore previous directory
I have checked the next FLOAD definition on 3 small files with relative FLOAD(ing). I think it work fine.
MAX_PATH BUFFER: (zDir)
: (ZSPLIT) ( a u -- zFile zDir )
DUP >R (zDir) ZPLACE
(zDir) DUP R> BOUNDS \ pChar zDir+len zDir
?DO \ pChar
I C@ [CHAR] \ =
IF DROP I THEN \ pChar'
LOOP
DUP (zDir) u>
IF 0 OVER C! CHAR+ (zDir) EXIT THEN
DROP (zDir) 0 ;
: FLOAD ( <<pathfile>> -- )
0 WORD DUP C@ 0= IF DROP EXIT THEN \ nothing to FLOAD
PUSHPATH
COUNT (ZSPLIT) \ s: zFile zDir
?DUP IF SetCurrentDirectory ELSE TRUE THEN
IF ZCOUNT DEFAULT.EXT INCLUDED ELSE DROP THEN
POPPATH ;
-----Original Message-----
From: SF Talk <sftalk_at_forth.com>
To: SF Talk <sftalk_at_forth.com>
Date: samedi 11 mars 2000 0:04
Subject: Re: [sftalk] INCLUDE proposal
Date: Fri, 10 Mar 2000 16:39:22 -0600
From: "Gene LeFave" <gene_at_tekdata.com>
Subject: Re: [sftalk] INCLUDE proposal
I always like to have word names sorted say what they mean, how about
..INCLUDE
or ..\INCLUDE
Gene
Date sent: Fri, 10 Mar 2000 06:43:56 -0800
From: SF Talk <sftalk_at_forth.com>
To: SF Talk <sftalk_at_forth.com>
Send reply to: SF Talk <sftalk_at_forth.com>
Subject: Re: INCLUDE proposal
> Date: Fri, 10 Mar 2000 06:25:01 -0800
> From: "Rick VanNorman" <rvn_at_forth.com>
> Subject: Re: INCLUDE proposal
>
> Charles,
>
> >From: "Charles Melice" <mail_at_forthcad.com>
> >
> >REQUIRES is usefull, but not reliable when 2 files have the same
> >name.
> >
> >A more precise tool is INCLUDE. But there is a problem.
> >
> >If we want to include a file in a parent directory, using
> >
> > INCLUDE ..\A.F
> >
> >Supposing A.F must INCLUDE B.F in its own directory, it cannot do it.
> >
> >
> >To resolve, its necessary to write:
> >
> > PUSHPATH
> > CD ..
> > INCLUDE A.F <-- now, it can INCLUDE B.F
> > POPPATH
> >
> >
> >my proposal is to have the previous sequence fully assumed by
> >INCLUDE.
>
> Thanks for the thoughts. We have explored this as an implementation
> device, but decided that it was counter-intuitive. To change it now
> for the name INCLUDE would break _ALL_ of our existing code.
>
> However, a new name for such a function is a feasible option.
>
> The floor is open for name suggestions...
>
> Rick
>
>
>
.
Received on Fri Mar 10 2000 - 16:39:22 PST
This archive was generated by hypermail 2.2.0 : Thu Nov 20 2008 - 03:04:28 PST