diff options
author | Araq <rumpf_a@web.de> | 2011-07-31 00:21:32 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2011-07-31 00:21:32 +0200 |
commit | 6a8a409f1b8694e380e27afddff3cd9c29452b8c (patch) | |
tree | 4dcda408e2db40d0ce6b243c74d9160cad54c6c1 /lib | |
parent | 2d62738bbb5e7a664fab3f7a49313b5fb839a47c (diff) | |
download | Nim-6a8a409f1b8694e380e27afddff3cd9c29452b8c.tar.gz |
preparation for new 'is' operator; breaks bootstrapping again, sorry (use generated C code)
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/system.nim | 3 | ||||
-rwxr-xr-x | lib/system/excpt.nim | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/lib/system.nim b/lib/system.nim index 363d31578..33e350d7e 100755 --- a/lib/system.nim +++ b/lib/system.nim @@ -43,6 +43,7 @@ type stmt* {.magic: Stmt.} ## meta type to denote a statement (for templates) typeDesc* {.magic: TypeDesc.} ## meta type to denote ## a type description (for templates) + void* {.magic: "VoidType".} ## meta type to denote the absense of any type proc defined*[T](x: T): bool {.magic: "Defined", noSideEffect.} ## Special compile-time procedure that checks whether `x` is @@ -649,6 +650,8 @@ template `not_in` * (x, y: expr): expr = not contains(y, x) proc `is` *[T, S](x: T, y: S): bool {.magic: "Is", noSideEffect.} template `is_not` *(x, y: expr): expr = not (x is y) +proc `of` *[T, S](x: T, y: S): bool {.magic: "Of", noSideEffect.} + proc cmp*[T](x, y: T): int {.procvar.} = ## Generic compare proc. Returns a value < 0 iff x < y, a value > 0 iff x > y ## and 0 iff x == y. This is useful for writing generic algorithms without diff --git a/lib/system/excpt.nim b/lib/system/excpt.nim index 9095c168b..2da768810 100755 --- a/lib/system/excpt.nim +++ b/lib/system/excpt.nim @@ -199,7 +199,7 @@ proc raiseException(e: ref E_Base, ename: CString) {.compilerRtl.} = if excHandler != nil: pushCurrentException(e) c_longjmp(excHandler.context, 1) - elif e[] is EOutOfMemory: + elif e[] of EOutOfMemory: writeToStdErr(ename) quitOrDebug() else: |