all repos — min @ 971cdb5d8daddbb43132df2142cf90f06e83f0a4

A small but practical concatenative programming language.

feat(sleep) Added time tests, added sleep operator.
h3rald h3rald@h3rald.com
Fri, 03 Jun 2016 13:17:32 +0200
commit

971cdb5d8daddbb43132df2142cf90f06e83f0a4

parent

2ed7c9d1bcf3ddec095696ade4064ec0f55b4263

5 files changed, 22 insertions(+), 3 deletions(-)

jump to
M lib/prelude.minlib/prelude.min

@@ -71,6 +71,7 @@ ((() cons cons) dip swap i) :bury2

((() cons cons cons) dip swap i) :bury3 ; Other -(print pop) :print! -(put pop) :put! +(print pop) :print! +(put pop) :put! +(:ms :q :check (check) (ms sleep q) while) :interval
M lib/sys.nimlib/sys.nim

@@ -141,4 +141,10 @@ i.error errRuntime, getCurrentExceptionMsg()

else: i.error errIncorrect, "A string is required on the stack" + .symbol("sleep") do (i: In): + let ms = i.pop + if not ms.isInt: + i.error errIncorrect, "An integer is required on the stack" + sleep ms.intVal + .finalize()
M tests/all.mintests/all.min

@@ -5,3 +5,4 @@ @num

@stack @str @sys +@time
M tests/lang.mintests/lang.min

@@ -3,7 +3,7 @@ #test

"lang" describe - (symbols size 157 ==) assert + (symbols size 159 ==) assert (sigils size 10 ==) assert
A tests/time.min

@@ -0,0 +1,11 @@

+@test +#test + +"time" describe + + (timestamp 1464951736 >) assert + + (now 1464951736 >) assert + + report + clear