Commit graph

105 commits

Author SHA1 Message Date
Simon Hafner
73655e3dd6 merge for CountTable, see #1680 2015-03-26 03:38:30 +05:00
Araq
a541be8935 prepare for upcoming parsing change of unary operators 2015-03-22 09:31:15 +01:00
Hans Raaf
b42c729da4 Making tuples anonymous (so far... not finished). 2015-03-17 00:15:23 +01:00
krolik
4fe0a72577 Fixed table getter not compiling when table value type had not '$' proc overriden 2015-03-05 14:43:15 +02:00
Hans Raaf
93aa73284e Fix unknown symbol in tables mpairs iterator.
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.
2015-02-21 23:20:02 +01:00
Charles Blake
55840d9505 Merge ../Nim into devel 2015-02-16 14:55:08 -05:00
Charles Blake
629decd170 Add comments explaining odd looking i<0..data[i]. 2015-02-16 07:48:31 -05:00
Charles Blake
0a3e732b9f Just do wide interface of hasKeyOrPut & mgetOrPut.
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.
2015-02-16 06:52:23 -05:00
Charles Blake
614a1f9d5a Add TableRef version of mgetOrPut. 2015-02-16 06:02:31 -05:00
Federico Ceratto
657dca5c3b Fix typos 2015-02-15 16:20:32 +00:00
Charles Blake
7c1c9a6a9d Add mgetOrPut to support just one probe chase for the common
pattern of either updating or initializing table entries.
2015-02-15 10:03:41 -05:00
Charles Blake
5068a5aa01 assignment -> shallowCopy for efficiency. 2015-02-13 14:10:09 -05:00
Charles Blake
45a2c1b1d1 Merge ../Nim into devel; track ttables.nim delete. 2015-02-13 08:42:41 -05:00
Charles Blake
d129e8f6c6 Update doc comments to mention rightSize. 2015-02-13 08:28:58 -05:00
Araq
10335fd726 fixed minor bugs; cleaned up tests 2015-02-12 14:56:56 +01:00
Charles Blake
49d88cee68 Oops - missed updates to a few later rawGet()s. 2015-02-12 06:44:09 -05:00
Charles Blake
5fbcf93860 Add hcode,rightSize,rawGetKnownHC. Fix inf loop.
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.
2015-02-12 05:22:04 -05:00
Araq
dbe71c715e documented new C++ support 2015-01-28 12:59:04 +01:00
Guillaume Gelin
3119fe087d Happy new year! 2015-01-06 15:26:33 +01:00
Araq
2990a9224b better CSS; better docs for teh tables module 2014-12-21 15:59:01 +01:00
Araq
27869b6c7b big rename 2014-08-28 00:36:14 +02:00
Araq
df172806ea big rename 2014-08-28 00:24:52 +02:00
Araq
11b6958755 big rename 2014-08-27 23:42:51 +02:00
Araq
2f43fdb837 renamefest 2014-08-23 01:43:49 +02:00
Clay Sweetser
18003ff196 Added stylistic consistancy. 2014-07-24 18:17:20 -04:00
Felix Krause
f59ca2736d Fixed == for PTables, added test. 2014-06-27 16:57:01 +02:00
Andreas Rumpf
d927eb5854 Merge pull request #1251 from gradha/pr_misc_docs
Misc docs suggestions
2014-06-12 16:39:20 +02:00
Araq
9354b8a9d7 added allValues iterator 2014-06-12 14:45:56 +02:00
Grzegorz Adam Hankiewicz
af6abac491 Revert "Adds to tables module example of reference type vs value type."
This reverts commit bde9d1ac07.
2014-06-10 00:39:19 +02:00
Grzegorz Adam Hankiewicz
bde9d1ac07 Adds to tables module example of reference type vs value type. 2014-06-06 20:18:19 +02:00
Grzegorz Adam Hankiewicz
9009841d62 Avoids temporal string in tables hashing example. 2014-06-06 19:53:39 +02:00
Reimer Behrends
79891b6b9b Added support for ref type hash tables.
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.
2014-05-04 15:22:50 +02:00
Grzegorz Adam Hankiewicz
15bd91a5da Adds example of custom object types used as table key. 2014-04-22 09:37:24 +02:00
Dominik Picheta
00dc93b65b Fixes collections/ttables. 2014-04-18 21:50:51 +01:00
Andreas Rumpf
3ee25170c3 fixes '==' for TTTable 2014-04-13 00:22:07 +02:00
Andreas Rumpf
587f0bd086 fixes '==' for TTTable 2014-04-13 00:20:25 +02:00
Simon Hafner
5498415f3b indexBy, which indexes a collection into a hashtable 2014-02-06 16:11:55 -06:00
Araq
fc452787e7 better html generator for the tester; fixes some VM bugs 2014-01-17 01:18:57 +01:00
Araq
92b8fac94a case consistency part 4 2013-12-27 23:10:36 +01:00
Araq
2df9b442c6 case consistency part 1 2013-12-27 15:48:53 +01:00
Grzegorz Adam Hankiewicz
1bd12e208b Mentions nextPowerOfTwo proc for table initialization. 2013-03-17 12:19:40 +01:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00
Araq
b3e70febb4 'sort' for ordered tables 2013-01-12 23:59:29 +01:00
Araq
4670445a93 'importcpp' for the JS target to generate an infix call 2013-01-11 01:08:37 +01:00
Araq
3af5c99336 fixes #293 2013-01-08 20:03:02 +01:00
Araq
a59abdf8e4 made more tests green; fixes #201 2012-09-12 21:48:37 +02:00
Araq
f893179889 documented hygienic templates; made tests green; fixed system.clamp 2012-08-22 22:46:02 +02:00
Araq
4f1b89c30c year 2012 for most copyright headers 2012-01-02 23:07:35 +01:00
Araq
62aa8bed3b tester: threading tests added 2011-11-19 02:05:16 +01:00
Araq
7000cf51b7 modifyable results for generics; teventemitter works 2011-08-09 01:40:12 +02:00