added system.finished for first class iterators

This commit is contained in:
Araq 2012-11-17 01:25:32 +01:00
commit 7f6633a06f
8 changed files with 55 additions and 12 deletions

View file

@ -2096,6 +2096,12 @@ when not defined(EcmaScript) and not defined(NimrodVM):
`result` = `x`.ClEnv;
""".}
proc finished*[T: proc](x: T): bool {.noSideEffect, inline.} =
## can be used to determine if a first class iterator has finished.
{.emit: """
`result` = *((NI*) `x`.ClEnv) < 0;
""".}
elif defined(ecmaScript) or defined(NimrodVM):
# Stubs:
proc GC_disable() = nil