summary refs log tree commit diff stats
path: root/lib/pure/collections/tables.nim
Commit message (Collapse)AuthorAgeFilesLines
* Fixes #5035Felix Krause2016-11-181-10/+3
|
* Fixes #4974Felix Krause2016-10-311-9/+15
|
* fixes #4940andri lim2016-10-271-1/+1
|
* Fixes #4946Felix Krause2016-10-241-0/+1
|
* Table fixes. fixes #4901Felix Krause2016-10-231-4/+37
| | | | | | | | * added `==` for OrderedTable, CountTable and the *Ref types * added missing documentation to all `==` procs * fixed clear() for OrderedTables, which did not work because `var` does not work well with `|` * added tests
* fixes #4844Araq2016-10-081-1/+5
|
* fixes a critical tables bug that caused 'enlarge' to crash after 'add'Andreas Rumpf2016-09-051-3/+6
|
* Merge pull request #4367 from kierdavis/4365-tables-clearAndreas Rumpf2016-08-251-3/+3
|\ | | | | Improvements to tables.clear()
| * Add a fix for clear() on non-ref types by adding a missing 'var' annotation ↵Kier Davis2016-07-091-3/+3
| | | | | | | | | | | | | | | | to the type signature However, this fix won't take effect until a compiler bug (#4448) is fixed. Until then, the codebase functions identically to how it did before this commit (calls to clear() fail to compile for Table/OrderedTable/CountTable as the argument is immutable).
* | make nim bootstrap again for older versionsAndreas Rumpf2016-07-301-2/+2
| |
* | stdlib and compiler don't use .immediate anymoreAndreas Rumpf2016-07-291-8/+8
| |
* | Merge pull request #4463 from flyx/tables-equals-no-KeyErrorAndreas Rumpf2016-07-191-5/+4
|\ \ | | | | | | `==` in tables should not raise KeyError
| * | Use getOrDefault for tables.`==`Felix Krause2016-07-081-7/+5
| | |
| * | `==` in tables should not raise KeyErrorFelix Krause2016-07-071-2/+3
| |/ | | | | | | | | | | * With previous code, the compiler deduced that equalsImpl may raise a KeyError. While this could only actually happen in a nasty multi-threaded environment, I fixed the code so that it will never happen.
* | use table literal syntaxAxel Pahl2016-07-121-2/+2
| |
* | explain difference between Table and TableRef in tables.nimAxel Pahl2016-07-121-0/+33
|/
* 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
| |