all repos — min @ 6cdda03069cd0d2a3ab5cc0f8a14e77e6b1ea7a1

A small but practical concatenative programming language.

Added pragmas to init proc.
h3rald h3rald@h3rald.com
Sun, 06 Nov 2016 10:58:12 +0100
commit

6cdda03069cd0d2a3ab5cc0f8a14e77e6b1ea7a1

parent

e3d14865a90c31798aad081b399589d56df75843

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M minim.nimminim.nim

@@ -116,7 +116,7 @@ if not MINIMRC.fileExists:

MINIMRC.writeFile("") i.eval MINIMRC.readFile() -proc minimStream(s: Stream, filename: string, debugging = false, init = proc(i: In) = discard) = +proc minimStream(s: Stream, filename: string, debugging = false, init = proc(i: In) {.closure, locks:0.}= discard) = var i = newMinInterpreter(debugging) i.pwd = filename.parentDir i.stdLib()

@@ -129,17 +129,17 @@ except:

discard i.close() -proc minimString*(buffer: string, debugging = false, init = proc(i: In) = discard) = +proc minimString*(buffer: string, debugging = false, init = proc(i: In) {.closure, locks:0.}= discard) = minimStream(newStringStream(buffer), "input", debugging, init) -proc minimFile*(filename: string, debugging = false, init = proc(i: In) = discard) = +proc minimFile*(filename: string, debugging = false, init = proc(i: In) {.closure, locks:0.}= discard) = var stream = newFileStream(filename, fmRead) if stream == nil: stderr.writeLine("Error - Cannot read from file: "& filename) stderr.flushFile() minimStream(stream, filename, debugging, init) -proc minimFile*(file: File, filename="stdin", debugging = false, init = proc(i: In) = discard) = +proc minimFile*(file: File, filename="stdin", debugging = false, init = proc(i: In) {.closure, locks:0.}= discard) = var stream = newFileStream(stdin) if stream == nil: stderr.writeLine("Error - Cannot read from "& filename)