version 0.8.6
This commit is contained in:
parent
9dda24e475
commit
2169fd63bd
34 changed files with 748 additions and 776 deletions
|
|
@ -12,8 +12,8 @@ var
|
|||
|
||||
proc testA() =
|
||||
var p = 0
|
||||
map(myData, lambda (x: int): int =
|
||||
result = x + 1 shl (lambda (y: int): int =
|
||||
map(myData, proc (x: int): int =
|
||||
result = x + 1 shl (proc (y: int): int =
|
||||
return y + p
|
||||
)(0)
|
||||
inc(p))
|
||||
|
|
|
|||
|
|
@ -1,3 +1,4 @@
|
|||
import strutils
|
||||
|
||||
const
|
||||
HelpText = """
|
||||
|
|
@ -9,7 +10,7 @@ const
|
|||
Compiled at: $2, $3
|
||||
|
||||
Usage:
|
||||
koch.py [options] command [options for command]
|
||||
koch [options] command [options for command]
|
||||
Options:
|
||||
--force, -f, -B, -b forces rebuild
|
||||
--help, -h shows this help and quits
|
||||
|
|
@ -23,4 +24,5 @@ Possible Commands:
|
|||
""" % [NimrodVersion & repeatChar(44-len(NimrodVersion)),
|
||||
CompileDate, CompileTime]
|
||||
|
||||
echo helpText
|
||||
|
||||
|
|
|
|||
|
|
@ -1,10 +0,0 @@
|
|||
type
|
||||
TCardPts = enum
|
||||
North, West, South, East
|
||||
|
||||
TCardPts2 = enum of TCardPts
|
||||
N, W, S, E
|
||||
|
||||
# If I do:
|
||||
var y = W
|
||||
echo($y & "=" & $ord(y)) #OUT W=5
|
||||
|
|
@ -61,11 +61,15 @@ for x, y in items([(1, 2), (3, 4), (6, 1), (5, 2)]):
|
|||
echo x
|
||||
echo y
|
||||
|
||||
proc simpleConst(): int = return 34
|
||||
|
||||
# test constant evaluation:
|
||||
const
|
||||
const
|
||||
constEval3 = simpleConst()
|
||||
constEval = "abc".contains('b')
|
||||
constEval2 = fac(7)
|
||||
|
||||
echo(constEval3)
|
||||
echo(constEval)
|
||||
echo(constEval2)
|
||||
echo(1.`+`(2))
|
||||
|
|
|
|||
|
|
@ -1,4 +1,6 @@
|
|||
# Test method call syntax for iterators:
|
||||
import strutils
|
||||
|
||||
const lines = """abc xyz"""
|
||||
|
||||
for x in lines.split():
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue