all repos — min @ 49d5bd853a05be2751ea2eb685f73cff8f3e2241

A small but practical concatenative programming language.

Fixed invoke.
h3rald h3rald@h3rald.com
Tue, 29 Dec 2020 15:11:38 +0100
commit

49d5bd853a05be2751ea2eb685f73cff8f3e2241

parent

f30ddf488d2127a0fc4007f4e69a0af4158962f1

1 files changed, 11 insertions(+), 5 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -258,7 +258,10 @@ var inVals = i.expect(inExpects)

i.withScope(): # Inject variables for mapped inputs for k in 0..inVars.len-1: - i.scope.symbols[inVars[k]] = MinOperator(kind: minValOp, sealed: false, val: inVals[k], quotation: inVals[k].isQuotation) + var iv = inVals[k] + if iv.isQuotation: + iv = @[iv].newVal + i.scope.symbols[inVars[k]] = MinOperator(kind: minValOp, sealed: false, val: iv, quotation: inVals[k].isQuotation) # Inject variables for mapped outputs for k in 0..outVars.len-1: i.scope.symbols[outVars[k]] = MinOperator(kind: minValOp, sealed: false, val: newNull(), quotation: false)

@@ -581,11 +584,14 @@ for p in 0..parts.len-2:

let vals = i.expect("dict") let mdl = vals[0] let symId = parts[p+1] - var q = newSeq[MinValue](0) - q.add symId.newSym - i.push q.newVal + #var q = newSeq[MinValue](0) + #q.add symId.newSym i.push mdl - i.push "with".newSym + i.push symId.newVal + i.push "call".newSym + #i.push q.newVal + #i.push mdl + #i.push "with".newSym def.symbol("set-type") do (i: In): let vals = i.expect("'sym", "dict")