Differences From Artifact [6813c951891beb98]:
File hangman/files.retro part of check-in [eca5386b7f] - Check in of hangman game from the forthlets part of the main Retro repo. by charleschilders on 2010-05-31 21:51:52. [annotate] [view]
To Artifact [971a1aa871283e3d]:
File hangman/files.retro part of check-in [0c2cfa8b8b] - Update hangman game to work with chained vocabularies. by charleschilders on 2010-07-25 00:28:17. [annotate] [view]
@@ -1,18 +1,17 @@
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
( Copyright [c] 2010, Charles Childers )
( License: ISC )
( ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ )
-' files open
-: fread! ( ha-f ) swap fread dup rot ! ;
+: fread! ( ha-f ) swap \file.read dup rot ! ;
: slurp ( a"- )
- :r fopen dup
+ \file.:r \file.open dup
if
- swap repeat 2dup fread! 0 =if 0 swap ! fclose drop ;then 1+ again
+ swap repeat 2dup \file.read! 0 =if 0 swap ! \file.close drop ;then 1+ again
else
drop 0 swap !
then ;
: >file ( $h- )
push repeat @+ dup 0 =if rdrop 2drop ;then
- r fwrite 0 =if rdrop 2drop ;then again ;
+ r \file.write 0 =if rdrop 2drop ;then again ;