home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.forth      Forth programmers eat a lot of Bratwurst      117,927 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 116,425 of 117,927   
   Krishna Myneni to Anton Ertl   
   Re: Application benchmark suite appbench   
   21 Apr 24 08:13:04   
   
   From: krishna.myneni@ccreweb.org   
      
   On 4/20/24 16:26, Anton Ertl wrote:   
   > mhx@iae.nl (mhx) writes:   
   >> Anton Ertl wrote:   
   >> [..]   
   >>> iForth-5.1-mini does not occur in the table, because not a single   
   >>> benchmark runs on it, because this system does not support relative   
   >>> file names, not even in the working-directory-relative way that other   
   >>> commercial systems support (at least in my installation, and my   
   >>> impression when I asked about that is that this is the way Marcel   
   >>> Hendrix intends it to be).   
   >>   
   >> Can you refresh my memory, and/or define "working-directory-relative"   
   >> file naming?   
   >   
   > A relative file name is not absolute, i.e., does not start with "/"   
   > (or, on DOS-derived OSs, with stuff like "C:\").   
   >   
   > What is it relative to?  In some cases, it's relative to the working   
   > directory (the thing you change with cd or chdir).  However, this   
   > means that when you INCLUDE/REQUIRE from within a file, you either   
   > have to specify an absolute file name or your INCLUDE is only correct   
   > if the working directory is in a specific directory; so for specifying   
   > other source files from a source file, it's better to make relative   
   > filenames mean relative to the (directory immediately containing) the   
   > source file.  Unfortunately, the Forth community could not agree even   
   > on the most basic things about portable file names, such as directory   
   > separators.   
   >   
   > Anyway, some years ago I reported that iForth-5.1-mini INCLUDEing only   
   > works for absolute file names, and you wrote that that's the   
   > intention.   
   >   
   > - anton   
      
   In kForth, a filename parsed by INCLUDE or given to INCLUDED is always   
   treated a relative filename to the current working directory. If the   
   file is not found, then it is taken to be relative to a directory   
   specified by an environment variable, KFORTH_DIR.   
      
   $ echo $KFORTH_DIR   
   /home/krishna/kforth   
      
   As an example, the folder above contains   
      
   ans-words.4th   
   games/ ( subdirectory )   
   games/tscp.4th   
   games/chessboard.4th   
   games/tscp-tgfx.4th   
      
   The Forth program, tsc-tgfx.4th, which executes the following statements   
   looks for each file relative to the current directory, individually. If   
   each one is not found, it will include the one relative to KFORTH_DIR   
      
   include ans-words   
   include games/tscp   
   include games/chessboard   
      
    From any working directory, I can use a different chessboard by placing   
   a modified chessboard.4th in ./games/   
      
   and performing   
      
   include games/tscp-tgfx   
      
   which will include files in the following order.   
      
   $KFORTH_DIR/games/tscp-tgfx.4th   
   $KFORTH_DIR/ans-words.4th   
   $KFORTH_DIR/games/tscp.4th   
   ./games/chessboard.4th   
      
   This assumes that the ./games/ directory in my working directory does   
   not contain tscp-tgfx.4th or tscp.4th.   
      
   --   
   Krishna   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca