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:
parent
f091b5a0ee
commit
d55bbefdcc
4 changed files with 145 additions and 27 deletions
14
changelog.md
14
changelog.md
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue