all repos — min @ 172fbe14240f22e98bca3612f239a9680fb049e8

A small but practical concatenative programming language.

Added aliases for prefix/infix dequote
h3rald h3rald@h3rald.com
Sun, 29 Nov 2020 01:31:11 +0000
commit

172fbe14240f22e98bca3612f239a9680fb049e8

parent

39c4bbcabd9ac22aa15874005f58260535a928a1

1 files changed, 8 insertions(+), 2 deletions(-)

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

@@ -603,7 +603,7 @@ var q: MinValue

i.reqQuotationOfSymbols q i.push(i.expect(q.qVal.mapIt(it.getString())).reversed.newVal) - def.symbol("infix") do (i: In): + def.symbol("infix-dequote") do (i: In): let vals = i.expect("quot") let q = vals[0] proc infix(i: In, q: MinValue): MinValue =

@@ -624,7 +624,7 @@ res = newSeq[MinValue](0).newVal

return i.pop i.push i.infix(q) - def.symbol("prefix") do (i: In): + def.symbol("prefix-dequote") do (i: In): let vals = i.expect("quot") var q = vals[0] q.qVal.reverse

@@ -742,5 +742,11 @@ i.push("dequote".newSym)

def.symbol("=>") do (i: In): i.push("apply".newSym) + + def.symbol(">>") do (i: In): + i.push("prefix-dequote".newSym) + + def.symbol("><") do (i: In): + i.push("infix-dequote".newSym) def.finalize("ROOT")