X-Git-Url: https://git.kengrimes.com/?p=watForth.git;a=blobdiff_plain;f=forth.forth;h=5c9834f320e840e6a83dce9b578cc82317b44981;hp=cb6090f20113adc87f86ec7be54589961374bb54;hb=ad3b02f34ef51d8df8db0472f8bebf412251ea2b;hpb=fb7946e17777ee389e3eaf742e6ff87a5d832710 diff --git a/forth.forth b/forth.forth index cb6090f..5c9834f 100644 --- a/forth.forth +++ b/forth.forth @@ -36,6 +36,8 @@ word BYE 25 define word WORDS 27 define word CHANNEL-IN 35 define word CHANNEL-OUT 48 define +word CHANNEL-OPEN 51 define +word CHANNEL-AWAIT 50 define word !HERE 36 define word HERE 28 define @@ -55,6 +57,7 @@ word WS? 17 define word . 9 define word .S 38 define word @ 10 define +word @8_u 53 define word @+ 42 define word ! 11 define word !+ 43 define @@ -90,7 +93,7 @@ word ::> here define ' drop , ' lit , ' lit , ' , , ' execute-num , ' , , ' ; , \ change interpreter semantics to "memorize-word" -: memorizing ' lit , ' mode , ' lit , ' memorize-word , ' ! , ' ; , +::> MEMORIZING ' lit , ' mode , ' lit , ' memorize-word , ' ! , ' ; , \ memorize the compiler \memorizing @@ -137,14 +140,27 @@ here define-does then compiling ; \ Multi-line comments ::> ( key 41 =? swap -1 =? swap drop + if ;; then JMP: \' ( \, ; -\ Set the number conversion base -: BASE 14348 swap ! ; - ( End of bootstrap process beyond this point, all hope is lost ) +\ Set the number conversion base +: BASE 14348 swap ! ; +: BASE10 10 base ; + +\ TICK compilation semantics +:> ' lit lit , word find , ; +\ "TICK DOES" (get compilation semantics execution token) +: '> word find-does ; +:> '> word find-does , ; + +\ Include a remote file +: REQUIRE" ' quit channel-open dup \' " \, fetch channel-await ; + +\ Let's try it +REQUIRE" { \"url\": \"forth/test-watfor.forth\" }" + \ Print intro string " watForth-32 Interactive CLI: " .s