aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nim/mal.nimble11
-rw-r--r--nim/step0_repl.nim11
2 files changed, 22 insertions, 0 deletions
diff --git a/nim/mal.nimble b/nim/mal.nimble
new file mode 100644
index 0000000..f512616
--- /dev/null
+++ b/nim/mal.nimble
@@ -0,0 +1,11 @@
+[Package]
+name = "mal"
+version = "1.0"
+author = "Dennis Felsing"
+description = "Mal code in Nim"
+license = "MIT"
+
+bin = "step0_repl"
+
+[Deps]
+Requires: "nim >= 0.10.0"
diff --git a/nim/step0_repl.nim b/nim/step0_repl.nim
new file mode 100644
index 0000000..6ae7d89
--- /dev/null
+++ b/nim/step0_repl.nim
@@ -0,0 +1,11 @@
+import rdstdin
+
+proc read(str: string): string = str
+
+proc eval(ast: string): string = ast
+
+proc print(exp: string): string = exp
+
+while true:
+ let line = readLineFromStdin("user> ")
+ echo line.read.eval.print