X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;f=sys.f;h=38708d1e1a88f479264951bf154c85509583826d;hb=e3bee6e77d04f68fe14e4a0106f02d9284d7dcac;hp=27d540a87cee34e5f172194a21b88812ec72338e;hpb=f0df53c35124c9a5e2b045aba60b513faa344567;p=rrq%2Fjonasforth.git diff --git a/sys.f b/sys.f index 27d540a..38708d1 100644 --- a/sys.f +++ b/sys.f @@ -1,4 +1,4 @@ -BUF" :" CREATE ] DOCOL +S" :" CREATE ] DOCOL READ-WORD CREATE LIT DOCOL , ] @@ -47,7 +47,7 @@ EXIT [ ELSE DROP THEN - AGAIN ; + AGAIN ; ( Yay! We now have comments! ) : UNTIL IMMEDIATE ' 0BRANCH , @@ -69,6 +69,12 @@ EXIT [ : OVER ( a b -- a b a ) SWAP DUP ROT ; +( An alternative comment syntax. Reads until the end of the line. ) +: \ IMMEDIATE + BEGIN + KEY + 10 = UNTIL ; + ( Compile the given string into the current word directly. ) : STORE-STRING ( str len -- ) BEGIN @@ -83,5 +89,7 @@ EXIT [ ( Read a number from standard input. ) : READ-NUMBER READ-WORD PARSE-NUMBER ; +S" Ready." TELL NEWLINE + ( vim: syntax=forth )