Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!usc!ucsd!ucbvax!MITCH.ENG.SUN.COM!wmb From: wmb@MITCH.ENG.SUN.COM Newsgroups: comp.lang.forth Subject: (none) Message-ID: <9008271932.AA00162@ucbvax.Berkeley.EDU> Date: 27 Aug 90 18:29:48 GMT Sender: daemon@ucbvax.BERKELEY.EDU Reply-To: wmb%MITCH.ENG.SUN.COM@SCFVM.GSFC.NASA.GOV Organization: The Internet Lines: 28 Robert Berkey writes: > However, it's not clear on how to set >IN in BASIS. > : ( addr len token -- ) > BLK @ >R >IN @ >R #TIB @ >R SOURCE-FILE @ >R \ save-it > ROT ROT ( token addr len) > 0 BLK ! \ prepare BLK > 0 SOURCE-FILE ! \ prepare SOURCE-FILE > TIB ROT - DUP >IN ! ( token len tib-addr) \ prepare >IN > + #TIB ! ( token) \ prepare #TIB > EXECUTE \ do-it! > R> SOURCE-FILE ! R> #TIB ! R> >IN ! R> BLK ! \ restore-it > ; > > (This is here so that Mitch or anyone else can tell me how to fix or > improve it.) It looks good to me. I don't see any problem. The basic axioms are satisfied. Those are: >IN @ TIB + is the start of the current input stream. #TIB @ TIB + is the end of the current input stream. Due care has been taken to save and restore BLK , SOURCE-FILE , >IN , and #TIB , and to set BLK and SOURCE-FILE to 0, so I give this code a big yes vote. Mitch