summary refs log tree commit diff stats
path: root/lib
Commit message (Collapse)AuthorAgeFilesLines
* add custom pragma support for var and let symbols (#9582)jcosborn2019-01-071-1/+7
| | | | | | * add custom pragma support for var and let symbols * updated changelog for custom pragmas on var and let symbols * add oldast switch for backwards compatibility
* os.execShellCmd: use WEXITSTATUS to retrieve exit code (#10222)alaviss2019-01-071-1/+1
| | | | | | | According to POSIX, system() shall returns the termination status in the format specified by waitpid(), which means WEXITSTATUS should be used to retrieve the exit code portably. This fixes execShellCmd on Haiku.
* remove deprecated modules (#10215)Miran2019-01-079-1088/+0
| | | | | | | | | | | | | | | | | | * removed from `compiler`: * lists (deprecated 2 years ago) * removed from `lib` (all deprecated 3 years ago): * ssl * matchers * httpserver * removed from `lib/deprecated`: * unsigned * actors (and three accompanying tests) * parseurl * moved to `lib/deprecated`: * securehash (the reason for not directly removing - it was deprecated (only) one year ago)
* Added examples to strtabs module (#10160)Ico Doornekamp2019-01-071-0/+31
|
* Fix ODBC SQL Error string decoding (#10207) [backport]Leonardo Cecchi2019-01-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | ODBC Errors were presented to the users as a sequence of characters. I.e.: >test_oracle.exe Error: ['H', 'Y', '0', '0', '0', '\x00', '\x00', ...] test_oracle.nim(15) test_oracle test_oracle.nim(8) test_oracle db_odbc.nim(534) open db_odbc.nim(168) dbError Error: unhandled exception: ODBC Error [DbError] This patch fix the string decoding, creating a real string: >test_oracle.exe Error: HY000 [Oracle][ODBC][Ora]ORA-12541: TNS:no listener test_oracle.nim(15) test_oracle test_oracle.nim(8) test_oracle db_odbc.nim(534) open db_odbc.nim(168) dbError Error: unhandled exception: ODBC Error [DbError]
* Remove totally unneeded import of hashes. (#10221)c-blake2019-01-073-3/+3
|
* Fix getAddrInfo, add IPPROTO_ICMPV6 Closes #10198Federico Ceratto2019-01-064-2/+8
|
* * move up runnableExamples definition so can be used more in system.nim (#10196)Timothee Cour2019-01-051-28/+30
| | | | * document that toInt, toBiggestInt round towards 0 and add runnableExamples * minor doc fixes
* Fix the tuple returned by `os.splitFile()` in documentation (#10197)Hugo Locurcio2019-01-051-1/+1
|
* fix system.nim documentations (#10168)alaviss2019-01-042-4/+4
| | | | | * system: fix nimGC_getStackBottom doc * system/helpers: avoid leaking docs to system
* expandFilename on windows is now consistent with other platforms (#10154)Neelesh Chandola2019-01-041-42/+48
|
* Guard against null exception (#10162)rec2019-01-041-1/+1
|
* fix bug in doAssertRaises when exception==Exception (#10172)Timothee Cour2019-01-041-11/+19
| | | | | * fix bug in doAssertRaises when exception==Exception * add testcase for doAssertRaises
* [backport] improve unicode docs, fixes #2353 (#10174)Miran2019-01-041-85/+122
| | | | | | | | * as instructed in #2353, provides a short description why there are no specialized procs for seq[Rune] * adds several examples to better explain what some functions do * small fixes (double backticks, add missing dots, etc.) * use `rune` instead of "unicode characer"
* [backport] correctly document `toInt`, fixes #2764 [ci skip] (#10176)Miran2019-01-041-4/+6
|
* Add {.noReturn.} to system.raiseAssert (#10161)Oscar Nihlgård2019-01-021-1/+1
|
* Add Example code to Documentation comment of wordWrap proc. (#10146)jiro2019-01-011-0/+5
|
* Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? (#10084)c-blake2018-12-312-21/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Resolve things raised in https://github.com/nim-lang/Nim/issues/10081 ? CDF is a standard ident in all things related to random numbers/sampling, and full words "cumulativeDistributionFunction" would be silly long, in this case, IMO. We use lowercase `cdf` to make it not look like a type, remove all looping from `sample` letting callers do it. Besides just side-stepping any `sampleSize` name choice, callers may want to filter out samples anyway which this makes slightly simpler. Also add two variants of `cumsum`, value return and in-place update distinguished by the var-ness of the first argument. Add tests for `int` and `float` for both `cumsum` and the new `sample`. (The sample tests exercise the value return mode of `cumsum`.) Functionality pre-this-PR `sample(a, w)` is now the almost as simple `for i in 0..<n: sample(a, w.cumsum)`, but this new code factoring is almost surely better. The statistical tests pass, as before. * Address Araq comment in https://github.com/nim-lang/Nim/pull/10084 We can always add in some `var` version later if desired to save memory, but this change now at least firms up the `sample` interface. * Rename `cumsum` -> `cumsummed` to honor NEP1 style. Re-instate `cumsum` as the in-place transformation. Test both in `tests/stdlib/tmath.nim` and use `cumsummed` in the example code for sample since that's a simpler example. * Fix requests from https://github.com/nim-lang/Nim/pull/10084 : example in lib/pure/math.nim and comment whitespace in lib/pure/random.nim
* help Nim optimize intsets.initIntSetAndreas Rumpf2018-12-301-8/+7
|
* Dead code elimination for entire modules and their init procs if empty (#10032)cooldome2018-12-301-6/+3
| | | | | | * fixes #9798 * Change order of write modules * Move datInit calls ahead of initStackBottom
* fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84 ↵Timothee Cour2018-12-301-0/+2
| | | | | | | (#10131) * fix typetraits.`$` regression https://github.com/c-blake/cligen/issues/84 * add test
* Support undefined in isNil (#9960)Alexander Ivanov2018-12-301-0/+6
|
* refs #10121 (#10124)Timothee Cour2018-12-301-1/+2
|
* revives: Move typetraits.`$` to system. Fixes #5827 (#10071)Timothee Cour2018-12-302-24/+29
| | | | | | * Move typetraits.`$` to system. Fixes #5827. * revive PR; adjust code to make sure everything works and add tests * fix tests/concepts/tstackconcept.nim * address comments
* `checkErr` now shows actual system error msg instead of unknown error (#9987)Timothee Cour2018-12-271-3/+14
|
* Fixes long-standing asynchttpserver regression. (#10102)Dominik Picheta2018-12-271-21/+27
|
* Revert sub-second randomize(). Fixes randomize for JS backend. (#10000)Dominik Picheta2018-12-271-2/+6
| | | Fixes #9999.
* Add ability to sample elements from openArray according to a weight array ↵c-blake2018-12-231-2/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | (#10072) * Add the ability to sample elements from an openArray according to a parallel array of weights/unnormalized probabilities (any sort of histogram, basically). Also add a non-thread safe version for convenience. * Address Araq comments on https://github.com/nim-lang/Nim/pull/10072 * import at top of file and space after '#'. * Put in a check for non-zero total weight. * Clarify constraint on `w`. * Rename `rand(openArray[T])` to `sample(openArray[T])` to `sample`, deprecating old name and name new (openArray[T], openArray[U]) variants `sample`. * Rename caller-provided state version of rand(openArray[T]) and also clean up doc comments. * Add test for new non-uniform array sampler. 3 sd bound makes it 99% likely that it will still pass in the future if the random number generator changes. We cannot both have a tight bound to check distribution *and* loose check to ensure resilience to RNG changes. (We cannot *guarantee* resilience, anyway. There's always a small chance any test hits a legitimate random fluctuation.)
* Don't use parseutils.parseInt in the times module (#10028)Oscar Nihlgård2018-12-221-39/+67
|
* appveyor: make the build green againAndreas Rumpf2018-12-221-3/+8
|
* IntSet documentation notes (#10051)Alexis Hope2018-12-211-19/+28
|
* Stop false positives in distros.detectOs (#10062)Taylor Hoff2018-12-211-3/+3
| | | | | | * Stop false positives in distros.nim * Fix bad string comparison on line 176 of distros.nim
* clarify doc for <= on tuple uses lexicographic order (#10069)Timothee Cour2018-12-211-4/+4
|
* Fixed insert for nil seq in js (#10068)Yuriy Glukhov2018-12-211-1/+1
|
* C++: make async tests green on WindowsAraq2018-12-211-1/+1
|
* Add system.$(HSlice) and fix #7898 (#8670)hlaaf2018-12-211-1/+11
| | | | | | * Add system.$(HSlice) and fix #7898 * Surround system.$(HSlice) with spaces
* fixes #10066Araq2018-12-211-19/+27
|
* os.walkDir: correctly evaluate paths when relative = true (#10057) [backport]alaviss2018-12-211-4/+5
|
* Add call to hostnamectl in detectOsImpl (#10048)Taylor Hoff2018-12-201-3/+4
|
* GC: avoid pathological behaviour; fixes #10040 [backport] (#10052)Andreas Rumpf2018-12-201-9/+9
|
* [json] document fact that key ordering is preserved (#10020)Timothee Cour2018-12-201-0/+7
|
* fix test failureTimothee Cour2018-12-191-2/+4
|
* fix #8255 numerous issues with splitFileTimothee Cour2018-12-191-4/+13
|
* strutils: minor code cleanupAraq2018-12-191-1/+0
|
* Update osproc.nim (#10043)Timothee Cour2018-12-191-1/+1
|
* much simpler implementation of constant tuple declarationsAndreas Rumpf2018-12-191-4/+3
|
* Const tuple unpacking (#9964)Neelesh Chandola2018-12-191-1/+2
| | | | | | | | | | * tuple unpacking is now supported for consts * Move nkConstTuple to the end of TNodeKind * Add nnkConstTuple in macros.nim * Fix Formatting
* Fixes #3060 and adds error checking for invalid else branches in object ↵Andreas Rumpf2018-12-191-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | variants (#9957) * Fix semRecordCase * Fix ftpclient.nim * Check for ordinal type * Check tyRange for exhaustiveness
| * Merge remote-tracking branch 'upstream/devel' into record-caseNeelesh Chandola2018-12-132-5/+0
| |\
| * | Fix ftpclient.nimNeelesh Chandola2018-12-131-1/+0
| | |