From: Tim Vaughan Date: Sun, 1 May 2016 10:57:39 +0000 (+1200) Subject: Renamed CREATE to HEADER in prep for true CREATE/DOES> X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=forth.jl.git;a=commitdiff_plain;h=7f2c4e5ef814e84cee84cba32667418cec15af12 Renamed CREATE to HEADER in prep for true CREATE/DOES> --- diff --git a/src/forth.jl b/src/forth.jl index ea3fba0..64d2d23 100644 --- a/src/forth.jl +++ b/src/forth.jl @@ -523,11 +523,12 @@ BASE, BASE_CFA = defNewVar("BASE", 10) # Constants -defConst("VERSION", 1) defConst("DOCOL", DOCOL) defConst("DOCON", DOCON) defConst("DOVAR", DOVAR) + defConst("DICT", DICT) + F_IMMED = defConst("F_IMMED", 128) F_HIDDEN = defConst("F_HIDDEN", 256) F_LENMASK = defConst("F_LENMASK", 127) @@ -769,7 +770,7 @@ end) # Compilation -CREATE = defPrimWord("CREATE", () -> begin +HEADER = defPrimWord("HEADER", () -> begin wordLen = popPS() wordAddr = popPS() @@ -811,7 +812,7 @@ HIDE = defWord("HIDE", COLON = defWord(":", [WORD, - CREATE, + HEADER, LIT, DOCOL, COMMA, LATEST_CFA, FETCH, HIDDEN, RBRAC, diff --git a/src/lib.4th b/src/lib.4th index 745acf6..b6c523b 100644 --- a/src/lib.4th +++ b/src/lib.4th @@ -471,8 +471,7 @@ ( CONSTANTS AND VARIABLES ------------------------------------------------------ ) : CONSTANT - WORD ( get the name (the name follows CONSTANT) ) - CREATE ( make the dictionary entry ) + WORD HEADER ( make dictionary entry (the name follows CONSTANT) ) DOCOL , ( append DOCOL (the codeword field of this word) ) ['] LIT , ( append the codeword LIT ) , ( append the value on the top of the stack ) @@ -486,7 +485,7 @@ : VARIABLE 1 CELLS ALLOT ( allocate 1 cell of memory, push the pointer to this memory ) - WORD CREATE ( make the dictionary entry (the name follows VARIABLE) ) + WORD HEADER ( make the dictionary entry (the name follows VARIABLE) ) DOCOL , ( append DOCOL (the codeword field of this word) ) ['] LIT , ( append the codeword LIT ) , ( append the pointer to the new memory ) @@ -495,7 +494,7 @@ : VALUE ( n -- ) - WORD CREATE ( make the dictionary entry (the name follows VALUE) ) + WORD HEADER ( make the dictionary entry (the name follows VALUE) ) DOCOL , ( append DOCOL ) ['] LIT , ( append the codeword LIT ) , ( append the initial value )