X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=blobdiff_plain;f=src%2Flib_1_basic.4th;h=40851f34e198b37ea532e08d30227065d545716f;hp=176472312f2bca7a80641eda60447b92e6c9ec8a;hb=6cb12b03e2a154214fc60d7c437e650e79fb42e5;hpb=9da6dc7c0252fdc18aca602928feab518737cc8f diff --git a/src/lib_1_basic.4th b/src/lib_1_basic.4th index 1764723..40851f3 100644 --- a/src/lib_1_basic.4th +++ b/src/lib_1_basic.4th @@ -40,10 +40,15 @@ : '\n' 10 ; : BL 32 ; - -: LITERAL IMMEDIATE ['] LIT , , ; +: CR '\n' emit ; +: SPACE BL emit ; : ' BL WORD FIND DROP ; +: [COMPILE] IMMEDIATE ' , ; +: ['] IMMEDIATE + LIT LIT , ' , ; + +: LITERAL IMMEDIATE ['] LIT , , ; : CHAR BL WORD 1+ @ ; : [CHAR] IMMEDIATE @@ -51,15 +56,6 @@ ['] LIT , , ; -: CR '\n' emit ; -: SPACE BL emit ; - -: [COMPILE] IMMEDIATE - BL WORD \ get the next word - FIND DROP \ find it in the dictionary - , \ and compile that -; - : RECURSE IMMEDIATE LATEST @ \ LATEST points to the word being compiled at the moment >CFA \ get the codeword