wrapnils: add ??. which returns an Option (#16931)

* wrapnils: add option-like API with ??., isSome, get
* fix test after rebase
* cleanups
* fix changelog
* address comments regarding get vs unsafeGet
This commit is contained in:
Timothee Cour 2021-02-24 05:02:32 -08:00 • committed by GitHub
commit 8942586fa6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 73 additions and 67 deletions

View file

@ -149,9 +149,11 @@ provided by the operating system.
- Added experimental `linenoise.readLineStatus` to get line and status (e.g. ctrl-D or ctrl-C).
- Added `compilesettings.SingleValueSetting.libPath`
- `std/wrapnils` doesn't use `experimental:dotOperators` anymore, avoiding
issues like https://github.com/nim-lang/Nim/issues/13063 (which affected error messages)
for modules importing `std/wrapnils`.
Added `??.` macro which returns an `Option`.
- Added `math.frexp` overload procs. Deprecated `c_frexp`, use `frexp` instead.
@ -174,6 +176,8 @@ provided by the operating system.
- Added `strip` and `setSlice` to `std/strbasics`.
- Added to `wrapnils` an option-like API via `??.`, `isSome`, `get`.
## Language changes
- `nimscript` now handles `except Exception as e`.