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 117,725 of 117,927   
   Paul Rubin to All   
   Idiomatic way to read a word of text fro   
   17 Nov 25 15:25:20   
   
   From: no.email@nospam.invalid   
      
   I'm playing with the idea of writing a Roff-like text formatter in   
   Forth.  The input is lines of text "blah blech, and this that the   
   other...".  The text lines can be arbitrarily long so I don't want to   
   read the entire line into a memory buffer using something like REFILL.   
      
   Let's say I don't have to worry about individual words overflowing   
   memory though (segfault is not allowed, but it's ok to panic and quit).   
   So the main loop will be to copy an input word to the output buffer and   
   maybe flush the output buffer.  The output buffer can be of fixed size.   
      
   Also, some input lines will be formatting commands like ".i\n" (change   
   font to italic).  Those lines should be given to the Forth text   
   interpreter.   
      
   I guess I could use the FILE word set to write something like getc()   
   with its own buffering, but that seems messy.  I'm wondering if this is   
   a common situation and there's an idiomatic solution.   
      
   --- 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