Fix broken links in docs (#16336)
* Fix broken links in docs * Fix rand HSlice links
This commit is contained in:
parent
e843492b13
commit
f3d57761ab
21 changed files with 126 additions and 120 deletions
|
|
@ -316,7 +316,7 @@ symbols in the `system module <system.html>`_.
|
||||||
* ``proc len[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}`` **=>**
|
* ``proc len[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}`` **=>**
|
||||||
`#len,seq[T] <system.html#len,seq[T]>`_
|
`#len,seq[T] <system.html#len,seq[T]>`_
|
||||||
* ``iterator pairs[T](a: seq[T]): tuple[key: int, val: T] {.inline.}`` **=>**
|
* ``iterator pairs[T](a: seq[T]): tuple[key: int, val: T] {.inline.}`` **=>**
|
||||||
`#pairs.i,seq[T] <system.html#pairs.i,seq[T]>`_
|
`#pairs.i,seq[T] <iterators.html#pairs.i,seq[T]>`_
|
||||||
* ``template newException[](exceptn: typedesc; message: string;
|
* ``template newException[](exceptn: typedesc; message: string;
|
||||||
parentException: ref Exception = nil): untyped`` **=>**
|
parentException: ref Exception = nil): untyped`` **=>**
|
||||||
`#newException.t,typedesc,string,ref.Exception
|
`#newException.t,typedesc,string,ref.Exception
|
||||||
|
|
|
||||||
|
|
@ -1778,7 +1778,7 @@ dereferencing operations for reference types:
|
||||||
|
|
||||||
Automatic dereferencing can be performed for the first argument of a routine
|
Automatic dereferencing can be performed for the first argument of a routine
|
||||||
call, but this is an experimental feature and is described `here
|
call, but this is an experimental feature and is described `here
|
||||||
<manual_experimental.html#type-bound-operations>`_.
|
<manual_experimental.html#automatic-dereferencing>`_.
|
||||||
|
|
||||||
In order to simplify structural type checking, recursive tuples are not valid:
|
In order to simplify structural type checking, recursive tuples are not valid:
|
||||||
|
|
||||||
|
|
@ -3653,7 +3653,7 @@ Creating closures in loops
|
||||||
Since closures capture local variables by reference it is often not wanted
|
Since closures capture local variables by reference it is often not wanted
|
||||||
behavior inside loop bodies. See `closureScope
|
behavior inside loop bodies. See `closureScope
|
||||||
<system.html#closureScope.t,untyped>`_ and `capture
|
<system.html#closureScope.t,untyped>`_ and `capture
|
||||||
<sugar.html#capture.m,openArray[typed],untyped>`_ for details on how to change this behavior.
|
<sugar.html#capture.m,varargs[typed],untyped>`_ for details on how to change this behavior.
|
||||||
|
|
||||||
Anonymous Procs
|
Anonymous Procs
|
||||||
---------------
|
---------------
|
||||||
|
|
|
||||||
|
|
@ -1315,11 +1315,11 @@ Sequence variables are initialized with ``@[]``.
|
||||||
The ``for`` statement can be used with one or two variables when used with a
|
The ``for`` statement can be used with one or two variables when used with a
|
||||||
sequence. When you use the one variable form, the variable will hold the value
|
sequence. When you use the one variable form, the variable will hold the value
|
||||||
provided by the sequence. The ``for`` statement is looping over the results
|
provided by the sequence. The ``for`` statement is looping over the results
|
||||||
from the `items() <system.html#items.i,seq[T]>`_ iterator from the `system
|
from the `items() <iterators.html#items.i,seq[T]>`_ iterator from the `system
|
||||||
<system.html>`_ module. But if you use the two-variable form, the first
|
<system.html>`_ module. But if you use the two-variable form, the first
|
||||||
variable will hold the index position and the second variable will hold the
|
variable will hold the index position and the second variable will hold the
|
||||||
value. Here the ``for`` statement is looping over the results from the
|
value. Here the ``for`` statement is looping over the results from the
|
||||||
`pairs() <system.html#pairs.i,seq[T]>`_ iterator from the `system
|
`pairs() <iterators.html#pairs.i,seq[T]>`_ iterator from the `system
|
||||||
<system.html>`_ module. Examples:
|
<system.html>`_ module. Examples:
|
||||||
|
|
||||||
.. code-block:: nim
|
.. code-block:: nim
|
||||||
|
|
|
||||||
|
|
@ -107,7 +107,7 @@ type
|
||||||
timing*: PerformanceTiming
|
timing*: PerformanceTiming
|
||||||
|
|
||||||
Range* {.importc.} = ref object
|
Range* {.importc.} = ref object
|
||||||
## see `docs{https://developer.mozilla.org/en-US/docs/Web/API/Range}`_
|
## see `docs<https://developer.mozilla.org/en-US/docs/Web/API/Range>`_
|
||||||
collapsed*: bool
|
collapsed*: bool
|
||||||
commonAncestorContainer*: Node
|
commonAncestorContainer*: Node
|
||||||
endContainer*: Node
|
endContainer*: Node
|
||||||
|
|
|
||||||
|
|
@ -235,7 +235,7 @@ template implementSetInheritable() {.dirty.} =
|
||||||
## Returns ``true`` on success.
|
## Returns ``true`` on success.
|
||||||
##
|
##
|
||||||
## This procedure is not guaranteed to be available for all platforms.
|
## This procedure is not guaranteed to be available for all platforms.
|
||||||
## Test for availability with `declared()`_.
|
## Test for availability with `declared() <system.html#declared,untyped>`_.
|
||||||
fd.FileHandle.setInheritable(inheritable)
|
fd.FileHandle.setInheritable(inheritable)
|
||||||
|
|
||||||
when defined(windows) or defined(nimdoc):
|
when defined(windows) or defined(nimdoc):
|
||||||
|
|
|
||||||
|
|
@ -64,7 +64,7 @@ type
|
||||||
HashSet*[A] {.myShallow.} = object ## \
|
HashSet*[A] {.myShallow.} = object ## \
|
||||||
## A generic hash set.
|
## A generic hash set.
|
||||||
##
|
##
|
||||||
## Use `init proc <#init,HashSet[A],int>`_ or `initHashSet proc <#initHashSet,int>`_
|
## Use `init proc <#init,HashSet[A]>`_ or `initHashSet proc <#initHashSet,int>`_
|
||||||
## before calling other procs on it.
|
## before calling other procs on it.
|
||||||
data: KeyValuePairSeq[A]
|
data: KeyValuePairSeq[A]
|
||||||
counter: int
|
counter: int
|
||||||
|
|
@ -76,8 +76,8 @@ type
|
||||||
OrderedSet*[A] {.myShallow.} = object ## \
|
OrderedSet*[A] {.myShallow.} = object ## \
|
||||||
## A generic hash set that remembers insertion order.
|
## A generic hash set that remembers insertion order.
|
||||||
##
|
##
|
||||||
## Use `init proc <#init,OrderedSet[A],int>`_ or `initOrderedSet proc
|
## Use `init proc <#init,OrderedSet[A]>`_ or `initOrderedSet proc
|
||||||
## <#initOrderedSet,int>`_ before calling other procs on it.
|
## <#initOrderedSet>`_ before calling other procs on it.
|
||||||
data: OrderedKeyValuePairSeq[A]
|
data: OrderedKeyValuePairSeq[A]
|
||||||
counter, first, last: int
|
counter, first, last: int
|
||||||
SomeSet*[A] = HashSet[A] | OrderedSet[A]
|
SomeSet*[A] = HashSet[A] | OrderedSet[A]
|
||||||
|
|
@ -104,7 +104,7 @@ proc init*[A](s: var HashSet[A], initialSize = defaultInitialSize) =
|
||||||
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
|
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initHashSet proc <#initHashSet,int>`_
|
## * `initHashSet proc <#initHashSet>`_
|
||||||
## * `toHashSet proc <#toHashSet,openArray[A]>`_
|
## * `toHashSet proc <#toHashSet,openArray[A]>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var a: HashSet[int]
|
var a: HashSet[int]
|
||||||
|
|
@ -113,7 +113,7 @@ proc init*[A](s: var HashSet[A], initialSize = defaultInitialSize) =
|
||||||
initImpl(s, initialSize)
|
initImpl(s, initialSize)
|
||||||
|
|
||||||
proc initHashSet*[A](initialSize = defaultInitialSize): HashSet[A] =
|
proc initHashSet*[A](initialSize = defaultInitialSize): HashSet[A] =
|
||||||
## Wrapper around `init proc <#init,HashSet[A],int>`_ for initialization of
|
## Wrapper around `init proc <#init,HashSet[A]>`_ for initialization of
|
||||||
## hash sets.
|
## hash sets.
|
||||||
##
|
##
|
||||||
## Returns an empty hash set you can assign directly in ``var`` blocks in a
|
## Returns an empty hash set you can assign directly in ``var`` blocks in a
|
||||||
|
|
@ -209,7 +209,7 @@ proc toHashSet*[A](keys: openArray[A]): HashSet[A] =
|
||||||
## Duplicates are removed.
|
## Duplicates are removed.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initHashSet proc <#initHashSet,int>`_
|
## * `initHashSet proc <#initHashSet>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
a = toHashSet([5, 3, 2])
|
a = toHashSet([5, 3, 2])
|
||||||
|
|
@ -601,7 +601,7 @@ proc toSet*[A](keys: openArray[A]): HashSet[A] {.deprecated:
|
||||||
proc isValid*[A](s: HashSet[A]): bool {.deprecated:
|
proc isValid*[A](s: HashSet[A]): bool {.deprecated:
|
||||||
"Deprecated since v0.20; sets are initialized by default".} =
|
"Deprecated since v0.20; sets are initialized by default".} =
|
||||||
## Returns `true` if the set has been initialized (with `initHashSet proc
|
## Returns `true` if the set has been initialized (with `initHashSet proc
|
||||||
## <#initHashSet,int>`_ or `init proc <#init,HashSet[A],int>`_).
|
## <#initHashSet>`_ or `init proc <#init,HashSet[A]>`_).
|
||||||
##
|
##
|
||||||
## **Examples:**
|
## **Examples:**
|
||||||
##
|
##
|
||||||
|
|
@ -640,7 +640,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
|
||||||
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
|
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initOrderedSet proc <#initOrderedSet,int>`_
|
## * `initOrderedSet proc <#initOrderedSet>`_
|
||||||
## * `toOrderedSet proc <#toOrderedSet,openArray[A]>`_
|
## * `toOrderedSet proc <#toOrderedSet,openArray[A]>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var a: OrderedSet[int]
|
var a: OrderedSet[int]
|
||||||
|
|
@ -649,7 +649,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
|
||||||
initImpl(s, initialSize)
|
initImpl(s, initialSize)
|
||||||
|
|
||||||
proc initOrderedSet*[A](initialSize = defaultInitialSize): OrderedSet[A] =
|
proc initOrderedSet*[A](initialSize = defaultInitialSize): OrderedSet[A] =
|
||||||
## Wrapper around `init proc <#init,OrderedSet[A],int>`_ for initialization of
|
## Wrapper around `init proc <#init,OrderedSet[A]>`_ for initialization of
|
||||||
## ordered hash sets.
|
## ordered hash sets.
|
||||||
##
|
##
|
||||||
## Returns an empty ordered hash set you can assign directly in ``var`` blocks
|
## Returns an empty ordered hash set you can assign directly in ``var`` blocks
|
||||||
|
|
@ -674,7 +674,7 @@ proc toOrderedSet*[A](keys: openArray[A]): OrderedSet[A] =
|
||||||
## Duplicates are removed.
|
## Duplicates are removed.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initOrderedSet proc <#initOrderedSet,int>`_
|
## * `initOrderedSet proc <#initOrderedSet>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
a = toOrderedSet([5, 3, 2])
|
a = toOrderedSet([5, 3, 2])
|
||||||
|
|
|
||||||
|
|
@ -135,7 +135,7 @@
|
||||||
##
|
##
|
||||||
## The same could have been achieved by manually iterating over a container
|
## The same could have been achieved by manually iterating over a container
|
||||||
## and increasing each key's value with `inc proc
|
## and increasing each key's value with `inc proc
|
||||||
## <#inc,CountTable[A],A,Positive>`_:
|
## <#inc,CountTable[A],A,int>`_:
|
||||||
##
|
##
|
||||||
## .. code-block::
|
## .. code-block::
|
||||||
## import tables
|
## import tables
|
||||||
|
|
@ -230,13 +230,13 @@ type
|
||||||
## `data` and `counter` are internal implementation details which
|
## `data` and `counter` are internal implementation details which
|
||||||
## can't be accessed.
|
## can't be accessed.
|
||||||
##
|
##
|
||||||
## For creating an empty Table, use `initTable proc<#initTable,int>`_.
|
## For creating an empty Table, use `initTable proc<#initTable>`_.
|
||||||
data: KeyValuePairSeq[A, B]
|
data: KeyValuePairSeq[A, B]
|
||||||
counter: int
|
counter: int
|
||||||
TableRef*[A, B] = ref Table[A, B] ## Ref version of `Table<#Table>`_.
|
TableRef*[A, B] = ref Table[A, B] ## Ref version of `Table<#Table>`_.
|
||||||
##
|
##
|
||||||
## For creating a new empty TableRef, use `newTable proc
|
## For creating a new empty TableRef, use `newTable proc
|
||||||
## <#newTable,int>`_.
|
## <#newTable>`_.
|
||||||
|
|
||||||
const
|
const
|
||||||
defaultInitialSize* = 32
|
defaultInitialSize* = 32
|
||||||
|
|
@ -293,7 +293,7 @@ proc initTable*[A, B](initialSize = defaultInitialSize): Table[A, B] =
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toTable proc<#toTable,openArray[]>`_
|
## * `toTable proc<#toTable,openArray[]>`_
|
||||||
## * `newTable proc<#newTable,int>`_ for creating a `TableRef`
|
## * `newTable proc<#newTable>`_ for creating a `TableRef`
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
a = initTable[int, string]()
|
a = initTable[int, string]()
|
||||||
|
|
@ -322,7 +322,7 @@ proc toTable*[A, B](pairs: openArray[(A, B)]): Table[A, B] =
|
||||||
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initTable proc<#initTable,int>`_
|
## * `initTable proc<#initTable>`_
|
||||||
## * `newTable proc<#newTable,openArray[]>`_ for a `TableRef` version
|
## * `newTable proc<#newTable,openArray[]>`_ for a `TableRef` version
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let a = [('a', 5), ('b', 9)]
|
let a = [('a', 5), ('b', 9)]
|
||||||
|
|
@ -771,7 +771,7 @@ iterator allValues*[A, B](t: Table[A, B]; key: A): B {.deprecated:
|
||||||
## Iterates over any value in the table ``t`` that belongs to the given ``key``.
|
## Iterates over any value in the table ``t`` that belongs to the given ``key``.
|
||||||
##
|
##
|
||||||
## Used if you have a table with duplicate keys (as a result of using
|
## Used if you have a table with duplicate keys (as a result of using
|
||||||
## `add proc<#add,Table[A,B],A,B>`_).
|
## `add proc<#add,Table[A,B],A,sinkB>`_).
|
||||||
##
|
##
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import sequtils, algorithm
|
import sequtils, algorithm
|
||||||
|
|
@ -801,7 +801,7 @@ proc newTable*[A, B](initialSize = defaultInitialSize): <//>TableRef[A, B] =
|
||||||
## See also:
|
## See also:
|
||||||
## * `newTable proc<#newTable,openArray[]>`_ for creating a `TableRef`
|
## * `newTable proc<#newTable,openArray[]>`_ for creating a `TableRef`
|
||||||
## from a collection of `(key, value)` pairs
|
## from a collection of `(key, value)` pairs
|
||||||
## * `initTable proc<#initTable,int>`_ for creating a `Table`
|
## * `initTable proc<#initTable>`_ for creating a `Table`
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
a = newTable[int, string]()
|
a = newTable[int, string]()
|
||||||
|
|
@ -816,7 +816,7 @@ proc newTable*[A, B](pairs: openArray[(A, B)]): <//>TableRef[A, B] =
|
||||||
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `newTable proc<#newTable,int>`_
|
## * `newTable proc<#newTable>`_
|
||||||
## * `toTable proc<#toTable,openArray[]>`_ for a `Table` version
|
## * `toTable proc<#toTable,openArray[]>`_ for a `Table` version
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let a = [('a', 5), ('b', 9)]
|
let a = [('a', 5), ('b', 9)]
|
||||||
|
|
@ -845,7 +845,7 @@ proc `[]`*[A, B](t: TableRef[A, B], key: A): var B =
|
||||||
## a default value (e.g. zero for int) if the key doesn't exist
|
## a default value (e.g. zero for int) if the key doesn't exist
|
||||||
## * `getOrDefault proc<#getOrDefault,TableRef[A,B],A,B>`_ to return
|
## * `getOrDefault proc<#getOrDefault,TableRef[A,B],A,B>`_ to return
|
||||||
## a custom value if the key doesn't exist
|
## a custom value if the key doesn't exist
|
||||||
## * `[]= proc<#[]=,TableRef[A,B],A,B>`_ for inserting a new
|
## * `[]= proc<#[]=,TableRef[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table
|
## (key, value) pair in the table
|
||||||
## * `hasKey proc<#hasKey,TableRef[A,B],A>`_ for checking if a key is in
|
## * `hasKey proc<#hasKey,TableRef[A,B],A>`_ for checking if a key is in
|
||||||
## the table
|
## the table
|
||||||
|
|
@ -1008,7 +1008,7 @@ proc add*[A, B](t: TableRef[A, B], key: A, val: sink B) {.deprecated:
|
||||||
##
|
##
|
||||||
## **This can introduce duplicate keys into the table!**
|
## **This can introduce duplicate keys into the table!**
|
||||||
##
|
##
|
||||||
## Use `[]= proc<#[]=,TableRef[A,B],A,B>`_ for inserting a new
|
## Use `[]= proc<#[]=,TableRef[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table without introducing duplicates.
|
## (key, value) pair in the table without introducing duplicates.
|
||||||
t[].add(key, val)
|
t[].add(key, val)
|
||||||
|
|
||||||
|
|
@ -1228,14 +1228,14 @@ type
|
||||||
## Hash table that remembers insertion order.
|
## Hash table that remembers insertion order.
|
||||||
##
|
##
|
||||||
## For creating an empty OrderedTable, use `initOrderedTable proc
|
## For creating an empty OrderedTable, use `initOrderedTable proc
|
||||||
## <#initOrderedTable,int>`_.
|
## <#initOrderedTable>`_.
|
||||||
data: OrderedKeyValuePairSeq[A, B]
|
data: OrderedKeyValuePairSeq[A, B]
|
||||||
counter, first, last: int
|
counter, first, last: int
|
||||||
OrderedTableRef*[A, B] = ref OrderedTable[A, B] ## Ref version of
|
OrderedTableRef*[A, B] = ref OrderedTable[A, B] ## Ref version of
|
||||||
## `OrderedTable<#OrderedTable>`_.
|
## `OrderedTable<#OrderedTable>`_.
|
||||||
##
|
##
|
||||||
## For creating a new empty OrderedTableRef, use `newOrderedTable proc
|
## For creating a new empty OrderedTableRef, use `newOrderedTable proc
|
||||||
## <#newOrderedTable,int>`_.
|
## <#newOrderedTable>`_.
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------ helpers ---------------------------------
|
# ------------------------------ helpers ---------------------------------
|
||||||
|
|
@ -1294,7 +1294,7 @@ proc initOrderedTable*[A, B](initialSize = defaultInitialSize): OrderedTable[A,
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_
|
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_
|
||||||
## * `newOrderedTable proc<#newOrderedTable,int>`_ for creating an
|
## * `newOrderedTable proc<#newOrderedTable>`_ for creating an
|
||||||
## `OrderedTableRef`
|
## `OrderedTableRef`
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
|
|
@ -1324,7 +1324,7 @@ proc toOrderedTable*[A, B](pairs: openArray[(A, B)]): OrderedTable[A, B] =
|
||||||
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initOrderedTable proc<#initOrderedTable,int>`_
|
## * `initOrderedTable proc<#initOrderedTable>`_
|
||||||
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for an
|
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for an
|
||||||
## `OrderedTableRef` version
|
## `OrderedTableRef` version
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
|
|
@ -1347,7 +1347,7 @@ proc `[]`*[A, B](t: OrderedTable[A, B], key: A): B =
|
||||||
## a default value (e.g. zero for int) if the key doesn't exist
|
## a default value (e.g. zero for int) if the key doesn't exist
|
||||||
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
||||||
## a custom value if the key doesn't exist
|
## a custom value if the key doesn't exist
|
||||||
## * `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
|
## * `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table
|
## (key, value) pair in the table
|
||||||
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
||||||
## key is in the table
|
## key is in the table
|
||||||
|
|
@ -1369,7 +1369,7 @@ proc `[]`*[A, B](t: var OrderedTable[A, B], key: A): var B =
|
||||||
## a default value (e.g. zero for int) if the key doesn't exist
|
## a default value (e.g. zero for int) if the key doesn't exist
|
||||||
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
||||||
## a custom value if the key doesn't exist
|
## a custom value if the key doesn't exist
|
||||||
## * `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
|
## * `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table
|
## (key, value) pair in the table
|
||||||
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
||||||
## key is in the table
|
## key is in the table
|
||||||
|
|
@ -1495,7 +1495,7 @@ proc add*[A, B](t: var OrderedTable[A, B], key: A, val: sink B) {.deprecated:
|
||||||
##
|
##
|
||||||
## **This can introduce duplicate keys into the table!**
|
## **This can introduce duplicate keys into the table!**
|
||||||
##
|
##
|
||||||
## Use `[]= proc<#[]=,OrderedTable[A,B],A,B>`_ for inserting a new
|
## Use `[]= proc<#[]=,OrderedTable[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table without introducing duplicates.
|
## (key, value) pair in the table without introducing duplicates.
|
||||||
addImpl(enlarge)
|
addImpl(enlarge)
|
||||||
|
|
||||||
|
|
@ -1796,7 +1796,7 @@ proc newOrderedTable*[A, B](initialSize = defaultInitialSize): <//>OrderedTableR
|
||||||
## See also:
|
## See also:
|
||||||
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for creating
|
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for creating
|
||||||
## an `OrderedTableRef` from a collection of `(key, value)` pairs
|
## an `OrderedTableRef` from a collection of `(key, value)` pairs
|
||||||
## * `initOrderedTable proc<#initOrderedTable,int>`_ for creating an
|
## * `initOrderedTable proc<#initOrderedTable>`_ for creating an
|
||||||
## `OrderedTable`
|
## `OrderedTable`
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let
|
let
|
||||||
|
|
@ -1811,7 +1811,7 @@ proc newOrderedTable*[A, B](pairs: openArray[(A, B)]): <//>OrderedTableRef[A, B]
|
||||||
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
## ``pairs`` is a container consisting of ``(key, value)`` tuples.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `newOrderedTable proc<#newOrderedTable,int>`_
|
## * `newOrderedTable proc<#newOrderedTable>`_
|
||||||
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_ for an
|
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_ for an
|
||||||
## `OrderedTable` version
|
## `OrderedTable` version
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
|
|
@ -1835,7 +1835,7 @@ proc `[]`*[A, B](t: OrderedTableRef[A, B], key: A): var B =
|
||||||
## a default value (e.g. zero for int) if the key doesn't exist
|
## a default value (e.g. zero for int) if the key doesn't exist
|
||||||
## * `getOrDefault proc<#getOrDefault,OrderedTableRef[A,B],A,B>`_ to return
|
## * `getOrDefault proc<#getOrDefault,OrderedTableRef[A,B],A,B>`_ to return
|
||||||
## a custom value if the key doesn't exist
|
## a custom value if the key doesn't exist
|
||||||
## * `[]= proc<#[]=,OrderedTableRef[A,B],A,B>`_ for inserting a new
|
## * `[]= proc<#[]=,OrderedTableRef[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table
|
## (key, value) pair in the table
|
||||||
## * `hasKey proc<#hasKey,OrderedTableRef[A,B],A>`_ for checking if
|
## * `hasKey proc<#hasKey,OrderedTableRef[A,B],A>`_ for checking if
|
||||||
## a key is in the table
|
## a key is in the table
|
||||||
|
|
@ -1981,7 +1981,7 @@ proc add*[A, B](t: OrderedTableRef[A, B], key: A, val: sink B) {.deprecated:
|
||||||
##
|
##
|
||||||
## **This can introduce duplicate keys into the table!**
|
## **This can introduce duplicate keys into the table!**
|
||||||
##
|
##
|
||||||
## Use `[]= proc<#[]=,OrderedTableRef[A,B],A,B>`_ for inserting a new
|
## Use `[]= proc<#[]=,OrderedTableRef[A,B],A,sinkB>`_ for inserting a new
|
||||||
## (key, value) pair in the table without introducing duplicates.
|
## (key, value) pair in the table without introducing duplicates.
|
||||||
t[].add(key, val)
|
t[].add(key, val)
|
||||||
|
|
||||||
|
|
@ -2208,7 +2208,7 @@ type
|
||||||
## Hash table that counts the number of each key.
|
## Hash table that counts the number of each key.
|
||||||
##
|
##
|
||||||
## For creating an empty CountTable, use `initCountTable proc
|
## For creating an empty CountTable, use `initCountTable proc
|
||||||
## <#initCountTable,int>`_.
|
## <#initCountTable>`_.
|
||||||
data: seq[tuple[key: A, val: int]]
|
data: seq[tuple[key: A, val: int]]
|
||||||
counter: int
|
counter: int
|
||||||
isSorted: bool
|
isSorted: bool
|
||||||
|
|
@ -2216,7 +2216,7 @@ type
|
||||||
## `CountTable<#CountTable>`_.
|
## `CountTable<#CountTable>`_.
|
||||||
##
|
##
|
||||||
## For creating a new empty CountTableRef, use `newCountTable proc
|
## For creating a new empty CountTableRef, use `newCountTable proc
|
||||||
## <#newCountTable,int>`_.
|
## <#newCountTable>`_.
|
||||||
|
|
||||||
|
|
||||||
# ------------------------------ helpers ---------------------------------
|
# ------------------------------ helpers ---------------------------------
|
||||||
|
|
@ -2260,7 +2260,7 @@ proc initCountTable*[A](initialSize = defaultInitialSize): CountTable[A] =
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toCountTable proc<#toCountTable,openArray[A]>`_
|
## * `toCountTable proc<#toCountTable,openArray[A]>`_
|
||||||
## * `newCountTable proc<#newCountTable,int>`_ for creating a
|
## * `newCountTable proc<#newCountTable>`_ for creating a
|
||||||
## `CountTableRef`
|
## `CountTableRef`
|
||||||
initImpl(result, initialSize)
|
initImpl(result, initialSize)
|
||||||
|
|
||||||
|
|
@ -2294,7 +2294,7 @@ proc `[]=`*[A](t: var CountTable[A], key: A, val: int) =
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `[] proc<#[],CountTable[A],A>`_ for retrieving a value of a key
|
## * `[] proc<#[],CountTable[A],A>`_ for retrieving a value of a key
|
||||||
## * `inc proc<#inc,CountTable[A],A,Positive>`_ for incrementing a
|
## * `inc proc<#inc,CountTable[A],A,int>`_ for incrementing a
|
||||||
## value of a key
|
## value of a key
|
||||||
assert(not t.isSorted, "CountTable must not be used after sorting")
|
assert(not t.isSorted, "CountTable must not be used after sorting")
|
||||||
assert val >= 0
|
assert val >= 0
|
||||||
|
|
@ -2617,7 +2617,7 @@ proc newCountTable*[A](initialSize = defaultInitialSize): <//>CountTableRef[A] =
|
||||||
## See also:
|
## See also:
|
||||||
## * `newCountTable proc<#newCountTable,openArray[A]>`_ for creating
|
## * `newCountTable proc<#newCountTable,openArray[A]>`_ for creating
|
||||||
## a `CountTableRef` from a collection
|
## a `CountTableRef` from a collection
|
||||||
## * `initCountTable proc<#initCountTable,int>`_ for creating a
|
## * `initCountTable proc<#initCountTable>`_ for creating a
|
||||||
## `CountTable`
|
## `CountTable`
|
||||||
new(result)
|
new(result)
|
||||||
result[] = initCountTable[A](initialSize)
|
result[] = initCountTable[A](initialSize)
|
||||||
|
|
@ -2635,7 +2635,7 @@ proc `[]`*[A](t: CountTableRef[A], key: A): int =
|
||||||
## See also:
|
## See also:
|
||||||
## * `getOrDefault<#getOrDefault,CountTableRef[A],A,int>`_ to return
|
## * `getOrDefault<#getOrDefault,CountTableRef[A],A,int>`_ to return
|
||||||
## a custom value if the key doesn't exist
|
## a custom value if the key doesn't exist
|
||||||
## * `inc proc<#inc,CountTableRef[A],A>`_ to inc even if missing
|
## * `inc proc<#inc,CountTableRef[A],A,int>`_ to inc even if missing
|
||||||
## * `[]= proc<#[]%3D,CountTableRef[A],A,int>`_ for inserting a new
|
## * `[]= proc<#[]%3D,CountTableRef[A],A,int>`_ for inserting a new
|
||||||
## (key, value) pair in the table
|
## (key, value) pair in the table
|
||||||
## * `hasKey proc<#hasKey,CountTableRef[A],A>`_ for checking if a key
|
## * `hasKey proc<#hasKey,CountTableRef[A],A>`_ for checking if a key
|
||||||
|
|
|
||||||
|
|
@ -468,7 +468,7 @@ template spawnX*(call) =
|
||||||
## Spawns a new task if a CPU core is ready, otherwise executes the
|
## Spawns a new task if a CPU core is ready, otherwise executes the
|
||||||
## call in the calling thread.
|
## call in the calling thread.
|
||||||
##
|
##
|
||||||
## Usually it is advised to use `spawn proc <#spawn,typed>`_ in order to
|
## Usually it is advised to use `spawn proc <#spawn,sinktyped>`_ in order to
|
||||||
## not block the producer for an unknown amount of time.
|
## not block the producer for an unknown amount of time.
|
||||||
##
|
##
|
||||||
## ``call`` has to be proc call ``p(...)`` where ``p`` is gcsafe and has a
|
## ``call`` has to be proc call ``p(...)`` where ``p`` is gcsafe and has a
|
||||||
|
|
|
||||||
|
|
@ -129,7 +129,7 @@
|
||||||
## A set of directories and files from the `ssl_certs <ssl_certs.html>`_
|
## A set of directories and files from the `ssl_certs <ssl_certs.html>`_
|
||||||
## module are scanned to locate CA certificates.
|
## module are scanned to locate CA certificates.
|
||||||
##
|
##
|
||||||
## See `newContext <net.html#newContext>`_ to tweak or disable certificate validation.
|
## See `newContext <net.html#newContext.string,string,string,string>`_ to tweak or disable certificate validation.
|
||||||
##
|
##
|
||||||
## Timeouts
|
## Timeouts
|
||||||
## ========
|
## ========
|
||||||
|
|
@ -565,7 +565,7 @@ proc newHttpClient*(userAgent = defUserAgent, maxRedirects = 5,
|
||||||
## default is 5.
|
## default is 5.
|
||||||
##
|
##
|
||||||
## ``sslContext`` specifies the SSL context to use for HTTPS requests.
|
## ``sslContext`` specifies the SSL context to use for HTTPS requests.
|
||||||
## See `SSL/TLS support <##ssl-tls-support>`_
|
## See `SSL/TLS support <#sslslashtls-support>`_
|
||||||
##
|
##
|
||||||
## ``proxy`` specifies an HTTP proxy to use for this HTTP client's
|
## ``proxy`` specifies an HTTP proxy to use for this HTTP client's
|
||||||
## connections.
|
## connections.
|
||||||
|
|
|
||||||
|
|
@ -246,7 +246,7 @@ when not defined(js):
|
||||||
## rotation.
|
## rotation.
|
||||||
##
|
##
|
||||||
## Create a new ``RollingFileLogger`` with the `newRollingFileLogger proc
|
## Create a new ``RollingFileLogger`` with the `newRollingFileLogger proc
|
||||||
## <#newRollingFileLogger,FileMode,int,int>`_.
|
## <#newRollingFileLogger,FileMode,Positive,int>`_.
|
||||||
##
|
##
|
||||||
## **Note:** This logger is not available for the JavaScript backend.
|
## **Note:** This logger is not available for the JavaScript backend.
|
||||||
##
|
##
|
||||||
|
|
@ -395,7 +395,7 @@ proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr,
|
||||||
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
||||||
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
||||||
## that accepts a filename
|
## that accepts a filename
|
||||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||||
##
|
##
|
||||||
## **Examples:**
|
## **Examples:**
|
||||||
##
|
##
|
||||||
|
|
@ -460,7 +460,7 @@ when not defined(js):
|
||||||
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
||||||
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
||||||
## that accepts a filename
|
## that accepts a filename
|
||||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||||
##
|
##
|
||||||
## **Examples:**
|
## **Examples:**
|
||||||
##
|
##
|
||||||
|
|
@ -496,7 +496,7 @@ when not defined(js):
|
||||||
## See also:
|
## See also:
|
||||||
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
||||||
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
||||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||||
##
|
##
|
||||||
## **Examples:**
|
## **Examples:**
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
##
|
##
|
||||||
## In order to use the SSL procedures defined in this module, you will need to
|
## In order to use the SSL procedures defined in this module, you will need to
|
||||||
## compile your application with the ``-d:ssl`` flag. See the
|
## compile your application with the ``-d:ssl`` flag. See the
|
||||||
## `newContext<net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring%2Cstring>`_
|
## `newContext<net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring>`_
|
||||||
## procedure for additional details.
|
## procedure for additional details.
|
||||||
##
|
##
|
||||||
## Examples
|
## Examples
|
||||||
|
|
|
||||||
|
|
@ -106,7 +106,7 @@ proc execCmd*(command: string): int {.rtl, extern: "nosp$1",
|
||||||
## This operation is also often called `system`:idx:.
|
## This operation is also often called `system`:idx:.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `execCmdEx proc <#execCmdEx,string,set[ProcessOption]>`_
|
## * `execCmdEx proc <#execCmdEx,string,set[ProcessOption],StringTableRef,string,string>`_
|
||||||
## * `startProcess proc
|
## * `startProcess proc
|
||||||
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_
|
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_
|
||||||
## * `execProcess proc
|
## * `execProcess proc
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
##
|
##
|
||||||
## Its implementation is based on the ``xoroshiro128+``
|
## Its implementation is based on the ``xoroshiro128+``
|
||||||
## (xor/rotate/shift/rotate) library.
|
## (xor/rotate/shift/rotate) library.
|
||||||
## * More information: http://xoroshiro.di.unimi.it/
|
## * More information: http://xoroshiro.di.unimi.it
|
||||||
## * C implementation: http://xoroshiro.di.unimi.it/xoroshiro128plus.c
|
## * C implementation: http://xoroshiro.di.unimi.it/xoroshiro128plus.c
|
||||||
##
|
##
|
||||||
## **Do not use this module for cryptographic purposes!**
|
## **Do not use this module for cryptographic purposes!**
|
||||||
|
|
@ -135,7 +135,8 @@ proc next*(r: var Rand): uint64 =
|
||||||
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer between zero and
|
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer between zero and
|
||||||
## a given upper bound
|
## a given upper bound
|
||||||
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
||||||
## * `rand proc<#rand,Rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,Rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
## * `skipRandomNumbers proc<#skipRandomNumbers,Rand>`_
|
## * `skipRandomNumbers proc<#skipRandomNumbers,Rand>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
|
|
@ -220,7 +221,8 @@ proc rand*(r: var Rand; max: Natural): int {.benign.} =
|
||||||
## * `rand proc<#rand,int>`_ that returns an integer using the default
|
## * `rand proc<#rand,int>`_ that returns an integer using the default
|
||||||
## random number generator
|
## random number generator
|
||||||
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
||||||
## * `rand proc<#rand,Rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,Rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var r = initRand(123)
|
var r = initRand(123)
|
||||||
|
|
@ -246,7 +248,8 @@ proc rand*(max: int): int {.benign.} =
|
||||||
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer using a
|
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer using a
|
||||||
## provided state
|
## provided state
|
||||||
## * `rand proc<#rand,float>`_ that returns a float
|
## * `rand proc<#rand,float>`_ that returns a float
|
||||||
## * `rand proc<#rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
randomize(123)
|
randomize(123)
|
||||||
|
|
@ -263,7 +266,8 @@ proc rand*(r: var Rand; max: range[0.0 .. high(float)]): float {.benign.} =
|
||||||
## * `rand proc<#rand,float>`_ that returns a float using the default
|
## * `rand proc<#rand,float>`_ that returns a float using the default
|
||||||
## random number generator
|
## random number generator
|
||||||
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
|
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
|
||||||
## * `rand proc<#rand,Rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,Rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var r = initRand(234)
|
var r = initRand(234)
|
||||||
|
|
@ -289,7 +293,8 @@ proc rand*(max: float): float {.benign.} =
|
||||||
## * `rand proc<#rand,Rand,range[]>`_ that returns a float using a
|
## * `rand proc<#rand,Rand,range[]>`_ that returns a float using a
|
||||||
## provided state
|
## provided state
|
||||||
## * `rand proc<#rand,int>`_ that returns an integer
|
## * `rand proc<#rand,int>`_ that returns an integer
|
||||||
## * `rand proc<#rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
randomize(234)
|
randomize(234)
|
||||||
|
|
@ -304,8 +309,8 @@ proc rand*[T: Ordinal or SomeFloat](r: var Rand; x: HSlice[T, T]): T =
|
||||||
## Allowed types for `T` are integers, floats, and enums without holes.
|
## Allowed types for `T` are integers, floats, and enums without holes.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `rand proc<#rand,HSlice[T,T]>`_ that accepts a slice and uses the
|
## * `rand proc<#rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
## default random number generator
|
## that accepts a slice and uses the default random number generator
|
||||||
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
|
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
|
||||||
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
|
|
@ -333,8 +338,8 @@ proc rand*[T: Ordinal or SomeFloat](x: HSlice[T, T]): T =
|
||||||
## thread-safe.
|
## thread-safe.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `rand proc<#rand,Rand,HSlice[T,T]>`_ that accepts a slice and uses
|
## * `rand proc<#rand,Rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
## a provided state
|
## that accepts a slice and uses a provided state
|
||||||
## * `rand proc<#rand,int>`_ that returns an integer
|
## * `rand proc<#rand,int>`_ that returns an integer
|
||||||
## * `rand proc<#rand,float>`_ that returns a floating point number
|
## * `rand proc<#rand,float>`_ that returns a floating point number
|
||||||
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
## * `rand proc<#rand,typedesc[T]>`_ that accepts an integer or range type
|
||||||
|
|
@ -357,7 +362,8 @@ proc rand*[T: SomeInteger](t: typedesc[T]): T =
|
||||||
## See also:
|
## See also:
|
||||||
## * `rand proc<#rand,int>`_ that returns an integer
|
## * `rand proc<#rand,int>`_ that returns an integer
|
||||||
## * `rand proc<#rand,float>`_ that returns a floating point number
|
## * `rand proc<#rand,float>`_ that returns a floating point number
|
||||||
## * `rand proc<#rand,HSlice[T,T]>`_ that accepts a slice
|
## * `rand proc<#rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||||
|
## that accepts a slice
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
randomize(567)
|
randomize(567)
|
||||||
doAssert rand(int8) == 55
|
doAssert rand(int8) == 55
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ proc debugRecv*(smtp: Smtp | AsyncSmtp): Future[TaintedString] {.multisync.} =
|
||||||
## this is if you are implementing any
|
## this is if you are implementing any
|
||||||
## `SMTP extensions<https://en.wikipedia.org/wiki/Extended_SMTP>`_.
|
## `SMTP extensions<https://en.wikipedia.org/wiki/Extended_SMTP>`_.
|
||||||
##
|
##
|
||||||
## See `checkReply(reply)<#checkReply,,string>`_.
|
## See `checkReply(reply)<#checkReply,AsyncSmtp,string>`_.
|
||||||
|
|
||||||
result = await smtp.sock.recvLine()
|
result = await smtp.sock.recvLine()
|
||||||
if smtp.debug:
|
if smtp.debug:
|
||||||
|
|
@ -211,7 +211,7 @@ proc quitExcpt(smtp: AsyncSmtp, msg: string): Future[void] =
|
||||||
return retFuture
|
return retFuture
|
||||||
|
|
||||||
proc checkReply*(smtp: Smtp | AsyncSmtp, reply: string) {.multisync.} =
|
proc checkReply*(smtp: Smtp | AsyncSmtp, reply: string) {.multisync.} =
|
||||||
## Calls `debugRecv<#debugRecv>`_ and checks that the received
|
## Calls `debugRecv<#debugRecv,AsyncSmtp>`_ and checks that the received
|
||||||
## data starts with ``reply``. If the received data does not start
|
## data starts with ``reply``. If the received data does not start
|
||||||
## with ``reply``, then a ``QUIT`` command will be sent to the SMTP
|
## with ``reply``, then a ``QUIT`` command will be sent to the SMTP
|
||||||
## server and a ``ReplyError`` exception will be raised.
|
## server and a ``ReplyError`` exception will be raised.
|
||||||
|
|
|
||||||
|
|
@ -813,7 +813,7 @@ proc toRunes*(s: string): seq[Rune] =
|
||||||
## Obtains a sequence containing the Runes in ``s``.
|
## Obtains a sequence containing the Runes in ``s``.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `$ proc <#$,seq[T][Rune]>`_ for a reverse operation
|
## * `$ proc <#$,Rune>`_ for a reverse operation
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
let a = toRunes("aáä")
|
let a = toRunes("aáä")
|
||||||
doAssert a == @["a".runeAt(0), "á".runeAt(0), "ä".runeAt(0)]
|
doAssert a == @["a".runeAt(0), "á".runeAt(0), "ä".runeAt(0)]
|
||||||
|
|
|
||||||
|
|
@ -278,7 +278,7 @@ proc fromJsonHook*[K, V](t: var (Table[K, V] | OrderedTable[K, V]),
|
||||||
## Enables `fromJson` for `Table` and `OrderedTable` types.
|
## Enables `fromJson` for `Table` and `OrderedTable` types.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toJsonHook proc<#toJsonHook,(Table[K,V]|OrderedTable[K,V])>`_
|
## * `toJsonHook proc<#toJsonHook>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import tables, json
|
import tables, json
|
||||||
var foo: tuple[t: Table[string, int], ot: OrderedTable[string, int]]
|
var foo: tuple[t: Table[string, int], ot: OrderedTable[string, int]]
|
||||||
|
|
@ -298,7 +298,7 @@ proc toJsonHook*[K, V](t: (Table[K, V] | OrderedTable[K, V])): JsonNode =
|
||||||
## Enables `toJson` for `Table` and `OrderedTable` types.
|
## Enables `toJson` for `Table` and `OrderedTable` types.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `fromJsonHook proc<#fromJsonHook,(Table[K,V]|OrderedTable[K,V]),JsonNode>`_
|
## * `fromJsonHook proc<#fromJsonHook,,JsonNode>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import tables, json
|
import tables, json
|
||||||
let foo = (
|
let foo = (
|
||||||
|
|
@ -383,7 +383,7 @@ proc fromJsonHook*(a: var StringTableRef, b: JsonNode) =
|
||||||
## Enables `fromJson` for `StringTableRef` type.
|
## Enables `fromJson` for `StringTableRef` type.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toJsonHook` proc<#toJsonHook,StringTableRef>`_
|
## * `toJsonHook proc<#toJsonHook,StringTableRef>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import strtabs, json
|
import strtabs, json
|
||||||
var t = newStringTable(modeCaseSensitive)
|
var t = newStringTable(modeCaseSensitive)
|
||||||
|
|
@ -401,7 +401,7 @@ proc toJsonHook*(a: StringTableRef): JsonNode =
|
||||||
## Enables `toJson` for `StringTableRef` type.
|
## Enables `toJson` for `StringTableRef` type.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `fromJsonHook` proc<#fromJsonHook,StringTableRef,JsonNode>`_
|
## * `fromJsonHook proc<#fromJsonHook,StringTableRef,JsonNode>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
import strtabs, json
|
import strtabs, json
|
||||||
let t = newStringTable("name", "John", "surname", "Doe", modeCaseSensitive)
|
let t = newStringTable("name", "John", "surname", "Doe", modeCaseSensitive)
|
||||||
|
|
|
||||||
|
|
@ -165,7 +165,7 @@ proc initPackedSet*[A]: PackedSet[A] =
|
||||||
## A must be Ordinal
|
## A must be Ordinal
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `toPackedSet[A] proc <#toPackedSet[A],openArray[int]>`_
|
## * `toPackedSet[A] proc <#toPackedSet,openArray[A]>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var a = initPackedSet[int]()
|
var a = initPackedSet[int]()
|
||||||
assert len(a) == 0
|
assert len(a) == 0
|
||||||
|
|
@ -273,7 +273,7 @@ proc toPackedSet*[A](x: openArray[A]): PackedSet[A] {.since: (1, 3).} =
|
||||||
## Duplicates are removed.
|
## Duplicates are removed.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `initPackedSet[A] proc <#initPackedSet[A]>`_
|
## * `initPackedSet[A] proc <#initPackedSet>`_
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var
|
var
|
||||||
a = toPackedSet([5, 6, 7])
|
a = toPackedSet([5, 6, 7])
|
||||||
|
|
@ -418,7 +418,7 @@ proc isNil*[A](x: PackedSet[A]): bool {.inline.} = x.head.isNil and x.elems == 0
|
||||||
|
|
||||||
proc assign*[A](dest: var PackedSet[A], src: PackedSet[A]) =
|
proc assign*[A](dest: var PackedSet[A], src: PackedSet[A]) =
|
||||||
## Copies `src` to `dest`.
|
## Copies `src` to `dest`.
|
||||||
## `dest` does not need to be initialized by `initPackedSet[A] proc <#initPackedSet[A]>`_.
|
## `dest` does not need to be initialized by `initPackedSet[A] proc <#initPackedSet>`_.
|
||||||
runnableExamples:
|
runnableExamples:
|
||||||
var
|
var
|
||||||
a = initPackedSet[int]()
|
a = initPackedSet[int]()
|
||||||
|
|
|
||||||
|
|
@ -96,7 +96,7 @@ proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
|
||||||
## defined.
|
## defined.
|
||||||
##
|
##
|
||||||
## `x` is an external symbol introduced through the compiler's
|
## `x` is an external symbol introduced through the compiler's
|
||||||
## `-d:x switch <nimc.html#compiler-usage-compile-time-symbols>`_ to enable
|
## `-d:x switch <nimc.html#compiler-usage-compileminustime-symbols>`_ to enable
|
||||||
## build time conditionals:
|
## build time conditionals:
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
|
|
@ -1152,7 +1152,7 @@ when defined(nimdoc):
|
||||||
## Stops the program immediately with an exit code.
|
## Stops the program immediately with an exit code.
|
||||||
##
|
##
|
||||||
## Before stopping the program the "exit procedures" are called in the
|
## Before stopping the program the "exit procedures" are called in the
|
||||||
## opposite order they were added with `addExitProc <exitprocs.html#addExitProc,proc>`_.
|
## opposite order they were added with `addExitProc <exitprocs.html#addExitProc,proc)>`_.
|
||||||
## ``quit`` never returns and ignores any exception that may have been raised
|
## ``quit`` never returns and ignores any exception that may have been raised
|
||||||
## by the quit procedures. It does *not* call the garbage collector to free
|
## by the quit procedures. It does *not* call the garbage collector to free
|
||||||
## all the memory, unless a quit procedure calls `GC_fullCollect
|
## all the memory, unless a quit procedure calls `GC_fullCollect
|
||||||
|
|
@ -1225,7 +1225,7 @@ when defined(gcDestructors):
|
||||||
## respected.
|
## respected.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `& proc <#&,seq[T][T],seq[T][T]>`_
|
## * `& proc <#&,seq[T],seq[T]>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## var s: seq[string] = @["test2","test2"]
|
## var s: seq[string] = @["test2","test2"]
|
||||||
|
|
@ -1250,7 +1250,7 @@ else:
|
||||||
## respected.
|
## respected.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `& proc <#&,seq[T][T],seq[T][T]>`_
|
## * `& proc <#&,seq[T],seq[T]>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## var s: seq[string] = @["test2","test2"]
|
## var s: seq[string] = @["test2","test2"]
|
||||||
|
|
@ -1274,7 +1274,7 @@ proc del*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
|
||||||
## This is an `O(1)` operation.
|
## This is an `O(1)` operation.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `delete <#delete,seq[T][T],Natural>`_ for preserving the order
|
## * `delete <#delete,seq[T],Natural>`_ for preserving the order
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## var i = @[1, 2, 3, 4, 5]
|
## var i = @[1, 2, 3, 4, 5]
|
||||||
|
|
@ -1289,7 +1289,7 @@ proc delete*[T](x: var seq[T], i: Natural) {.noSideEffect.} =
|
||||||
## This is an `O(n)` operation.
|
## This is an `O(n)` operation.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `del <#delete,seq[T][T],Natural>`_ for O(1) operation
|
## * `del <#delete,seq[T],Natural>`_ for O(1) operation
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## var i = @[1, 2, 3, 4, 5]
|
## var i = @[1, 2, 3, 4, 5]
|
||||||
|
|
@ -1575,7 +1575,7 @@ proc isNil*(x: string): bool {.noSideEffect, magic: "IsNil", nilError.}
|
||||||
## Requires `--nilseqs:on`.
|
## Requires `--nilseqs:on`.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `isNil(seq[T]) <#isNil,seq[T][T]>`_
|
## * `isNil(seq[T]) <#isNil,seq[T]>`_
|
||||||
|
|
||||||
proc isNil*[T](x: ptr T): bool {.noSideEffect, magic: "IsNil".}
|
proc isNil*[T](x: ptr T): bool {.noSideEffect, magic: "IsNil".}
|
||||||
proc isNil*(x: pointer): bool {.noSideEffect, magic: "IsNil".}
|
proc isNil*(x: pointer): bool {.noSideEffect, magic: "IsNil".}
|
||||||
|
|
@ -1602,7 +1602,7 @@ when defined(nimSeqsV2):
|
||||||
## Requires copying of the sequences.
|
## Requires copying of the sequences.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `add(var seq[T], openArray[T]) <#add,seq[T][T],openArray[T]>`_
|
## * `add(var seq[T], openArray[T]) <#add,seq[T],openArray[T]>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
|
## assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
|
||||||
|
|
@ -1618,7 +1618,7 @@ when defined(nimSeqsV2):
|
||||||
## Requires copying of the sequence.
|
## Requires copying of the sequence.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `add(var seq[T], T) <#add,seq[T][T],T>`_
|
## * `add(var seq[T], T) <#add,seq[T],sinkT>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
||||||
|
|
@ -1647,7 +1647,7 @@ else:
|
||||||
## Requires copying of the sequences.
|
## Requires copying of the sequences.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `add(var seq[T], openArray[T]) <#add,seq[T][T],openArray[T]>`_
|
## * `add(var seq[T], openArray[T]) <#add,seq[T],openArray[T]>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
|
## assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
|
||||||
|
|
@ -1663,7 +1663,7 @@ else:
|
||||||
## Requires copying of the sequence.
|
## Requires copying of the sequence.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `add(var seq[T], T) <#add,seq[T][T],T>`_
|
## * `add(var seq[T], T) <#add,seq[T],sinkT>`_
|
||||||
##
|
##
|
||||||
## .. code-block:: Nim
|
## .. code-block:: Nim
|
||||||
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
||||||
|
|
@ -2950,7 +2950,7 @@ template closureScope*(body: untyped): untyped =
|
||||||
## their current iteration values.
|
## their current iteration values.
|
||||||
##
|
##
|
||||||
## Note: This template may not work in some cases, use
|
## Note: This template may not work in some cases, use
|
||||||
## `capture <sugar.html#capture.m,openArray[typed],untyped>`_ instead.
|
## `capture <sugar.html#capture.m,varargs[typed],untyped>`_ instead.
|
||||||
##
|
##
|
||||||
## Example:
|
## Example:
|
||||||
##
|
##
|
||||||
|
|
|
||||||
|
|
@ -48,7 +48,7 @@ template assert*(cond: untyped, msg = "") =
|
||||||
##
|
##
|
||||||
## The compiler may not generate any code at all for ``assert`` if it is
|
## The compiler may not generate any code at all for ``assert`` if it is
|
||||||
## advised to do so through the ``-d:danger`` or ``--assertions:off``
|
## advised to do so through the ``-d:danger`` or ``--assertions:off``
|
||||||
## `command line switches <nimc.html#compiler-usage-command-line-switches>`_.
|
## `command line switches <nimc.html#compiler-usage-commandminusline-switches>`_.
|
||||||
##
|
##
|
||||||
## .. code-block:: nim
|
## .. code-block:: nim
|
||||||
## static: assert 1 == 9, "This assertion generates code when not built with -d:danger or --assertions:off"
|
## static: assert 1 == 9, "This assertion generates code when not built with -d:danger or --assertions:off"
|
||||||
|
|
|
||||||
|
|
@ -77,16 +77,16 @@ when hasAlloc and not defined(js):
|
||||||
template alloc*(size: Natural): pointer =
|
template alloc*(size: Natural): pointer =
|
||||||
## Allocates a new memory block with at least ``size`` bytes.
|
## Allocates a new memory block with at least ``size`` bytes.
|
||||||
##
|
##
|
||||||
## The block has to be freed with `realloc(block, 0) <#realloc,pointer,Natural>`_
|
## The block has to be freed with `realloc(block, 0) <#realloc.t,pointer,Natural>`_
|
||||||
## or `dealloc(block) <#dealloc,pointer>`_.
|
## or `dealloc(block) <#dealloc,pointer>`_.
|
||||||
## The block is not initialized, so reading
|
## The block is not initialized, so reading
|
||||||
## from it before writing to it is undefined behaviour!
|
## from it before writing to it is undefined behaviour!
|
||||||
##
|
##
|
||||||
## The allocated memory belongs to its allocating thread!
|
## The allocated memory belongs to its allocating thread!
|
||||||
## Use `allocShared <#allocShared,Natural>`_ to allocate from a shared heap.
|
## Use `allocShared <#allocShared.t,Natural>`_ to allocate from a shared heap.
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## * `alloc0 <#alloc0,Natural>`_
|
## * `alloc0 <#alloc0.t,Natural>`_
|
||||||
incStat(allocCount)
|
incStat(allocCount)
|
||||||
allocImpl(size)
|
allocImpl(size)
|
||||||
|
|
||||||
|
|
@ -108,13 +108,13 @@ when hasAlloc and not defined(js):
|
||||||
template alloc0*(size: Natural): pointer =
|
template alloc0*(size: Natural): pointer =
|
||||||
## Allocates a new memory block with at least ``size`` bytes.
|
## Allocates a new memory block with at least ``size`` bytes.
|
||||||
##
|
##
|
||||||
## The block has to be freed with `realloc(block, 0) <#realloc,pointer,Natural>`_
|
## The block has to be freed with `realloc(block, 0) <#realloc.t,pointer,Natural>`_
|
||||||
## or `dealloc(block) <#dealloc,pointer>`_.
|
## or `dealloc(block) <#dealloc,pointer>`_.
|
||||||
## The block is initialized with all bytes containing zero, so it is
|
## The block is initialized with all bytes containing zero, so it is
|
||||||
## somewhat safer than `alloc <#alloc,Natural>`_.
|
## somewhat safer than `alloc <#alloc.t,Natural>`_.
|
||||||
##
|
##
|
||||||
## The allocated memory belongs to its allocating thread!
|
## The allocated memory belongs to its allocating thread!
|
||||||
## Use `allocShared0 <#allocShared0,Natural>`_ to allocate from a shared heap.
|
## Use `allocShared0 <#allocShared0.t,Natural>`_ to allocate from a shared heap.
|
||||||
incStat(allocCount)
|
incStat(allocCount)
|
||||||
alloc0Impl(size)
|
alloc0Impl(size)
|
||||||
|
|
||||||
|
|
@ -140,7 +140,7 @@ when hasAlloc and not defined(js):
|
||||||
## `dealloc(block) <#dealloc,pointer>`_.
|
## `dealloc(block) <#dealloc,pointer>`_.
|
||||||
##
|
##
|
||||||
## The allocated memory belongs to its allocating thread!
|
## The allocated memory belongs to its allocating thread!
|
||||||
## Use `reallocShared <#reallocShared,pointer,Natural>`_ to reallocate
|
## Use `reallocShared <#reallocShared.t,pointer,Natural>`_ to reallocate
|
||||||
## from a shared heap.
|
## from a shared heap.
|
||||||
reallocImpl(p, newSize)
|
reallocImpl(p, newSize)
|
||||||
|
|
||||||
|
|
@ -157,7 +157,7 @@ when hasAlloc and not defined(js):
|
||||||
## somewhat safer then realloc
|
## somewhat safer then realloc
|
||||||
##
|
##
|
||||||
## The allocated memory belongs to its allocating thread!
|
## The allocated memory belongs to its allocating thread!
|
||||||
## Use `reallocShared <#reallocShared,pointer,Natural>`_ to reallocate
|
## Use `reallocShared <#reallocShared.t,pointer,Natural>`_ to reallocate
|
||||||
## from a shared heap.
|
## from a shared heap.
|
||||||
realloc0Impl(p, oldSize, newSize)
|
realloc0Impl(p, oldSize, newSize)
|
||||||
|
|
||||||
|
|
@ -193,14 +193,14 @@ when hasAlloc and not defined(js):
|
||||||
## least ``size`` bytes.
|
## least ``size`` bytes.
|
||||||
##
|
##
|
||||||
## The block has to be freed with
|
## The block has to be freed with
|
||||||
## `reallocShared(block, 0) <#reallocShared,pointer,Natural>`_
|
## `reallocShared(block, 0) <#reallocShared.t,pointer,Natural>`_
|
||||||
## or `deallocShared(block) <#deallocShared,pointer>`_.
|
## or `deallocShared(block) <#deallocShared,pointer>`_.
|
||||||
##
|
##
|
||||||
## The block is not initialized, so reading from it before writing
|
## The block is not initialized, so reading from it before writing
|
||||||
## to it is undefined behaviour!
|
## to it is undefined behaviour!
|
||||||
##
|
##
|
||||||
## See also:
|
## See also:
|
||||||
## `allocShared0 <#allocShared0,Natural>`_.
|
## `allocShared0 <#allocShared0.t,Natural>`_.
|
||||||
incStat(allocCount)
|
incStat(allocCount)
|
||||||
allocSharedImpl(size)
|
allocSharedImpl(size)
|
||||||
|
|
||||||
|
|
@ -225,12 +225,12 @@ when hasAlloc and not defined(js):
|
||||||
## least ``size`` bytes.
|
## least ``size`` bytes.
|
||||||
##
|
##
|
||||||
## The block has to be freed with
|
## The block has to be freed with
|
||||||
## `reallocShared(block, 0) <#reallocShared,pointer,Natural>`_
|
## `reallocShared(block, 0) <#reallocShared.t,pointer,Natural>`_
|
||||||
## or `deallocShared(block) <#deallocShared,pointer>`_.
|
## or `deallocShared(block) <#deallocShared,pointer>`_.
|
||||||
##
|
##
|
||||||
## The block is initialized with all bytes
|
## The block is initialized with all bytes
|
||||||
## containing zero, so it is somewhat safer than
|
## containing zero, so it is somewhat safer than
|
||||||
## `allocShared <#allocShared,Natural>`_.
|
## `allocShared <#allocShared.t,Natural>`_.
|
||||||
incStat(allocCount)
|
incStat(allocCount)
|
||||||
allocShared0Impl(size)
|
allocShared0Impl(size)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -53,9 +53,9 @@ Proc Usage
|
||||||
and a given capacity
|
and a given capacity
|
||||||
`setLen<#setLen,seq[T],Natural>`_ Set the length of a sequence
|
`setLen<#setLen,seq[T],Natural>`_ Set the length of a sequence
|
||||||
`len<#len,seq[T]>`_ Return the length of a sequence
|
`len<#len,seq[T]>`_ Return the length of a sequence
|
||||||
`@<#@>`_ Turn an array into a sequence
|
`@<#@,openArray[T]>`_ Turn an array into a sequence
|
||||||
`add<#add,seq[T],>`_ Add an item to the sequence
|
`add<#add,seq[T],sinkT>`_ Add an item to the sequence
|
||||||
`insert<#insert,seq[T],>`_ Insert an item at a specific position
|
`insert<#insert,seq[T],sinkT>`_ Insert an item at a specific position
|
||||||
`delete<#delete,seq[T],Natural>`_ Delete an item while preserving the
|
`delete<#delete,seq[T],Natural>`_ Delete an item while preserving the
|
||||||
order of elements (`O(n)` operation)
|
order of elements (`O(n)` operation)
|
||||||
`del<#del,seq[T],Natural>`_ `O(1)` removal, doesn't preserve the order
|
`del<#del,seq[T],Natural>`_ `O(1)` removal, doesn't preserve the order
|
||||||
|
|
@ -152,9 +152,9 @@ Proc Usage
|
||||||
Misc
|
Misc
|
||||||
----
|
----
|
||||||
|
|
||||||
============================================= ============================================
|
==================================================== ============================================
|
||||||
Proc Usage
|
Proc Usage
|
||||||
============================================= ============================================
|
==================================================== ============================================
|
||||||
`is<#is,T,S>`_ Check if two arguments are of the same type
|
`is<#is,T,S>`_ Check if two arguments are of the same type
|
||||||
`isnot<#isnot.t,untyped,untyped>`_ Negated version of `is`
|
`isnot<#isnot.t,untyped,untyped>`_ Negated version of `is`
|
||||||
`!=<#!%3D.t,untyped,untyped>`_ Not equals
|
`!=<#!%3D.t,untyped,untyped>`_ Not equals
|
||||||
|
|
@ -164,9 +164,9 @@ Proc Usage
|
||||||
`T xor F<#xor,bool,bool>`_ Boolean `xor` (exclusive or)
|
`T xor F<#xor,bool,bool>`_ Boolean `xor` (exclusive or)
|
||||||
`not T<#not,bool>`_ Boolean `not`
|
`not T<#not,bool>`_ Boolean `not`
|
||||||
`a[^x]<#^.t,int>`_ Take the element at the reversed index `x`
|
`a[^x]<#^.t,int>`_ Take the element at the reversed index `x`
|
||||||
`a .. b<#..,T,U>`_ Binary slice that constructs an interval
|
`a .. b<#..,sinkT,sinkU>`_ Binary slice that constructs an interval
|
||||||
`[a, b]`
|
`[a, b]`
|
||||||
`a ..^ b<#..^.t,untyped,untyped>`_ Interval `[a, b]` but `b` as reversed index
|
`a ..^ b<#..^.t,untyped,untyped>`_ Interval `[a, b]` but `b` as reversed index
|
||||||
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
|
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
|
||||||
[runnableExamples](#runnableExamples,untyped) Create testable documentation
|
[runnableExamples](#runnableExamples,string,untyped) Create testable documentation
|
||||||
============================================= ============================================
|
==================================================== ============================================
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue