compiler distinguishes between 2 different 'var' types for C++ interop; code cleanups

This commit is contained in:
Araq 2015-02-07 01:06:25 +01:00
commit 74c6c8c903
7 changed files with 45 additions and 104 deletions

View file

@ -112,7 +112,7 @@ proc `[]`*(t: StringTableRef, key: string): string {.rtl, extern: "nstGet".} =
proc mget*(t: StringTableRef, key: string): var string {.
rtl, extern: "nstTake".} =
## retrieves the location at ``t[key]``. If `key` is not in `t`, the
## ``EInvalidKey`` exception is raised.
## ``KeyError`` exception is raised.
var index = rawGet(t, key)
if index >= 0: result = t.data[index].val
else: raise newException(KeyError, "key does not exist: " & key)