Commit Graph

249 Commits

Author SHA1 Message Date
Yuriy Glukhov
4423da465a Workaround for #5098 2016-12-05 23:44:55 +02:00
Andreas Rumpf
1a85c5231b Merge pull request #5044 from endragor/deques
Added deques module, deprecating queues
2016-11-28 10:29:05 +01:00
Yuriy Glukhov
10292a2626 Corrected test case for #5057. 2016-11-27 13:34:24 +02:00
Yuriy Glukhov
41205493c0 Fixes #5057 2016-11-26 12:43:36 +02:00
Ruslan Mustakov
2c146445bc Added deques module, deprecating queues 2016-11-24 19:11:51 +07:00
Felix Krause
93a998204c Fixes #5035 2016-11-18 23:42:15 +01:00
Felix Krause
af4c75a893 Fixes #4974 2016-10-31 20:46:50 +01:00
andri lim
a42e9b11a7 fixes #4940 2016-10-27 11:32:14 +07:00
Felix Krause
7476e4fcb2 Fixes #4946 2016-10-24 22:36:21 +02:00
Andreas Rumpf
236c2beead Merge pull request #4935 from flyx/tablefix
Table fixes. fixes #4901
2016-10-24 17:07:03 +02:00
Andreas Rumpf
c486e6377c fixes #4386 2016-10-23 17:43:38 +02:00
Felix Krause
73b0bb52bb Table fixes. fixes #4901
* 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
2016-10-23 11:21:52 +02:00
Araq
80ad3d3441 fixes #4844 2016-10-08 10:47:47 +02:00
coffeepots
9af584707d Allow compilation of sharedtables.nim
tableimpl uses {.oldimmediate.}, which is defined in system/inclrtl.
2016-09-09 11:53:17 +01:00
Andreas Rumpf
4077050a42 fixes a critical tables bug that caused 'enlarge' to crash after 'add' 2016-09-05 08:51:38 +02:00
Andreas Rumpf
1e134aed49 Merge pull request #4367 from kierdavis/4365-tables-clear
Improvements to tables.clear()
2016-08-25 16:46:53 +02:00
Ruslan Mustakov
91d3661522 Removed the use of .gensym pragma inside stdlib templates 2016-08-23 14:01:16 +07:00
Andreas Rumpf
8876ed23f1 expr and stmt are now deprecated 2016-07-30 16:34:42 +02:00
Andreas Rumpf
a8edf67a28 make nim bootstrap again for older versions 2016-07-30 00:50:38 +02:00
Andreas Rumpf
60b187513e stdlib and compiler don't use .immediate anymore 2016-07-29 23:51:01 +02:00
Andreas Rumpf
358f582939 Merge pull request #4463 from flyx/tables-equals-no-KeyError
`==` in tables should not raise KeyError
2016-07-19 00:16:58 +02:00
Andreas Rumpf
0834cd63d9 prepare Nim codebase for upcoming parser changes 2016-07-15 12:56:03 +02:00
Axel Pahl
6de1333a26 use table literal syntax 2016-07-12 10:45:54 +02:00
Axel Pahl
8d4614b5ab explain difference between Table and TableRef in tables.nim 2016-07-12 09:43:31 +02:00
Matthew Baulch
90a5edfa6d Fix #4422: Reset queue element on pop. Prevent NimVM confusion. Help GC. 2016-07-11 15:10:54 +10:00
Kier Davis
449960bf7e Add a fix for clear() on non-ref types by adding a missing 'var' annotation 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).
2016-07-09 17:34:01 +01:00
Kier Davis
edb5a1a5c6 Fix clear() on CountTable
The record tuples used in CountData.data don't contain an 'hcode' member,
unlike Table and OrderedTable, causing the existing clearImpl() implementation
to break when attempting to assign to t.data[i].hcode.
2016-07-09 17:21:18 +01:00
Felix Krause
9f8cdf2560 Use getOrDefault for tables.== 2016-07-08 10:41:37 +02:00
Felix Krause
4455e5d4b6 == in tables should not raise KeyError
* 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.
2016-07-07 18:13:12 +02:00
Matthew Baulch
a6c66139fa Update sets examples so they work again. 2016-07-06 20:30:57 +10:00
Andreas Rumpf
f54e2bae6b Merge pull request #4344 from ReneSac/queues
Enchanced random access support for queues among other changes
2016-06-19 13:56:58 +02:00
ReneSac
67c7a925c1 Remove high() and low() procs from queues module
Just in case as they are said not overloadable. No deprecation because this is during a PR: those procs didn't exist before.
Also update comment due to failed optimization attempt using copyMem() for POD datatypes.
2016-06-16 18:08:15 -03:00
ReneSac
8dcb3fe5b7 Fixes for things pointed by Araq on the PR 2016-06-16 17:33:45 -03:00
ReneSac
dac4826483 Improved the documentation and miscelaneous
Better bounds checking. Tried to make it and documentation comply with the conflicting style guides.
Added example of usage at the top of the module as well as warnings on usage.
Also fix the back() and internal englishOrdinal() proc from previous commit.
Added {.discardable.} pragma for .pop(), when calling only for it's side effects.
Sprinkled some unlikely() for optimization.
Some new tests reflecting those changes.
2016-06-15 18:19:51 -03:00
Andreas Rumpf
5f83e869fa attempt to fix a critical memory leak in Nim's collections 2016-06-15 17:15:27 +02:00
Kier Davis
acbb03ee5e Implement clear() for CountTableRef. Fixes #4325. 2016-06-13 17:23:56 +01:00
ReneSac
d6849b87c5 Enchanced random access support for queues
Now queues support indexing, front() and back() operations and pairs iteration.
Also modernized some of the code to use newer Nim features.
Added the "add()" alias to "enqueue()", per nim's conventions (also fits better with pop())
2016-06-12 16:34:24 -03:00
Dominik Picheta
2b162c04b1 Implements tables.clear. 2016-06-02 18:25:10 +01:00
Andreas Rumpf
95bb19a579 moved random procs from math to its own module (breaking change) 2016-05-30 16:24:52 +02:00
cheatfate
49c50e4e21 Introduce template withValue() for tables.nim too. 2016-05-27 01:00:05 +03:00
cheatfate
a2393d0593 Introduce template withValue() 2016-05-26 15:32:14 +03:00
Lompiktab
72ba30d0a9 Fix 2 compile errors in LockFreeHash.nim
* type mismatch in range (line 55)
* invalid indentation (line 249)
2016-05-14 09:41:35 +04:00
Stephane Fontaine
fbd6291f2f Fix missing ]
other nim can't parse the file.
Introduced in 192ba3bbc0 (diff-1a01187da2fad29f03da8ce36ffe1f91)
2016-05-13 22:14:22 +04:00
Yuriy Glukhov
1a8f784834 Added heapqueue collection. Fixed timers in asyncdispatch. 2016-04-28 00:04:32 +03:00
Yuriy Glukhov
b48d98b846 Added del for OrderedTable and OrderedTableRef 2016-04-13 13:41:32 +03:00
Andreas Rumpf
a61d5e466b added missing file for --gc:stack 2016-03-31 16:49:56 +02:00
Andreas Rumpf
878679fa3f added missing file 2016-03-28 02:26:38 +02:00
Yuriy Glukhov
308b7c0138 Fixed Table::del in JS 2016-03-21 13:35:54 +02:00
Hans Raaf
cddabcfc63 Fixes foldl() and foldr() + foldl() with start parameter.
This fixes the (potential) multi-evaluation of the sequence parameter in
foldl() and foldr().

It also adds a foldl() version which gets a start parameter. This allows
for creating a result with a different type than the elements of the
sequence.
2016-03-06 17:52:18 +01:00
Andreas Rumpf
82114b7980 Merge branch 'devel' of github.com:nim-lang/Nim into devel 2016-03-04 22:19:19 +01:00