renamefest

This commit is contained in:
Araq 2014-08-23 01:43:49 +02:00
commit 2f43fdb837
62 changed files with 342 additions and 343 deletions

View file

@ -129,7 +129,7 @@ proc mget*[A](s: var TSet[A], key: A): var A =
assert s.isValid, "The set needs to be initialized."
var index = rawGet(s, key)
if index >= 0: result = t.data[index].key
else: raise newException(EInvalidKey, "key not found: " & $key)
else: raise newException(KeyError, "key not found: " & $key)
proc contains*[A](s: TSet[A], key: A): bool =
## Returns true iff `key` is in `s`.

View file

@ -144,7 +144,7 @@ proc mget*[A, B](t: var TTable[A, B], key: A): var B =
## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
var index = rawGet(t, key)
if index >= 0: result = t.data[index].val
else: raise newException(EInvalidKey, "key not found: " & $key)
else: raise newException(KeyError, "key not found: " & $key)
iterator allValues*[A, B](t: TTable[A, B]; key: A): B =
## iterates over any value in the table `t` that belongs to the given `key`.
@ -411,7 +411,7 @@ proc mget*[A, B](t: var TOrderedTable[A, B], key: A): var B =
## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
var index = rawGet(t, key)
if index >= 0: result = t.data[index].val
else: raise newException(EInvalidKey, "key not found: " & $key)
else: raise newException(KeyError, "key not found: " & $key)
proc hasKey*[A, B](t: TOrderedTable[A, B], key: A): bool =
## returns true iff `key` is in the table `t`.
@ -663,7 +663,7 @@ proc mget*[A](t: var TCountTable[A], key: A): var int =
## If `key` is not in `t`, the ``EInvalidKey`` exception is raised.
var index = rawGet(t, key)
if index >= 0: result = t.data[index].val
else: raise newException(EInvalidKey, "key not found: " & $key)
else: raise newException(KeyError, "key not found: " & $key)
proc hasKey*[A](t: TCountTable[A], key: A): bool =
## returns true iff `key` is in the table `t`.