added operateOn to sugar.nim to give Nim the chaining mechanism it de… (#13092)

* implemented the with stdlib module as specified in https://github.com/nim-lang/RFCs/issues/193
* change sugar.outplace to sugar.dup according to https://github.com/nim-lang/RFCs/issues/193
* changelog update
This commit is contained in:
Andreas Rumpf 2020-02-26 20:36:06 +01:00 • committed by GitHub
commit d55bbefdcc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 145 additions and 27 deletions

View file

@ -52,7 +52,7 @@
`CountTable.pop`, `Table.pop`
- To `strtabs.nim`, added `StringTable.clear` overload that reuses the existing mode.
- Added `browsers.osOpen` const alias for the operating system specific *"open"* command.
- Added `sugar.outplace` for turning in-place algorithms like `sort` and `shuffle` into
- Added `sugar.dup` for turning in-place algorithms like `sort` and `shuffle` into
operations that work on a copy of the data and return the mutated copy. As the existing
`sorted` does.
- Added `sugar.collect` that does comprehension for seq/set/table collections.
@ -71,6 +71,18 @@
- Added `resetOutputFormatters` to `unittest`
- Added a `with` macro for easy function chaining that's available
everywhere, there is no need to concern your APIs with returning the first argument
to enable "chaining", instead use the dedicated macro `with` that
was designed for it. For example:
```nim
```
## Library changes
- `asynchttpserver` added an iterator that allows the request body to be read in