From ccc7d9d199c56473997b40f49c6bfc79d9799fd2 Mon Sep 17 00:00:00 2001 From: Chouser Date: Thu, 5 Feb 2015 18:47:32 -0500 Subject: forth: Add step 0 --- forth/step0_repl.fs | 23 +++++++++++++++++++++++ forth/types.fs | 5 +---- 2 files changed, 24 insertions(+), 4 deletions(-) create mode 100644 forth/step0_repl.fs 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= -- cgit v1.2.3