diff options
author | awr1 <41453959+awr1@users.noreply.github.com> | 2018-08-26 10:15:19 -0500 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2018-08-26 17:15:19 +0200 |
commit | 96d44fdd0a24bc5cbfe29de6079da6882388aed8 (patch) | |
tree | 6bf493a156641361a79dd0db700ab5b8ee20fd9d | |
parent | e9b665f33890d78d78cc851febac1caee5a30b5b (diff) | |
download | Nim-96d44fdd0a24bc5cbfe29de6079da6882388aed8.tar.gz |
Deprecate xlen() for strings and seqs (#8782)
* deprecates xlen() for strings and seqs * added docs
-rw-r--r-- | lib/system.nim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/system.nim b/lib/system.nim index 8b98706ab..2c88fe60f 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -4055,10 +4055,15 @@ proc procCall*(x: untyped) {.magic: "ProcCall", compileTime.} = ## procCall someMethod(a, b) discard -proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.} = discard -proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.} = +proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect, + deprecated: "use len() instead".} = + ## **Deprecated since version 0.18.1**. Use len() instead. + discard +proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect, + deprecated: "use len() instead".} = ## returns the length of a sequence or a string without testing for 'nil'. ## This is an optimization that rarely makes sense. + ## **Deprecated since version 0.18.1**. Use len() instead. discard |