From: dxforth@gmail.com   
      
   On 26/07/2025 1:06 am, Anton Ertl wrote:   
   > dxf writes:   
   >> Ambiguous condition? If not, what should be the result   
   >   
   > AFAICS u1=0 is not specified as ambiguous condition, and I don't see   
   > a reason that would make it ambiguous.   
   >   
   > The results depend on the state of the file.   
   >   
   > 1) Either a non-zero ior, or   
   > 2) ior=0, u2=0, and   
   > a) flag=false under the specified condition   
   > b) flag=true otherwise   
   >   
   >> and what is it good for?   
   >   
   > If you ever meet programmers that call READ-LINE with u1=0, ask them.   
   >   
   > The last time I asked about a usage that appeared pointless to me (an   
   > empty DOES> clause), the author had no satisfying explanation.   
      
   If not ambiguous then the result should be exactly predictable.   
   If the result differs but with no harmful effect then what would   
   you call that?   
      
   0 value fid   
      
   : print cr rot 2 .r ." ->" swap 2 .r 3 .r ;   
      
   : test   
   s" foo.txt" r/w create-file throw to fid   
   s" foobar" fid write-file throw   
   fid close-file drop   
      
   s" foo.txt" r/o open-file throw to fid   
   page   
   0 pad over fid read-line throw print   
   10 pad over fid read-line throw print   
   0 pad over fid read-line throw print   
   1 pad over fid read-line throw print   
   fid close-file drop cr   
      
      
   test   
      
   \\   
      
   SwiftForth   
    0 -> 0 -1   
   10 -> 6 -1   
    0 -> 0 0   
    1 -> 0 0   
      
   VFX   
    0 -> 0 -1   
   10 -> 6 -1   
    0 -> 0 -1   
    1 -> 0 0   
      
   Gforth   
    0 -> 0 -1   
   10 -> 6 -1   
    0 -> 0 -1   
    1 -> 0 0   
      
   NTF   
    0 -> 0 -1   
   10 -> 6 -1   
    0 -> 0 -1   
    1 -> 0 0   
      
   Win32Forth   
    0 -> 0 -1   
   10 -> 6 -1   
    0 -> 0 0   
    1 -> 0 0   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   
|