Initial import

This commit is contained in:
Andreas Rumpf 2008-06-22 16:14:11 +02:00
commit 405b86068e
324 changed files with 163599 additions and 0 deletions

46
tests/tseqcon.nim Executable file
View file

@ -0,0 +1,46 @@
# Test the &= operator for sequences and strings
import
io
type
TRec = record
x, y: int
s: string
seq: seq[string]
TRecSeq = seq[TRec]
proc test() =
var seq, b: seq[string]
seq = []
add(seq, "Hi")
add(seq, "there, ")
add(seq, "what's your name?")
b = seq # deep copying here!
b[0][1] = 'a'
for i in 0 .. length(seq)-1:
write(stdout, seq[i])
for i in 0 .. length(b)-1:
write(stdout, b[i])
when defined(nestedFixed):
proc nested() =
var
seq: seq[seq[string]]
for i in 0..10_000: # test if the garbage collector
# now works with sequences
seq = [
["A", "B", "C", "D"],
["E", "F", "G", "H"],
["I", "J", "K", "L"],
["M", "N", "O", "P"]
]
test()
when defined(nestedFixed):
nested()
#OUT Hithere, what's your name?Hathere, what's your name?