diff --git a/doc/StackComments.md b/doc/StackComments.md index 8b64497..e75d14b 100644 --- a/doc/StackComments.md +++ b/doc/StackComments.md @@ -4,7 +4,7 @@ Most words in RETRO have a stack comment. These look like: (nn-n) As with all comments, a stack comment begins with ( and should end with - a ). There are two parts to the comment. On the left side of the - is +a ). There are two parts to the comment. On the left side of the - is what the word *consumes*. On the right is what it *leaves*. RETRO uses a short notation, with one character per value taken or left. diff --git a/example/edit.forth b/example/edit.forth old mode 100755 new mode 100644 index 8e82c3d..a593f37 --- a/example/edit.forth +++ b/example/edit.forth @@ -125,7 +125,7 @@ indicator can be toggled via the ~ key. @ShowEOL [ $~ putc ] if nl ; :display-line (n-n) - dup @LineCount lteq? + dup @LineCount lt? [ dup mark-if-current pad line# n:inc @FID file:read-line puts eol ] if ; :display (-) @@ -243,7 +243,7 @@ to the start or end of the file. #0 !CurrentLine ; :goto-end (-) - @LineCount !CurrentLine ; + @LineCount n:dec !CurrentLine ; ~~~ And now tie everything together. There's a key handler and a top level loop. @@ -275,7 +275,7 @@ And now tie everything together. There's a key handler and a top level loop. ~~~ ~~~ -:constrain (-) &CurrentLine #0 @LineCount v:limit ; +:constrain (-) &CurrentLine #0 @LineCount n:dec v:limit ; :handler getc $1 [ replace-line ] case