mirror of
https://github.com/nim-lang/Nim.git
synced 2025-12-28 17:04:41 +00:00
Fix broken links in docs (#16336)
* Fix broken links in docs * Fix rand HSlice links
This commit is contained in:
@@ -316,7 +316,7 @@ symbols in the `system module <system.html>`_.
|
||||
* ``proc len[T](x: seq[T]): int {.magic: "LengthSeq", noSideEffect.}`` **=>**
|
||||
`#len,seq[T] <system.html#len,seq[T]>`_
|
||||
* ``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;
|
||||
parentException: ref Exception = nil): untyped`` **=>**
|
||||
`#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
|
||||
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:
|
||||
|
||||
@@ -3653,7 +3653,7 @@ Creating closures in loops
|
||||
Since closures capture local variables by reference it is often not wanted
|
||||
behavior inside loop bodies. See `closureScope
|
||||
<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
|
||||
---------------
|
||||
|
||||
@@ -1315,11 +1315,11 @@ Sequence variables are initialized with ``@[]``.
|
||||
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
|
||||
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
|
||||
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
|
||||
`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:
|
||||
|
||||
.. code-block:: nim
|
||||
|
||||
@@ -107,7 +107,7 @@ type
|
||||
timing*: PerformanceTiming
|
||||
|
||||
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
|
||||
commonAncestorContainer*: Node
|
||||
endContainer*: Node
|
||||
|
||||
@@ -235,7 +235,7 @@ template implementSetInheritable() {.dirty.} =
|
||||
## Returns ``true`` on success.
|
||||
##
|
||||
## 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)
|
||||
|
||||
when defined(windows) or defined(nimdoc):
|
||||
|
||||
@@ -64,7 +64,7 @@ type
|
||||
HashSet*[A] {.myShallow.} = object ## \
|
||||
## 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.
|
||||
data: KeyValuePairSeq[A]
|
||||
counter: int
|
||||
@@ -76,8 +76,8 @@ type
|
||||
OrderedSet*[A] {.myShallow.} = object ## \
|
||||
## A generic hash set that remembers insertion order.
|
||||
##
|
||||
## Use `init proc <#init,OrderedSet[A],int>`_ or `initOrderedSet proc
|
||||
## <#initOrderedSet,int>`_ before calling other procs on it.
|
||||
## Use `init proc <#init,OrderedSet[A]>`_ or `initOrderedSet proc
|
||||
## <#initOrderedSet>`_ before calling other procs on it.
|
||||
data: OrderedKeyValuePairSeq[A]
|
||||
counter, first, last: int
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `initHashSet proc <#initHashSet,int>`_
|
||||
## * `initHashSet proc <#initHashSet>`_
|
||||
## * `toHashSet proc <#toHashSet,openArray[A]>`_
|
||||
runnableExamples:
|
||||
var a: HashSet[int]
|
||||
@@ -113,7 +113,7 @@ proc init*[A](s: var HashSet[A], initialSize = defaultInitialSize) =
|
||||
initImpl(s, initialSize)
|
||||
|
||||
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.
|
||||
##
|
||||
## 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.
|
||||
##
|
||||
## See also:
|
||||
## * `initHashSet proc <#initHashSet,int>`_
|
||||
## * `initHashSet proc <#initHashSet>`_
|
||||
runnableExamples:
|
||||
let
|
||||
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:
|
||||
"Deprecated since v0.20; sets are initialized by default".} =
|
||||
## 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:**
|
||||
##
|
||||
@@ -640,7 +640,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
|
||||
## existing values and calling `excl() <#excl,HashSet[A],A>`_ on them.
|
||||
##
|
||||
## See also:
|
||||
## * `initOrderedSet proc <#initOrderedSet,int>`_
|
||||
## * `initOrderedSet proc <#initOrderedSet>`_
|
||||
## * `toOrderedSet proc <#toOrderedSet,openArray[A]>`_
|
||||
runnableExamples:
|
||||
var a: OrderedSet[int]
|
||||
@@ -649,7 +649,7 @@ proc init*[A](s: var OrderedSet[A], initialSize = defaultInitialSize) =
|
||||
initImpl(s, initialSize)
|
||||
|
||||
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.
|
||||
##
|
||||
## 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.
|
||||
##
|
||||
## See also:
|
||||
## * `initOrderedSet proc <#initOrderedSet,int>`_
|
||||
## * `initOrderedSet proc <#initOrderedSet>`_
|
||||
runnableExamples:
|
||||
let
|
||||
a = toOrderedSet([5, 3, 2])
|
||||
|
||||
@@ -135,7 +135,7 @@
|
||||
##
|
||||
## The same could have been achieved by manually iterating over a container
|
||||
## and increasing each key's value with `inc proc
|
||||
## <#inc,CountTable[A],A,Positive>`_:
|
||||
## <#inc,CountTable[A],A,int>`_:
|
||||
##
|
||||
## .. code-block::
|
||||
## import tables
|
||||
@@ -230,13 +230,13 @@ type
|
||||
## `data` and `counter` are internal implementation details which
|
||||
## 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]
|
||||
counter: int
|
||||
TableRef*[A, B] = ref Table[A, B] ## Ref version of `Table<#Table>`_.
|
||||
##
|
||||
## For creating a new empty TableRef, use `newTable proc
|
||||
## <#newTable,int>`_.
|
||||
## <#newTable>`_.
|
||||
|
||||
const
|
||||
defaultInitialSize* = 32
|
||||
@@ -293,7 +293,7 @@ proc initTable*[A, B](initialSize = defaultInitialSize): Table[A, B] =
|
||||
##
|
||||
## See also:
|
||||
## * `toTable proc<#toTable,openArray[]>`_
|
||||
## * `newTable proc<#newTable,int>`_ for creating a `TableRef`
|
||||
## * `newTable proc<#newTable>`_ for creating a `TableRef`
|
||||
runnableExamples:
|
||||
let
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `initTable proc<#initTable,int>`_
|
||||
## * `initTable proc<#initTable>`_
|
||||
## * `newTable proc<#newTable,openArray[]>`_ for a `TableRef` version
|
||||
runnableExamples:
|
||||
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``.
|
||||
##
|
||||
## 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:
|
||||
import sequtils, algorithm
|
||||
@@ -801,7 +801,7 @@ proc newTable*[A, B](initialSize = defaultInitialSize): <//>TableRef[A, B] =
|
||||
## See also:
|
||||
## * `newTable proc<#newTable,openArray[]>`_ for creating a `TableRef`
|
||||
## from a collection of `(key, value)` pairs
|
||||
## * `initTable proc<#initTable,int>`_ for creating a `Table`
|
||||
## * `initTable proc<#initTable>`_ for creating a `Table`
|
||||
runnableExamples:
|
||||
let
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `newTable proc<#newTable,int>`_
|
||||
## * `newTable proc<#newTable>`_
|
||||
## * `toTable proc<#toTable,openArray[]>`_ for a `Table` version
|
||||
runnableExamples:
|
||||
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
|
||||
## * `getOrDefault proc<#getOrDefault,TableRef[A,B],A,B>`_ to return
|
||||
## 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
|
||||
## * `hasKey proc<#hasKey,TableRef[A,B],A>`_ for checking if a key is in
|
||||
## 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!**
|
||||
##
|
||||
## 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.
|
||||
t[].add(key, val)
|
||||
|
||||
@@ -1228,14 +1228,14 @@ type
|
||||
## Hash table that remembers insertion order.
|
||||
##
|
||||
## For creating an empty OrderedTable, use `initOrderedTable proc
|
||||
## <#initOrderedTable,int>`_.
|
||||
## <#initOrderedTable>`_.
|
||||
data: OrderedKeyValuePairSeq[A, B]
|
||||
counter, first, last: int
|
||||
OrderedTableRef*[A, B] = ref OrderedTable[A, B] ## Ref version of
|
||||
## `OrderedTable<#OrderedTable>`_.
|
||||
##
|
||||
## For creating a new empty OrderedTableRef, use `newOrderedTable proc
|
||||
## <#newOrderedTable,int>`_.
|
||||
## <#newOrderedTable>`_.
|
||||
|
||||
|
||||
# ------------------------------ helpers ---------------------------------
|
||||
@@ -1294,7 +1294,7 @@ proc initOrderedTable*[A, B](initialSize = defaultInitialSize): OrderedTable[A,
|
||||
##
|
||||
## See also:
|
||||
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_
|
||||
## * `newOrderedTable proc<#newOrderedTable,int>`_ for creating an
|
||||
## * `newOrderedTable proc<#newOrderedTable>`_ for creating an
|
||||
## `OrderedTableRef`
|
||||
runnableExamples:
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `initOrderedTable proc<#initOrderedTable,int>`_
|
||||
## * `initOrderedTable proc<#initOrderedTable>`_
|
||||
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for an
|
||||
## `OrderedTableRef` version
|
||||
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
|
||||
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
||||
## 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
|
||||
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
||||
## 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
|
||||
## * `getOrDefault proc<#getOrDefault,OrderedTable[A,B],A,B>`_ to return
|
||||
## 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
|
||||
## * `hasKey proc<#hasKey,OrderedTable[A,B],A>`_ for checking if a
|
||||
## 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!**
|
||||
##
|
||||
## 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.
|
||||
addImpl(enlarge)
|
||||
|
||||
@@ -1796,7 +1796,7 @@ proc newOrderedTable*[A, B](initialSize = defaultInitialSize): <//>OrderedTableR
|
||||
## See also:
|
||||
## * `newOrderedTable proc<#newOrderedTable,openArray[]>`_ for creating
|
||||
## an `OrderedTableRef` from a collection of `(key, value)` pairs
|
||||
## * `initOrderedTable proc<#initOrderedTable,int>`_ for creating an
|
||||
## * `initOrderedTable proc<#initOrderedTable>`_ for creating an
|
||||
## `OrderedTable`
|
||||
runnableExamples:
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `newOrderedTable proc<#newOrderedTable,int>`_
|
||||
## * `newOrderedTable proc<#newOrderedTable>`_
|
||||
## * `toOrderedTable proc<#toOrderedTable,openArray[]>`_ for an
|
||||
## `OrderedTable` version
|
||||
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
|
||||
## * `getOrDefault proc<#getOrDefault,OrderedTableRef[A,B],A,B>`_ to return
|
||||
## 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
|
||||
## * `hasKey proc<#hasKey,OrderedTableRef[A,B],A>`_ for checking if
|
||||
## 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!**
|
||||
##
|
||||
## 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.
|
||||
t[].add(key, val)
|
||||
|
||||
@@ -2208,7 +2208,7 @@ type
|
||||
## Hash table that counts the number of each key.
|
||||
##
|
||||
## For creating an empty CountTable, use `initCountTable proc
|
||||
## <#initCountTable,int>`_.
|
||||
## <#initCountTable>`_.
|
||||
data: seq[tuple[key: A, val: int]]
|
||||
counter: int
|
||||
isSorted: bool
|
||||
@@ -2216,7 +2216,7 @@ type
|
||||
## `CountTable<#CountTable>`_.
|
||||
##
|
||||
## For creating a new empty CountTableRef, use `newCountTable proc
|
||||
## <#newCountTable,int>`_.
|
||||
## <#newCountTable>`_.
|
||||
|
||||
|
||||
# ------------------------------ helpers ---------------------------------
|
||||
@@ -2260,7 +2260,7 @@ proc initCountTable*[A](initialSize = defaultInitialSize): CountTable[A] =
|
||||
##
|
||||
## See also:
|
||||
## * `toCountTable proc<#toCountTable,openArray[A]>`_
|
||||
## * `newCountTable proc<#newCountTable,int>`_ for creating a
|
||||
## * `newCountTable proc<#newCountTable>`_ for creating a
|
||||
## `CountTableRef`
|
||||
initImpl(result, initialSize)
|
||||
|
||||
@@ -2294,7 +2294,7 @@ proc `[]=`*[A](t: var CountTable[A], key: A, val: int) =
|
||||
##
|
||||
## See also:
|
||||
## * `[] 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
|
||||
assert(not t.isSorted, "CountTable must not be used after sorting")
|
||||
assert val >= 0
|
||||
@@ -2617,7 +2617,7 @@ proc newCountTable*[A](initialSize = defaultInitialSize): <//>CountTableRef[A] =
|
||||
## See also:
|
||||
## * `newCountTable proc<#newCountTable,openArray[A]>`_ for creating
|
||||
## a `CountTableRef` from a collection
|
||||
## * `initCountTable proc<#initCountTable,int>`_ for creating a
|
||||
## * `initCountTable proc<#initCountTable>`_ for creating a
|
||||
## `CountTable`
|
||||
new(result)
|
||||
result[] = initCountTable[A](initialSize)
|
||||
@@ -2635,7 +2635,7 @@ proc `[]`*[A](t: CountTableRef[A], key: A): int =
|
||||
## See also:
|
||||
## * `getOrDefault<#getOrDefault,CountTableRef[A],A,int>`_ to return
|
||||
## 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
|
||||
## (key, value) pair in the table
|
||||
## * `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
|
||||
## 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.
|
||||
##
|
||||
## ``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>`_
|
||||
## 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
|
||||
## ========
|
||||
@@ -565,7 +565,7 @@ proc newHttpClient*(userAgent = defUserAgent, maxRedirects = 5,
|
||||
## default is 5.
|
||||
##
|
||||
## ``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
|
||||
## connections.
|
||||
|
||||
@@ -246,7 +246,7 @@ when not defined(js):
|
||||
## rotation.
|
||||
##
|
||||
## 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.
|
||||
##
|
||||
@@ -395,7 +395,7 @@ proc newConsoleLogger*(levelThreshold = lvlAll, fmtStr = defaultFmtStr,
|
||||
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
||||
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
||||
## that accepts a filename
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||
##
|
||||
## **Examples:**
|
||||
##
|
||||
@@ -460,7 +460,7 @@ when not defined(js):
|
||||
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
||||
## * `newFileLogger proc<#newFileLogger,FileMode,int>`_
|
||||
## that accepts a filename
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||
##
|
||||
## **Examples:**
|
||||
##
|
||||
@@ -496,7 +496,7 @@ when not defined(js):
|
||||
## See also:
|
||||
## * `newConsoleLogger proc<#newConsoleLogger>`_
|
||||
## * `newFileLogger proc<#newFileLogger,File>`_ that uses a file handle
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,int,int>`_
|
||||
## * `newRollingFileLogger proc<#newRollingFileLogger,FileMode,Positive,int>`_
|
||||
##
|
||||
## **Examples:**
|
||||
##
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
##
|
||||
## 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
|
||||
## `newContext<net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring%2Cstring>`_
|
||||
## `newContext<net.html#newContext%2Cstring%2Cstring%2Cstring%2Cstring>`_
|
||||
## procedure for additional details.
|
||||
##
|
||||
## Examples
|
||||
|
||||
@@ -106,7 +106,7 @@ proc execCmd*(command: string): int {.rtl, extern: "nosp$1",
|
||||
## This operation is also often called `system`:idx:.
|
||||
##
|
||||
## See also:
|
||||
## * `execCmdEx proc <#execCmdEx,string,set[ProcessOption]>`_
|
||||
## * `execCmdEx proc <#execCmdEx,string,set[ProcessOption],StringTableRef,string,string>`_
|
||||
## * `startProcess proc
|
||||
## <#startProcess,string,string,openArray[string],StringTableRef,set[ProcessOption]>`_
|
||||
## * `execProcess proc
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
##
|
||||
## Its implementation is based on the ``xoroshiro128+``
|
||||
## (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
|
||||
##
|
||||
## **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
|
||||
## a given upper bound
|
||||
## * `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
|
||||
## * `skipRandomNumbers proc<#skipRandomNumbers,Rand>`_
|
||||
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
|
||||
## random number generator
|
||||
## * `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
|
||||
runnableExamples:
|
||||
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
|
||||
## provided state
|
||||
## * `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
|
||||
runnableExamples:
|
||||
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
|
||||
## random number generator
|
||||
## * `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
|
||||
runnableExamples:
|
||||
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
|
||||
## provided state
|
||||
## * `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
|
||||
runnableExamples:
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `rand proc<#rand,HSlice[T,T]>`_ that accepts a slice and uses the
|
||||
## default random number generator
|
||||
## * `rand proc<#rand,HSlice[T: Ordinal or float or float32 or float64,T: Ordinal or float or float32 or float64]>`_
|
||||
## that accepts a slice and uses the default random number generator
|
||||
## * `rand proc<#rand,Rand,Natural>`_ that returns an integer
|
||||
## * `rand proc<#rand,Rand,range[]>`_ that returns a float
|
||||
## * `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.
|
||||
##
|
||||
## See also:
|
||||
## * `rand proc<#rand,Rand,HSlice[T,T]>`_ that accepts a slice and uses
|
||||
## a provided state
|
||||
## * `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 and uses a provided state
|
||||
## * `rand proc<#rand,int>`_ that returns an integer
|
||||
## * `rand proc<#rand,float>`_ that returns a floating point number
|
||||
## * `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:
|
||||
## * `rand proc<#rand,int>`_ that returns an integer
|
||||
## * `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:
|
||||
randomize(567)
|
||||
doAssert rand(int8) == 55
|
||||
|
||||
@@ -99,7 +99,7 @@ proc debugRecv*(smtp: Smtp | AsyncSmtp): Future[TaintedString] {.multisync.} =
|
||||
## this is if you are implementing any
|
||||
## `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()
|
||||
if smtp.debug:
|
||||
@@ -211,7 +211,7 @@ proc quitExcpt(smtp: AsyncSmtp, msg: string): Future[void] =
|
||||
return retFuture
|
||||
|
||||
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
|
||||
## with ``reply``, then a ``QUIT`` command will be sent to the SMTP
|
||||
## 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``.
|
||||
##
|
||||
## See also:
|
||||
## * `$ proc <#$,seq[T][Rune]>`_ for a reverse operation
|
||||
## * `$ proc <#$,Rune>`_ for a reverse operation
|
||||
runnableExamples:
|
||||
let a = toRunes("aáä")
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `toJsonHook proc<#toJsonHook,(Table[K,V]|OrderedTable[K,V])>`_
|
||||
## * `toJsonHook proc<#toJsonHook>`_
|
||||
runnableExamples:
|
||||
import tables, json
|
||||
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.
|
||||
##
|
||||
## See also:
|
||||
## * `fromJsonHook proc<#fromJsonHook,(Table[K,V]|OrderedTable[K,V]),JsonNode>`_
|
||||
## * `fromJsonHook proc<#fromJsonHook,,JsonNode>`_
|
||||
runnableExamples:
|
||||
import tables, json
|
||||
let foo = (
|
||||
@@ -383,7 +383,7 @@ proc fromJsonHook*(a: var StringTableRef, b: JsonNode) =
|
||||
## Enables `fromJson` for `StringTableRef` type.
|
||||
##
|
||||
## See also:
|
||||
## * `toJsonHook` proc<#toJsonHook,StringTableRef>`_
|
||||
## * `toJsonHook proc<#toJsonHook,StringTableRef>`_
|
||||
runnableExamples:
|
||||
import strtabs, json
|
||||
var t = newStringTable(modeCaseSensitive)
|
||||
@@ -401,7 +401,7 @@ proc toJsonHook*(a: StringTableRef): JsonNode =
|
||||
## Enables `toJson` for `StringTableRef` type.
|
||||
##
|
||||
## See also:
|
||||
## * `fromJsonHook` proc<#fromJsonHook,StringTableRef,JsonNode>`_
|
||||
## * `fromJsonHook proc<#fromJsonHook,StringTableRef,JsonNode>`_
|
||||
runnableExamples:
|
||||
import strtabs, json
|
||||
let t = newStringTable("name", "John", "surname", "Doe", modeCaseSensitive)
|
||||
|
||||
@@ -165,7 +165,7 @@ proc initPackedSet*[A]: PackedSet[A] =
|
||||
## A must be Ordinal
|
||||
##
|
||||
## See also:
|
||||
## * `toPackedSet[A] proc <#toPackedSet[A],openArray[int]>`_
|
||||
## * `toPackedSet[A] proc <#toPackedSet,openArray[A]>`_
|
||||
runnableExamples:
|
||||
var a = initPackedSet[int]()
|
||||
assert len(a) == 0
|
||||
@@ -273,7 +273,7 @@ proc toPackedSet*[A](x: openArray[A]): PackedSet[A] {.since: (1, 3).} =
|
||||
## Duplicates are removed.
|
||||
##
|
||||
## See also:
|
||||
## * `initPackedSet[A] proc <#initPackedSet[A]>`_
|
||||
## * `initPackedSet[A] proc <#initPackedSet>`_
|
||||
runnableExamples:
|
||||
var
|
||||
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]) =
|
||||
## 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:
|
||||
var
|
||||
a = initPackedSet[int]()
|
||||
|
||||
@@ -96,7 +96,7 @@ proc defined*(x: untyped): bool {.magic: "Defined", noSideEffect, compileTime.}
|
||||
## defined.
|
||||
##
|
||||
## `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:
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
@@ -1152,7 +1152,7 @@ when defined(nimdoc):
|
||||
## Stops the program immediately with an exit code.
|
||||
##
|
||||
## 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
|
||||
## by the quit procedures. It does *not* call the garbage collector to free
|
||||
## all the memory, unless a quit procedure calls `GC_fullCollect
|
||||
@@ -1225,7 +1225,7 @@ when defined(gcDestructors):
|
||||
## respected.
|
||||
##
|
||||
## See also:
|
||||
## * `& proc <#&,seq[T][T],seq[T][T]>`_
|
||||
## * `& proc <#&,seq[T],seq[T]>`_
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## var s: seq[string] = @["test2","test2"]
|
||||
@@ -1250,7 +1250,7 @@ else:
|
||||
## respected.
|
||||
##
|
||||
## See also:
|
||||
## * `& proc <#&,seq[T][T],seq[T][T]>`_
|
||||
## * `& proc <#&,seq[T],seq[T]>`_
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## 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.
|
||||
##
|
||||
## See also:
|
||||
## * `delete <#delete,seq[T][T],Natural>`_ for preserving the order
|
||||
## * `delete <#delete,seq[T],Natural>`_ for preserving the order
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## 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.
|
||||
##
|
||||
## See also:
|
||||
## * `del <#delete,seq[T][T],Natural>`_ for O(1) operation
|
||||
## * `del <#delete,seq[T],Natural>`_ for O(1) operation
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## var i = @[1, 2, 3, 4, 5]
|
||||
@@ -1575,7 +1575,7 @@ proc isNil*(x: string): bool {.noSideEffect, magic: "IsNil", nilError.}
|
||||
## Requires `--nilseqs:on`.
|
||||
##
|
||||
## 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*(x: pointer): bool {.noSideEffect, magic: "IsNil".}
|
||||
@@ -1602,7 +1602,7 @@ when defined(nimSeqsV2):
|
||||
## Requires copying of the sequences.
|
||||
##
|
||||
## 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
|
||||
## 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.
|
||||
##
|
||||
## See also:
|
||||
## * `add(var seq[T], T) <#add,seq[T][T],T>`_
|
||||
## * `add(var seq[T], T) <#add,seq[T],sinkT>`_
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
||||
@@ -1647,7 +1647,7 @@ else:
|
||||
## Requires copying of the sequences.
|
||||
##
|
||||
## 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
|
||||
## assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
|
||||
@@ -1663,7 +1663,7 @@ else:
|
||||
## Requires copying of the sequence.
|
||||
##
|
||||
## See also:
|
||||
## * `add(var seq[T], T) <#add,seq[T][T],T>`_
|
||||
## * `add(var seq[T], T) <#add,seq[T],sinkT>`_
|
||||
##
|
||||
## .. code-block:: Nim
|
||||
## assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
|
||||
@@ -2950,7 +2950,7 @@ template closureScope*(body: untyped): untyped =
|
||||
## their current iteration values.
|
||||
##
|
||||
## 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:
|
||||
##
|
||||
|
||||
@@ -48,7 +48,7 @@ template assert*(cond: untyped, msg = "") =
|
||||
##
|
||||
## 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``
|
||||
## `command line switches <nimc.html#compiler-usage-command-line-switches>`_.
|
||||
## `command line switches <nimc.html#compiler-usage-commandminusline-switches>`_.
|
||||
##
|
||||
## .. code-block:: nim
|
||||
## 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 =
|
||||
## 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>`_.
|
||||
## The block is not initialized, so reading
|
||||
## from it before writing to it is undefined behaviour!
|
||||
##
|
||||
## 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:
|
||||
## * `alloc0 <#alloc0,Natural>`_
|
||||
## * `alloc0 <#alloc0.t,Natural>`_
|
||||
incStat(allocCount)
|
||||
allocImpl(size)
|
||||
|
||||
@@ -108,13 +108,13 @@ when hasAlloc and not defined(js):
|
||||
template alloc0*(size: Natural): pointer =
|
||||
## 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>`_.
|
||||
## 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!
|
||||
## Use `allocShared0 <#allocShared0,Natural>`_ to allocate from a shared heap.
|
||||
## Use `allocShared0 <#allocShared0.t,Natural>`_ to allocate from a shared heap.
|
||||
incStat(allocCount)
|
||||
alloc0Impl(size)
|
||||
|
||||
@@ -140,7 +140,7 @@ when hasAlloc and not defined(js):
|
||||
## `dealloc(block) <#dealloc,pointer>`_.
|
||||
##
|
||||
## 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.
|
||||
reallocImpl(p, newSize)
|
||||
|
||||
@@ -157,7 +157,7 @@ when hasAlloc and not defined(js):
|
||||
## somewhat safer then realloc
|
||||
##
|
||||
## 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.
|
||||
realloc0Impl(p, oldSize, newSize)
|
||||
|
||||
@@ -193,14 +193,14 @@ when hasAlloc and not defined(js):
|
||||
## least ``size`` bytes.
|
||||
##
|
||||
## 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>`_.
|
||||
##
|
||||
## The block is not initialized, so reading from it before writing
|
||||
## to it is undefined behaviour!
|
||||
##
|
||||
## See also:
|
||||
## `allocShared0 <#allocShared0,Natural>`_.
|
||||
## `allocShared0 <#allocShared0.t,Natural>`_.
|
||||
incStat(allocCount)
|
||||
allocSharedImpl(size)
|
||||
|
||||
@@ -225,12 +225,12 @@ when hasAlloc and not defined(js):
|
||||
## least ``size`` bytes.
|
||||
##
|
||||
## 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>`_.
|
||||
##
|
||||
## The block is initialized with all bytes
|
||||
## containing zero, so it is somewhat safer than
|
||||
## `allocShared <#allocShared,Natural>`_.
|
||||
## `allocShared <#allocShared.t,Natural>`_.
|
||||
incStat(allocCount)
|
||||
allocShared0Impl(size)
|
||||
|
||||
|
||||
@@ -53,9 +53,9 @@ Proc Usage
|
||||
and a given capacity
|
||||
`setLen<#setLen,seq[T],Natural>`_ Set the length of a sequence
|
||||
`len<#len,seq[T]>`_ Return the length of a sequence
|
||||
`@<#@>`_ Turn an array into a sequence
|
||||
`add<#add,seq[T],>`_ Add an item to the sequence
|
||||
`insert<#insert,seq[T],>`_ Insert an item at a specific position
|
||||
`@<#@,openArray[T]>`_ Turn an array into a sequence
|
||||
`add<#add,seq[T],sinkT>`_ Add an item to the sequence
|
||||
`insert<#insert,seq[T],sinkT>`_ Insert an item at a specific position
|
||||
`delete<#delete,seq[T],Natural>`_ Delete an item while preserving the
|
||||
order of elements (`O(n)` operation)
|
||||
`del<#del,seq[T],Natural>`_ `O(1)` removal, doesn't preserve the order
|
||||
@@ -152,21 +152,21 @@ Proc Usage
|
||||
Misc
|
||||
----
|
||||
|
||||
============================================= ============================================
|
||||
Proc Usage
|
||||
============================================= ============================================
|
||||
`is<#is,T,S>`_ Check if two arguments are of the same type
|
||||
`isnot<#isnot.t,untyped,untyped>`_ Negated version of `is`
|
||||
`!=<#!%3D.t,untyped,untyped>`_ Not equals
|
||||
`addr<#addr,T>`_ Take the address of a memory location
|
||||
`T and F<#and,bool,bool>`_ Boolean `and`
|
||||
`T or F<#or,bool,bool>`_ Boolean `or`
|
||||
`T xor F<#xor,bool,bool>`_ Boolean `xor` (exclusive or)
|
||||
`not T<#not,bool>`_ Boolean `not`
|
||||
`a[^x]<#^.t,int>`_ Take the element at the reversed index `x`
|
||||
`a .. b<#..,T,U>`_ Binary slice that constructs an interval
|
||||
`[a, b]`
|
||||
`a ..^ b<#..^.t,untyped,untyped>`_ Interval `[a, b]` but `b` as reversed index
|
||||
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
|
||||
[runnableExamples](#runnableExamples,untyped) Create testable documentation
|
||||
============================================= ============================================
|
||||
==================================================== ============================================
|
||||
Proc Usage
|
||||
==================================================== ============================================
|
||||
`is<#is,T,S>`_ Check if two arguments are of the same type
|
||||
`isnot<#isnot.t,untyped,untyped>`_ Negated version of `is`
|
||||
`!=<#!%3D.t,untyped,untyped>`_ Not equals
|
||||
`addr<#addr,T>`_ Take the address of a memory location
|
||||
`T and F<#and,bool,bool>`_ Boolean `and`
|
||||
`T or F<#or,bool,bool>`_ Boolean `or`
|
||||
`T xor F<#xor,bool,bool>`_ Boolean `xor` (exclusive or)
|
||||
`not T<#not,bool>`_ Boolean `not`
|
||||
`a[^x]<#^.t,int>`_ Take the element at the reversed index `x`
|
||||
`a .. b<#..,sinkT,sinkU>`_ Binary slice that constructs an interval
|
||||
`[a, b]`
|
||||
`a ..^ b<#..^.t,untyped,untyped>`_ Interval `[a, b]` but `b` as reversed index
|
||||
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
|
||||
[runnableExamples](#runnableExamples,string,untyped) Create testable documentation
|
||||
==================================================== ============================================
|
||||
|
||||
Reference in New Issue
Block a user