Fix typos

This commit is contained in:
Federico Ceratto 2015-02-15 16:20:32 +00:00
commit 657dca5c3b
81 changed files with 126 additions and 126 deletions

View file

@ -404,7 +404,7 @@ proc setVal[K,V](table: var PConcTable[K,V], key: int, val: int,
#echo("tomb old slot then set in new table")
nextTable = copySlotAndCheck(table,idx)
return setVal(nextTable, key, val, expVal, match)
# Finaly ready to add new val to table
# Finally ready to add new val to table
while true:
if match and oldVal != expVal:
#echo("set failed, no match oldVal= " & $oldVal & " expVal= " & $expVal)

View file

@ -174,7 +174,7 @@ proc excl*[T](c: var CritBitTree[T], key: string) =
iterator leaves[T](n: Node[T]): Node[T] =
if n != nil:
# XXX actually we could compute the necessary stack size in advance:
# it's rougly log2(c.count).
# it's roughly log2(c.count).
var stack = @[n]
while stack.len > 0:
var it = stack.pop

View file

@ -333,7 +333,7 @@ template foldl*(sequence, operation: expr): expr =
## words = @["nim", "is", "cool"]
## concatenation = foldl(words, a & b)
## assert addition == 25, "Addition is (((5)+9)+11)"
## assert subtraction == -15, "Substraction is (((5)-9)-11)"
## assert subtraction == -15, "Subtraction is (((5)-9)-11)"
## assert multiplication == 495, "Multiplication is (((5)*9)*11)"
## assert concatenation == "nimiscool"
assert sequence.len > 0, "Can't fold empty sequences"
@ -369,7 +369,7 @@ template foldr*(sequence, operation: expr): expr =
## words = @["nim", "is", "cool"]
## concatenation = foldr(words, a & b)
## assert addition == 25, "Addition is (5+(9+(11)))"
## assert subtraction == 7, "Substraction is (5-(9-(11)))"
## assert subtraction == 7, "Subtraction is (5-(9-(11)))"
## assert multiplication == 495, "Multiplication is (5*(9*(11)))"
## assert concatenation == "nimiscool"
assert sequence.len > 0, "Can't fold empty sequences"
@ -512,7 +512,7 @@ when isMainModule:
words = @["nim", "is", "cool"]
concatenation = foldl(words, a & b)
assert addition == 25, "Addition is (((5)+9)+11)"
assert subtraction == -15, "Substraction is (((5)-9)-11)"
assert subtraction == -15, "Subtraction is (((5)-9)-11)"
assert multiplication == 495, "Multiplication is (((5)*9)*11)"
assert concatenation == "nimiscool"
@ -525,7 +525,7 @@ when isMainModule:
words = @["nim", "is", "cool"]
concatenation = foldr(words, a & b)
assert addition == 25, "Addition is (5+(9+(11)))"
assert subtraction == 7, "Substraction is (5-(9-(11)))"
assert subtraction == 7, "Subtraction is (5-(9-(11)))"
assert multiplication == 495, "Multiplication is (5*(9*(11)))"
assert concatenation == "nimiscool"

View file

@ -11,7 +11,7 @@
## (also often named `dictionary`:idx: in other programming languages) that is
## a mapping from keys to values. ``Table`` is the usual hash table,
## ``OrderedTable`` is like ``Table`` but remembers insertion order
## and ``CountTable`` is a mapping from a key to its number of occurances.
## and ``CountTable`` is a mapping from a key to its number of occurrences.
## For consistency with every other data type in Nim these have **value**
## semantics, this means that ``=`` performs a copy of the hash table.
## For **reference** semantics use the ``Ref`` variant: ``TableRef``,