Fixed clear line; fixed map implementation.
h3rald h3rald@h3rald.com
Sun, 11 Sep 2016 12:28:06 +0200
3 files changed,
7 insertions(+),
3 deletions(-)
M
core/linedit.nim
→
core/linedit.nim
@@ -211,9 +211,10 @@ ed.printChar(c.ord)
ed.printChar(32) proc clearLine*(ed: var LineEditor) = - stdout.cursorBackward(ed.line.position) + stdout.cursorBackward(ed.line.position+1) for i in ed.line.text: putchar(32) + putchar(32) stdout.cursorBackward(ed.line.text.len) ed.line.position = 0 ed.line.text = ""
M
lib/min_lang.nim
→
lib/min_lang.nim
@@ -329,11 +329,12 @@ .symbol("map") do (i: In):
var prog, list: MinValue i.reqTwoQuotations prog, list i.push newVal(newSeq[MinValue](0)) + var res = newSeq[MinValue](0) for litem in list.qVal: i.push litem i.unquote("<map-quotation>", prog) - i.apply("swap") - i.apply("append") + res.add i.pop + i.push res.newVal .symbol("times") do (i: In): var t, prog: MinValue
M
minim.nim
→
minim.nim
@@ -64,6 +64,8 @@ if word.startsWith(">"):
return symbols.mapIt(">" & $it) if word.startsWith("*"): return symbols.mapIt("*" & $it) + if word.startsWith("("): + return symbols.mapIt("(" & $it) if word.startsWith("<"): return toSeq(MINIMSYMBOLS.readFile.parseJson.pairs).mapIt(">" & $it[0]) if word.startsWith("$"):