all repos — min @ 686936b5d9eea4aa1849a1650836e5e117e6903d

A small but practical concatenative programming language.

Implemented hostsync operator.
h3rald h3rald@h3rald.com
Sun, 17 Jul 2016 17:25:56 +0200
commit

686936b5d9eea4aa1849a1650836e5e117e6903d

parent

568d793dca984d3e6735c9a6845f5fe9a31ec1be

2 files changed, 7 insertions(+), 2 deletions(-)

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

@@ -37,7 +37,7 @@ if not pair.isQuotation or vals.len != 2 or not vals[0].isStringLike or not vals[1].isStringLike:

raiseInvalid("Invalid host quotation") i.link.hosts.replace(vals[0].getString, vals[1].getString) cfgSet("hosts", %i.link.hosts) - i.push("OK".newVal) + i.push(@["OK".newSym].newVal) .symbol("hosts") do (i: In): var q = newSeq[MinValue](0).newVal

@@ -63,5 +63,10 @@ if host != i.link.name:

res = res & " " & i.executeOnHost(host, q) i.eval("($1)" % res) + .symbol("hostsync") do (i: In): + var res = "" + for key, value in i.syncHosts().pairs: + res = res & " " & value + i.eval "($1) dprint!" % res .finalize()
M lib/prelude.minlib/prelude.min

@@ -85,7 +85,7 @@ (dprint pop) :dprint!

(put pop) :put! (:ms :q :check (check) (ms sleep q) while) :interval (call pop) :call! -(host print! ":" print! " (OK)" put! ('OK) >* dprint!) :linkcheck +(host print! ":" print! " (OK)" put! ('OK) >* dprint!) :hostcheck ; Socket constructors ((ipv4 stream tcp) ^socket) :tcp-socket