summary refs log tree commit diff stats
path: root/lib/pure
Commit message (Collapse)AuthorAgeFilesLines
* Add `hasDefaultValue` type trait (#22636)Amjad Ben Hedhili2023-09-041-0/+17
| | | Needed for #21842.
* deprecate `std/threadpool`; use `malebolgia`, `weave`, `nim-taskpool` ↵ringabout2023-08-291-0/+2
| | | | | | | | | | | instead (#22576) * deprecate `std/threadpool`; use `malebolgia` instead * Apply suggestions from code review * Apply suggestions from code review * change the URL of inim
* fixes broken nightlies; follow up #22544 (#22585)ringabout2023-08-291-1/+1
| | | | | ref https://github.com/nim-lang/nightlies/actions/runs/5970369118/job/16197865657 > /home/runner/work/nightlies/nightlies/nim/lib/pure/os.nim(678, 30) Error: getApplOpenBsd() can raise an unlisted exception: ref OSError
* define toList procs after add for lists [backport] (#22573)metagn2023-08-281-22/+22
| | | fixes #22543
* Add `cursor` to lists iterator variables (#22531)Amjad Ben Hedhili2023-08-241-3/+3
| | | * followup #21507
* Fix `getAppFilename` exception handling (#22544)Jacek Sieka2023-08-241-5/+10
| | | | | | | | | * Fix `getAppFilename` exception handling avoid platform-dependendent error handling strategies * more fixes * space
* fixes #22541; peg matchLen can raise an unlisted exception: Exception (#22545)ringabout2023-08-241-1/+1
| | | The `mopProc` is a recursive function.
* allow tuples and procs in 'toTask' + minor things (#22530)Andreas Rumpf2023-08-221-2/+2
|
* Markdown code blocks migration part 8 (#22478)Andrey Makarov2023-08-1530-508/+595
|
* fixes CI (#22471)ringabout2023-08-141-1/+1
| | | | | Revert "fixes bareExcept warnings; catch specific exceptions (#21119)" This reverts commit 9207d77848d6f5db3635ae64f3cd4972cdbe3296.
* fixes bareExcept warnings; catch specific exceptions (#21119)ringabout2023-08-131-1/+1
| | | | | * fixes bareExcept warnings; catch specific exceptions * Update lib/pure/coro.nim
* replace `doAssert false` with `raiseAssert` in lib, which works better with ↵ringabout2023-08-119-13/+13
| | | | strictdefs (#22458)
* fixes #22387; Undefined behavior when with hash(...) (#22404)ringabout2023-08-081-6/+14
| | | | | | | * fixes #22387; Undefined behavior when with hash(...) * fixes vm * fixes nimscript
* nimIoselector option (#22395)Bung2023-08-071-1/+12
| | | | | | | | | * selectors.nim: Add define to select event loop implementation * rename to nimIoselector --------- Co-authored-by: Jan Pobrislo <ccx@webprojekty.cz>
* use strictdefs for compiler (#22365)ringabout2023-08-066-10/+13
| | | | | | | | | | | | | | | * wip; use strictdefs for compiler * checkpoint * complete the chores * more fixes * first phase cleanup * Update compiler/bitsets.nim * cleanup
* fixes AddressSanitizer: global-buffer-overflow in getAppFilename on windows ↵norrath-hero-cn2023-08-041-2/+2
| | | | | 10 (#22380) fixes AddressSanitizer: global-buffer-overflow
* fixes #22360; compare with the half of randMax (#22361)ringabout2023-08-021-4/+1
| | | | | * fixes #22360; compare with the half of randMax * add a test
* Fix the position of "Grey" in colors.nim (#22358)Michal Maršálek2023-08-011-2/+2
| | | Update the position of "Grey"
* fixes #22210; transform return future in try/finally properly (#22249)ringabout2023-07-211-9/+48
| | | | | | | | | | | * wip; fixes #22210; transform return future in try/finally properly * add a test case for #22210 * minor * inserts a needsCompletion flag * uses copyNimNode
* fixes #22254; fixes #22253; stricteffects bugs on recursive calls (#22294)ringabout2023-07-191-2/+3
|
* fixes #22163; use `{.push warning[BareExcept]:off.}` to override settings ↵ringabout2023-06-271-4/+8
| | | | | | | temporarily (#21390) * use `{.push warning[BareExcept]:off.}` to override settings temporarily * likewise, suppress expect
* Fix regression in `std/times` (#22155)Jake Leahy2023-06-261-2/+2
| | | | | | | * Add simple test case Just so the regression doesn't happen again * Specify initDateTime is gcsafe in the forward declarations
* fix #20023 hash for generic tables (#20346)Bung2023-06-211-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | * fix #20023 hash for generic tables * use default computation * Update lib/pure/collections/tables.nim Co-authored-by: Dan Rose <dan@digilabs.io> * Update lib/pure/collections/tables.nim Co-authored-by: Dan Rose <dan@digilabs.io> * Update lib/pure/collections/tables.nim * Update lib/pure/collections/tables.nim * Update t20023.nim --------- Co-authored-by: Dan Rose <dan@digilabs.io> Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* `strutils.split/rsplit` now return src on an empty sep (#22136)Zoom2023-06-211-23/+37
| | | | | | | | | | | | | | | This is a rebase of an earlier rejected PR. Following the discussion around it, this commit provides a valid output for and edge case of an empty separator for `split` and `rsplit` routines. The empty separator is interpreted as "split by no separators" and the initial string is returned. This is consistent with the behaviour of the `set[char]` version of `split`/`rsplit` routines and unifies them all. Compared to a commit merged earlier, this one has a benefit of not using assertions that will be removed in release builds and thus still not preventing possible infinite loops (which was the earlier behaviour for this edge case for separator of type `string`). Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* Amend divmod (#22131)Ryan McConnell2023-06-201-1/+6
| | | | | | | * Add Overflow checks & test adjust * Avoiding nimvm differences in tests * distinguish DivByZeroDefect
* Add divmod (#22102)Ryan McConnell2023-06-171-0/+38
| | | | | | | | | | | | | | | | | | | | | | | * Adding divmod * Adding support to VM * Wrapped C structs and funcs * Fix javascript impl * Fixing struct compat * Segregate tests, better compiletime defs * Using `inline` and switch back to `func` * Apply suggestions from code review * Explicit structures --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* use TimeInterval instead of Duration for calculating ISO week date (#22091)metagn2023-06-141-17/+30
| | | | | | | | | * use TimeInterval instead of Duration for calculating ISO week date hopefully actually fixes (space) #22059 * forward declare * explicit effects
* fix timezone in initDateTime for ISO week date (#22090)metagn2023-06-131-1/+1
| | | fixes #22059
* Update browsers.nim, fix openDefaultBrowser()'s bug (#22052)litlighilit2023-06-091-5/+10
| | | | | | modified to fix blank page fault. see openDefaultBrowser() The previous implement use "http:about:blank" which will be processed by "prepare" and be considered as a file path, turning to "file://...", which is no doubt beyond expectation. To fix it,firstly the "about:blank" is used instead. Next, a new "openDefaultBrowserImplPrep" proc is added, take place of the previous version of "openDefaultBrowserImpl"
* fixes overriden typo (#22044)ringabout2023-06-081-1/+1
|
* small fixes for atomicArc (#22017)ringabout2023-06-064-5/+5
| | | | | * small fixes for atomicArc * Update lib/system/arc.nim
* post expr blocks colon fix + correct grammar (#21983)metagn2023-06-061-2/+2
| | | | | | | | | | | | | | | * post expr blocks colon fix + correct grammar fixes #21982 * fix dochelpers * this is remarkably common * use head for unchained * fix atlas * final grammar fix
* handle out of range value for `COLUMNS` / `LINES` (#21968)Etan Kissling2023-05-311-2/+2
| | | | | | | | | * handle out of range value for `COLUMNS` / `LINES` Querying terminal size may fail with a `ValueError` if size is too big. Return highest possible value instead. Note that `ValueError` is also reported on underflow (negative size) but that is out of POSIX specs. * `parseSaturatedNatural`
* make `proc` not implicitly convert to `pointer` with a preview define (#21953)metagn2023-05-301-1/+1
| | | | | | | | | * test `proc` not converting to `pointer` * ignore define for now to test * remove cstring * fixes, changelog
* alternative to #21914; split, rsplit now forbid an empty separator (#21961)ringabout2023-05-301-4/+22
|
* fixes #21734; backport (#21957)Andreas Rumpf2023-05-292-3/+3
|
* Suggest files and paths modules (#21950)Federico Ceratto2023-05-291-0/+1
|
* Fix documentation typo in endians.nim (#21949)Simon Krauter2023-05-281-1/+1
|
* Fix const in async regression (#21898)Jake Leahy2023-05-251-7/+5
| | | | | | | | | * Add test case for a const being used inside an async proc * Use `typeof` to get the type of the block instead of overloaded templates This removes the problem with the symbol having different types I am unsure why I didn't use this in the first place. IIRC I had problems with `typeof` when I first tried to use it in the original implementation
* Improve times (#21901)Juan Carlos2023-05-241-12/+21
| | | | | * . * Improve times
* js -r defines nodejs & program result undeclared if unavailable (#21849)metagn2023-05-241-0/+6
| | | | | | | | | | | * js -r defines nodejs & program result undefined if unavailable fixes #16985, fixes #16074 * fix * add changelog too * minor word change
* fix #21251 Compiler SIGSEGV when using SharedTable (#21876)Bung2023-05-233-8/+7
| | | fix #21251
* Weekday parse/format (replacement) (#21857)Carlo Capocasa2023-05-211-30/+110
| | | | | * parsing capability for iso week year * remove outdated test
* Update threadpool.nim with correct link to typedthreads module (#21865)noah edward hall2023-05-191-1/+1
|
* Add `minmax` to comparisons (#21820)Matt Wilson2023-05-121-0/+9
| | | | | | | | | | | | | | * Add `minmax` to sequtils This adds a `minmax` proc to complement `min` and `max`; it computes both results in a single pass for efficiency. * Update lib/pure/collections/sequtils.nim * Add minmax note to changelog. --------- Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
* clean up SOME pending/xxx/issue link comments (#21826)metagn2023-05-111-7/+5
| | | | | * clean up SOME pending/xxx/issue link comments * great
* fix #9423 followup #17594: distinct generics now work in VM (#21816)ringabout2023-05-101-7/+1
| | | | | | | | | * fix #9423 distinct generics now work in vm * fixes cpp tests --------- Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fixes #21792; enable checks for sum, prod, cumsummed and cumsum (#21793)ringabout2023-05-051-60/+63
| | | | | | | * enable checks for sum, prod, cumsummed and cumsum * fixes #21792 * add test cases
* build documentation for `checksums/md5` and `checksums/sha1` (#21791)ringabout2023-05-042-2/+2
| | | | | * build documentation for md5 and sha1 * fixes documentation reference
* line info for strformat + fix issue with typed templates (#21761)metagn2023-05-021-8/+22
| | | | | * line info in strformat * also fix #20381