added '..^' and '..<' operators; 'nil' is allowed for 'len'; added plugin system to the compiler

This commit is contained in:
Araq 2015-04-22 11:49:41 +02:00
commit 4be0d16520
10 changed files with 85 additions and 18 deletions

View file

@ -3266,4 +3266,9 @@ template `..<`*(a, b: expr): expr =
## '..' and '<' is required.
a .. <b
proc xlen*(x: string): int {.magic: "XLenStr", noSideEffect.}
proc xlen*[T](x: seq[T]): int {.magic: "XLenSeq", noSideEffect.}
## returns the length of a sequence or a string without testing for 'nil'.
## This is an optimization that rarely makes sense.
{.pop.} #{.push warning[GcMem]: off.}