Deprecate xlen() for strings and seqs (#8782)

* deprecates xlen() for strings and seqs

* added docs
This commit is contained in:
awr1 2018-08-26 10:15:19 -05:00 • committed by Andreas Rumpf
commit 96d44fdd0a

View file

@ -4055,10 +4055,15 @@ proc procCall*(x: untyped) {.magic: "ProcCall", compileTime.} =
## procCall someMethod(a, b) ## procCall someMethod(a, b)
discard discard
proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.} = discard proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect,
proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", 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'. ## returns the length of a sequence or a string without testing for 'nil'.
## This is an optimization that rarely makes sense. ## This is an optimization that rarely makes sense.
## **Deprecated since version 0.18.1**. Use len() instead.
discard discard