From 937f0cdc6614592b9057c023be67b8ff0db8758c Mon Sep 17 00:00:00 2001 From: def Date: Sat, 28 Feb 2015 05:15:38 +0100 Subject: Nim: step0 --- nim/mal.nimble | 11 +++++++++++ nim/step0_repl.nim | 11 +++++++++++ 2 files changed, 22 insertions(+) create mode 100644 nim/mal.nimble create mode 100644 nim/step0_repl.nim 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 -- cgit v1.2.3