Commit Graph

112 Commits

Author SHA1 Message Date
Andrey Makarov
19ff746916 Markdown code blocks migration part 7 (#20547) 2022-10-12 16:13:43 +02:00
Andrey Makarov
088487f652 Implement Markdown definition lists (+ migration) (#20333)
Implements definition lists Markdown extension adopted in a few
implementations including:
* [Pandoc](
  https://pandoc.org/MANUAL.html#definition-lists)
* [kramdown](
  https://kramdown.gettalong.org/quickref.html#definition-lists)
* [PHP extra Markdown](
  https://michelf.ca/projects/php-markdown/extra/#def-list)

Also affected files have been migrated.
RST definition lists are turned off for Markdown: this solves the
problem of broken formatting mentioned in
https://github.com/nim-lang/Nim/pull/20292.
2022-09-11 13:52:43 -04:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
Andreas Rumpf
e0ef859130 strict effects (#18777)
* fixes #17369
* megatest is green for --cpu:arm64
* docgen output includes more tags/raises
* implemented 'effectsOf' 
* algorithm.nim: uses new effectsOf annotation
* closes #18376
* closes #17475
* closes #13905
* allow effectsOf: [a, b]
* added a test case
* parameters that are not ours cannot be declared as .effectsOf
* documentation
* manual: added the 'sort' example
* bootstrap with the new better options
2021-09-02 12:10:14 +02:00
Timothee Cour
4a7f2c386c close #16569: deprecated reversed(a, start, last) overload, use toOpenArray instead (#18047)
* close #16569: deprecated reversed overload, use toOpenArray instead

* [skip ci] change wording in changelog per review

* fixup
2021-05-30 22:37:21 +02:00
flywind
28221e8a33 followup #16182 (#17472)
* fix nim js cmp fails at CT

* followup #16182
2021-03-23 20:18:36 +01:00
flywind
c719d79d23 add algorithm.merge (#16182)
* add merge to algorithm
* Apply suggestions from code review
* Update lib/pure/algorithm.nim
* Apply suggestions from code review
* Update changelog.md

Co-authored-by: ee7 <45465154+ee7@users.noreply.github.com>
2021-03-23 10:49:02 +01:00
flywind
5670b848cb use .. warning:: (#17226)
* remove unnecessary when statement

* remove outdated codes

* use warnings
2021-03-04 11:34:55 +01:00
flywind
39230422d0 make style consistent (#16944) 2021-02-05 19:58:26 +01:00
konsumlamm
2eccef7ad6 Algorithm improvements (#16529)
* Improve documentation for algorithm

Remove unused import in algorithm tests
Improve formatting

* Reapply fix for reverse on empty openArray

* Use 3rd person singular

Add more explanations.
2021-01-02 20:28:59 +01:00
flywind
735c06d7f1 small runnableExamples changes (#16181) 2020-11-30 10:18:47 +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
shirleyquirk
218acfe367 fixes #10456,#12928 issues when chaining templates to sortedByIt (#15734)
* update c_malloc's to csize_t 

fix for broken --os:ios

* I'm an idiot sorry

* Create talgorithm.nim

* workaround for #10456

I don't understand the intricacies of how lambdalifting and template expansions interact with lent, so i don't know how to fix the real problem, but this sidesteps whatever issue that is.

* working test, use typeof rather than auto
2020-10-27 12:38:46 +00:00
Andreas Rumpf
da29222f86 init checks and 'out' parameters (#14521)
* I don't care about observable stores
* enforce explicit initializations
* cleaner code for the stdlib
* stdlib: use explicit initializations
* make tests green
* algorithm.nim: set result explicitly
* remove out parameters and bring the PR into a mergable state
* updated the changelog
2020-06-23 10:53:57 +02:00
Miran
e7f280bd26 Remove deprecated stuff from stdlib (#14699)
* update to the latest Jester

* remove deprecated procs from some stdlib modules

* 'criterion' is not maintained anymore and relies on obsolete stuff
2020-06-17 15:25:02 +02:00
Andreas Rumpf
d9e907c0e2 fixes #14079 [backport:1.2] (#14163) 2020-04-29 21:58:59 +02:00
Jacek Sieka
7d6cbf290a Error -> Defect for defects (#13908)
* Error -> Defect for defects

The distinction between Error and Defect is subjective,
context-dependent and somewhat arbitrary, so when looking at an
exception, it's hard to guess what it is - this happens often when
looking at a `raises` list _without_ opening the corresponding
definition and digging through layers of inheritance.

With the help of a little consistency in naming, it's at least possible
to start disentangling the two error types and the standard lib can set
a good example here.
2020-04-28 19:56:01 +02:00
narimiran
36d1ad39d0 [backport] fix #13352 2020-02-07 18:26:08 +01:00
Jjp137
93461aee34 Fix many broken links
Note that contrary to what docgen.rst currently says, the ids have
to match exactly or else most web browsers will not jump to the
intended symbol.
2019-10-22 17:59:12 -07:00
Andreas Rumpf
60d64d1aef use system.move instead of system.shallowCopy if the GC mode requires it 2019-10-04 09:48:45 +02:00
narimiran
6c994b2498 [backport] run nimpretty on numbers stuff 2019-09-30 13:58:05 +02:00
Araq
c94647aeca styleCheck: make the compiler and large parts of the stdlib compatible with --styleCheck:error 2019-07-10 12:42:41 +02:00
LemonBoy
7d217a71d3 Render deprecated pragmas (#8886)
* Render deprecated pragmas
* fix the expected html
* clean up the documentation regarding deprecations
* fix typo
* fix system.nim
* fix random
2019-06-03 10:15:20 +02:00
Federico Ceratto
51c43218c9 Comment on isSorted complexity. (#10686) [ci skip] 2019-02-16 15:56:26 +01:00
Thomas T. Jarløv
f9a0eaf89d better docs: algorithm (#10372) 2019-01-24 10:28:07 +01:00
Konstantin Molchanov
fde4a086c5 8684 add shortcut sort procs (#9174)
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
* Stdlib: Algorithm: Add shortcut versions of sort, sorted, and isSorted procs.
* Add tests for sort, sorted, and isSorted procs from algorithm module.
* Merge sort tests into tsortcall.nim, remove tsort.nim.
2018-10-11 22:51:23 +02:00
Miran
47828efe32 better docs for algorithm module (#9192)
* better docs for `algorithm` module

* address the comments

* small first letter in the first sentence
* last argument is reverted to be `int`
* `rotateLeft` keeps `discardable` pragma, as discussed on IRC

* another small correction
2018-10-09 21:36:51 +02:00
Kaushal Modi
c0266e1afa Fix typo in an algorithm runnableExamples (#9260)
Fixes the 'koch docs' build failure.

Ref:
b90b45b01b
2018-10-09 15:36:36 +02:00
pqflx3
b90b45b01b Add algorithm.[sort,sorted,isSorted] overloads using 'system.cmp'. (#8778)
* Add algorithm.[sort,sorted,isSorted] overloads using 'system.cmp'. Fixes 8684.

* Change signatures to 'func'. Improve overload sort doc comments
2018-10-09 13:25:25 +02:00
Dmitry Atamanov
a075a912cf Add algorithm.upperBound (#7851)
* Add algorithm.upperBound
* Docs updated
2018-05-29 07:28:15 +03:00
data-man
17b8bb8b47 Fixes binarySearch's bug 2018-05-23 12:58:26 +03:00
data-man
a093605ab0 binarySearch became even better 2018-05-23 12:40:55 +03:00
data-man
39a1ad650c Faster binarySearch 2018-05-23 08:42:22 +03:00
Dmitry Atamanov
90afb1baa7 binarySearch improvements (#7850) 2018-05-20 20:11:25 +02:00
Araq
4b3ad4f00c keep algorithm.nim warning free 2018-05-18 01:35:09 +02:00
Andreas Rumpf
272bbad784 Merge branch 'devel' into araq-parser-fixes 2018-05-06 08:03:29 +02:00
Araq
bbb0fd4eb7 remove deprecated stuff from the stdlib; introduce better deprecation warnings 2018-05-05 21:45:07 +02:00
Andreas Rumpf
1aa359febb warn about inconsistent spacing around binary operators; fixes #7582 2018-05-05 14:58:33 +02:00
Arne Döring
6f4ca3f276 test binarySearch, fix for search in empty. (#7769) 2018-05-04 15:29:21 +02:00
Arne Döring
f94fafff9b Deprecate smart binary search (#7745)
* deprecate smartBinarySearch

* changelog entry
2018-05-03 17:23:13 +02:00
Oscar Nihlgård
34df046d37 Fix algorithm.fill for empty input 2018-04-04 13:02:14 +02:00
Oscar Nihlgård
da077eea7c Move algorithm tests away from koch 2018-04-04 13:00:51 +02:00
Yuriy Glukhov
5ea80b43b1 More flexible lowerBound interface (#7344) 2018-03-16 16:22:45 +01:00
Araq
e3b6ee85b3 algorithm.nim: change formatting to Nim's defaults 2018-03-05 13:20:50 +01:00
Andreas Rumpf
b14cc1e3b2 fixes #6631 2017-10-30 14:45:57 +01:00
Andreas Rumpf
a62051e304 updated algorithm.rotateLeft implementation 2017-10-30 08:42:44 +01:00
Arne Döring
484f729e27 use doAssert in rotateLeft example 2017-08-17 13:34:03 +02:00
Arne Döring
efe606ef81 fix for feedback on PR 2017-08-14 13:55:38 +02:00
Arne Döring
316886542b allow a negative distance argument. Improved documentation. 2017-07-27 18:22:59 +02:00
Arne Döring
409854c913 changed rotate to rotateLeft with slice api 2017-07-27 17:40:33 +02:00