all repos — min @ 2ac8f37b62655e812cc5ec544e27d42a1ddad6da

A small but practical concatenative programming language.

Now supporting BiggestInt and BiggestFloat.
h3rald h3rald@h3rald.com
Sat, 18 Jun 2016 12:16:10 +0200
commit

2ac8f37b62655e812cc5ec544e27d42a1ddad6da

parent

b71fe023f217ad462e63f7179782d5381bec0648

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

jump to
M core/types.nimcore/types.nim

@@ -30,8 +30,8 @@ line*: int

column*: int filename*: string case kind*: MinKind - of minInt: intVal*: int - of minFloat: floatVal*: float + of minInt: intVal*: BiggestInt + of minFloat: floatVal*: BiggestFloat of minQuotation: qVal*: seq[MinValue] scope*: ref MinScope
M core/utils.nimcore/utils.nim

@@ -31,10 +31,10 @@

proc newVal*(q: seq[MinValue]): MinValue = return MinValue(kind: minQuotation, qVal: q) -proc newVal*(s: int): MinValue = +proc newVal*(s: BiggestInt): MinValue = return MinValue(kind: minInt, intVal: s) -proc newVal*(s: float): MinValue = +proc newVal*(s: BiggestFloat): MinValue = return MinValue(kind: minFloat, floatVal: s) proc newVal*(s: bool): MinValue =
M lib/min_lang.nimlib/min_lang.nim

@@ -301,7 +301,7 @@ var index, q: MinValue

i.reqIntAndQuotation index, q if q.qVal.len-1 < index.intVal: raiseOutOfBounds("Insufficient items in quotation") - i.push q.qVal[index.intVal] + i.push q.qVal[index.intVal.int] .symbol("size") do (i: In): var q: MinValue
M lib/min_net.nimlib/min_net.nim

@@ -109,7 +109,7 @@ var size, q: MinValue

i.reqInt size i.reqObject "socket", q var s = "" - discard q.to(Socket).recv(s, size.intVal) + discard q.to(Socket).recv(s, size.intVal.int) i.push @[q] i.push s.newVal
M lib/min_num.nimlib/min_num.nim

@@ -56,7 +56,7 @@ var a, b: MinValue

i.reqTwoNumbers a, b if a.isInt: if b.isInt: - i.push newVal(b.intVal / a.intVal) + i.push newVal(b.intVal.int / a.intVal.int) else: i.push newVal(b.floatVal / a.intVal.float) else:
M lib/min_sys.nimlib/min_sys.nim

@@ -94,6 +94,6 @@

.symbol("sleep") do (i: In): var ms: MinValue i.reqInt ms - sleep ms.intVal + sleep ms.intVal.int .finalize()