diff --git a/doc/lib.rst b/doc/lib.rst index c01e6df535383..47ede70ee8c7e 100644 --- a/doc/lib.rst +++ b/doc/lib.rst @@ -85,10 +85,16 @@ Algorithms * `algorithm `_ This module implements some common generic algorithms like sort or binary search. +* `std/enumutils `_ + This module adds functionality for the built-in ``enum`` type. + * `sequtils `_ This module implements operations for the built-in ``seq`` type which were inspired by functional programming languages. +* `std/setutils `_ + This module adds functionality for the built-in ``set`` type. + Collections ----------- @@ -120,12 +126,6 @@ Collections * `sets `_ Nim hash and bit set support. -* `std/setutils `_ - This module adds functionality for the built-in ``set`` type. - -* `std/enumutils `_ - This module adds functionality for the built-in ``enum`` type. - * `sharedlist `_ Nim shared linked list support. Contains a shared singly-linked list. diff --git a/lib/pure/typetraits.nim b/lib/pure/typetraits.nim index 38c22feb300d0..888168cb7408a 100644 --- a/lib/pure/typetraits.nim +++ b/lib/pure/typetraits.nim @@ -15,7 +15,7 @@ import std/private/since export system.`$` # for backward compatibility -type SomeSparseEnum* = (not Ordinal) and enum ## sparse enum's, a.k.a enum with holes +type SomeSparseEnum* = (not Ordinal) and enum ## Sparse enum's, a.k.a enum with holes. #[ xxx `runnableExamples` isn't run if inside: diff --git a/lib/std/enumutils.nim b/lib/std/enumutils.nim index 4ddd1a41e3d37..fd8fe99bb3ed6 100644 --- a/lib/std/enumutils.nim +++ b/lib/std/enumutils.nim @@ -69,7 +69,7 @@ macro sparseEnumFullRange(a: typed): untyped = newNimNode(nnkCurly).add(a.getType[1][1..^1]) iterator items*[T: enum and not Ordinal](E: typedesc[T]): T = - ## iterates over a sparse enum + ## Iterates over a sparse enum. runnableExamples: type A = enum a0 = 2, a1 = 4, a2 type B[T] = enum b0 = 2, b1 = 4