needs tests/harness mem/roll io/stream testbegin 8 newrollingbuffer const mybuf \test write then read without bounds "hello" mybuf puts 5 mybuf gets "hello" #s= \test read from empty buffer 42 mybuf readbuf 0 #eq \test full the buffer "hellogoodbye" c@+ mybuf write 7 #eq \test a full buffer can't get anything else "hey" c@+ mybuf write 0 #eq \test read that buffer 7 mybuf gets "hellogo" #s= \test try that fastputc, thing code myfastputc ( c stream -- f ) A) &) !, drop, fastputc, 1 i) @, else 0 i) @, then exit, 'X' mybuf myfastputc #true mybuf getc 'X' #eq mybuf getc EOF #eq \ update ridx from nextridx \test fastputc, on a full buffer "hellogoodbye" c@+ mybuf write 7 #eq 'X' mybuf myfastputc not #true testend