Merge branch 'master' of github.com:Araq/Nimrod

This commit is contained in:
dom96 2011-01-28 00:07:08 +00:00
commit 557adbcaac
32 changed files with 629 additions and 147 deletions

View file

@ -2,6 +2,7 @@ tack.nim;125
tambsym2.nim;7
tambsys.nim;
tarray.nim;10012
tarraycons.nim;6
tarray2.nim;[16, 25, 36]
tarray3.nim;3
tassert.nim;assertion failure!this shall be always written

1 tack.nim 125
2 tambsym2.nim 7
3 tambsys.nim
4 tarray.nim 10012
5 tarraycons.nim 6
6 tarray2.nim [16, 25, 36]
7 tarray3.nim 3
8 tassert.nim assertion failure!this shall be always written

View file

@ -0,0 +1,17 @@
type
TEnum = enum
eA, eB, eC, eD, eE, eF
const
myMapping: array[TEnum, array[0..1, int]] = [
eA: [1, 2],
eB: [3, 4],
[5, 6],
eD: [0: 8, 1: 9],
eE: [0: 8, 9],
eF: [2, 1: 9]
]
echo myMapping[eC][1]

21
tests/gc/tthreads.nim Normal file
View file

@ -0,0 +1,21 @@
import threads
var
thr: array [0..4, TThread]
L: TLock
proc threadFunc(c: pointer) {.procvar.} =
for i in 0..9:
Aquire(L)
echo i
Release(L)
InitLock(L)
for i in 0..high(thr):
createThread(thr[i], threadFunc)
for i in 0..high(thr):
joinThread(thr[i])

View file

@ -3,6 +3,7 @@ tadrdisc.nim;15;for a 'var' type a variable needs to be passed
tambsym.nim;6;ambiguous identifier
tambsym2.nim;4;undeclared identifier: 'CreateRGBSurface'
tambsym3.nim;6;ambiguous identifier
tarraycons.nim;9;invalid order in array constructor
tatomic.nim;2;identifier expected, but found 'atomic'
tbind2.nim;7;ambiguous call
tbind4.nim;4;undeclared identifier: 'lastId'

1 t99bott.nim 20 constant expression expected
3 tambsym.nim 6 ambiguous identifier
4 tambsym2.nim 4 undeclared identifier: 'CreateRGBSurface'
5 tambsym3.nim 6 ambiguous identifier
6 tarraycons.nim 9 invalid order in array constructor
7 tatomic.nim 2 identifier expected, but found 'atomic'
8 tbind2.nim 7 ambiguous call
9 tbind4.nim 4 undeclared identifier: 'lastId'

View file

@ -0,0 +1,17 @@
type
TEnum = enum
eA, eB, eC, eD, eE, eF
const
myMapping: array[TEnum, array[0..1, int]] = [
eA: [1, 2],
eC: [3, 4],
eB: [5, 6],
eD: [0: 8, 1: 9],
eE: [0: 8, 9],
eF: [2, 1: 9]
]
echo myMapping[eC][1]