Commit Graph

5318 Commits

Author SHA1 Message Date
gecko
7af484da94 Add client.close() in httpclient examples. (#20118)
Without this, the httpclient examples are essentially setting you up for failure. I was bitten by this when my app became unable to open any more sockets.

I'm not entirely sure how long this will relevant, as I hope destructors will be added to an upcoming version of the stdlib. But figured it was worth submitting anyways!
2022-08-04 06:46:08 +02:00
ringabout
59befed8ee prevent cache thrashing (#20129)
* prevent cache thrash

Co-authored-by: Charles Blake <cb@cblake.net>

* Update lib/pure/random.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: Charles Blake <cb@cblake.net>
Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-08-02 00:06:27 +08:00
Clay Sweetser
77891cedae Fix "Add Wider Ascii Chars sets and func for string formatting" (#20120) 2022-07-31 23:24:14 -04:00
Sultan Al Isaiee
3987a3bf97 Add Wider Ascii Chars sets and func for string formatting (#19994)
* Add more Ascii Chars sets

- add UpperCaseLetters set
- add LowerCaseLetters set
- add Punctuations set
- add PrintablesNoWhiteSpace set
- add Printables set
- add isPunctuationAscii func
- add isPrintableAscii func

* Omit isPunctuationAscii and isPrintableAscii procs

* Apply suggestions for adding Wider Ascii Chars sets

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>

* Update strutils.nim

Co-authored-by: Clay Sweetser <Varriount@users.noreply.github.com>
2022-07-31 20:20:25 -04:00
ringabout
a8590d6707 [ORC] replace threadpool with createThread in the runnableExamples (#20106)
replace threadpool with createThreads in the runnableExamples
2022-07-31 20:02:23 -04:00
ringabout
4c46358db1 remove shallowCopy for ARC/ORC (#20070)
* remove shallowCopy for ARC/ORC

* use move

* fix

* more fixes

* typo

* Update lib/system.nim

* follow

* add nodestroy

* move

* copy string

* add a changelog entry

Co-authored-by: xflywind <43030857+xflywind@users.noreply.github.com>
Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
2022-07-26 16:51:01 +02:00
ringabout
1c39af3389 fixes #20089; remove setPointer since strings/seqs are not pointers with ORC (#20090)
fixes #20089; remove setPointer since strings/seqs are not pointers anymore
2022-07-26 16:48:01 +02:00
flywind
d934ba9326 replace shallowcopy with move in ARC/ORC (#20061) 2022-07-18 21:23:39 +02:00
Antonis Geralis
f34734ffb4 Improve rand(bool) (#20045)
* Improve rand(bool)

* Use sign test instead of mod 2

* Use mod 2 again, as it works for js

* Use right shift as suggested by the authors of xoroshiro

* Update random.nim

* General case doesn't need any right shift it was correct to begin with

* Update random.nim

* add comment

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-07-18 21:18:12 +02:00
LetThereBeLemons
f443bece06 Fixed typo in std/os doc (#20054)
Fixed typo
2022-07-18 14:20:30 +08:00
kraptor
8679464e49 Display protocol name in exceptions raised by getProtoByName() (#19808) 2022-07-16 17:44:14 -04:00
Amjad Ben Hedhili
cf78c02b70 Make random.rand work with Ordinal (#20043)
* Make `random.rand` work with `Ordinal`

* Add changelog entry

* It's fine to cast to char
2022-07-16 16:51:27 -04:00
David Krause
60dd38c502 make AsyncSocket.getPeerAddr work ; fix #15022 (#20038)
Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
2022-07-16 10:59:58 +01:00
flywind
286fcef68e [Orc] fixes "streams.readDataStr segafaults" when accepting a string literal (#20019) [backport]
fixes streams.readDataStr accept a string literal
2022-07-15 09:42:54 +02:00
silent-observer
93211a2bdd Add sink and lent annotations to the critbits module (#20021)
* 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
2022-07-14 12:03:16 +02:00
Juan M Gómez
a90763ebd7 Fixes Compilation error with --app:lib (#19965)
Fixes Compilation error with --app:lib  when a module tries to pull os.paramStr on posix by throwing a runtime exception instead. 
More details here: #19964
2022-07-10 15:40:26 +02:00
Daniel Clarke
01b40dc1d7 Fixes return values of execCmd on macos (#19963)
* Fixes return values of execCmd on macos

* update tests to use existing structure

Co-authored-by: daniel <danielclarke@wearepopgun.com>
2022-07-05 22:29:05 +02:00
Carlo Capocasa
e2e663a143 Friendlier error message with solution (#19880)
* Add helpful suggestion, should always apply

* mention var param limitation in async docs

* Update compiler/lambdalifting.nim

whoops thanks

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>

Co-authored-by: flywind <43030857+xflywind@users.noreply.github.com>
2022-06-11 18:23:31 +02:00
Zoom
b024a45163 Fix find routines' api to default to last=-1 (#19761)
This changes the default for the `last` parameter of various `find`
routines from `0` to `-1`. Previous default prevents limiting the search
to the first character. This is a logic error, as full text search was
performed for 2 *valid* values of `last`: `0` and `last.high()`.

Adds an overload for `initSkipTable` which returns a newly initialized
table. This encapsulates every single usage of a `var`-acting original
func in this module.

Co-authored-by: flywind <xzsflywind@gmail.com>
2022-06-07 10:35:06 +02:00
Andrey Makarov
4341b06f65 RST: improve simple tables (#19859)
* RST: improve simple tables

* nim 1.0 gotchas

* Still allow legacy boundaries like `----`
2022-06-04 07:03:03 +02:00
Alfred Morgan
15f0b48676 Zectbumo fixes 19824 (#19825)
* borrowed `$` to make Time string friendly

* added sep character parameter

* Revert "added sep character parameter"

This reverts commit 45f4b019a4.

* added sep character parameter

* Revert "borrowed `$` to make Time string friendly"

This reverts commit 10e2e44c9a.

* added uri tests and made changelong entry

* Update lib/pure/uri.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update lib/pure/uri.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update tests/stdlib/turi.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

* Update tests/stdlib/turi.nim

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>

Co-authored-by: konsumlamm <44230978+konsumlamm@users.noreply.github.com>
2022-05-30 12:09:18 +02:00
Anthony Dario
19001c070b Fix typo in sequtils documentation (#19789)
Found another small typo.
2022-05-13 11:19:42 +08:00
Alfred Morgan
b9f243eb2a string is missing formatting when calling fmt (#19780)
it appears the documentation intends to compare & with .fmt but there is no formatting in the string. even though the assert is true it doesn't quite prove that .fmt is an equivalent formatter.
2022-05-10 17:45:57 +02:00
Zoom
0455d24d55 Fix questionable suggestion in strutils docs (#19765)
* Fix questionable suggestion in `stutils` docs

- Removes the recommendation to pass a string slice for getting a relative
index for `find` and `rfind` functions, as this currently makes a string
copy, while a simple subtraction is enough.

- Docstring for `SkipTable` type.

* Doc layout fixup
2022-05-06 11:19:27 +02:00
Anthony Dario
a4401054cc Fix broken link in sets documentation. (#19769) 2022-05-06 17:16:00 +08:00
huantian
927978345b Rework discarding futures documentation in asyncdispatch (#19738)
* Rework discarding futures docs in asyncdispatch

* Fix typos

Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>

* Use rst note::

Co-authored-by: flywind <xzsflywind@gmail.com>

* Split discarding and handling futures.

* Update lib/pure/asyncdispatch.nim

* Update lib/pure/asyncdispatch.nim

* Update lib/pure/asyncdispatch.nim

* Update lib/pure/asyncdispatch.nim

Co-authored-by: Danil Yarantsev <tiberiumk12@gmail.com>
Co-authored-by: flywind <xzsflywind@gmail.com>
Co-authored-by: Dominik Picheta <dominikpicheta@googlemail.com>
2022-05-02 17:06:57 +01:00
Danil Yarantsev
2f32b450d3 Really fix StringStream with ARC at compile-time, improve streams test (#19739)
* Fix compile-time StringStream with ARC

* make readDataStr work with ARC, improve test
2022-04-25 11:15:03 +02:00
huantian
02e8aa9660 Fix doc: list of async backends (#19741) 2022-04-24 10:47:39 +01:00
Jason Beetham
dc4cc2dca5 Fix string stream crashing when created on nimscript due to last fix (#19717) 2022-04-14 11:30:59 +02:00
huantian
ef7d7f2459 Better error message and tests for bad await (#19622)
* Better error message and tests for bad await

* Use compiles to check if await is valid

* temp: disable windows noasync test

* Better error report, simplify test

Co-authored-by: flywind <xzsflywind@gmail.com>
2022-04-13 23:03:46 +02:00
flywind
98cebad7de enable style:usages for stdlib tests [backport: 1.6] (#19715)
* enable style:usages for stdlib tests

* freeAddrInfo

* more tests

* importc

* bufSize

* fix more

* => parseSql and renderSql
2022-04-13 11:53:02 +02:00
Jason Beetham
26acc97864 StringStreams no longer errors when intialized with literals on arc/orc (#19708) 2022-04-11 14:27:12 +02:00
Timothee Cour
e78ef57c93 typetraits: add toSigned, toUnsigned (#18445)
* typetraits: add toSigned, toUnsigned

* improve and add tests

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
Co-authored-by: flywind <xzsflywind@gmail.com>
2022-04-07 17:38:01 -04:00
Nan Xiao
065f568470 No need to export pos from OptParser (#19688)
Co-authored-by: flywind <xzsflywind@gmail.com>
2022-04-06 20:28:58 +02:00
Nan Xiao
a7024f49af fix 19655 - fixing more url fragments (#19669) 2022-04-01 13:29:15 -04:00
rockcavera
1275763284 fix 19655 - fixing url fragment (#19667) 2022-04-01 08:01:51 +02:00
Jaremy Creechley
eae29e8eaf Embedded Network patches - eventfd & socket getters (#19632) 2022-03-28 12:37:59 +02:00
John Titor
8cdd8867c0 Fix dial ignoring buffered parameter (#19650) [backport] 2022-03-26 11:43:26 +01:00
Juan Carlos
b0bd4320a0 Remove deprecated typo poDemon (#19631)
* Remove Deprecated poDemon

* Remove Deprecated poDemon
2022-03-23 20:43:58 +01:00
flywind
7f6e800caf move assertions out of system (#19599) 2022-03-23 20:34:53 +01:00
Dominic Ward
a8b5ad845c Fix process lines iterator (#19605)
* Ensure lines when process done

* eliminate post-EOF exit test

* Recommend fixes for execCmdEx/execProcess
2022-03-23 07:50:36 +01:00
Juan Carlos
7a50d66346 Removed deprecated httpcore func (#19550)
* Remove Deprecated httpcore func

* Remove Deprecated httpcore func

* Fix a test with Deprecated func

* Restart CI, Apple can code shit anymore I tell you
2022-03-18 07:54:20 +01:00
flywind
8f9dd5b349 register callback for marshal in VM (#19578)
* register callback for marshal in VM

* remove unrelated code

* polish

* more tests

* more tests

* add loadVM and toVM
2022-03-08 18:12:31 +01:00
Sizhe Zhao
b2c5d7b4ff Documentation: Fix word usage (#19529) 2022-02-14 22:15:59 +00:00
Juan Carlos
8e8231f9d6 Remove deprecated math.c_frexp (#19518)
* Remove Deprecated math proc

* Remove Deprecated math proc

* Remove Deprecated math proc
2022-02-14 14:35:33 +01:00
Juan Carlos
42eeab5fd1 Remove Deprecated oids.oidsToString (#19519)
* Remove deprecated oids.oidToString

* Remove deprecated oids.oidToString
2022-02-14 09:09:21 +01:00
David Krause
cda77c1520 use OrderedTable instead of OrderedTableRef for mimedb (#19522)
* use OrderedTable instead of OrderedTableRef for mimedb

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>

* added changelog entry for mimedb change

Signed-off-by: David Krause <enthus1ast@users.noreply.github.com>
2022-02-14 08:56:35 +01:00
konsumlamm
551225d888 Remove backslash in glob pattern (#19524) 2022-02-14 08:50:38 +01:00
flywind
891329cd4b move io out of system (#19442)
* move io out of system

* fix tests

* fix tests

* next step

* rename to syncio

* rename

* fix nimscript

* comma

* fix

* fix parts of errors

* good for now

* fix test
2022-02-02 17:10:11 +01:00
ehmry
f7c4fb0014 os: faster getFileSize (#19438)
Use "stat" rather than "open", "seek", and "close" system calls.
The Windows implementation remains the same.
2022-01-24 20:57:37 +01:00