Nim: step0
authordef <dennis@felsin9.de>
Sat, 28 Feb 2015 04:15:38 +0000 (05:15 +0100)
committerdef <dennis@felsin9.de>
Sat, 28 Feb 2015 04:15:38 +0000 (05:15 +0100)
nim/mal.nimble [new file with mode: 0644]
nim/step0_repl.nim [new file with mode: 0644]

diff --git a/nim/mal.nimble b/nim/mal.nimble
new file mode 100644 (file)
index 0000000..f512616
--- /dev/null
@@ -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 (file)
index 0000000..6ae7d89
--- /dev/null
@@ -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