all repos — mn @ b028b43c79d46395fb5873139ce6b76ee3628097

A truly minimal concatenative programming language.

Fixing split symbol with blank separator.
Fixes #4
h3rald h3rald@h3rald.com
Sat, 02 Dec 2023 14:29:25 +0000
commit

b028b43c79d46395fb5873139ce6b76ee3628097

parent

51f1ea40733c1554fd19a048da380208a0d7acd5

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

jump to
M mnpkg/lang.nimmnpkg/lang.nim

@@ -267,7 +267,12 @@ let vals = i.expect("'sym", "'sym")

let sep = vals[0].getString let s = vals[1].getString var q = newSeq[MnValue](0) - for e in s.split(sep): + var ss: seq[string] + if sep == "": + ss = s.items.toSeq.mapIt($it) + else: + ss = s.split(sep) + for e in ss: q.add e.newVal i.push q.newVal