all repos — min @ 876bb15d4ea2631fc0c4a5c90ebdce3ff826b8a5

A small but practical concatenative programming language.

fixes
h3rald h3rald@h3rald.com
Sun, 16 Jun 2024 17:40:49 +0200
commit

876bb15d4ea2631fc0c4a5c90ebdce3ff826b8a5

parent

37124ae3fe967ae4a2681c3f1cb6c33fb1c2c8dd

1 files changed, 4 insertions(+), 4 deletions(-)

jump to
M minpkg/core/interpreter.nimminpkg/core/interpreter.nim

@@ -197,13 +197,13 @@ proc apply*(i: In, op: MinOperator, sym = "") {.effectsOf: op.} =

if op.kind == minProcOp: if not op.mdl.isNil and not op.mdl.scope.isNil: # Capture closures at module level - let origScope = i.scope let origParentScope = i.scope.parent - i.scope = op.mdl.scope - i.scope.parent = origScope + let origMdlParentScope = op.mdl.scope.parent + i.scope.parent = op.mdl.scope + i.scope.parent.parent = origParentScope op.prc(i) - i.scope = origScope i.scope.parent = origParentScope + op.mdl.scope.parent = origMdlParentScope else: op.prc(i) else: