Stored symbols are loaded on startup.
h3rald h3rald@h3rald.com
Sun, 18 Sep 2016 10:14:39 +0200
2 files changed,
9 insertions(+),
7 deletions(-)
M
lib/min_lang.nim
→
lib/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.min
→
prelude.min
@@ -67,4 +67,4 @@ (call pop) :call!
; Load all stored symbols -stored-symbols 'load-symbol foreach +stored-symbols ('load-symbol ROOT with) foreach