Commit Graph

535 Commits

Author SHA1 Message Date
Miran
40a5d6537a fix #17385, len must be declared before items (#17386) 2021-03-15 10:45:10 -07:00
flywind
2e730f1452 rename channels to channels_builtin (#17330)
* improve test coverage for isolation

* a bit better

* rename channels to channels_builtin
2021-03-12 13:04:32 +01:00
konsumlamm
9819fb21d8 Use .. warning:: (#17320) 2021-03-10 10:39:23 -08:00
konsumlamm
3dc1bd0d09 Change parameter names in lists module from L (#17321) 2021-03-10 17:07:31 +01:00
konsumlamm
b52febf77e Improve the lists module (#17312) 2021-03-10 08:25:50 +01:00
Danil Yarantsev
aef55a7a88 Replace double backticks with single backticks - Part 3 out of ~7 (#17207) 2021-02-28 23:22:05 -08:00
Danil Yarantsev
56461c280f Change stdlib imports to use std prefix in most examples (#17202) 2021-02-28 13:17:19 -08:00
flywind
f26c25737c remove outdated codes (#17140)
* remove unnecessary when statement

* remove outdated codes
2021-02-22 09:40:11 +01:00
flywind
4556901572 use single backtick (#17141) 2021-02-21 19:53:28 -08:00
Timothee Cour
b9994925f5 remove all uses of condsyms symbols defined prior to bootstrap nim 0.20.0 (#16918)
* nimNoArrayToCstringConversion deadcode
* nimbabel deadcode
* nimHasalignOf deadcode
* nimvarargstyped deadcode
* nimhygiene deadcode
* nimNewTypedesc deadcode
* nimlocks deadcode
* nimHasCppDefine deadcode
* nimHasRunnableExamples deadcode
* nimHasNilChecks deadcode
* nimSymKind deadcode
* minor macros refactoring
* nimVmEqIdent deadcode
* nimNoNil deadcode
* nimNoZeroTerminator deadcode
* nimHasSymOwnerInMacro deadcode
* nimVmExportFixed deadcode
* nimNewRuntime deadcode
* nimAshr deadcode
* nimUncheckedArrayTyp deadcode
* nimHasTypeof deadcode
* nimErrorProcCanHaveBody deadcode
* nimHasHotCodeReloading deadcode
* nimHasSignatureHashInMacro deadcode
* nimHasDefault deadcode
* nimMacrosSizealignof deadcode
2021-02-17 09:32:36 +01:00
konsumlamm
56f5010fa4 Improve the heapqueue module (#17034)
Improve documentation
Optimize toHeapQueue
Rename siftup and siftdown
Add tests for the heap property
2021-02-15 13:57:15 +01:00
flywind
c8d9963150 fix the wrong examples (#17035) 2021-02-15 10:44:46 +01:00
flywind
eb8cc51bb8 tables module uses runnableExamples (#16994)
* tables module use runnableExamples
* disable the tests
2021-02-13 09:09:12 +01:00
flywind
41d32c3ea3 fix lists docs regression (#16981) 2021-02-09 12:19:11 +01:00
Héctor M. Monacci
d1210a3bb9 Another typo corrected (#16974)
From `fliter proc` to `filter proc`
2021-02-08 20:12:48 -08:00
Peter Salvi
e211a2a9f6 std/lists: Various changes to lists (RFC #303) (#16536)
* Various changes to `lists` (RFC #303)

* Removing a non-element is no-op; better tests

* Remove preserves cycles; add appendMove alias; tests.

* Return value for (singly linked) `lists.remove`

* More test for lists.remove

* Moved `lists.append` to the end of the file to see all `add` definitions

* Disable testing js for now

* Use workaround for swap js bug

* Smaller diff

* Undo "silent" deprecation of append

* Correct typo in changelog

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Remove `appendMoved`

Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>

* Don't remove appendMoved

Co-authored-by: Clyybber <darkmine956@gmail.com>
Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
2021-02-08 22:24:16 +01:00
Héctor M. Monacci
a9f44b7257 Correct typo (#16972)
From `fliter proc` to `filter proc`
2021-02-08 19:39:25 +01:00
flywind
0cf3ba159c close #15767 (#16959)
* fix some warnings

* close #15767

* Revert "fix some warnings"

This reverts commit 39f2f23b00.
2021-02-08 11:47:28 +01:00
flywind
d447c0fe3f use typeof instead type (#16962) 2021-02-08 09:46:07 +01:00
narimiran
1d1c831efa [ci skip] CountTable, remove link to unexisting proc 2021-02-02 09:52:39 +01:00
ee7
0b01eddace critbits: fix error from strictFuncs (#16877)
Previously, compiling a file containing just `import critbits` with
`nim c --experimental:strictFuncs` would produce the following error:
    critbits.nim(529, 6) Error: 'toCritBitTree' can have side effects

This was introduced by 2aed418698 (#16564).

Fixes: #16873
2021-02-01 13:14:23 +01:00
Andreas Rumpf
0300203e81 intsets are here to stay (#16751) 2021-01-19 14:17:22 +01:00
konsumlamm
44ceefa9fe Improve documentation for packedsets (#16715)
* Improve documentation for packedsets

Add more runnableExamples
Add deprecated pragma to intsets
Replace intsets with packedsets in lib.rst

* Apply suggested changes
2021-01-16 16:09:53 +01:00
konsumlamm
bf184bcdd9 Remove longestMatch in _WithPrefix iterators (#16689) 2021-01-12 08:35:27 +01:00
konsumlamm
8a3b6190c3 Improve documentation for deques (#16589) 2021-01-06 20:16:26 +01:00
konsumlamm
435f829348 Improve sequtils documentation (#16559)
* Improve sequtils documentation

Uncomment assertions in tests

* Use present tense
2021-01-04 11:04:30 +01:00
konsumlamm
763fef59fa Improve documentation for critbits (#16568) 2021-01-03 22:25:05 -08:00
hlaaftana
2aed418698 Fix #16554 (#16564) 2021-01-03 08:02:12 +01:00
Peter Salvi
051477b314 O(1) concatenation of singly- and doubly linked lists. (#16362)
* O(1) concatenation of singly- and doubly linked lists.

There is also new `toSinglyLinkedList` and `toDoublyLinkedList`
functions for conversion from `openArray`s, similarly
to `toHashSet` or `toTable`.

* Add `sequtils` import to runnable examples with `toSeq`.

* Added missing call to runnable examples.

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* Improved tests for lists.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* More compact tests for lists with templates.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Added extended example to `lists.copy`.

* Corrected .since annotations to 1.6

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Since declarations changed to (1,5,1).

* Add .since annotation, changelog, and tests.

* Rename `lists.concat` as an overload to `lists.append`.

* Renamed `append` to `add` in lists.

* Remove faulty `add` for `DoublyLinkedList`s.

* `lists.add` moves the second list; added `lists.copy` for shallow copy.

* More tests for `lists.add` and `lists.copy`.

* List concatenation with copying (`add`) and moving (tentatively `addMove`)

* Renamed `addMove` to `addMoved`; renamed arguments according to the style guide.

* Changelog update.

* Fix rebasing errors.

* Self-adding with `lists.addMove` results in a cycle now.
Added some extra tests.
2020-12-20 13:09:35 +01:00
ee7
38eb021f81 sequtils.nim: Change some func back to proc (#16309)
This commit changes the funcs that take a `proc` parameter back to
procs.

This reverts some of commit 6f57ebae34:
  sequtils.nim: Use `func` (#16293)

See also:
- https://github.com/nim-lang/Nim/issues/16303
- https://github.com/nim-lang/Nim/pull/16304
2020-12-14 20:14:49 +01:00
Elliot Waite
f3d57761ab Fix broken links in docs (#16336)
* Fix broken links in docs

* Fix rand HSlice links
2020-12-14 20:13:12 +01:00
flywind
8f6e07a9a2 clean the docs of sequtils (#16332) 2020-12-14 16:38:02 +01:00
Timothee Cour
b1c232aca1 improve tests for collections (#16328)
* improve tests for collections

* remove remaining code blocks in deques.nim

* improve runnableExamples
2020-12-12 09:33:29 +01:00
ee7
6f57ebae34 sequtils.nim: Use func (#16293)
* sequtils.nim: proc -> func

* sequtils.nim: proc -> func in links

* sequtils.nim: proc -> func in non-link doc comments

* test: add `sequtils` to strictFuncs test
2020-12-09 12:11:16 +01:00
ihlec
5c23ba7545 fixed article duplication typos (#16216) 2020-12-02 09:15:29 +01:00
Andreas Rumpf
da753c6a2e fixes #15076 (#16143)
* fixes #15076

* heapqueue: optimized for ARC

* added another test case [backport:1.4]

* code cleanup
2020-11-26 10:24:52 +01:00
flywind
cbc793b30b move tests to testament (#16101)
* move tests to testament

* minor

* fix random

* disable test random
2020-11-24 19:06:41 +01:00
flywind
afb8b69c0a improve document for heapqueue (#16107) 2020-11-24 14:29:34 +01:00
flywind
f1764aaa9e sets minor improvement (#16087) 2020-11-21 12:50:23 -08:00
flywind
c9371ef59d deques minor improvement (#16084) 2020-11-21 12:30:04 -08:00
flywind
f3887dea2c heapqueue minor improvement (#16088) 2020-11-21 12:16:35 -08:00
landerlo
c39fa0d495 Make IntSet a generic ordinal set OrdSet[A] (#15564)
* Make IntSet an ordinal set OrdSet[A: Ordinal]

Backward compatibility with IntSet is maintained.
IntSet is an alias for OrdSet[int]

* move ordsets to new file, intsets exports it
* ordset, move to lib/std folder

* Fix `$` for ordsets and test cleanup
* Fix ordsets compilation in doc example
* Rename ordsets to packedsets
2020-11-13 14:12:51 +01:00
flywind
492e9afa4c fix #15941 (#15948)
* fix #15941

* add testcase

* update
2020-11-13 08:11:00 +01:00
Thomas Tay
5298366f86 Update tables documentation (#15807)
Added a case where a user might use mgetOrPut and create an accidental
copy of a seq.
2020-11-02 10:33:16 +01:00
Clyybber
7364794fed Grammar fixes 2020-10-30 16:00:37 +01:00
Miran
ec059240b0 promote collect macro as a map+filter replacement (#15788)
* promote `collect` macro as a map+filter replacement

* Update lib/pure/collections/sequtils.nim
2020-10-30 10:12:01 +01:00
narimiran
b13fb9ddb8 fix #15750 2020-10-28 10:20:18 +01:00
cooldome
04f8fcfbd0 Tables, use sink val arguments more actively (#15625) 2020-10-19 14:13:26 +02:00
Christopher Dunn
f1d81dc6e6 Fix doc for CountTable (#15561) [backport] 2020-10-13 06:33:53 +02:00
flywind
c2c7f60259 docs minor (#15550) 2020-10-11 20:43:44 +02:00