summary refs log tree commit diff stats
path: root/lib/pure/collections
Commit message (Collapse)AuthorAgeFilesLines
* fixes backticks in the documentation (#21340)ringabout2023-02-081-2/+2
|
* fixes #21278; `deques.shrink` off by one bug (#21284)ringabout2023-01-201-1/+1
| | | fixes #21278; deques.shrink off ny one bug
* remove legacy code (#21134)ringabout2022-12-261-3/+0
| | | | | * remove legacy code * fixes
* Document that system:pop() may raise IndexDefect (#21070)Xavier Noria2022-12-131-3/+3
| | | | | * Document system:pop() may raise IndexDefect * Add backticks to KeyError
* Remove deprecated rightSize (#21011)Juan Carlos2022-12-081-10/+0
| | | | | * Remove deprecated rightSize nop * Remove deprecated rightSize nop
* add effectsOf to map in the std/sets module (#20760)ringabout2022-11-051-1/+4
|
* add `effectsOf` to `std/tables` (#20751)ringabout2022-11-041-2/+6
|
* removes channels_builtin when enabling `nimPreviewSlimSystem` (#20713)ringabout2022-10-311-1/+0
|
* out parameters: enforce that 'out' is only used as a parameter (#20510)Andreas Rumpf2022-10-072-2/+3
| | | | | | | * out parameters: enforce that 'out' is only used as a parameter * make tables.nim use 'out' parameters * better backwards compat
* new move analyser2 (#20471)Andreas Rumpf2022-10-011-2/+1
| | | | | | | | * produce better code for closure environment creation * new 'first write' analysis; * scope based move analyser * code cleanup Co-authored-by: ringabout <43030857+ringabout@users.noreply.github.com>
* make more standard libraries work with `nimPreviewSlimSystem` (#20343)ringabout2022-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | * make more standard libraries work with `nimPreviewSlimSystem` * typo * part two * Delete specutils.nim * fixes more tests * more fixes * fixes tests * fixes three more tests * add formatfloat import * fix * last
* remove `var` for ref parameters in `std/tables` (#20175)ringabout2022-08-251-2/+2
| | | remove `var` from ref parameters; make it consistent
* top-down type inference, implements rfc 149 (#20091)metagn2022-08-241-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * micro implementation of rfc 149 refs https://github.com/nim-lang/RFCs/issues/149 * number/array/seq literals, more statements * try fix number literal alias issue * renew expectedType with if/case/try branch types * fix (nerf) index type handling and float typed int * use typeAllowed * tweaks + const test (tested locally) [skip ci] * fill out more of the checklist * more literals, change @ order, type conversions Not copying the full call tree before the typedesc call check in `semIndirectOp` is also a small performance improvement. * disable self-conversion warning * revert type conversions (maybe separate op later) * deal with CI for now (seems unrelated), try enums * workaround CI different way * proper fix * again * see sizes * lol * overload selection, simplify int literal -> float * range, new @ solution, try use fitNode for nil * use new magic * try fix ranges, new magic, deal with #20193 * add documentation, support templates Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* bootstrap the compiler with nimPreviewSlimSystem (#20176)ringabout2022-08-091-0/+3
| | | | | * bootstrap the compiler with nimPreviewSlimSystem * threads
* Add sink and lent annotations to the critbits module (#20021)silent-observer2022-07-141-8/+8
| | | | | | | | | * Add sink and lent to critbits * Remove lent for pairs I guess lent doesn't work well inside tuples * Remove lent from template in critbits Apparently this also doesn't work, because some checks failed
* Fix typo in sequtils documentation (#19789)Anthony Dario2022-05-131-1/+1
| | | Found another small typo.
* Fix broken link in sets documentation. (#19769)Anthony Dario2022-05-061-1/+1
|
* move assertions out of system (#19599)flywind2022-03-232-0/+8
|
* Fix `remove` on last node of singly-linked list [backport:1.6] (#19353)gecko2022-01-101-0/+2
|
* Fix #19314 - fixing broken `DoublyLinkedList` after adding empty ↵rockcavera2022-01-031-6/+6
| | | | | | | `DoublyLinkedList` (#19315) [backport] * Update lists.nim * Update tlists.nim
* Fix #19297 - fixing broken list after adding empty list (#19299)rockcavera2021-12-301-5/+6
| | | | | | | | | * Update lists.nim * Update tlists.nim * removed check `if b.tail != nil` The tail of the list being null it is still possible to retrieve its end by going through all nodes from the head. So checking for null from `b.tail` is unnecessary. However, setting `a.tail = b.tail` only if `a.head != nil`, so you don't break a good list with an already broken one.
* move toDeque to after addLast (#19233) [backport:1.0]MichalMarsalek2021-12-101-14/+14
| | | Changes the order of procs definitions in order to avoid calling an undefined proc.
* Deprecate `std/sharedlist` and `std/sharedtables` (#19112)konsumlamm2021-11-094-2/+4
|
* sequtils: fix errors from `strictFuncs` use (#18998)ee72021-10-161-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nim 1.4.x compiled the below code without error when using `--experimental:strictFuncs` import std/sequtils type Foo = ref object let foo1 = Foo() let foo2 = Foo() let foos = @[foo1, foo2] let fooTuples = @[(foo1, 1), (foo2, 2)] discard repeat(foo1, 3) discard zip(foos, foos) discard unzip(fooTuples) However, since 2020-12-09, devel Nim produced errors like /tmp/bar.nim(11, 15) template/generic instantiation of `repeat` from here /foo/nim/pure/collections/sequtils.nim(172, 6) Error: 'repeat' can have side effects an object reachable from 'x' is potentially mutated /foo/nim/pure/collections/sequtils.nim(183, 15) the mutation is here /foo/nim/pure/collections/sequtils.nim(183, 15) is the statement that connected the mutation to the parameter This commit reverts some `proc` to `func` changes so that code that: - calls `repeat`, `zip`, or `unzip` - and instantiates them with types containing `ref` can once again be compiled with `strictFuncs`. Otherwise, a user might be forced to drop or alter their `strictFuncs` use when upgrading from Nim 1.4.x, or when writing new code that uses these procedures (at least for now, with the current `strictFuncs` implementation). This commit also adds tests to assert that the remaining funcs in this module can be compiled with `strictFuncs` when used with types containing `ref`. The original batch of `proc` to `func` changes in `sequtils.nim` was in commit 6f57ebae349f, which was partially reverted in 38eb021f8158. See also: https://github.com/nim-lang/Nim/issues/16305
* [minor] fix docs (#18834)flywind2021-09-111-6/+4
|
* sequtils now support strict effect tracking (#18782)Andreas Rumpf2021-09-021-9/+14
|
* various small documentation improvements (#18602)Miran2021-07-284-15/+22
|
* optimize for the non-throwing case (#18587)Antonis Geralis2021-07-261-4/+7
|
* complement notes of two doc strings of tables module (#18527)IterableTrucks2021-07-211-0/+4
| | | | | | | | | | | | | | | * complement notes of two doc strings warning the deprecated procedure's side effect * Update lib/pure/collections/tables.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> * Update lib/pure/collections/tables.nim Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com> Co-authored-by: BillyZee <billyzee@localhost.localdomain> Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
* Revert #17321 (#18521)konsumlamm2021-07-191-135/+135
| | | Use better names in example
* deprecate `sequtils.delete` and add an overload with saner semantics ↵Timothee Cour2021-07-151-3/+42
| | | | | | | | consistent with `system.delete` (#18487) * deprecate sequtils.delete and add an overload with saner semantics * AssertionDefect => IndexDefect * improve tsequtils * add tests; use splice in js for optimization
* fixes #17696 (#18276)flywind2021-06-161-2/+5
|
* fix #7295: use move(result) inside template to avoid copy with --gc:refc ↵Timothee Cour2021-06-041-10/+10
| | | | (#18168)
* workaround bug in sharedtables.withValue to unblock frozen CI on OSX (#18172)flywind2021-06-041-0/+4
|
* Ref #17697 improve withValue docs (#18154)flywind2021-06-031-31/+50
| | | | | * Ref #17697 improve withValue docs * address comments
* [std/tables] remove unnecessary `do: ` (#18160)flywind2021-06-021-10/+16
|
* [std/hashcommon]improve docs a bit (#18153)flywind2021-06-021-3/+3
| | | | * reduce duplicated deprecated messages
* fix #17941: UnusedImport works for var/let/const/type invoked inside a ↵Timothee Cour2021-05-081-1/+1
| | | | | | | generic (#17942) * fix #17941: UnusedImport works for var/let/const/type invoked inside a generic * fixup
* Remove confusing <//> (#17830)flywind2021-04-262-14/+14
|
* CIs: attempt to use csources_v1 (#16282)Andreas Rumpf2021-04-212-2/+2
| | | | | | | | * CIs: attempt to use csources_v1 * also updated the BSDs * also updated azure pipelines * std modules should not itself use the 'std/' import dir... * compiler has to be careful with std/ for v1 booting
* [std/deques] move data instead of copy + destroy (#17800)flywind2021-04-201-4/+2
|
* use sink and lent in deques (#17661)flywind2021-04-071-10/+10
| | | | | | | | | * use sink and lent in deques * Update lib/pure/collections/deques.nim Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* lent support for tables (#17505)flywind2021-03-251-9/+9
|
* fix #17385, `len` must be declared before `items` (#17386)Miran2021-03-151-21/+21
|
* rename channels to channels_builtin (#17330)flywind2021-03-121-1/+1
| | | | | | | * improve test coverage for isolation * a bit better * rename channels to channels_builtin
* Use `.. warning::` (#17320)konsumlamm2021-03-101-2/+2
|
* Change parameter names in lists module from `L` (#17321)konsumlamm2021-03-101-127/+127
|
* Improve the lists module (#17312)konsumlamm2021-03-101-166/+185
|
* Replace double backticks with single backticks - Part 3 out of ~7 (#17207)Danil Yarantsev2021-02-282-6/+6
|
* Change stdlib imports to use std prefix in most examples (#17202)Danil Yarantsev2021-02-285-17/+17
|