diff options
| author | Chouser <chouser@n01se.net> | 2015-02-05 18:47:32 -0500 |
|---|---|---|
| committer | Chouser <chouser@n01se.net> | 2015-02-21 13:22:43 -0500 |
| commit | ccc7d9d199c56473997b40f49c6bfc79d9799fd2 (patch) | |
| tree | c4e249a0f1edde0896609d419bd8ad9e03002066 | |
| parent | 14b846ffeb0a785c4918e4a3850ee229fcf1879d (diff) | |
| download | mal-ccc7d9d199c56473997b40f49c6bfc79d9799fd2.tar.gz mal-ccc7d9d199c56473997b40f49c6bfc79d9799fd2.zip | |
forth: Add step 0
| -rw-r--r-- | forth/step0_repl.fs | 23 | ||||
| -rw-r--r-- | forth/types.fs | 5 |
2 files changed, 24 insertions, 4 deletions
diff --git a/forth/step0_repl.fs b/forth/step0_repl.fs new file mode 100644 index 0000000..42c33f5 --- /dev/null +++ b/forth/step0_repl.fs @@ -0,0 +1,23 @@ +s" types.fs" included + +: read ; +: eval ; +: print ; + +: rep + read + eval + print ; + +create buff 128 allot + +: read-lines + begin + ." user> " + buff 128 stdin read-line throw + while + buff swap + rep type cr + repeat ; + +read-lines
\ No newline at end of file diff --git a/forth/types.fs b/forth/types.fs index 2f97fa5..460c3aa 100644 --- a/forth/types.fs +++ b/forth/types.fs @@ -330,7 +330,4 @@ mal-nil 10 MalInt. mal-nil conj conj 20 MalInt. swap conj 23 MalInt. mal-nil conj conj conj - -pr-str safe-type cr - -bye +pr-str s" (nil (20 (42) 10) 23)" str= -1 test= |
