all repos — min @ 66263c20760243554ea019fda22083ff593ac313

A small but practical concatenative programming language.

Removed unnecessary unquote overload.
h3rald h3rald@h3rald.com
Sun, 19 Feb 2017 14:40:11 +0100
commit

66263c20760243554ea019fda22083ff593ac313

parent

8bf6436a99ee7d4a80feb65bd909b208c8e1112a

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

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

@@ -113,18 +113,10 @@ i.push e

else: i.push(op.val) -#proc apply*(i: In, op: MinOperator, name="apply") = -# var scope = newScopeRef(i.scope, name) -# i.apply(op, scope) - -proc unquote*(i: In, name: string, q: var MinValue, scope: var ref MinScope) = - i.withScope(q, scope): +proc unquote*(i: In, name: string, q: var MinValue) = + i.withScope(q, q.scope): for v in q.qVal: i.push v - -proc unquote*(i: In, name: string, q: var MinValue) = - var scope = newScopeRef(i.scope, "unquote") - i.unquote(name, q, scope) proc push*(i: In, val: MinValue) = if val.kind == minSymbol:
M lib/min_lang.nimlib/min_lang.nim

@@ -214,7 +214,7 @@ var code, name: MinValue

i.reqStringLike name i.reqQuotation code code.filename = i.filename - i.unquote("<module>", code, code.scope) + i.unquote("<module>", code) info("[module] $1 ($2 symbols)" % [name.getString, $code.scope.symbols.len]) i.scope.symbols[name.getString] = MinOperator(kind: minValOp, val: @[code].newVal(i.scope))

@@ -256,7 +256,7 @@ var qscope, qprog: MinValue

i.reqTwoQuotations qscope, qprog if qscope.qVal.len > 0: # System modules are empty quotes and don't need to be unquoted - i.unquote("<with-scope>", qscope, qscope.scope) + i.unquote("<with-scope>", qscope) i.withScope(qscope, qscope.scope): for v in qprog.qVal: i.push v