summary refs log tree commit diff stats
path: root/lib/pure/collections/tables.nim
Commit message (Collapse)AuthorAgeFilesLines
* Implement clear() for CountTableRef. Fixes #4325.Kier Davis2016-06-131-1/+1
|
* Implements tables.clear.Dominik Picheta2016-06-021-5/+29
|
* Introduce template withValue() for tables.nim too.cheatfate2016-05-271-0/+45
|
* Added del for OrderedTable and OrderedTableRefYuriy Glukhov2016-04-131-0/+41
|
* Fix CountTableRef#getOrDefaultSloane Simmons2016-01-091-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes issue with CountTableRef and getOrDefault: ```{nimrod} import tables proc main() = const testKey = "TESTKEY" let t: CountTableRef[string] = newCountTable[string]() # Before, does not compile with error message: #test_counttable.nim(7, 43) template/generic instantiation from here #lib/pure/collections/tables.nim(117, 21) template/generic instantiation from here #lib/pure/collections/tableimpl.nim(32, 27) Error: undeclared field: 'hcode' echo "Count of " & testKey & " is " & $t.getOrDefault(testKey) t.inc(testKey,3) echo "Count of " & testKey & " is " & $t.getOrDefault(testKey) when isMainModule: main() ``` Previously, `getOrDefault` for CountTableRef objects was calling the `getOrDefaultImpl` template, which used the t.data.hcode object - assuming a Table or similar object. Because CountTableRef didn't have an hcode in its data tuples, this wouldn't compile. Changed to be the same as `CountTable#getOrDefault`.
* udpated the compiler and tester to use getOrDefaultAraq2015-10-131-8/+10
|
* added getOrDefault; bootstrapping works againAraq2015-10-131-33/+38
|
* Merge branch 'mget' of https://github.com/def-/Nim into def--mgetAraq2015-10-131-33/+73
|\ | | | | | | | | | | | | | | | | | | Conflicts: lib/pure/collections/critbits.nim lib/pure/collections/tables.nim lib/pure/xmltree.nim lib/system/sets.nim tests/collections/ttables.nim tests/collections/ttablesref.nim
| * Rename mget to `[]`def2015-03-311-55/+83
| | | | | | | | | | | | | | | | | | - In sets, tables, strtabs, critbits, xmltree - This uses the new var parameter overloading - mget variants still exist, but are deprecated in favor of `[]` - Includes tests and fixed tests and usages of mget - The non-var `[]` now throws an exception instead of returning binary 0 or an empty string
* | breaking change: symbol lookups in generics follows spec more closely; fixes ↵Araq2015-08-071-4/+4
| | | | | | | | #2664
* | Merge branch 'more_concurrency' into develAraq2015-06-301-168/+49
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: doc/tut1.txt lib/core/locks.nim lib/pure/collections/tables.nim lib/pure/selectors.nim
| * | some progress on making async multithreadedAraq2015-05-281-168/+49
| | |
* | | lib/pure/a-c - Dropped 'T' from typespdw2015-06-041-36/+36
| | |
* | | Add contains proc for tables to allow usage of `in`Jonathan2015-05-051-0/+24
|/ /
* | fixes #2625Araq2015-05-031-4/+7
| |
* | Merge pull request #2411 from reactormonk/merge-counttablesAndreas Rumpf2015-04-211-0/+61
|\ \ | | | | | | merge for CountTable, see #1680
| * | doc comments for mergeSimon Hafner2015-03-261-0/+3
| | |
| * | merge for CountTable, see #1680Simon Hafner2015-03-261-0/+58
| |/
* / Use more Natural and Positive numbers in proc parametersdef2015-04-061-1/+1
|/ | | | | - Didn't go through all modules, only the main ones I thought of - Building the compiler and tests still work
* prepare for upcoming parsing change of unary operatorsAraq2015-03-221-10/+10
|
* Making tuples anonymous (so far... not finished).Hans Raaf2015-03-171-23/+22
|
* Fixed table getter not compiling when table value type had not '$' proc ↵krolik2015-03-051-1/+5
| | | | overriden
* Fix unknown symbol in tables mpairs iterator.Hans Raaf2015-02-211-1/+1
| | | | Fixes an error with mpairs iterator which was introduced with 5fbcf93860. This is used by nimforum thats why I found it. I also added a testcase for the mpairs iterator.
* Merge ../Nim into develCharles Blake2015-02-161-1/+1
|\
| * Fix typosFederico Ceratto2015-02-151-1/+1
| |
* | Add comments explaining odd looking i<0..data[i].Charles Blake2015-02-161-3/+3
| |
* | Just do wide interface of hasKeyOrPut & mgetOrPut.Charles Blake2015-02-161-36/+55
| | | | | | | | | | | | | | Extract maybe re-hash/re-search and insert logic into a new template. Use this new template to do impl templates for all three put forms (which required renaming a couple 'value' arguments to 'val'). Added OrderedTable and OrderedTableRef versions of both as well.
* | Add TableRef version of mgetOrPut.Charles Blake2015-02-161-0/+5
| |
* | Add mgetOrPut to support just one probe chase for the commonCharles Blake2015-02-151-0/+14
|/ | | | pattern of either updating or initializing table entries.
* assignment -> shallowCopy for efficiency.Charles Blake2015-02-131-1/+1
|
* Merge ../Nim into devel; track ttables.nim delete.Charles Blake2015-02-131-1/+1
|\
| * fixed minor bugs; cleaned up testsAraq2015-02-121-1/+1
| |
* | Update doc comments to mention rightSize.Charles Blake2015-02-131-4/+4
| |
* | Oops - missed updates to a few later rawGet()s.Charles Blake2015-02-121-4/+8
| |
* | Add hcode,rightSize,rawGetKnownHC. Fix inf loop.Charles Blake2015-02-121-60/+140
|/ | | | | | | | | | | | | | | | | | | | | | Make similar changes to those made in sets.nim, including hcode, rightSize rawGet/rawGetKnownHC result protocol, nextTry probe sequence to be the cache friendlier h=h+1 which in turn allows supporting changing deletion to fix the infinite loop bug with local rehashing which in turn has desirable properties of graceful table aging when deletes do happen and also making insert-only usage patterns no longer pay any time/space cost to check deleted status. Unlike collections.sets, this module has add() for duplicate key inserts and a 3rd type of table, CountTable. The first wrinkle is handled by introducing a rawGetDeep for unconditionally adding entries along collision chains. This point of CountTable seems to be space efficiency at 2 items per slot. These changes retain that by keeping the val==0 => EMPTY rule and not caching hash codes. putImpl is expanded in-place for CountTable since the new putImpl() is too different. { Depending on table size relative to caches & key expense, regular Table[A,B] may become faster than CountTable, especially if the basic count update could be something like inc(mGetOrPut(t, key, 0)). } Unit tests pass, but in this module those are much more of just a demo than probing for bugs. Should exercise/test this a little more before merging.
* documented new C++ supportAraq2015-01-281-1/+2
|
* Happy new year!Guillaume Gelin2015-01-061-1/+1
|
* better CSS; better docs for teh tables moduleAraq2014-12-211-9/+18
|
* big renameAraq2014-08-281-108/+108
|
* big renameAraq2014-08-281-2/+2
|
* big renameAraq2014-08-271-19/+25
|
* renamefestAraq2014-08-231-3/+3
|
* Added stylistic consistancy.Clay Sweetser2014-07-241-1/+1
|
* Fixed `==` for PTables, added test.Felix Krause2014-06-271-2/+5
|
* Merge pull request #1251 from gradha/pr_misc_docsAndreas Rumpf2014-06-121-2/+4
|\ | | | | Misc docs suggestions
| * Revert "Adds to tables module example of reference type vs value type."Grzegorz Adam Hankiewicz2014-06-101-32/+2
| | | | | | | | This reverts commit bde9d1ac0753e46c726dc63930539bb82d09f19d.
| * Adds to tables module example of reference type vs value type.Grzegorz Adam Hankiewicz2014-06-061-2/+32
| |
| * Avoids temporal string in tables hashing example.Grzegorz Adam Hankiewicz2014-06-061-2/+4
| |
* | added allValues iteratorAraq2014-06-121-2/+9
|/
* Added support for ref type hash tables.Reimer Behrends2014-05-041-1/+266
| | | | | | This reuses the hash table implementation for objects (and the associated tests). For efficiency reasons, iterator implementations are currently adapted rather than calling the TTable code.