all repos — min @ 086a1cf98134220cc60b8bdfd27ce749d0e1d2c0

A small but practical concatenative programming language.

Minor changes.
h3rald h3rald@h3rald.com
Sat, 07 Jul 2018 13:37:45 +0200
commit

086a1cf98134220cc60b8bdfd27ce749d0e1d2c0

parent

1ee08fd0de6b063d5bb0db373ed3abdbd2d0f307

2 files changed, 4 insertions(+), 6 deletions(-)

jump to
M core/interpreter.nimcore/interpreter.nim

@@ -124,12 +124,11 @@

proc push*(i: In, val: MinValue) {.gcsafe, extern:"min_exported_symbol_$1".} proc apply*(i: In, op: MinOperator) {.gcsafe, extern:"min_exported_symbol_$1".}= - var newscope = newScopeRef(i.scope) - case op.kind - of minProcOp: + if op.kind == minProcOp: op.prc(i) - of minValOp: + else: if op.val.kind == minQuotation: + var newscope = newScopeRef(i.scope) var q = op.val i.withScope(newscope): for e in q.quot:

@@ -200,8 +199,8 @@ raiseUndefined("Undefined symbol '$1'" % [val.symVal])

discard i.trace.pop else: if (val.kind == minDictionary): - var v = val if val.scope.symbols.len == 0: + var v = val i.dequote(v) # Clear the initial quotation; only used when parsing a dictionary for the first time v.quot = @[]
M core/utils.nimcore/utils.nim

@@ -217,7 +217,6 @@ if value.isTypedDictionary(split[1]):

return true return false - proc expect*(i: var MinInterpreter, elements: varargs[string]): seq[MinValue] {.extern:"min_exported_symbol_$1".}= let stack = elements.reverse.join(" ") let sym = i.currSym.getString