gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gforth] stuff.fs possible bug in \\\ word


From: Philip Smith
Subject: [gforth] stuff.fs possible bug in \\\ word
Date: Fri, 29 Jan 2016 16:26:12 -0700

Looking through source file stuff.fs and found this gem! I have version 0.7.9_20160113 !

\ \\\ - skip to end of file

: \\\ ( -- ) \ gforth
    \G skip remaining source file
    source-id dup 0> IF
>r r@ file-size throw r> reposition-file throw
BEGIN  refill 0= UNTIL  postpone \  THEN ; immediate

But when i tested it i do not get the skip to end of file that i thought i should get!
I think the intent here was to see if source-id is a file handle and if so do the skipping so i tried this change:

: \\\ ( -- ) \ gforth
    \G skip remaining source file
    source-id dup 0<> IF            \  **** basically changed 0> to 0<> 
>r r@ file-size throw r> reposition-file throw
BEGIN  refill 0= UNTIL  postpone \  THEN ; immediate

The \\\ word now skips to the end of the file so is this a bug and the solution is 0<> not 0>  or am i wrong! 

--
                \|||/
-----0oo---( o o )---oo0------
                (_)
From the hand of PKS


reply via email to

[Prev in Thread] Current Thread [Next in Thread]