9 lines
194 B
Nim
9 lines
194 B
Nim
template first*(a: openarray): auto = a[0]
|
|
|
|
template last*(a: openarray): auto = a[len(a)-1]
|
|
|
|
proc flatten*[T](a: seq[seq[T]]): seq[T] =
|
|
result = @[]
|
|
for subseq in a:
|
|
result.add(subseq)
|