This commit is contained in:
Andreas Rumpf
2016-03-05 14:36:40 +01:00
parent 267a2756e4
commit d3ce5f34f8

View File

@@ -3541,16 +3541,22 @@ proc `^`*(x: int): int {.noSideEffect, magic: "Roof".} =
## overloaded ``[]`` or ``[]=`` accessors.
discard
template `..^`*(a, b: expr): expr =
template `..^`*(a, b: untyped): untyped =
## a shortcut for '.. ^' to avoid the common gotcha that a space between
## '..' and '^' is required.
a .. ^b
template `..<`*(a, b: expr): expr =
template `..<`*(a, b: untyped): untyped {.dirty.} =
## a shortcut for '.. <' to avoid the common gotcha that a space between
## '..' and '<' is required.
a .. <b
iterator `..<`*[S,T](a: S, b: T): T =
var i = T(a)
while i < b:
yield i
inc i
proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.} = discard
proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.} =
## returns the length of a sequence or a string without testing for 'nil'.