Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!SCFVM.BITNET!ZMLEB From: ZMLEB@SCFVM.BITNET (Lee Brotzman) Newsgroups: comp.lang.forth Subject: Re: File handling tips Message-ID: <8904040204.AA21175@jade.berkeley.edu> Date: 4 Apr 89 01:44:36 GMT References: Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 45 > >David Phillip Oster (oster@dewey.soe.berkeley.edu.UUCP) writes: >| >| One advantage of traditional "blocks" over files: >| >| When your program crashes during LOAD, it is easier to fix it up and >| continue, rather than FORGETing everything and restarting the load: > >This is not necessarily so. Why not put the blocks into files? >I believe that the Macintosh MacForth does this - I know Mad Apple Forth does. >This way, everything still looks like blocks to the user, but can either >be a standard text file or an "all-text" file just like the blocks are. > I don't know about MacForth, but, in my experience, block-oriented Forth systems that run under host operating systems usually implement blocks as 1024-byte fixed-length records. There are no intervening end-of-line characters or other record terminators. They are not at all like standard text files, as evidenced by trying to print them and getting a run-on mish-mash. The reason I use blockish files while using Forth under MS-DOS, or Apple ProDOS, or VAX VMS (our Forth system is implemented under all three plus a few others) is for fast access to any part of the code. When an error occurs I type WHERE and the editor puts my cursor at the point of the error. Or, if I leave the editor, I type RESUME and I'm right back where I left off. It's a simple matter to vector the system words to invoke these functions automatically, I just haven't found it important enough to do. The overhead is exactly two integers: block number and offset into the block. The buffer is already in Forth's memory space, so no additional reads are required to position the cursor. This is just like the Turbo-xxxx compiler environments, the only difference being that I had it before Borland was incorporated. On the other hand, I am not a BLOCK fanatic. I just like them, and they work for me. If others prefer text files, great. > >-- >======== David Douthitt :::: Madison, WI :::: The Stainless Steel Rat ======== >FidoNet: 1:121/2 ::::: WittiNet: "Curiouser and curiouser, said Alice." :::::: >UseNet: ...{rutgers|ucbvax|harvard}!uwvax!astroatc!nicmad!madnix!rat >ArpaNet: madnix!rat@cs.wisc.edu {decvax|att}! -- Lee Brotzman (FIGI-L Moderator) -- NASA doesn't know what I'm saying. Let's keep it that way. -- Astronomical Data Center. NASA Goddard Space Flight Center. -- BITNET: ZMLEB@SCFVM Internet: zmleb@scfvm.gsfc.nasa.gov -- SPAN: CHAMP::BROTZMAN GEnie: L.BROTZMAN