all repos — min @ 9d294ff4c2efb889fac6e82a727b1e66919097fb

A small but practical concatenative programming language.

Moved interpolate to str module.
h3rald h3rald@h3rald.com
Sun, 26 Mar 2017 10:51:57 +0200
commit

9d294ff4c2efb889fac6e82a727b1e66919097fb

parent

358c9895fa78019998a3f96bfce24f2a95aa09f5

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

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

@@ -531,15 +531,6 @@ var d: MinValue

i.reqDictionary d i.push i.values(d) - .symbol("interpolate") do (i: In): - var s, q: MinValue - i.reqQuotationAndString q, s - var strings = newSeq[string](0) - for el in q.qVal: - strings.add $$el - let res = s.strVal % strings - i.push res.newVal - .symbol("version") do (i: In): i.push version.newVal
M lib/min_str.nimlib/min_str.nim

@@ -13,6 +13,15 @@

proc str_module*(i: In) = i.define() + .symbol("interpolate") do (i: In): + var s, q: MinValue + i.reqQuotationAndString q, s + var strings = newSeq[string](0) + for el in q.qVal: + strings.add $$el + let res = s.strVal % strings + i.push res.newVal + .symbol("strip") do (i: In): var s: MinValue i.reqStringLike s
M tests/lang.mintests/lang.min

@@ -164,8 +164,6 @@ (((a 1)(b 2)(c 3)) keys (a b c) ==) assert

(((a 1)(b 2)(c 3)) values (1 2 3) ==) assert - ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) assert - (((1 2 3)) :sym1 >sym1 stored-symbols "sym1" contains) assert (<sym1 symbols "sym1" contains) assert
M tests/str.mintests/str.min

@@ -3,6 +3,8 @@ 'test import

"str" describe + ("$1 - $2 - $3" (1 true "test") interpolate "1 - true - test" ==) assert + (" test " strip "test" ==) assert ("test" length 4 ==) assert