all repos — min @ ab0b9a1d27d3b7ea1c4fcf659efbcea33afa99c0

A small but practical concatenative programming language.

Implemented prompt operator.
h3rald h3rald@h3rald.com
Sun, 02 Oct 2016 16:22:31 +0200
commit

ab0b9a1d27d3b7ea1c4fcf659efbcea33afa99c0

parent

52c40db3ec70cf78cce070f01eccf5d350c45778

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

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

@@ -41,13 +41,18 @@ .symbol("password") do (i: In):

var ed = initEditor() i.push ed.password("Enter Password: ").newVal + .symbol("prompt") do (i: In): + var s: MinValue + var ed = initEditor() + i.reqString s + i.push ed.readLine(s.getString & " ").newVal + .symbol("confirm") do (i: In): var s: MinValue var ed = initEditor() i.reqString s - stdout.write(s.getString & " [yes/no]: ") proc confirm(): bool = - let answer = ed.readLine() + let answer = ed.readLine(s.getString & " [yes/no]: ") if answer.match("^y(es)?$", "i"): return true elif answer.match("^no?$", "i"):