diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/system.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 06c4f103b..13f16903a 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -3443,6 +3443,14 @@ when not defined(nimNoArrayToString): ## generic ``$`` operator for arrays that is lifted from the components collectionToString(x, "[", ", ", "]") +proc `$`*[T](x: openarray[T]): string = + ## generic ``$`` operator for openarrays that is lifted from the components + ## of `x`. Example: + ## + ## .. code-block:: nim + ## $(@[23, 45].toOpenArray(0, 1)) == "[23, 45]" + collectionToString(x, "[", ", ", "]") + proc quit*(errormsg: string, errorcode = QuitFailure) {.noReturn.} = ## a shorthand for ``echo(errormsg); quit(errorcode)``. echo(errormsg) |