all repos — min @ 19afd6c88ca389d12a7eb058495860a6c519feb8

A small but practical concatenative programming language.

Fixed SIGSEGV with tap and tap! operators.
h3rald h3rald@h3rald.com
Sun, 06 Aug 2017 15:52:04 +0200
commit

19afd6c88ca389d12a7eb058495860a6c519feb8

parent

5c206cafa547d0c9f17aff351eea5850d788a405

2 files changed, 15 insertions(+), 3 deletions(-)

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

@@ -111,9 +111,12 @@ else:

i.push(op.val) proc dequote*(i: In, q: var MinValue) = - i.withScope(q, q.scope): - for v in q.qVal: - i.push v + if not q.isQuotation: + i.push(q) + else: + i.withScope(q, q.scope): + for v in q.qVal: + i.push v proc apply*(i: In, q: var MinValue) = var i2 = newMinInterpreter("<apply>")
M tests/lang.mintests/lang.min

@@ -183,6 +183,15 @@ (("a" 3) ("b" 3) ("c" 3)) ==

) assert ( + () =data + data ( + 1 %a + 2 %b + ) tap + (("a" 1) ("b" 2)) == + ) assert + + ( "" :s1 "test" ( (' "1" swap append "" join)