all repos — min @ 097438db56cfa262876c46dae71dd2cf0a5fdbab

A small but practical concatenative programming language.

Stored symbols are loaded on startup.
h3rald h3rald@h3rald.com
Sun, 18 Sep 2016 10:14:39 +0200
commit

097438db56cfa262876c46dae71dd2cf0a5fdbab

parent

d0e1ba8058973b54e3b1e14ca6b065b9662df194

2 files changed, 9 insertions(+), 7 deletions(-)

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

@@ -159,9 +159,14 @@

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

@@ -170,9 +175,6 @@ i.reqQuotation q

let s = symbol.getString let origScope = i.scope i.scope = q.scope - #let sProc = i.scope.getSymbol(s).prc - # Restore original quotation - #sProc(i) let sym = i.scope.getSymbol(s) i.execOp(sym) i.scope = origScope
M prelude.minprelude.min

@@ -67,4 +67,4 @@ (call pop) :call!

; Load all stored symbols -stored-symbols 'load-symbol foreach +stored-symbols ('load-symbol ROOT with) foreach