In article ,   
   dxf wrote:   
   >On 4/04/2025 10:36 pm, albert@spenarnc.xs4all.nl wrote:   
   >> In article ,   
   >> Hans Bezemer wrote:   
   >>> On 27-03-2025 06:05, Alexis wrote:   
   >> ...   
   >>> "I've looked at a lot of Forth code, and it's almost uniformly   
   >>> doc-free." That's an attitude problem - not a language problem.   
   >> I agree. Most programmers agree that ( -- ) is sufficient documentation.   
   >> My advice is : precede each word with a specification that allows   
   >> the use of this word. The ideal is that the definition itself is   
   >> in fact the documentation of the definition. This is Chuck Moore's   
   >> pipe dream.   
   >   
   >I'm not so sure. 10 definitions and 2 comments. Does it need more?   
   >   
   >\ Encountered file error, display msg, filename then quit   
   >: FERR ( ? ior a u -- ? ) rot 0= if 2drop end   
   > cr ." File error: " type ." - " @fname type abort ;   
   >   
   >: FOPEN ( a n fam -- ) open-file s" open" ferr cf ! ;   
   >: FCREAT ( a n fam -- ) create-file s" create" ferr cf ! ;   
   >: FREAD ( a n -- n' ) cf @ read-file s" read" ferr ;   
   >: FWRITE ( a n -- ) cf @ write-file s" write" ferr ;   
   >: FSEEK ( ud -- ) cf @ reposition-file s" position" ferr ;   
   >: FCLOSE ( -- ) cf @ close-file s" close" ferr ;   
   >   
   >\ Install terminal data at offs to target at adr   
   >: SET.S ( a ofs -- ) dbuf + count rot >target place ;   
   >: SET.W ( a ofs -- ) dbuf + @ swap >target ! ;   
   >: SET.B ( a ofs -- ) dbuf + c@ swap >target c! ;   
      
      
   Who would have guessed (a n ) is actually a file name?   
      
   Groetjes Albert   
   --   
   Temu exploits Christians: (Disclaimer, only 10 apostles)   
   Last Supper Acrylic Suncatcher - 15Cm Round Stained Glass- Style Wall   
   Art For Home, Office And Garden Decor - Perfect For Windows, Bars,   
   And Gifts For Friends Family And Colleagues.   
      
   --- SoupGate-DOS v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|