summary refs log tree commit diff stats
path: root/lib/pure/options.nim
Commit message (Collapse)AuthorAgeFilesLines
* Change `UnpackError` with `UnpackDefect` (#14457)Ivan Bobev2020-05-271-6/+6
| | | | | | | | | | | | | | | | | | * Change `UnpackError` with `UnpackDefect` The deprecation warning for `UnpackError` exception raised by some `inline` procedures in the Nim standard library propagates to the user code. If the user code has a requirement for building without warnings this is a problem for the successful execution of the tests. In order to resolve this, all occurrences of `UnpackError` in the Nim code base are changed to `UnpackDefect`. Only the type alias is retained to not break other people's user code since `UnpackError` is exported type. * Remove the catching of `UnpackDefect` Defect exceptions should not be cached, because they indicate problem in the API usage. The code in `nimblesocket.nim` is rewritten to first check whether there is a value set into the `knownDomain` variable from the `Option` type before usage.
* make get for options use lent T (#14442)cooldome2020-05-251-2/+2
| | | Co-authored-by: cooldome <ariabushenko@bk.ru>
* The whole options module should be inline (#14417) [backport:1.2]Mamy Ratsimbazafy2020-05-211-15/+14
| | | | | | | * The whole options module should be inline * Use inline per proc and tag `lent` where appropriate * Remove lent annotation (failing at compiletime)
* Error -> Defect for defects (#13908)Jacek Sieka2020-04-281-3/+3
| | | | | | | | | | | | | | * Error -> Defect for defects The distinction between Error and Defect is subjective, context-dependent and somewhat arbitrary, so when looking at an exception, it's hard to guess what it is - this happens often when looking at a `raises` list _without_ opening the corresponding definition and digging through layers of inheritance. With the help of a little consistency in naming, it's at least possible to start disentangling the two error types and the standard lib can set a good example here.
* Consider proc as a pointer type in options (#13460)hlaaftana2020-02-211-3/+12
| | | | | | | | * Consider proc as a pointer type in options * Add version annotation for SomePointer having proc in options * Log procs as pointers for options in changelog
* [backport] run nimpretty on the remaining filesnarimiran2019-09-301-2/+3
|
* Prevent options from calling custom ref == operators (#10745)Yuriy Glukhov2019-02-261-3/+18
|
* better docs: options (#10720)Miran2019-02-221-54/+226
|
* Make options.UnpackError inherit from system.DefectOscar Nihlgård2018-12-081-19/+15
|
* fixes #8658; addQuoted on Option[T] (#8659)Arne Döring2018-08-171-3/+5
|
* Adds get for Option[T]. (#8462)Dominik Picheta2018-08-141-1/+8
|
* Fixed $ on None[T] for T with .name (#8293)Quelklef2018-07-121-1/+15
|
* options: use isSome (#7782)alaviss2018-05-061-4/+4
| | | Fixes #7780
* Add none[T]() as alias to none(T) (#7512)hlaaf2018-04-161-0/+8
| | | | | | | | * Add none[T]() as alias to none(T) * Add tests for none[T] * this test shouldn't work anyway
* option optimization (#6253)Arne Döring2018-04-111-15/+49
|
* Fix documentation for the `$` proc on an option (#6449)Euan T2017-10-021-1/+4
|
* Add flatMap operator to Options (#6404)Zach Smith2017-09-271-24/+57
| | | | | | | | | | | | * Add >>= operator to Options * options.bind callback signature: A -> Option[B] * Use `flatMap` as the name of the Option bind operation. * Rename Options test "bind" to "flatMap" * CR from @dom96: Remove spaces inside of check() call
* Fix options module to use new import namedef2015-11-231-2/+2
|
* Extend option functionalityNycto2015-09-231-1/+63
|
* Rename optionals module to optionsFlaviu Tamas2015-05-261-0/+160