Nim is a statically typed compiled systems programming language. It combines successful concepts from mature languages like Python, Ada and Modula. Its design focuses on efficiency, expressiveness, and elegance (in that order of priority).
The only overloads for add to string are for char, string and cstring. An overload that allows adding an openArray[char] does not exist, for things like cstrings with a specific length, sections of seq[char], ptr UncheckedArray[char] etc. Writing it manually via for c in openarr: str.add(c) would be much less efficient than a specialized overload.
The only overloads for
add
tostring
are for char, string and cstring. An overload that allows adding anopenArray[char]
does not exist, for things like cstrings with a specific length, sections ofseq[char]
,ptr UncheckedArray[char]
etc. Writing it manually viafor c in openarr: str.add(c)
would be much less efficient than a specialized overload.Same goes for
insert
.