all repos — min @ 45478ecefd31bf5e0f9f198f42dde2da01a5fb46

A small but practical concatenative programming language.

Implemented basic time functins.
h3rald h3rald@h3rald.com
Sun, 07 Dec 2014 21:12:50 +0100
commit

45478ecefd31bf5e0f9f198f42dde2da01a5fb46

parent

a67550c6cb21811d52aa1d43c30810bce56b92fd

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

jump to
M minim.nimminim.nim

@@ -60,7 +60,6 @@ echo "MiNiM v"&version&" - REPL initialized."

i.eval prelude echo "Prelude loaded." echo "-> Press Ctrl+C to exit." - var pos = 0 var line: string while true: stdout.write(": ")
M primitives.nimprimitives.nim

@@ -1,4 +1,4 @@

-import tables, strutils, os, osproc +import tables, strutils, os, osproc, times import parser, interpreter, utils minsym "exit":

@@ -445,6 +445,14 @@ if a.isBool and b.isBool:

i.push newVal(a.boolVal xor b.boolVal) else: i.error(errIncorrect, "Two bool values are required on the stack") + +# Time + +minsym "timestamp": + i.push getTime().int.newVal + +minsym "now": + i.push epochTime().newVal # I/O