diff options
author | Simon Ruderich <simon@ruderich.org> | 2016-09-15 04:22:23 +0200 |
---|---|---|
committer | Simon Ruderich <simon@ruderich.org> | 2016-09-15 11:43:57 +0200 |
commit | 14e80a1abe93d423adfc1a3c3b4acade8bef32e1 (patch) | |
tree | 869f55a19d5ea0f421a14f8485594c3639f3f96b | |
parent | b52240fc9e7991926345f3b3a34175b66da1f783 (diff) | |
download | Nim-14e80a1abe93d423adfc1a3c3b4acade8bef32e1.tar.gz |
system: high, low: add example which uses the type
-rw-r--r-- | lib/system.nim | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/system.nim b/lib/system.nim index 4cd0378b7..cbfcd8b81 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -226,6 +226,7 @@ proc high*[T](x: T): T {.magic: "High", noSideEffect.} ## var arr = [1,2,3,4,5,6,7] ## high(arr) #=> 6 ## high(2) #=> 9223372036854775807 + ## high(int) #=> 9223372036854775807 proc low*[T](x: T): T {.magic: "Low", noSideEffect.} ## returns the lowest possible index of an array, a sequence, a string or @@ -236,6 +237,7 @@ proc low*[T](x: T): T {.magic: "Low", noSideEffect.} ## var arr = [1,2,3,4,5,6,7] ## low(arr) #=> 0 ## low(2) #=> -9223372036854775808 + ## low(int) #=> -9223372036854775808 type range*{.magic: "Range".}[T] ## Generic type to construct range types. |