1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
discard """
cmd: "nim c --experimental:strictFuncs --experimental:views $file"
"""
import tables, streams, parsecsv
type
Contig2Reads = TableRef[string, seq[string]]
proc get_Contig2Reads(sin: Stream, fn: string, contig2len: TableRef[string, int]): Contig2Reads =
result = newTable[string, seq[string]]()
var parser: CsvParser
open(parser, sin, filename = fn, separator = ' ', skipInitialSpace = true)
while readRow(parser, 2):
if contig2len.haskey(parser.row[1]):
mgetOrPut(result, parser.row[1], @[]).add(parser.row[0])
block:
# issue #15756
func `&&&`[T](x: var seq[T], y: sink T): seq[T] =
newSeq(result, x.len + 1)
for i in 0..x.len-1:
result[i] = move(x[i])
result[x.len] = move(y)
var x = @[0, 1]
let z = x &&& 2
func copy[T](x: var openArray[T]; y: openArray[T]) =
for i in 0..high(x):
x[i] = y[i]
type
R = ref object
a, b: R
data: string
proc main =
var a, b: array[3, R]
b = [R(data: "a"), R(data: "b"), R(data: "c")]
copy a, b
main()
|