

Nim Documentation Overview
==========================

 The documentation consists of several documents:* [Tutorial (part I)](https://nim-lang.org/docs/tut1.html)  
The Nim tutorial part one deals with the basics.
* [Tutorial (part II)](https://nim-lang.org/docs/tut2.html)  
The Nim tutorial part two deals with the advanced language constructs.
* [Tutorial (part III)](https://nim-lang.org/docs/tut3.html)  
The Nim tutorial part three about Nim's macro system.
* [Language Manual](manual)  
The Nim manual is a draft that will evolve into a proper specification.
* [Library documentation](lib)  
This document describes Nim's standard library.
* [Compiler user guide](nimc)  
The user guide lists command line arguments, special features of the compiler, etc.
* [Tools documentation](https://nim-lang.org/docs/tools.html)  
Description of some tools that come with the standard distribution.
* [GC](gc)  
Additional documentation about Nim's multi-paradigm memory management strategies  
and how to operate them in a realtime setting.
* [Source code filters](filters)  
The Nim compiler supports source code filters as a simple yet powerful builtin templating system.
* [Internal documentation](intern)  
The internal documentation describes how the compiler is implemented. Read this if you want to hack the compiler.
* [Index](https://nim-lang.org/docs/theindex.html)  
The generated index. **Index + (Ctrl+F) == Joy**

 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/overview.html>

Nim Standard Library
====================


Nim's library is divided into *pure libraries*, *impure libraries*, and *wrappers*.

 Pure libraries do not depend on any external `*.dll` or `lib*.so` binary while impure libraries do. A wrapper is an impure library that is a very low-level interface to a C library.

 Read this [document](apis) for a quick overview of the API design.

 Nimble
------


Nim's standard library only covers the basics, check out <https://nimble.directory/> for a list of 3rd party packages.

 Pure libraries
--------------

 ### Automatic imports


* <system> Basic procs and operators that every program needs. It also provides IO facilities for reading and writing text and binary files. It is imported implicitly by the compiler. Do not import it directly. It relies on compiler magic to work.
* <threads> Basic Nim thread support. **Note**: This is part of the system module. Do not import it explicitly. Enabled with `--threads:on`.
* <channels> Nim message passing support for threads. **Note**: This is part of the system module. Do not import it explicitly. Enabled with `--threads:on`.

 ### Core


* <bitops> Provides a series of low-level methods for bit manipulation.
* <cpuinfo> This module implements procs to determine the number of CPUs / cores.
* <endians> This module contains helpers that deal with different byte orders.
* <lenientops> Provides binary operators for mixed integer/float expressions for convenience.
* <locks> Locks and condition variables for Nim.
* <macros> Contains the AST API and documentation of Nim for writing macros.
* <rlocks> Reentrant locks for Nim.
* <typeinfo> Provides (unsafe) access to Nim's run-time type information.
* <typetraits> This module defines compile-time reflection procs for working with types.
* <volatile> This module contains code for generating volatile loads and stores, which are useful in embedded and systems programming.

 ### Algorithms


* <algorithm> This module implements some common generic algorithms like sort or binary search.
* <sequtils> This module implements operations for the built-in seq type which were inspired by functional programming languages.

 ### Collections


* <critbits> This module implements a *crit bit tree* which is an efficient container for a sorted set of strings, or a sorted mapping of strings.
* <deques> Implementation of a double-ended queue. The underlying implementation uses a `seq`.
* <heapqueue> Implementation of a heap data structure that can be used as a priority queue.
* <intsets> Efficient implementation of a set of ints as a sparse bit set.
* <lists> Nim linked list support. Contains singly and doubly linked lists and circular lists ("rings").
* <options> The option type encapsulates an optional value.
* <sets> Nim hash and bit set support.
* <sharedlist> Nim shared linked list support. Contains a shared singly-linked list.
* <sharedtables> Nim shared hash table support. Contains shared tables.
* <tables> Nim hash table support. Contains tables, ordered tables, and count tables.

 ### String handling


* <cstrutils> Utilities for `cstring` handling.
* [std/editdistance](editdistance) This module contains an algorithm to compute the edit distance between two Unicode strings.
* <encodings> Converts between different character encodings. On UNIX, this uses the `iconv` library, on Windows the Windows API.
* <parseutils> This module contains helpers for parsing tokens, numbers, identifiers, etc.
* <pegs> This module contains procedures and operators for handling PEGs.
* <punycode> Implements a representation of Unicode with the limited ASCII character subset.
* <ropes> This module contains support for a *rope* data type. Ropes can represent very long strings efficiently; especially concatenation is done in O(1) instead of O(n).
* <strformat> Macro based standard string interpolation/formatting. Inspired by Python's `f`-strings.
* <strmisc> This module contains uncommon string handling operations that do not fit with the commonly used operations in strutils.
* <strscans> This module contains a `scanf` macro for convenient parsing of mini languages.
* <strtabs> The `strtabs` module implements an efficient hash table that is a mapping from strings to strings. Supports a case-sensitive, case-insensitive and style-insensitive modes.
* <strutils> This module contains common string handling operations like changing case of a string, splitting a string into substrings, searching for substrings, replacing substrings.
* <unicode> This module provides support to handle the Unicode UTF-8 encoding.
* <unidecode> It provides a single proc that does Unicode to ASCII transliterations. Based on Python's Unidecode module.
* [std/wordwrap](wordwrap) This module contains an algorithm to wordwrap a Unicode string.

 ### Time handling


* [std/monotimes](monotimes) The `monotimes` module implements monotonic timestamps.
* <times> The `times` module contains support for working with time.

 ### Generic Operating System Services


* <distros> This module implements the basics for OS distribution ("distro") detection and the OS's native package manager. Its primary purpose is to produce output for Nimble packages, but it also contains the widely used **Distribution** enum that is useful for writing platform-specific code. See <packaging> for hints on distributing Nim using OS packages.
* <dynlib> This module implements the ability to access symbols from shared libraries.
* <marshal> Contains procs for serialization and deserialization of arbitrary Nim data structures.
* <memfiles> This module provides support for memory-mapped files (Posix's `mmap`) on the different operating systems.
* <os> Basic operating system facilities like retrieving environment variables, reading command line arguments, working with directories, running shell commands, etc.
* <osproc> Module for process communication beyond `os.execShellCmd`.
* <streams> This module provides a stream interface and two implementations thereof: the `FileStream` and the `StringStream` which implement the stream interface for Nim file objects (`File`) and strings. Other modules may provide other implementations for this standard stream interface.
* <terminal> This module contains a few procedures to control the *terminal* (also called *console*). The implementation simply uses ANSI escape sequences and does not depend on any other module.

 ### Math libraries


* <complex> This module implements complex numbers and relevant mathematical operations.
* <fenv> Floating-point environment. Handling of floating-point rounding and exceptions (overflow, zero-divide, etc.).
* <math> Mathematical operations like cosine, square root.
* <mersenne> Mersenne twister random number generator.
* <random> Fast and tiny random number generator.
* <rationals> This module implements rational numbers and relevant mathematical operations.
* <stats> Statistical analysis
* [std/sums](sums) Fast summation functions.

 ### Internet Protocols and Support


* <asyncdispatch> This module implements an asynchronous dispatcher for IO operations.
* <asyncfile> This module implements asynchronous file reading and writing using `asyncdispatch`.
* <asyncftpclient> This module implements an asynchronous FTP client using the `asyncnet` module.
* <asynchttpserver> This module implements an asynchronous HTTP server using the `asyncnet` module.
* <asyncnet> This module implements asynchronous sockets based on the `asyncdispatch` module.
* <asyncstreams> This module provides `FutureStream` - a future that acts as a queue.
* <cgi> This module implements helpers for CGI applications.
* <cookies> This module contains helper procs for parsing and generating cookies.
* <httpclient> This module implements a simple HTTP client which supports both synchronous and asynchronous retrieval of web pages.
* <mimetypes> This module implements a mimetypes database.
* <nativesockets> This module implements a low-level sockets API.
* <net> This module implements a high-level sockets API. It replaces the `sockets` module.
* <selectors> This module implements a selector API with backends specific to each OS. Currently, epoll on Linux and select on other operating systems.
* <smtp> This module implements a simple SMTP client.
* <uri> This module provides functions for working with URIs.

 ### Threading


* <threadpool> Implements Nim's [spawn](manual_experimental#parallel-amp-spawn).

 ### Parsers


* <htmlparser> This module parses an HTML document and creates its XML tree representation.
* <json> High-performance JSON parser.
* <lexbase> This is a low-level module that implements an extremely efficient buffering scheme for lexers and parsers. This is used by the diverse parsing modules.
* <parsecfg> The `parsecfg` module implements a high-performance configuration file parser. The configuration file's syntax is similar to the Windows `.ini` format, but much more powerful, as it is not a line based parser. String literals, raw string literals, and triple quote string literals are supported as in the Nim programming language.
* <parsecsv> The `parsecsv` module implements a simple high-performance CSV parser.
* <parseopt> The `parseopt` module implements a command line option parser.
* <parsesql> The `parsesql` module implements a simple high-performance SQL parser.
* <parsexml> The `parsexml` module implements a simple high performance XML/HTML parser. The only encoding that is supported is UTF-8. The parser has been designed to be somewhat error-correcting, so that even some "wild HTML" found on the web can be parsed with it.

 ### Docutils


* [packages/docutils/highlite](highlite) Source highlighter for programming or markup languages. Currently, only a few languages are supported, other languages may be added. The interface supports one language nested in another.
* [packages/docutils/rst](rst) This module implements a reStructuredText parser. A large subset is implemented. Some features of the markdown wiki syntax are also supported.
* [packages/docutils/rstast](rstast) This module implements an AST for the reStructuredText parser.
* [packages/docutils/rstgen](rstgen) This module implements a generator of HTML/Latex from reStructuredText.

 ### XML Processing


* <xmltree> A simple XML tree. More efficient and simpler than the DOM. It also contains a macro for XML/HTML code generation.
* <xmlparser> This module parses an XML document and creates its XML tree representation.

 ### Generators


* <htmlgen> This module implements a simple XML and HTML code generator. Each commonly used HTML tag has a corresponding macro that generates a string with its HTML representation.

 ### Hashing


* <base64> This module implements a base64 encoder and decoder.
* <hashes> This module implements efficient computations of hash values for diverse Nim types.
* <md5> This module implements the MD5 checksum algorithm.
* <oids> An OID is a global ID that consists of a timestamp, a unique counter, and a random value. This combination should suffice to produce a globally distributed unique ID. This implementation was extracted from the Mongodb interface and it thus binary compatible with a Mongo OID.
* [std/sha1](sha1) This module implements a sha1 encoder and decoder.

 ### Miscellaneous


* <browsers> This module implements procs for opening URLs with the user's default browser.
* <colors> This module implements color handling for Nim.
* <coro> This module implements experimental coroutines in Nim.
* <logging> This module implements a simple logger.
* <segfaults> Turns access violations or segfaults into a `NilAccessDefect` exception.
* <sugar> This module implements nice syntactic sugar based on Nim's macro system.
* <unittest> Implements a Unit testing DSL.
* [std/varints](varints) Decode variable-length integers that are compatible with SQLite.

 ### Modules for JS backend


* <asyncjs> Types and macros for writing asynchronous procedures in JavaScript.
* <dom> Declaration of the Document Object Model for the JS backend.
* <jsconsole> Wrapper for the `console` object.
* <jscore> The wrapper of core JavaScript functions. For most purposes, you should be using the `math`, `json`, and `times` stdlib modules instead of this module.
* <jsffi> Types and macros for easier interaction with JavaScript.

 Impure libraries
----------------

 ### Regular expressions


* <re> This module contains procedures and operators for handling regular expressions. The current implementation uses PCRE.

 ### Database support


* <db_postgres> A higher level PostgreSQL database wrapper. The same interface is implemented for other databases too.
* <db_mysql> A higher level MySQL database wrapper. The same interface is implemented for other databases too.
* <db_sqlite> A higher level SQLite database wrapper. The same interface is implemented for other databases too.

 Wrappers
--------


The generated HTML for some of these wrappers is so huge that it is not contained in the distribution. You can then find them on the website.

 ### Windows-specific


* <winlean> Contains a wrapper for a small subset of the Win32 API.
* <registry> Windows registry support.

 ### UNIX specific


* <posix> Contains a wrapper for the POSIX standard.
* <posix_utils> Contains helpers for the POSIX standard or specialized for Linux and BSDs.

 ### Regular expressions


* <pcre> Wrapper for the PCRE library.

 ### GUI libraries


* <iup> The wrapper of the IUP GUI library.

 ### Database support


* <postgres> Contains a wrapper for the PostgreSQL API.
* <mysql> Contains a wrapper for the mySQL API.
* <sqlite3> Contains a wrapper for SQLite 3 API.
* <odbcsql> interface to the ODBC driver.

 ### Network Programming and Internet Protocols


* <openssl> Wrapper for OpenSSL.



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/lib.html>

Nim Manual
==========



> "Complexity" seems to be a lot like "energy": you can transfer it from the end-user to one/some of the other players, but the total amount seems to remain pretty much constant for a given task. -- Ran
> 
> 

 About this document
-------------------


**Note**: This document is a draft! Several of Nim's features may need more precise wording. This manual is constantly evolving into a proper specification.

 **Note**: The experimental features of Nim are covered [here](manual_experimental).

 **Note**: Assignments, moves, and destruction are specified in the <destructors> document.

 This document describes the lexis, the syntax, and the semantics of the Nim language.

 To learn how to compile Nim programs and generate documentation see [Compiler User Guide](nimc) and [DocGen Tools Guide](https://nim-lang.org/docs/docgen.html).

 The language constructs are explained using an extended BNF, in which `(a)*` means 0 or more `a`'s, `a+` means 1 or more `a`'s, and `(a)?` means an optional *a*. Parentheses may be used to group elements.

 `&` is the lookahead operator; `&a` means that an `a` is expected but not consumed. It will be consumed in the following rule.

 The `|`, `/` symbols are used to mark alternatives and have the lowest precedence. `/` is the ordered choice that requires the parser to try the alternatives in the given order. `/` is often used to ensure the grammar is not ambiguous.

 Non-terminals start with a lowercase letter, abstract terminal symbols are in UPPERCASE. Verbatim terminal symbols (including keywords) are quoted with `'`. An example:



```
ifStmt = 'if' expr ':' stmts ('elif' expr ':' stmts)* ('else' stmts)?
```
 The binary `^*` operator is used as a shorthand for 0 or more occurrences separated by its second argument; likewise `^+` means 1 or more occurrences: `a ^+ b` is short for `a (b a)*` and `a ^* b` is short for `(a (b a)*)?`. Example:



```
arrayConstructor = '[' expr ^* ',' ']'
```
 Other parts of Nim, like scoping rules or runtime semantics, are described informally.

 Definitions
-----------


Nim code specifies a computation that acts on a memory consisting of components called locations. A variable is basically a name for a location. Each variable and location is of a certain type. The variable's type is called static type, the location's type is called dynamic type. If the static type is not the same as the dynamic type, it is a super-type or subtype of the dynamic type.

 An identifier is a symbol declared as a name for a variable, type, procedure, etc. The region of the program over which a declaration applies is called the scope of the declaration. Scopes can be nested. The meaning of an identifier is determined by the smallest enclosing scope in which the identifier is declared unless overloading resolution rules suggest otherwise.

 An expression specifies a computation that produces a value or location. Expressions that produce locations are called l-values. An l-value can denote either a location or the value the location contains, depending on the context.

 A Nim program consists of one or more text source files containing Nim code. It is processed by a Nim compiler into an executable. The nature of this executable depends on the compiler implementation; it may, for example, be a native binary or JavaScript source code.

 In a typical Nim program, most of the code is compiled into the executable. However, some of the code may be executed at compile-time. This can include constant expressions, macro definitions, and Nim procedures used by macro definitions. Most of the Nim language is supported at compile-time, but there are some restrictions -- see [Restrictions on Compile-Time Execution](#restrictions-on-compileminustime-execution) for details. We use the term runtime to cover both compile-time execution and code execution in the executable.

 The compiler parses Nim source code into an internal data structure called the abstract syntax tree (AST). Then, before executing the code or compiling it into the executable, it transforms the AST through semantic analysis. This adds semantic information such as expression types, identifier meanings, and in some cases expression values. An error detected during semantic analysis is called a static error. Errors described in this manual are static errors when not otherwise specified.

 A panic is an error that the implementation detects and reports at runtime. The method for reporting such errors is via *raising exceptions* or *dying with a fatal error*. However, the implementation provides a means to disable these runtime checks. See the section [pragmas](#pragmas) for details.

 Whether a panic results in an exception or in a fatal error is implementation specific. Thus the following program is invalid; even though the code purports to catch the `IndexDefect` from an out-of-bounds array access, the compiler may instead choose to allow the program to die with a fatal error.

 
```
var a: array[0..1, char]
let i = 5
try:
  a[i] = 'N'
except IndexDefect:
  echo "invalid index"
```

The current implementation allows to switch between these different behaviors via `--panics:on|off`. When panics are turned on, the program dies with a panic, if they are turned off the runtime errors are turned into exceptions. The benefit of `--panics:on` is that it produces smaller binary code and the compiler has more freedom to optimize the code.

 An unchecked runtime error is an error that is not guaranteed to be detected and can cause the subsequent behavior of the computation to be arbitrary. Unchecked runtime errors cannot occur if only safe language features are used and if no runtime checks are disabled.

 A constant expression is an expression whose value can be computed during a semantic analysis of the code in which it appears. It is never an l-value and never has side effects. Constant expressions are not limited to the capabilities of semantic analysis, such as constant folding; they can use all Nim language features that are supported for compile-time execution. Since constant expressions can be used as an input to semantic analysis (such as for defining array bounds), this flexibility requires the compiler to interleave semantic analysis and compile-time code execution.

 It is mostly accurate to picture semantic analysis proceeding top to bottom and left to right in the source code, with compile-time code execution interleaved when necessary to compute values that are required for subsequent semantic analysis. We will see much later in this document that macro invocation not only requires this interleaving, but also creates a situation where semantic analysis does not entirely proceed top to bottom and left to right.

 Lexical Analysis
----------------

 ### Encoding


All Nim source files are in the UTF-8 encoding (or its ASCII subset). Other encodings are not supported. Any of the standard platform line termination sequences can be used - the Unix form using ASCII LF (linefeed), the Windows form using the ASCII sequence CR LF (return followed by linefeed), or the old Macintosh form using the ASCII CR (return) character. All of these forms can be used equally, regardless of the platform.

 ### Indentation


Nim's standard grammar describes an indentation sensitive language. This means that all the control structures are recognized by indentation. Indentation consists only of spaces; tabulators are not allowed.

 The indentation handling is implemented as follows: The lexer annotates the following token with the preceding number of spaces; indentation is not a separate token. This trick allows parsing of Nim with only 1 token of lookahead.

 The parser uses a stack of indentation levels: the stack consists of integers counting the spaces. The indentation information is queried at strategic places in the parser but ignored otherwise: The pseudo-terminal `IND{>}` denotes an indentation that consists of more spaces than the entry at the top of the stack; `IND{=}` an indentation that has the same number of spaces. `DED` is another pseudo terminal that describes the *action* of popping a value from the stack, `IND{>}` then implies to push onto the stack.

 With this notation we can now easily define the core of the grammar: A block of statements (simplified example):



```
ifStmt = 'if' expr ':' stmt
         (IND{=} 'elif' expr ':' stmt)*
         (IND{=} 'else' ':' stmt)?

simpleStmt = ifStmt / ...

stmt = IND{>} stmt ^+ IND{=} DED  # list of statements
     / simpleStmt                 # or a simple statement
```
 ### Comments


Comments start anywhere outside a string or character literal with the hash character `#`. Comments consist of a concatenation of comment pieces. A comment piece starts with `#` and runs until the end of the line. The end of line characters belong to the piece. If the next line only consists of a comment piece with no other tokens between it and the preceding one, it does not start a new comment:

 
```
i = 0     # This is a single comment over multiple lines.
  # The scanner merges these two pieces.
  # The comment continues here.
```

Documentation comments are comments that start with two `##`. Documentation comments are tokens; they are only allowed at certain places in the input file as they belong to the syntax tree!

 ### Multiline comments


Starting with version 0.13.0 of the language Nim supports multiline comments. They look like:

 
```
#[Comment here.
Multiple lines
are not a problem.]#
```

Multiline comments support nesting:

 
```
#[  #[ Multiline comment in already
   commented out code. ]#
proc p[T](x: T) = discard
]#
```

Multiline documentation comments also exist and support nesting too:

 
```
proc foo =
  ##[Long documentation comment
  here.
  ]##
```
 ### Identifiers & Keywords


Identifiers in Nim can be any string of letters, digits and underscores, with the following restrictions:

 * begins with a letter
* does not end with an underscore `_`
* two immediate following underscores `__` are not allowed::

 letter ::= 'A'..'Z' | 'a'..'z' | 'x80'..'xff' digit ::= '0'..'9' IDENTIFIER ::= letter ( ['\_'] (letter | digit) )\*

 Currently, any Unicode character with an ordinal value > 127 (non-ASCII) is classified as a `letter` and may thus be part of an identifier but later versions of the language may assign some Unicode characters to belong to the operator characters instead.

 The following keywords are reserved and cannot be used as identifiers:

 
```
addr and as asm
bind block break
case cast concept const continue converter
defer discard distinct div do
elif else end enum except export
finally for from func
if import in include interface is isnot iterator
let
macro method mixin mod
nil not notin
object of or out
proc ptr
raise ref return
shl shr static
template try tuple type
using
var
when while
xor
yield
```

Some keywords are unused; they are reserved for future developments of the language.

 ### Identifier equality


Two identifiers are considered equal if the following algorithm returns true:

 
```
proc sameIdentifier(a, b: string): bool =
  a[0] == b[0] and
    a.replace("_", "").toLowerAscii == b.replace("_", "").toLowerAscii
```

That means only the first letters are compared in a case-sensitive manner. Other letters are compared case-insensitively within the ASCII range and underscores are ignored.

 This rather unorthodox way to do identifier comparisons is called partial case-insensitivity and has some advantages over the conventional case sensitivity:

 It allows programmers to mostly use their own preferred spelling style, be it humpStyle or snake\_style, and libraries written by different programmers cannot use incompatible conventions. A Nim-aware editor or IDE can show the identifiers as preferred. Another advantage is that it frees the programmer from remembering the exact spelling of an identifier. The exception with respect to the first letter allows common code like `var foo: Foo` to be parsed unambiguously.

 Note that this rule also applies to keywords, meaning that `notin` is the same as `notIn` and `not_in` (all-lowercase version (`notin`, `isnot`) is the preferred way of writing keywords).

 Historically, Nim was a fully style-insensitive language. This meant that it was not case-sensitive and underscores were ignored and there was not even a distinction between `foo` and `Foo`.

 ### Stropping


If a keyword is enclosed in backticks it loses its keyword property and becomes an ordinary identifier.

 Examples

 
```
var `var` = "Hello Stropping"
```


```
type Type = object
  `int`: int

let `object` = Type(`int`: 9)
assert `object` is Type
assert `object`.`int` == 9

var `var` = 42
let `let` = 8
assert `var` + `let` == 50

const `assert` = true
assert `assert`
```
 ### String literals


Terminal symbol in the grammar: `STR_LIT`.

 String literals can be delimited by matching double quotes, and can contain the following escape sequences:

 

| Escape sequence | Meaning |
| --- | --- |
| `\p` | platform specific newline: CRLF on Windows, LF on Unix |
| `\r`, `\c` | carriage return |
| `\n`, `\l` | line feed (often called newline) |
| `\f` | form feed |
| `\t` | tabulator |
| `\v` | vertical tabulator |
| `\\` | backslash |
| `\"` | quotation mark |
| `\'` | apostrophe |
| `\` '0'..'9'+ | character with decimal value d; all decimal digits directly following are used for the character |
| `\a` | alert |
| `\b` | backspace |
| `\e` | escape [ESC] |
| `\x` HH | character with hex value HH; exactly two hex digits are allowed |
| `\u` HHHH | unicode codepoint with hex value HHHH; exactly four hex digits are allowed |
| `\u` {H+} | unicode codepoint; all hex digits enclosed in `{}` are used for the codepoint |


Strings in Nim may contain any 8-bit value, even embedded zeros. However some operations may interpret the first binary zero as a terminator.

 ### Triple quoted string literals


Terminal symbol in the grammar: `TRIPLESTR_LIT`.

 String literals can also be delimited by three double quotes `"""` ... `"""`. Literals in this form may run for several lines, may contain `"` and do not interpret any escape sequences. For convenience, when the opening `"""` is followed by a newline (there may be whitespace between the opening `"""` and the newline), the newline (and the preceding whitespace) is not included in the string. The ending of the string literal is defined by the pattern `"""[^"]`, so this:

 
```
""""long string within quotes""""
```

Produces:



```
"long string within quotes"
```
 ### Raw string literals


Terminal symbol in the grammar: `RSTR_LIT`.

 There are also raw string literals that are preceded with the letter `r` (or `R`) and are delimited by matching double quotes (just like ordinary string literals) and do not interpret the escape sequences. This is especially convenient for regular expressions or Windows paths:

 
```
var f = openFile(r"C:\texts\text.txt") # a raw string, so ``\t`` is no tab
```

To produce a single `"` within a raw string literal, it has to be doubled:

 
```
r"a""b"
```

Produces:



```
a"b
```
 `r""""` is not possible with this notation, because the three leading quotes introduce a triple quoted string literal. `r"""` is the same as `"""` since triple quoted string literals do not interpret escape sequences either.

 ### Generalized raw string literals


Terminal symbols in the grammar: `GENERALIZED_STR_LIT`, `GENERALIZED_TRIPLESTR_LIT`.

 The construct `identifier"string literal"` (without whitespace between the identifier and the opening quotation mark) is a generalized raw string literal. It is a shortcut for the construct `identifier(r"string literal")`, so it denotes a procedure call with a raw string literal as its only argument. Generalized raw string literals are especially convenient for embedding mini languages directly into Nim (for example regular expressions).

 The construct `identifier"""string literal"""` exists too. It is a shortcut for `identifier("""string literal""")`.

 ### Character literals


Character literals are enclosed in single quotes `''` and can contain the same escape sequences as strings - with one exception: the platform dependent newline (`\p`) is not allowed as it may be wider than one character (often it is the pair CR/LF for example). Here are the valid escape sequences for character literals:

 

| Escape sequence | Meaning |
| --- | --- |
| `\r`, `\c` | carriage return |
| `\n`, `\l` | line feed |
| `\f` | form feed |
| `\t` | tabulator |
| `\v` | vertical tabulator |
| `\\` | backslash |
| `\"` | quotation mark |
| `\'` | apostrophe |
| `\` '0'..'9'+ | character with decimal value d; all decimal digits directly following are used for the character |
| `\a` | alert |
| `\b` | backspace |
| `\e` | escape [ESC] |
| `\x` HH | character with hex value HH; exactly two hex digits are allowed |


A character is not a Unicode character but a single byte. The reason for this is efficiency: for the overwhelming majority of use-cases, the resulting programs will still handle UTF-8 properly as UTF-8 was specially designed for this. Another reason is that Nim can thus support `array[char, int]` or `set[char]` efficiently as many algorithms rely on this feature. The `Rune` type is used for Unicode characters, it can represent any Unicode character. `Rune` is declared in the [unicode module](unicode).

 ### Numerical constants


Numerical constants are of a single type and have the form:



```
hexdigit = digit | 'A'..'F' | 'a'..'f'
octdigit = '0'..'7'
bindigit = '0'..'1'
HEX_LIT = '0' ('x' | 'X' ) hexdigit ( ['_'] hexdigit )*
DEC_LIT = digit ( ['_'] digit )*
OCT_LIT = '0' 'o' octdigit ( ['_'] octdigit )*
BIN_LIT = '0' ('b' | 'B' ) bindigit ( ['_'] bindigit )*

INT_LIT = HEX_LIT
        | DEC_LIT
        | OCT_LIT
        | BIN_LIT

INT8_LIT = INT_LIT ['\''] ('i' | 'I') '8'
INT16_LIT = INT_LIT ['\''] ('i' | 'I') '16'
INT32_LIT = INT_LIT ['\''] ('i' | 'I') '32'
INT64_LIT = INT_LIT ['\''] ('i' | 'I') '64'

UINT_LIT = INT_LIT ['\''] ('u' | 'U')
UINT8_LIT = INT_LIT ['\''] ('u' | 'U') '8'
UINT16_LIT = INT_LIT ['\''] ('u' | 'U') '16'
UINT32_LIT = INT_LIT ['\''] ('u' | 'U') '32'
UINT64_LIT = INT_LIT ['\''] ('u' | 'U') '64'

exponent = ('e' | 'E' ) ['+' | '-'] digit ( ['_'] digit )*
FLOAT_LIT = digit (['_'] digit)* (('.' digit (['_'] digit)* [exponent]) |exponent)
FLOAT32_SUFFIX = ('f' | 'F') ['32']
FLOAT32_LIT = HEX_LIT '\'' FLOAT32_SUFFIX
            | (FLOAT_LIT | DEC_LIT | OCT_LIT | BIN_LIT) ['\''] FLOAT32_SUFFIX
FLOAT64_SUFFIX = ( ('f' | 'F') '64' ) | 'd' | 'D'
FLOAT64_LIT = HEX_LIT '\'' FLOAT64_SUFFIX
            | (FLOAT_LIT | DEC_LIT | OCT_LIT | BIN_LIT) ['\''] FLOAT64_SUFFIX
```
 As can be seen in the productions, numerical constants can contain underscores for readability. Integer and floating-point literals may be given in decimal (no prefix), binary (prefix `0b`), octal (prefix `0o`), and hexadecimal (prefix `0x`) notation.

 There exists a literal for each numerical type that is defined. The suffix starting with an apostrophe (''') is called a type suffix. Literals without a type suffix are of an integer type unless the literal contains a dot or `E|e` in which case it is of type `float`. This integer type is `int` if the literal is in the range `low(i32)..high(i32)`, otherwise it is `int64`. For notational convenience, the apostrophe of a type suffix is optional if it is not ambiguous (only hexadecimal floating-point literals with a type suffix can be ambiguous).

 The type suffixes are:

 

| Type Suffix | Resulting type of literal |
| --- | --- |
| `'i8` | int8 |
| `'i16` | int16 |
| `'i32` | int32 |
| `'i64` | int64 |
| `'u` | uint |
| `'u8` | uint8 |
| `'u16` | uint16 |
| `'u32` | uint32 |
| `'u64` | uint64 |
| `'f` | float32 |
| `'d` | float64 |
| `'f32` | float32 |
| `'f64` | float64 |


Floating-point literals may also be in binary, octal or hexadecimal notation: `0B0_10001110100_0000101001000111101011101111111011000101001101001001'f64` is approximately 1.72826e35 according to the IEEE floating-point standard.

 Literals are bounds checked so that they fit the datatype. Non-base-10 literals are used mainly for flags and bit pattern representations, therefore bounds checking is done on bit width, not value range. If the literal fits in the bit width of the datatype, it is accepted. Hence: 0b10000000'u8 == 0x80'u8 == 128, but, 0b10000000'i8 == 0x80'i8 == -1 instead of causing an overflow error.

 ### Operators


Nim allows user defined operators. An operator is any combination of the following characters:



```
=     +     -     *     /     <     >
@     $     ~     &     %     |
!     ?     ^     .     :     \
```
 (The grammar uses the terminal OPR to refer to operator symbols as defined here.)

 These keywords are also operators: `and or not xor shl shr div mod in notin is isnot of as from`.

 . =, :, :: are not available as general operators; they are used for other notational purposes.

 `*:` is as a special case treated as the two tokens \* and : (to support `var v*: T`).

 The `not` keyword is always a unary operator, `a not b` is parsed as `a(not b)`, not as `(a) not (b)`.

 ### Other tokens


The following strings denote other tokens:



```
`   (    )     {    }     [    ]    ,  ;   [.    .]  {.   .}  (.  .)  [:
```
 The slice operator .. takes precedence over other tokens that contain a dot: {..} are the three tokens {, .., } and not the two tokens {., .}.

 Syntax
------


This section lists Nim's standard syntax. How the parser handles the indentation is already described in the [Lexical Analysis](#lexical-analysis) section.

 Nim allows user-definable operators. Binary operators have 11 different levels of precedence.

 ### Associativity


Binary operators whose first character is `^` are right-associative, all other binary operators are left-associative.

 
```
proc `^/`(x, y: float): float =
  # a right-associative division operator
  result = x / y
echo 12 ^/ 4 ^/ 8 # 24.0 (4 / 8 = 0.5, then 12 / 0.5 = 24.0)
echo 12  / 4  / 8 # 0.375 (12 / 4 = 3.0, then 3 / 8 = 0.375)
```
 ### Precedence


Unary operators always bind stronger than any binary operator: `$a + b` is `($a) + b` and not `$(a + b)`.

 If an unary operator's first character is `@` it is a sigil-like operator which binds stronger than a `primarySuffix`: `@x.abc` is parsed as `(@x).abc` whereas `$x.abc` is parsed as `$(x.abc)`.

 For binary operators that are not keywords, the precedence is determined by the following rules:

 Operators ending in either `->`, `~>` or `=>` are called arrow like, and have the lowest precedence of all operators.

 If the operator ends with `=` and its first character is none of `<`, `>`, `!`, `=`, `~`, `?`, it is an *assignment operator* which has the second-lowest precedence.

 Otherwise, precedence is determined by the first character.

 

| Precedence level | Operators | First character | Terminal symbol |
| --- | --- | --- | --- |
| 10 (highest) |  | `$ ^` | OP10 |
| 9 | `* / div mod shl shr %` | `* % \ /` | OP9 |
| 8 | `+ -` | `+ - ~ |` | OP8 |
| 7 | `&` | `&` | OP7 |
| 6 | `..` | `.` | OP6 |
| 5 | `== <= < >= > != in notin is isnot not of as from` | `= < > !` | OP5 |
| 4 | `and` |  | OP4 |
| 3 | `or xor` |  | OP3 |
| 2 |  | `@ : ?` | OP2 |
| 1 | *assignment operator* (like `+=`, `*=`) |  | OP1 |
| 0 (lowest) | *arrow like operator* (like `->`, `=>`) |  | OP0 |


Whether an operator is used as a prefix operator is also affected by preceding whitespace (this parsing change was introduced with version 0.13.0):

 
```
echo $foo
# is parsed as
echo($foo)
```

Spacing also determines whether `(a, b)` is parsed as an argument list of a call or whether it is parsed as a tuple constructor:

 
```
echo(1, 2) # pass 1 and 2 to echo
```


```
echo (1, 2) # pass the tuple (1, 2) to echo
```
 ### Grammar


The grammar's start symbol is `module`.

 
```
# This file is generated by compiler/parser.nim.
module = stmt ^* (';' / IND{=})
comma = ',' COMMENT?
semicolon = ';' COMMENT?
colon = ':' COMMENT?
colcom = ':' COMMENT?
operator =  OP0 | OP1 | OP2 | OP3 | OP4 | OP5 | OP6 | OP7 | OP8 | OP9
         | 'or' | 'xor' | 'and'
         | 'is' | 'isnot' | 'in' | 'notin' | 'of' | 'as' | 'from'
         | 'div' | 'mod' | 'shl' | 'shr' | 'not' | 'static' | '..'
prefixOperator = operator
optInd = COMMENT? IND?
optPar = (IND{>} | IND{=})?
simpleExpr = arrowExpr (OP0 optInd arrowExpr)* pragma?
arrowExpr = assignExpr (OP1 optInd assignExpr)*
assignExpr = orExpr (OP2 optInd orExpr)*
orExpr = andExpr (OP3 optInd andExpr)*
andExpr = cmpExpr (OP4 optInd cmpExpr)*
cmpExpr = sliceExpr (OP5 optInd sliceExpr)*
sliceExpr = ampExpr (OP6 optInd ampExpr)*
ampExpr = plusExpr (OP7 optInd plusExpr)*
plusExpr = mulExpr (OP8 optInd mulExpr)*
mulExpr = dollarExpr (OP9 optInd dollarExpr)*
dollarExpr = primary (OP10 optInd primary)*
symbol = '`' (KEYW|IDENT|literal|(operator|'('|')'|'['|']'|'{'|'}'|'=')+)+ '`'
       | IDENT | KEYW
exprColonEqExpr = expr (':'|'=' expr)?
exprList = expr ^+ comma
exprColonEqExprList = exprColonEqExpr (comma exprColonEqExpr)* (comma)?
dotExpr = expr '.' optInd (symbol | '[:' exprList ']')
explicitGenericInstantiation = '[:' exprList ']' ( '(' exprColonEqExpr ')' )?
qualifiedIdent = symbol ('.' optInd symbol)?
setOrTableConstr = '{' ((exprColonEqExpr comma)* | ':' ) '}'
castExpr = 'cast' ('[' optInd typeDesc optPar ']' '(' optInd expr optPar ')') /
parKeyw = 'discard' | 'include' | 'if' | 'while' | 'case' | 'try'
        | 'finally' | 'except' | 'for' | 'block' | 'const' | 'let'
        | 'when' | 'var' | 'mixin'
par = '(' optInd
          ( &parKeyw (ifExpr \ complexOrSimpleStmt) ^+ ';'
          | ';' (ifExpr \ complexOrSimpleStmt) ^+ ';'
          | pragmaStmt
          | simpleExpr ( ('=' expr (';' (ifExpr \ complexOrSimpleStmt) ^+ ';' )? )
                       | (':' expr (',' exprColonEqExpr     ^+ ',' )? ) ) )
          optPar ')'
literal = | INT_LIT | INT8_LIT | INT16_LIT | INT32_LIT | INT64_LIT
          | UINT_LIT | UINT8_LIT | UINT16_LIT | UINT32_LIT | UINT64_LIT
          | FLOAT_LIT | FLOAT32_LIT | FLOAT64_LIT
          | STR_LIT | RSTR_LIT | TRIPLESTR_LIT
          | CHAR_LIT
          | NIL
generalizedLit = GENERALIZED_STR_LIT | GENERALIZED_TRIPLESTR_LIT
identOrLiteral = generalizedLit | symbol | literal
               | par | arrayConstr | setOrTableConstr
               | castExpr
tupleConstr = '(' optInd (exprColonEqExpr comma?)* optPar ')'
arrayConstr = '[' optInd (exprColonEqExpr comma?)* optPar ']'
primarySuffix = '(' (exprColonEqExpr comma?)* ')'
      | '.' optInd symbol generalizedLit?
      | '[' optInd exprColonEqExprList optPar ']'
      | '{' optInd exprColonEqExprList optPar '}'
      | &( '`'|IDENT|literal|'cast'|'addr'|'type') expr # command syntax
pragma = '{.' optInd (exprColonEqExpr comma?)* optPar ('.}' | '}')
identVis = symbol OPR?  # postfix position
identVisDot = symbol '.' optInd symbol OPR?
identWithPragma = identVis pragma?
identWithPragmaDot = identVisDot pragma?
declColonEquals = identWithPragma (comma identWithPragma)* comma?
                  (':' optInd typeDesc)? ('=' optInd expr)?
identColonEquals = IDENT (comma IDENT)* comma?
     (':' optInd typeDesc)? ('=' optInd expr)?)
inlTupleDecl = 'tuple'
    '[' optInd  (identColonEquals (comma/semicolon)?)*  optPar ']'
extTupleDecl = 'tuple'
    COMMENT? (IND{>} identColonEquals (IND{=} identColonEquals)*)?
tupleClass = 'tuple'
paramList = '(' declColonEquals ^* (comma/semicolon) ')'
paramListArrow = paramList? ('->' optInd typeDesc)?
paramListColon = paramList? (':' optInd typeDesc)?
doBlock = 'do' paramListArrow pragma? colcom stmt
procExpr = 'proc' paramListColon pragma? ('=' COMMENT? stmt)?
distinct = 'distinct' optInd typeDesc
forStmt = 'for' (identWithPragma ^+ comma) 'in' expr colcom stmt
forExpr = forStmt
expr = (blockExpr
      | ifExpr
      | whenExpr
      | caseStmt
      | forExpr
      | tryExpr)
      / simpleExpr
typeKeyw = 'var' | 'out' | 'ref' | 'ptr' | 'shared' | 'tuple'
         | 'proc' | 'iterator' | 'distinct' | 'object' | 'enum'
primary = typeKeyw optInd typeDesc
        /  prefixOperator* identOrLiteral primarySuffix*
        / 'bind' primary
typeDesc = simpleExpr ('not' expr)?
typeDefAux = simpleExpr ('not' expr)?
           | 'concept' typeClass
postExprBlocks = ':' stmt? ( IND{=} doBlock
                           | IND{=} 'of' exprList ':' stmt
                           | IND{=} 'elif' expr ':' stmt
                           | IND{=} 'except' exprList ':' stmt
                           | IND{=} 'else' ':' stmt )*
exprStmt = simpleExpr
         (( '=' optInd expr colonBody? )
         / ( expr ^+ comma
             postExprBlocks
           ))?
importStmt = 'import' optInd expr
              ((comma expr)*
              / 'except' optInd (expr ^+ comma))
exportStmt = 'export' optInd expr
              ((comma expr)*
              / 'except' optInd (expr ^+ comma))
includeStmt = 'include' optInd expr ^+ comma
fromStmt = 'from' expr 'import' optInd expr (comma expr)*
returnStmt = 'return' optInd expr?
raiseStmt = 'raise' optInd expr?
yieldStmt = 'yield' optInd expr?
discardStmt = 'discard' optInd expr?
breakStmt = 'break' optInd expr?
continueStmt = 'break' optInd expr?
condStmt = expr colcom stmt COMMENT?
           (IND{=} 'elif' expr colcom stmt)*
           (IND{=} 'else' colcom stmt)?
ifStmt = 'if' condStmt
whenStmt = 'when' condStmt
condExpr = expr colcom expr optInd
        ('elif' expr colcom expr optInd)*
         'else' colcom expr
ifExpr = 'if' condExpr
whenExpr = 'when' condExpr
whileStmt = 'while' expr colcom stmt
ofBranch = 'of' exprList colcom stmt
ofBranches = ofBranch (IND{=} ofBranch)*
                      (IND{=} 'elif' expr colcom stmt)*
                      (IND{=} 'else' colcom stmt)?
caseStmt = 'case' expr ':'? COMMENT?
            (IND{>} ofBranches DED
            | IND{=} ofBranches)
tryStmt = 'try' colcom stmt &(IND{=}? 'except'|'finally')
           (IND{=}? 'except' exprList colcom stmt)*
           (IND{=}? 'finally' colcom stmt)?
tryExpr = 'try' colcom stmt &(optInd 'except'|'finally')
           (optInd 'except' exprList colcom stmt)*
           (optInd 'finally' colcom stmt)?
exceptBlock = 'except' colcom stmt
blockStmt = 'block' symbol? colcom stmt
blockExpr = 'block' symbol? colcom stmt
staticStmt = 'static' colcom stmt
deferStmt = 'defer' colcom stmt
asmStmt = 'asm' pragma? (STR_LIT | RSTR_LIT | TRIPLESTR_LIT)
genericParam = symbol (comma symbol)* (colon expr)? ('=' optInd expr)?
genericParamList = '[' optInd
  genericParam ^* (comma/semicolon) optPar ']'
pattern = '{' stmt '}'
indAndComment = (IND{>} COMMENT)? | COMMENT?
routine = optInd identVis pattern? genericParamList?
  paramListColon pragma? ('=' COMMENT? stmt)? indAndComment
commentStmt = COMMENT
section(RULE) = COMMENT? RULE / (IND{>} (RULE / COMMENT)^+IND{=} DED)
enum = 'enum' optInd (symbol pragma? optInd ('=' optInd expr COMMENT?)? comma?)+
objectWhen = 'when' expr colcom objectPart COMMENT?
            ('elif' expr colcom objectPart COMMENT?)*
            ('else' colcom objectPart COMMENT?)?
objectBranch = 'of' exprList colcom objectPart
objectBranches = objectBranch (IND{=} objectBranch)*
                      (IND{=} 'elif' expr colcom objectPart)*
                      (IND{=} 'else' colcom objectPart)?
objectCase = 'case' identWithPragma ':' typeDesc ':'? COMMENT?
            (IND{>} objectBranches DED
            | IND{=} objectBranches)
objectPart = IND{>} objectPart^+IND{=} DED
           / objectWhen / objectCase / 'nil' / 'discard' / declColonEquals
object = 'object' pragma? ('of' typeDesc)? COMMENT? objectPart
typeClassParam = ('var' | 'out')? symbol
typeClass = typeClassParam ^* ',' (pragma)? ('of' typeDesc ^* ',')?
              &IND{>} stmt
typeDef = identWithPragmaDot genericParamList? '=' optInd typeDefAux
            indAndComment? / identVisDot genericParamList? pragma '=' optInd typeDefAux
            indAndComment?
varTuple = '(' optInd identWithPragma ^+ comma optPar ')' '=' optInd expr
colonBody = colcom stmt postExprBlocks?
variable = (varTuple / identColonEquals) colonBody? indAndComment
constant = (varTuple / identWithPragma) (colon typeDesc)? '=' optInd expr indAndComment
bindStmt = 'bind' optInd qualifiedIdent ^+ comma
mixinStmt = 'mixin' optInd qualifiedIdent ^+ comma
pragmaStmt = pragma (':' COMMENT? stmt)?
simpleStmt = ((returnStmt | raiseStmt | yieldStmt | discardStmt | breakStmt
           | continueStmt | pragmaStmt | importStmt | exportStmt | fromStmt
           | includeStmt | commentStmt) / exprStmt) COMMENT?
complexOrSimpleStmt = (ifStmt | whenStmt | whileStmt
                    | tryStmt | forStmt
                    | blockStmt | staticStmt | deferStmt | asmStmt
                    | 'proc' routine
                    | 'method' routine
                    | 'func' routine
                    | 'iterator' routine
                    | 'macro' routine
                    | 'template' routine
                    | 'converter' routine
                    | 'type' section(typeDef)
                    | 'const' section(constant)
                    | ('let' | 'var' | 'using') section(variable)
                    | bindStmt | mixinStmt)
                    / simpleStmt
stmt = (IND{>} complexOrSimpleStmt^+(IND{=} / ';') DED)
     / simpleStmt ^+ ';'
```
 Order of evaluation
-------------------


Order of evaluation is strictly left-to-right, inside-out as it is typical for most others imperative programming languages:

 
```
var s = ""

proc p(arg: int): int =
  s.add $arg
  result = arg

discard p(p(1) + p(2))

doAssert s == "123"
```

Assignments are not special, the left-hand-side expression is evaluated before the right-hand side:

 
```
var v = 0
proc getI(): int =
  result = v
  inc v

var a, b: array[0..2, int]

proc someCopy(a: var int; b: int) = a = b

a[getI()] = getI()

doAssert a == [1, 0, 0]

v = 0
someCopy(b[getI()], getI())

doAssert b == [1, 0, 0]
```

Rationale: Consistency with overloaded assignment or assignment-like operations, `a = b` can be read as `performSomeCopy(a, b)`.

 However, the concept of "order of evaluation" is only applicable after the code was normalized: The normalization involves template expansions and argument reorderings that have been passed to named parameters:

 
```
var s = ""

proc p(): int =
  s.add "p"
  result = 5

proc q(): int =
  s.add "q"
  result = 3

# Evaluation order is 'b' before 'a' due to template
# expansion's semantics.
template swapArgs(a, b): untyped =
  b + a

doAssert swapArgs(p() + q(), q() - p()) == 6
doAssert s == "qppq"

# Evaluation order is not influenced by named parameters:
proc construct(first, second: int) =
  discard

# 'p' is evaluated before 'q'!
construct(second = q(), first = p())

doAssert s == "qppqpq"
```

Rationale: This is far easier to implement than hypothetical alternatives.

 Constants and Constant Expressions
----------------------------------


A constant is a symbol that is bound to the value of a constant expression. Constant expressions are restricted to depend only on the following categories of values and operations, because these are either built into the language or declared and evaluated before semantic analysis of the constant expression:

 * literals
* built-in operators
* previously declared constants and compile-time variables
* previously declared macros and templates
* previously declared procedures that have no side effects beyond possibly modifying compile-time variables

 A constant expression can contain code blocks that may internally use all Nim features supported at compile time (as detailed in the next section below). Within such a code block, it is possible to declare variables and then later read and update them, or declare variables and pass them to procedures that modify them. However, the code in such a block must still adhere to the restrictions listed above for referencing values and operations outside the block.

 The ability to access and modify compile-time variables adds flexibility to constant expressions that may be surprising to those coming from other statically typed languages. For example, the following code echoes the beginning of the Fibonacci series **at compile-time**. (This is a demonstration of flexibility in defining constants, not a recommended style for solving this problem!)

 
```
import strformat

var fib_n {.compileTime.}: int
var fib_prev {.compileTime.}: int
var fib_prev_prev {.compileTime.}: int

proc next_fib(): int =
  result = if fib_n < 2:
    fib_n
  else:
    fib_prev_prev + fib_prev
  inc(fib_n)
  fib_prev_prev = fib_prev
  fib_prev = result

const f0 = next_fib()
const f1 = next_fib()

const display_fib = block:
  const f2 = next_fib()
  var result = fmt"Fibonacci sequence: {f0}, {f1}, {f2}"
  for i in 3..12:
    add(result, fmt", {next_fib()}")
  result

static:
  echo display_fib
```
 Restrictions on Compile-Time Execution
--------------------------------------


Nim code that will be executed at compile time cannot use the following language features:

 * methods
* closure iterators
* the `cast` operator
* reference (pointer) types
* FFI

 The use of wrappers that use FFI and/or `cast` is also disallowed. Note that these wrappers include the ones in the standard libraries.

 Some or all of these restrictions are likely to be lifted over time.

 Types
-----


All expressions have a type that is known during semantic analysis. Nim is statically typed. One can declare new types, which is in essence defining an identifier that can be used to denote this custom type.

 These are the major type classes:

 * ordinal types (consist of integer, bool, character, enumeration (and subranges thereof) types)
* floating-point types
* string type
* structured types
* reference (pointer) type
* procedural type
* generic type

 ### Ordinal types


Ordinal types have the following characteristics:

 * Ordinal types are countable and ordered. This property allows the operation of functions as `inc`, `ord`, `dec` on ordinal types to be defined.
* Ordinal values have the smallest possible value. Trying to count further down than the smallest value produces a panic or a static error.
* Ordinal values have the largest possible value. Trying to count further than the largest value produces a panic or a static error.

 Integers, bool, characters, and enumeration types (and subranges of these types) belong to ordinal types. For reasons of simplicity of implementation the types `uint` and `uint64` are not ordinal types. (This will be changed in later versions of the language.)

 A distinct type is an ordinal type if its base type is an ordinal type.

 ### Pre-defined integer types


These integer types are pre-defined:

 
`int` the generic signed integer type; its size is platform-dependent and has the same size as a pointer. This type should be used in general. An integer literal that has no type suffix is of this type if it is in the range `low(int32)..high(int32)` otherwise the literal's type is `int64`. intXX additional signed integer types of XX bits use this naming scheme (example: int16 is a 16-bit wide integer). The current implementation supports `int8`, `int16`, `int32`, `int64`. Literals of these types have the suffix 'iXX. `uint` the generic unsigned integer type; its size is platform-dependent and has the same size as a pointer. An integer literal with the type suffix `'u` is of this type. uintXX additional unsigned integer types of XX bits use this naming scheme (example: uint16 is a 16-bit wide unsigned integer). The current implementation supports `uint8`, `uint16`, `uint32`, `uint64`. Literals of these types have the suffix 'uXX. Unsigned operations all wrap around; they cannot lead to over- or underflow errors.  In addition to the usual arithmetic operators for signed and unsigned integers (`+ - *` etc.) there are also operators that formally work on *signed* integers but treat their arguments as *unsigned*: They are mostly provided for backwards compatibility with older versions of the language that lacked unsigned integer types. These unsigned operations for signed integers use the `%` suffix as convention:

 

| operation | meaning |
| --- | --- |
| `a +% b` | unsigned integer addition |
| `a -% b` | unsigned integer subtraction |
| `a *% b` | unsigned integer multiplication |
| `a /% b` | unsigned integer division |
| `a %% b` | unsigned integer modulo operation |
| `a <% b` | treat `a` and `b` as unsigned and compare |
| `a <=% b` | treat `a` and `b` as unsigned and compare |
| `ze(a)` | extends the bits of `a` with zeros until it has the width of the `int` type |
| `toU8(a)` | treats `a` as unsigned and converts it to an unsigned integer of 8 bits (but still the `int8` type) |
| `toU16(a)` | treats `a` as unsigned and converts it to an unsigned integer of 16 bits (but still the `int16` type) |
| `toU32(a)` | treats `a` as unsigned and converts it to an unsigned integer of 32 bits (but still the `int32` type) |


Automatic type conversion is performed in expressions where different kinds of integer types are used: the smaller type is converted to the larger.

 A narrowing type conversion converts a larger to a smaller type (for example `int32 -> int16`. A widening type conversion converts a smaller type to a larger type (for example `int16 -> int32`). In Nim only widening type conversions are *implicit*:

 
```
var myInt16 = 5i16
var myInt: int
myInt16 + 34     # of type ``int16``
myInt16 + myInt  # of type ``int``
myInt16 + 2i32   # of type ``int32``
```

However, `int` literals are implicitly convertible to a smaller integer type if the literal's value fits this smaller type and such a conversion is less expensive than other implicit conversions, so `myInt16 + 34` produces an `int16` result.

 For further details, see [Convertible relation](#type-relations-convertible-relation).

 ### Subrange types


A subrange type is a range of values from an ordinal or floating-point type (the base type). To define a subrange type, one must specify its limiting values -- the lowest and highest value of the type. For example:

 
```
type
  Subrange = range[0..5]
  PositiveFloat = range[0.0..Inf]
```

`Subrange` is a subrange of an integer which can only hold the values 0 to 5. `PositiveFloat` defines a subrange of all positive floating-point values. NaN does not belong to any subrange of floating-point types. Assigning any other value to a variable of type `Subrange` is a panic (or a static error if it can be determined during semantic analysis). Assignments from the base type to one of its subrange types (and vice versa) are allowed.

 A subrange type has the same size as its base type (`int` in the Subrange example).

 ### Pre-defined floating-point types


The following floating-point types are pre-defined:

 
`float` the generic floating-point type; its size used to be platform-dependent, but now it is always mapped to `float64`. This type should be used in general. floatXX an implementation may define additional floating-point types of XX bits using this naming scheme (example: float64 is a 64-bit wide float). The current implementation supports `float32` and `float64`. Literals of these types have the suffix 'fXX.  Automatic type conversion in expressions with different kinds of floating-point types is performed: See [Convertible relation](#type-relations-convertible-relation) for further details. Arithmetic performed on floating-point types follows the IEEE standard. Integer types are not converted to floating-point types automatically and vice versa.

 The IEEE standard defines five types of floating-point exceptions:

 * Invalid: operations with mathematically invalid operands, for example 0.0/0.0, sqrt(-1.0), and log(-37.8).
* Division by zero: divisor is zero and dividend is a finite nonzero number, for example 1.0/0.0.
* Overflow: operation produces a result that exceeds the range of the exponent, for example MAXDOUBLE+0.0000000000001e308.
* Underflow: operation produces a result that is too small to be represented as a normal number, for example, MINDOUBLE \* MINDOUBLE.
* Inexact: operation produces a result that cannot be represented with infinite precision, for example, 2.0 / 3.0, log(1.1) and 0.1 in input.

 The IEEE exceptions are either ignored during execution or mapped to the Nim exceptions: FloatInvalidOpDefect, FloatDivByZeroDefect, FloatOverflowDefect, FloatUnderflowDefect, and FloatInexactDefect. These exceptions inherit from the FloatingPointDefect base class.

 Nim provides the pragmas nanChecks and infChecks to control whether the IEEE exceptions are ignored or trap a Nim exception:

 
```
{.nanChecks: on, infChecks: on.}
var a = 1.0
var b = 0.0
echo b / b # raises FloatInvalidOpDefect
echo a / b # raises FloatOverflowDefect
```

In the current implementation `FloatDivByZeroDefect` and `FloatInexactDefect` are never raised. `FloatOverflowDefect` is raised instead of `FloatDivByZeroDefect`. There is also a floatChecks pragma that is a short-cut for the combination of `nanChecks` and `infChecks` pragmas. `floatChecks` are turned off as default.

 The only operations that are affected by the `floatChecks` pragma are the `+`, `-`, `*`, `/` operators for floating-point types.

 An implementation should always use the maximum precision available to evaluate floating pointer values during semantic analysis; this means expressions like `0.09'f32 + 0.01'f32 == 0.09'f64 + 0.01'f64` that are evaluating during constant folding are true.

 ### Boolean type


The boolean type is named bool in Nim and can be one of the two pre-defined values `true` and `false`. Conditions in `while`, `if`, `elif`, `when`-statements need to be of type `bool`.

 This condition holds:



```
ord(false) == 0 and ord(true) == 1
```
 The operators `not, and, or, xor, <, <=, >, >=, !=, ==` are defined for the bool type. The `and` and `or` operators perform short-cut evaluation. Example:

 
```
while p != nil and p.name != "xyz":
  # p.name is not evaluated if p == nil
  p = p.next
```

The size of the bool type is one byte.

 ### Character type


The character type is named `char` in Nim. Its size is one byte. Thus it cannot represent a UTF-8 character, but a part of it. The reason for this is efficiency: for the overwhelming majority of use-cases, the resulting programs will still handle UTF-8 properly as UTF-8 was especially designed for this. Another reason is that Nim can support `array[char, int]` or `set[char]` efficiently as many algorithms rely on this feature. The `Rune` type is used for Unicode characters, it can represent any Unicode character. `Rune` is declared in the [unicode module](unicode).

 ### Enumeration types


Enumeration types define a new type whose values consist of the ones specified. The values are ordered. Example:

 
```
type
  Direction = enum
    north, east, south, west
```

Now the following holds:



```
ord(north) == 0
ord(east) == 1
ord(south) == 2
ord(west) == 3

# Also allowed:
ord(Direction.west) == 3
```
 Thus, north < east < south < west. The comparison operators can be used with enumeration types. Instead of `north` etc, the enum value can also be qualified with the enum type that it resides in, `Direction.north`.

 For better interfacing to other programming languages, the fields of enum types can be assigned an explicit ordinal value. However, the ordinal values have to be in ascending order. A field whose ordinal value is not explicitly given is assigned the value of the previous field + 1.

 An explicit ordered enum can have *holes*:

 
```
type
  TokenType = enum
    a = 2, b = 4, c = 89 # holes are valid
```

However, it is then not ordinal anymore, so it is not possible to use these enums as an index type for arrays. The procedures `inc`, `dec`, `succ` and `pred` are not available for them either.

 The compiler supports the built-in stringify operator `$` for enumerations. The stringify's result can be controlled by explicitly giving the string values to use:

 
```
type
  MyEnum = enum
    valueA = (0, "my value A"),
    valueB = "value B",
    valueC = 2,
    valueD = (3, "abc")
```

As can be seen from the example, it is possible to both specify a field's ordinal value and its string value by using a tuple. It is also possible to only specify one of them.

 An enum can be marked with the `pure` pragma so that its fields are added to a special module-specific hidden scope that is only queried as the last attempt. Only non-ambiguous symbols are added to this scope. But one can always access these via type qualification written as `MyEnum.value`:

 
```
type
  MyEnum {.pure.} = enum
    valueA, valueB, valueC, valueD, amb
  
  OtherEnum {.pure.} = enum
    valueX, valueY, valueZ, amb


echo valueA # MyEnum.valueA
echo amb    # Error: Unclear whether it's MyEnum.amb or OtherEnum.amb
echo MyEnum.amb # OK.
```

To implement bit fields with enums see [Bit fields](#set-type-bit-fields)

 ### String type


All string literals are of the type `string`. A string in Nim is very similar to a sequence of characters. However, strings in Nim are both zero-terminated and have a length field. One can retrieve the length with the builtin `len` procedure; the length never counts the terminating zero.

 The terminating zero cannot be accessed unless the string is converted to the `cstring` type first. The terminating zero assures that this conversion can be done in O(1) and without any allocations.

 The assignment operator for strings always copies the string. The `&` operator concatenates strings.

 Most native Nim types support conversion to strings with the special `$` proc. When calling the `echo` proc, for example, the built-in stringify operation for the parameter is called:

 
```
echo 3 # calls `$` for `int`
```

Whenever a user creates a specialized object, implementation of this procedure provides for `string` representation.

 
```
type
  Person = object
    name: string
    age: int

proc `$`(p: Person): string = # `$` always returns a string
  result = p.name & " is " &
          $p.age & # we *need* the `$` in front of p.age which
                   # is natively an integer to convert it to
                   # a string
          " years old."
```

While `$p.name` can also be used, the `$` operation on a string does nothing. Note that we cannot rely on automatic conversion from an `int` to a `string` like we can for the `echo` proc.

 Strings are compared by their lexicographical order. All comparison operators are available. Strings can be indexed like arrays (lower bound is 0). Unlike arrays, they can be used in case statements:

 
```
case paramStr(i)
of "-v": incl(options, optVerbose)
of "-h", "-?": incl(options, optHelp)
else: write(stdout, "invalid command line option!\n")
```

Per convention, all strings are UTF-8 strings, but this is not enforced. For example, when reading strings from binary files, they are merely a sequence of bytes. The index operation `s[i]` means the i-th *char* of `s`, not the i-th *unichar*. The iterator `runes` from the [unicode module](unicode) can be used for iteration over all Unicode characters.

 ### cstring type


The `cstring` type meaning `compatible string` is the native representation of a string for the compilation backend. For the C backend the `cstring` type represents a pointer to a zero-terminated char array compatible with the type `char*` in Ansi C. Its primary purpose lies in easy interfacing with C. The index operation `s[i]` means the i-th *char* of `s`; however no bounds checking for `cstring` is performed making the index operation unsafe.

 A Nim `string` is implicitly convertible to `cstring` for convenience. If a Nim string is passed to a C-style variadic proc, it is implicitly converted to `cstring` too:

 
```
proc printf(formatstr: cstring) {.importc: "printf", varargs,
                                  header: "<stdio.h>".}

printf("This works %s", "as expected")
```

Even though the conversion is implicit, it is not *safe*: The garbage collector does not consider a `cstring` to be a root and may collect the underlying memory. However, in practice, this almost never happens as the GC considers stack roots conservatively. One can use the builtin procs `GC_ref` and `GC_unref` to keep the string data alive for the rare cases where it does not work.

 A `$` proc is defined for cstrings that returns a string. Thus to get a nim string from a cstring:

 
```
var str: string = "Hello!"
var cstr: cstring = str
var newstr: string = $cstr
```
 ### Structured types


A variable of a structured type can hold multiple values at the same time. Structured types can be nested to unlimited levels. Arrays, sequences, tuples, objects, and sets belong to the structured types.

 ### Array and sequence types


Arrays are a homogeneous type, meaning that each element in the array has the same type. Arrays always have a fixed length specified as a constant expression (except for open arrays). They can be indexed by any ordinal type. A parameter `A` may be an *open array*, in which case it is indexed by integers from 0 to `len(A)-1`. An array expression may be constructed by the array constructor `[]`. The element type of this array expression is inferred from the type of the first element. All other elements need to be implicitly convertible to this type.

 An array type can be defined using the `array[size, T]` syntax, or using `array[lo..hi, T]` for arrays that start at an index other than zero.

 Sequences are similar to arrays but of dynamic length which may change during runtime (like strings). Sequences are implemented as growable arrays, allocating pieces of memory as items are added. A sequence `S` is always indexed by integers from 0 to `len(S)-1` and its bounds are checked. Sequences can be constructed by the array constructor `[]` in conjunction with the array to sequence operator `@`. Another way to allocate space for a sequence is to call the built-in `newSeq` procedure.

 A sequence may be passed to a parameter that is of type *open array*.

 Example:

 
```
type
  IntArray = array[0..5, int] # an array that is indexed with 0..5
  IntSeq = seq[int] # a sequence of integers
var
  x: IntArray
  y: IntSeq
x = [1, 2, 3, 4, 5, 6]  # [] is the array constructor
y = @[1, 2, 3, 4, 5, 6] # the @ turns the array into a sequence

let z = [1.0, 2, 3, 4] # the type of z is array[0..3, float]
```

The lower bound of an array or sequence may be received by the built-in proc `low()`, the higher bound by `high()`. The length may be received by `len()`. `low()` for a sequence or an open array always returns 0, as this is the first valid index. One can append elements to a sequence with the `add()` proc or the `&` operator, and remove (and get) the last element of a sequence with the `pop()` proc.

 The notation `x[i]` can be used to access the i-th element of `x`.

 Arrays are always bounds checked (statically or at runtime). These checks can be disabled via pragmas or invoking the compiler with the `--boundChecks:off` command-line switch.

 An array constructor can have explicit indexes for readability:

 
```
type
  Values = enum
    valA, valB, valC

const
  lookupTable = [
    valA: "A",
    valB: "B",
    valC: "C"
  ]
```

If an index is left out, `succ(lastIndex)` is used as the index value:

 
```
type
  Values = enum
    valA, valB, valC, valD, valE

const
  lookupTable = [
    valA: "A",
    "B",
    valC: "C",
    "D", "e"
  ]
```
 ### Open arrays


Often fixed size arrays turn out to be too inflexible; procedures should be able to deal with arrays of different sizes. The openarray type allows this; it can only be used for parameters. Openarrays are always indexed with an `int` starting at position 0. The `len`, `low` and `high` operations are available for open arrays too. Any array with a compatible base type can be passed to an openarray parameter, the index type does not matter. In addition to arrays sequences can also be passed to an open array parameter.

 The openarray type cannot be nested: multidimensional openarrays are not supported because this is seldom needed and cannot be done efficiently.

 
```
proc testOpenArray(x: openArray[int]) = echo repr(x)

testOpenArray([1,2,3])  # array[]
testOpenArray(@[1,2,3]) # seq[]
```
 ### Varargs


A `varargs` parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure. The compiler converts the list of arguments to an array implicitly:

 
```
proc myWriteln(f: File, a: varargs[string]) =
  for s in items(a):
    write(f, s)
  write(f, "\n")

myWriteln(stdout, "abc", "def", "xyz")
# is transformed to:
myWriteln(stdout, ["abc", "def", "xyz"])
```

This transformation is only done if the varargs parameter is the last parameter in the procedure header. It is also possible to perform type conversions in this context:

 
```
proc myWriteln(f: File, a: varargs[string, `$`]) =
  for s in items(a):
    write(f, s)
  write(f, "\n")

myWriteln(stdout, 123, "abc", 4.0)
# is transformed to:
myWriteln(stdout, [$123, $"def", $4.0])
```

In this example `$` is applied to any argument that is passed to the parameter `a`. (Note that `$` applied to strings is a nop.)

 Note that an explicit array constructor passed to a `varargs` parameter is not wrapped in another implicit array construction:

 
```
proc takeV[T](a: varargs[T]) = discard

takeV([123, 2, 1]) # takeV's T is "int", not "array of int"
```

`varargs[typed]` is treated specially: It matches a variable list of arguments of arbitrary type but *always* constructs an implicit array. This is required so that the builtin `echo` proc does what is expected:

 
```
proc echo*(x: varargs[typed, `$`]) {...}

echo @[1, 2, 3]
# prints "@[1, 2, 3]" and not "123"
```
 ### Unchecked arrays


The `UncheckedArray[T]` type is a special kind of `array` where its bounds are not checked. This is often useful to implement customized flexibly sized arrays. Additionally, an unchecked array is translated into a C array of undetermined size:

 
```
type
  MySeq = object
    len, cap: int
    data: UncheckedArray[int]
```

Produces roughly this C code:

 
```
typedef struct {
  NI len;
  NI cap;
  NI data[];
} MySeq;
```

The base type of the unchecked array may not contain any GC'ed memory but this is currently not checked.

 **Future directions**: GC'ed memory should be allowed in unchecked arrays and there should be an explicit annotation of how the GC is to determine the runtime size of the array.

 ### Tuples and object types


A variable of a tuple or object type is a heterogeneous storage container. A tuple or object defines various named *fields* of a type. A tuple also defines a lexicographic *order* of the fields. Tuples are meant to be heterogeneous storage types with few abstractions. The `()` syntax can be used to construct tuples. The order of the fields in the constructor must match the order of the tuple's definition. Different tuple-types are *equivalent* if they specify the same fields of the same type in the same order. The *names* of the fields also have to be identical.

 The assignment operator for tuples copies each component. The default assignment operator for objects copies each component. Overloading of the assignment operator is described [here](manual_experimental#type-bound-operations).

 
```
type
  Person = tuple[name: string, age: int] # type representing a person:
                                         # a person consists of a name
                                         # and an age
var
  person: Person
person = (name: "Peter", age: 30)
echo person.name
# the same, but less readable:
person = ("Peter", 30)
echo person[0]
```

A tuple with one unnamed field can be constructed with the parentheses and a trailing comma:

 
```
proc echoUnaryTuple(a: (int,)) =
  echo a[0]

echoUnaryTuple (1,)
```

In fact, a trailing comma is allowed for every tuple construction.

 The implementation aligns the fields for the best access performance. The alignment is compatible with the way the C compiler does it.

 For consistency with `object` declarations, tuples in a `type` section can also be defined with indentation instead of `[]`:

 
```
type
  Person = tuple   # type representing a person
    name: string   # a person consists of a name
    age: Natural   # and an age
```

Objects provide many features that tuples do not. Object provide inheritance and the ability to hide fields from other modules. Objects with inheritance enabled have information about their type at runtime so that the `of` operator can be used to determine the object's type. The `of` operator is similar to the `instanceof` operator in Java.

 
```
type
  Person = object of RootObj
    name*: string   # the * means that `name` is accessible from other modules
    age: int        # no * means that the field is hidden
  
  Student = ref object of Person # a student is a person
    id: int                      # with an id field

var
  student: Student
  person: Person
assert(student of Student) # is true
assert(student of Person) # also true
```

Object fields that should be visible from outside the defining module, have to be marked by `*`. In contrast to tuples, different object types are never *equivalent*, they are nominal types whereas tuples are structural. Objects that have no ancestor are implicitly `final` and thus have no hidden type information. One can use the `inheritable` pragma to introduce new object roots apart from `system.RootObj`.

 
```
type
  Person = object # example of a final object
    name*: string
    age: int
  
  Student = ref object of Person # Error: inheritance only works with non-final objects
    id: int
```
 ### Object construction


Objects can also be created with an object construction expression that has the syntax `T(fieldA: valueA, fieldB: valueB, ...)` where `T` is an `object` type or a `ref object` type:

 
```
var student = Student(name: "Anton", age: 5, id: 3)
```

Note that, unlike tuples, objects require the field names along with their values. For a `ref object` type `system.new` is invoked implicitly.

 ### Object variants


Often an object hierarchy is an overkill in certain situations where simple variant types are needed. Object variants are tagged unions discriminated via an enumerated type used for runtime type flexibility, mirroring the concepts of *sum types* and *algebraic data types (ADTs)* as found in other languages.

 An example:

 
```
# This is an example how an abstract syntax tree could be modelled in Nim
type
  NodeKind = enum  # the different node types
    nkInt,          # a leaf with an integer value
    nkFloat,        # a leaf with a float value
    nkString,       # a leaf with a string value
    nkAdd,          # an addition
    nkSub,          # a subtraction
    nkIf            # an if statement
  Node = ref NodeObj
  NodeObj = object
    case kind: NodeKind  # the ``kind`` field is the discriminator
    of nkInt: intVal: int
    of nkFloat: floatVal: float
    of nkString: strVal: string
    of nkAdd, nkSub:
      leftOp, rightOp: Node
    of nkIf:
      condition, thenPart, elsePart: Node

# create a new case object:
var n = Node(kind: nkIf, condition: nil)
# accessing n.thenPart is valid because the ``nkIf`` branch is active:
n.thenPart = Node(kind: nkFloat, floatVal: 2.0)

# the following statement raises an `FieldDefect` exception, because
# n.kind's value does not fit and the ``nkString`` branch is not active:
n.strVal = ""

# invalid: would change the active object branch:
n.kind = nkInt

var x = Node(kind: nkAdd, leftOp: Node(kind: nkInt, intVal: 4),
                          rightOp: Node(kind: nkInt, intVal: 2))
# valid: does not change the active object branch:
x.kind = nkSub
```

As can be seen from the example, an advantage to an object hierarchy is that no casting between different object types is needed. Yet, access to invalid object fields raises an exception.

 The syntax of `case` in an object declaration follows closely the syntax of the `case` statement: The branches in a `case` section may be indented too.

 In the example, the `kind` field is called the discriminator: For safety its address cannot be taken and assignments to it are restricted: The new value must not lead to a change of the active object branch. Also, when the fields of a particular branch are specified during object construction, the corresponding discriminator value must be specified as a constant expression.

 Instead of changing the active object branch, replace the old object in memory with a new one completely:

 
```
var x = Node(kind: nkAdd, leftOp: Node(kind: nkInt, intVal: 4),
                          rightOp: Node(kind: nkInt, intVal: 2))
# change the node's contents:
x[] = NodeObj(kind: nkString, strVal: "abc")
```

Starting with version 0.20 `system.reset` cannot be used anymore to support object branch changes as this never was completely memory safe.

 As a special rule, the discriminator kind can also be bounded using a `case` statement. If possible values of the discriminator variable in a `case` statement branch are a subset of discriminator values for the selected object branch, the initialization is considered valid. This analysis only works for immutable discriminators of an ordinal type and disregards `elif` branches. For discriminator values with a `range` type, the compiler checks if the entire range of possible values for the discriminator value is valid for the chosen object branch.

 A small example:

 
```
let unknownKind = nkSub

# invalid: unsafe initialization because the kind field is not statically known:
var y = Node(kind: unknownKind, strVal: "y")

var z = Node()
case unknownKind
of nkAdd, nkSub:
  # valid: possible values of this branch are a subset of nkAdd/nkSub object branch:
  z = Node(kind: unknownKind, leftOp: Node(), rightOp: Node())
else:
  echo "ignoring: ", unknownKind

# also valid, since unknownKindBounded can only contain the values nkAdd or nkSub
let unknownKindBounded = range[nkAdd..nkSub](unknownKind)
z = Node(kind: unknownKindBounded, leftOp: Node(), rightOp: Node())
```
 ### Set type

The set type models the mathematical notion of a set. The set's basetype can only be an ordinal type of a certain size, namely:* `int8`-`int16`
* `uint8`/`byte`-`uint16`
* `char`
* `enum`

 or equivalent. For signed integers the set's base type is defined to be in the range `0 .. MaxSetElements-1` where `MaxSetElements` is currently always 2^16.

 The reason is that sets are implemented as high performance bit vectors. Attempting to declare a set with a larger type will result in an error:

 
```
var s: set[int64] # Error: set is too large
```

Sets can be constructed via the set constructor: `{}` is the empty set. The empty set is type compatible with any concrete set type. The constructor can also be used to include elements (and ranges of elements):

 
```
type
  CharSet = set[char]
var
  x: CharSet
x = {'a'..'z', '0'..'9'} # This constructs a set that contains the
                         # letters from 'a' to 'z' and the digits
                         # from '0' to '9'
```

These operations are supported by sets:

 

| operation | meaning |
| --- | --- |
| `A + B` | union of two sets |
| `A * B` | intersection of two sets |
| `A - B` | difference of two sets (A without B's elements) |
| `A == B` | set equality |
| `A <= B` | subset relation (A is subset of B or equal to B) |
| `A < B` | strict subset relation (A is a proper subset of B) |
| `e in A` | set membership (A contains element e) |
| `e notin A` | A does not contain element e |
| `contains(A, e)` | A contains element e |
| `card(A)` | the cardinality of A (number of elements in A) |
| `incl(A, elem)` | same as `A = A + {elem}` |
| `excl(A, elem)` | same as `A = A - {elem}` |

 #### Bit fields


Sets are often used to define a type for the *flags* of a procedure. This is a cleaner (and type safe) solution than defining integer constants that have to be `or`'ed together.

 Enum, sets and casting can be used together as in:

 
```
type
  MyFlag* {.size: sizeof(cint).} = enum
    A
    B
    C
    D
  MyFlags = set[MyFlag]

proc toNum(f: MyFlags): int = cast[cint](f)
proc toFlags(v: int): MyFlags = cast[MyFlags](v)

assert toNum({}) == 0
assert toNum({A}) == 1
assert toNum({D}) == 8
assert toNum({A, C}) == 5
assert toFlags(0) == {}
assert toFlags(7) == {A, B, C}
```

Note how the set turns enum values into powers of 2.

 If using enums and sets with C, use distinct cint.

 For interoperability with C see also the [bitsize pragma](manual#implementation-specific-pragmas-bitsize-pragma).

 ### Reference and pointer types


References (similar to pointers in other programming languages) are a way to introduce many-to-one relationships. This means different references can point to and modify the same location in memory (also called aliasing).

 Nim distinguishes between traced and untraced references. Untraced references are also called *pointers*. Traced references point to objects of a garbage-collected heap, untraced references point to manually allocated objects or objects somewhere else in memory. Thus untraced references are *unsafe*. However, for certain low-level operations (accessing the hardware) untraced references are unavoidable.

 Traced references are declared with the **ref** keyword, untraced references are declared with the **ptr** keyword. In general, a `ptr T` is implicitly convertible to the `pointer` type.

 An empty subscript `[]` notation can be used to de-refer a reference, the `addr` procedure returns the address of an item. An address is always an untraced reference. Thus the usage of `addr` is an *unsafe* feature.

 The `.` (access a tuple/object field operator) and `[]` (array/string/sequence index operator) operators perform implicit dereferencing operations for reference types:

 
```
type
  Node = ref NodeObj
  NodeObj = object
    le, ri: Node
    data: int

var
  n: Node
new(n)
n.data = 9
# no need to write n[].data; in fact n[].data is highly discouraged!
```

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#type-bound-operations).

 In order to simplify structural type checking, recursive tuples are not valid:

 
```
# invalid recursion
type MyTuple = tuple[a: ref MyTuple]
```

Likewise `T = ref T` is an invalid type.

 As a syntactical extension `object` types can be anonymous if declared in a type section via the `ref object` or `ptr object` notations. This feature is useful if an object should only gain reference semantics:

 
```
type
  Node = ref object
    le, ri: Node
    data: int
```

To allocate a new traced object, the built-in procedure `new` has to be used. To deal with untraced memory, the procedures `alloc`, `dealloc` and `realloc` can be used. The documentation of the system module contains further information.

 Nil ---

 If a reference points to *nothing*, it has the value `nil`. `nil` is the default value for all `ref` and `ptr` types. The `nil` value can also be used like any other literal value. For example, it can be used in an assignment like `myRef = nil`.

 Dereferencing `nil` is an unrecoverable fatal runtime error (and not a panic).

 A successful dereferencing operation `p[]` implies that `p` is not nil. This can be exploited by the implementation to optimize code like:

 
```
p[].field = 3
if p != nil:
  # if p were nil, ``p[]`` would have caused a crash already,
  # so we know ``p`` is always not nil here.
  action()
```

Into:

 
```
p[].field = 3
action()
```

*Note*: This is not comparable to C's "undefined behavior" for dereferencing NULL pointers.

 ### Mixing GC'ed memory with `ptr`


Special care has to be taken if an untraced object contains traced objects like traced references, strings, or sequences: in order to free everything properly, the built-in procedure `reset` has to be called before freeing the untraced memory manually:

 
```
type
  Data = tuple[x, y: int, s: string]

# allocate memory for Data on the heap:
var d = cast[ptr Data](alloc0(sizeof(Data)))

# create a new string on the garbage collected heap:
d.s = "abc"

# tell the GC that the string is not needed anymore:
reset(d.s)

# free the memory:
dealloc(d)
```

Without the `reset` call the memory allocated for the `d.s` string would never be freed. The example also demonstrates two important features for low-level programming: the `sizeof` proc returns the size of a type or value in bytes. The `cast` operator can circumvent the type system: the compiler is forced to treat the result of the `alloc0` call (which returns an untyped pointer) as if it would have the type `ptr Data`. Casting should only be done if it is unavoidable: it breaks type safety and bugs can lead to mysterious crashes.

 **Note**: The example only works because the memory is initialized to zero (`alloc0` instead of `alloc` does this): `d.s` is thus initialized to binary zero which the string assignment can handle. One needs to know low-level details like this when mixing garbage-collected data with unmanaged memory.

 ### Procedural type


A procedural type is internally a pointer to a procedure. `nil` is an allowed value for variables of a procedural type. Nim uses procedural types to achieve functional programming techniques.

 Examples:

 
```
proc printItem(x: int) = ...

proc forEach(c: proc (x: int) {.cdecl.}) =
  ...

forEach(printItem)  # this will NOT compile because calling conventions differ
```


```
type
  OnMouseMove = proc (x, y: int) {.closure.}

proc onMouseMove(mouseX, mouseY: int) =
  # has default calling convention
  echo "x: ", mouseX, " y: ", mouseY

proc setOnMouseMove(mouseMoveEvent: OnMouseMove) = discard

# ok, 'onMouseMove' has the default calling convention, which is compatible
# to 'closure':
setOnMouseMove(onMouseMove)
```

A subtle issue with procedural types is that the calling convention of the procedure influences the type compatibility: procedural types are only compatible if they have the same calling convention. As a special extension, a procedure of the calling convention `nimcall` can be passed to a parameter that expects a proc of the calling convention `closure`.

 Nim supports these calling conventions:

 
nimcall is the default convention used for a Nim **proc**. It is the same as `fastcall`, but only for C compilers that support `fastcall`. closure is the default calling convention for a **procedural type** that lacks any pragma annotations. It indicates that the procedure has a hidden implicit parameter (an *environment*). Proc vars that have the calling convention `closure` take up two machine words: One for the proc pointer and another one for the pointer to implicitly passed environment. stdcall This is the stdcall convention as specified by Microsoft. The generated C procedure is declared with the `__stdcall` keyword. cdecl The cdecl convention means that a procedure shall use the same convention as the C compiler. Under Windows the generated C procedure is declared with the `__cdecl` keyword. safecall This is the safecall convention as specified by Microsoft. The generated C procedure is declared with the `__safecall` keyword. The word *safe* refers to the fact that all hardware registers shall be pushed to the hardware stack. inline The inline convention means the the caller should not call the procedure, but inline its code directly. Note that Nim does not inline, but leaves this to the C compiler; it generates `__inline` procedures. This is only a hint for the compiler: it may completely ignore it and it may inline procedures that are not marked as `inline`. fastcall Fastcall means different things to different C compilers. One gets whatever the C `__fastcall` means. thiscall This is thiscall calling convention as specified by Microsoft, used on C++ class member functions on the x86 architecture syscall The syscall convention is the same as `__syscall` in C. It is used for interrupts. noconv The generated C code will not have any explicit calling convention and thus use the C compiler's default calling convention. This is needed because Nim's default calling convention for procedures is `fastcall` to improve speed.  Most calling conventions exist only for the Windows 32-bit platform.

 The default calling convention is `nimcall`, unless it is an inner proc (a proc inside of a proc). For an inner proc an analysis is performed whether it accesses its environment. If it does so, it has the calling convention `closure`, otherwise it has the calling convention `nimcall`.

 ### Distinct type


A `distinct` type is a new type derived from a base type that is incompatible with its base type. In particular, it is an essential property of a distinct type that it **does not** imply a subtype relation between it and its base type. Explicit type conversions from a distinct type to its base type and vice versa are allowed. See also `distinctBase` to get the reverse operation.

 A distinct type is an ordinal type if its base type is an ordinal type.

 #### Modeling currencies


A distinct type can be used to model different physical units with a numerical base type, for example. The following example models currencies.

 Different currencies should not be mixed in monetary calculations. Distinct types are a perfect tool to model different currencies:

 
```
type
  Dollar = distinct int
  Euro = distinct int

var
  d: Dollar
  e: Euro

echo d + 12
# Error: cannot add a number with no unit and a ``Dollar``
```

Unfortunately, `d + 12.Dollar` is not allowed either, because `+` is defined for `int` (among others), not for `Dollar`. So a `+` for dollars needs to be defined:

 
```
proc `+` (x, y: Dollar): Dollar =
  result = Dollar(int(x) + int(y))
```

It does not make sense to multiply a dollar with a dollar, but with a number without unit; and the same holds for division:

 
```
proc `*` (x: Dollar, y: int): Dollar =
  result = Dollar(int(x) * y)

proc `*` (x: int, y: Dollar): Dollar =
  result = Dollar(x * int(y))

proc `div` ...
```

This quickly gets tedious. The implementations are trivial and the compiler should not generate all this code only to optimize it away later - after all `+` for dollars should produce the same binary code as `+` for ints. The pragma borrow has been designed to solve this problem; in principle, it generates the above trivial implementations:

 
```
proc `*` (x: Dollar, y: int): Dollar {.borrow.}
proc `*` (x: int, y: Dollar): Dollar {.borrow.}
proc `div` (x: Dollar, y: int): Dollar {.borrow.}
```

The `borrow` pragma makes the compiler use the same implementation as the proc that deals with the distinct type's base type, so no code is generated.

 But it seems all this boilerplate code needs to be repeated for the `Euro` currency. This can be solved with [templates](#templates).

 
```
template additive(typ: typedesc) =
  proc `+` *(x, y: typ): typ {.borrow.}
  proc `-` *(x, y: typ): typ {.borrow.}
  
  # unary operators:
  proc `+` *(x: typ): typ {.borrow.}
  proc `-` *(x: typ): typ {.borrow.}

template multiplicative(typ, base: typedesc) =
  proc `*` *(x: typ, y: base): typ {.borrow.}
  proc `*` *(x: base, y: typ): typ {.borrow.}
  proc `div` *(x: typ, y: base): typ {.borrow.}
  proc `mod` *(x: typ, y: base): typ {.borrow.}

template comparable(typ: typedesc) =
  proc `<` * (x, y: typ): bool {.borrow.}
  proc `<=` * (x, y: typ): bool {.borrow.}
  proc `==` * (x, y: typ): bool {.borrow.}

template defineCurrency(typ, base: untyped) =
  type
    typ* = distinct base
  additive(typ)
  multiplicative(typ, base)
  comparable(typ)

defineCurrency(Dollar, int)
defineCurrency(Euro, int)
```

The borrow pragma can also be used to annotate the distinct type to allow certain builtin operations to be lifted:

 
```
type
  Foo = object
    a, b: int
    s: string
  
  Bar {.borrow: `.`.} = distinct Foo

var bb: ref Bar
new bb
# field access now valid
bb.a = 90
bb.s = "abc"
```

Currently, only the dot accessor can be borrowed in this way.

 #### Avoiding SQL injection attacks


An SQL statement that is passed from Nim to an SQL database might be modeled as a string. However, using string templates and filling in the values is vulnerable to the famous SQL injection attack:

 
```
import strutils

proc query(db: DbHandle, statement: string) = ...

var
  username: string

db.query("SELECT FROM users WHERE name = '$1'" % username)
# Horrible security hole, but the compiler does not mind!
```

This can be avoided by distinguishing strings that contain SQL from strings that don't. Distinct types provide a means to introduce a new string type `SQL` that is incompatible with `string`:

 
```
type
  SQL = distinct string

proc query(db: DbHandle, statement: SQL) = ...

var
  username: string

db.query("SELECT FROM users WHERE name = '$1'" % username)
# Static error: `query` expects an SQL string!
```

It is an essential property of abstract types that they **do not** imply a subtype relation between the abstract type and its base type. Explicit type conversions from `string` to `SQL` are allowed:

 
```
import strutils, sequtils

proc properQuote(s: string): SQL =
  # quotes a string properly for an SQL statement
  return SQL(s)

proc `%` (frmt: SQL, values: openarray[string]): SQL =
  # quote each argument:
  let v = values.mapIt(SQL, properQuote(it))
  # we need a temporary type for the type conversion :-(
  type StrSeq = seq[string]
  # call strutils.`%`:
  result = SQL(string(frmt) % StrSeq(v))

db.query("SELECT FROM users WHERE name = '$1'".SQL % [username])
```

Now we have compile-time checking against SQL injection attacks. Since `"".SQL` is transformed to `SQL("")` no new syntax is needed for nice looking `SQL` string literals. The hypothetical `SQL` type actually exists in the library as the [SqlQuery type](db_common#SqlQuery) of modules like <db_sqlite>.

 ### Auto type


The `auto` type can only be used for return types and parameters. For return types it causes the compiler to infer the type from the routine body:

 
```
proc returnsInt(): auto = 1984
```

For parameters it currently creates implicitly generic routines:

 
```
proc foo(a, b: auto) = discard
```

Is the same as:

 
```
proc foo[T1, T2](a: T1, b: T2) = discard
```

However, later versions of the language might change this to mean "infer the parameters' types from the body". Then the above `foo` would be rejected as the parameters' types can not be inferred from an empty `discard` statement.

 Type relations
--------------


The following section defines several relations on types that are needed to describe the type checking done by the compiler.

 ### Type equality


Nim uses structural type equivalence for most types. Only for objects, enumerations and distinct types name equivalence is used. The following algorithm, *in pseudo-code*, determines type equality:

 
```
proc typeEqualsAux(a, b: PType,
                   s: var HashSet[(PType, PType)]): bool =
  if (a,b) in s: return true
  incl(s, (a,b))
  if a.kind == b.kind:
    case a.kind
    of int, intXX, float, floatXX, char, string, cstring, pointer,
        bool, nil, void:
      # leaf type: kinds identical; nothing more to check
      result = true
    of ref, ptr, var, set, seq, openarray:
      result = typeEqualsAux(a.baseType, b.baseType, s)
    of range:
      result = typeEqualsAux(a.baseType, b.baseType, s) and
        (a.rangeA == b.rangeA) and (a.rangeB == b.rangeB)
    of array:
      result = typeEqualsAux(a.baseType, b.baseType, s) and
               typeEqualsAux(a.indexType, b.indexType, s)
    of tuple:
      if a.tupleLen == b.tupleLen:
        for i in 0..a.tupleLen-1:
          if not typeEqualsAux(a[i], b[i], s): return false
        result = true
    of object, enum, distinct:
      result = a == b
    of proc:
      result = typeEqualsAux(a.parameterTuple, b.parameterTuple, s) and
               typeEqualsAux(a.resultType, b.resultType, s) and
               a.callingConvention == b.callingConvention

proc typeEquals(a, b: PType): bool =
  var s: HashSet[(PType, PType)] = {}
  result = typeEqualsAux(a, b, s)
```

Since types are graphs which can have cycles, the above algorithm needs an auxiliary set `s` to detect this case.

 ### Type equality modulo type distinction


The following algorithm (in pseudo-code) determines whether two types are equal with no respect to `distinct` types. For brevity the cycle check with an auxiliary set `s` is omitted:

 
```
proc typeEqualsOrDistinct(a, b: PType): bool =
  if a.kind == b.kind:
    case a.kind
    of int, intXX, float, floatXX, char, string, cstring, pointer,
        bool, nil, void:
      # leaf type: kinds identical; nothing more to check
      result = true
    of ref, ptr, var, set, seq, openarray:
      result = typeEqualsOrDistinct(a.baseType, b.baseType)
    of range:
      result = typeEqualsOrDistinct(a.baseType, b.baseType) and
        (a.rangeA == b.rangeA) and (a.rangeB == b.rangeB)
    of array:
      result = typeEqualsOrDistinct(a.baseType, b.baseType) and
               typeEqualsOrDistinct(a.indexType, b.indexType)
    of tuple:
      if a.tupleLen == b.tupleLen:
        for i in 0..a.tupleLen-1:
          if not typeEqualsOrDistinct(a[i], b[i]): return false
        result = true
    of distinct:
      result = typeEqualsOrDistinct(a.baseType, b.baseType)
    of object, enum:
      result = a == b
    of proc:
      result = typeEqualsOrDistinct(a.parameterTuple, b.parameterTuple) and
               typeEqualsOrDistinct(a.resultType, b.resultType) and
               a.callingConvention == b.callingConvention
  elif a.kind == distinct:
    result = typeEqualsOrDistinct(a.baseType, b)
  elif b.kind == distinct:
    result = typeEqualsOrDistinct(a, b.baseType)
```
 ### Subtype relation


If object `a` inherits from `b`, `a` is a subtype of `b`. This subtype relation is extended to the types `var`, `ref`, `ptr`:

 
```
proc isSubtype(a, b: PType): bool =
  if a.kind == b.kind:
    case a.kind
    of object:
      var aa = a.baseType
      while aa != nil and aa != b: aa = aa.baseType
      result = aa == b
    of var, ref, ptr:
      result = isSubtype(a.baseType, b.baseType)
```
 ### Convertible relation


A type `a` is **implicitly** convertible to type `b` iff the following algorithm returns true:

 
```
proc isImplicitlyConvertible(a, b: PType): bool =
  if isSubtype(a, b) or isCovariant(a, b):
    return true
  if isIntLiteral(a):
    return b in {int8, int16, int32, int64, int, uint, uint8, uint16,
                 uint32, uint64, float32, float64}
  case a.kind
  of int:     result = b in {int32, int64}
  of int8:    result = b in {int16, int32, int64, int}
  of int16:   result = b in {int32, int64, int}
  of int32:   result = b in {int64, int}
  of uint:    result = b in {uint32, uint64}
  of uint8:   result = b in {uint16, uint32, uint64}
  of uint16:  result = b in {uint32, uint64}
  of uint32:  result = b in {uint64}
  of float32: result = b in {float64}
  of float64: result = b in {float32}
  of seq:
    result = b == openArray and typeEquals(a.baseType, b.baseType)
  of array:
    result = b == openArray and typeEquals(a.baseType, b.baseType)
    if a.baseType == char and a.indexType.rangeA == 0:
      result = b == cstring
  of cstring, ptr:
    result = b == pointer
  of string:
    result = b == cstring
```

Implicit conversions are also performed for Nim's `range` type constructor.

 Let `a0`, `b0` of type `T`.

 Let `A = range[a0..b0]` be the argument's type, `F` the formal parameter's type. Then an implicit conversion from `A` to `F` exists if `a0 >= low(F) and b0 <= high(F)` and both `T` and `F` are signed integers or if both are unsigned integers.

 A type `a` is **explicitly** convertible to type `b` iff the following algorithm returns true:

 
```
proc isIntegralType(t: PType): bool =
  result = isOrdinal(t) or t.kind in {float, float32, float64}

proc isExplicitlyConvertible(a, b: PType): bool =
  result = false
  if isImplicitlyConvertible(a, b): return true
  if typeEqualsOrDistinct(a, b): return true
  if isIntegralType(a) and isIntegralType(b): return true
  if isSubtype(a, b) or isSubtype(b, a): return true
```

The convertible relation can be relaxed by a user-defined type converter.

 
```
converter toInt(x: char): int = result = ord(x)

var
  x: int
  chr: char = 'a'

# implicit conversion magic happens here
x = chr
echo x # => 97
# one can use the explicit form too
x = chr.toInt
echo x # => 97
```

The type conversion `T(a)` is an L-value if `a` is an L-value and `typeEqualsOrDistinct(T, typeof(a))` holds.

 ### Assignment compatibility


An expression `b` can be assigned to an expression `a` iff `a` is an `l-value` and `isImplicitlyConvertible(b.typ, a.typ)` holds.

 Overloading resolution
----------------------


In a call `p(args)` the routine `p` that matches best is selected. If multiple routines match equally well, the ambiguity is reported during semantic analysis.

 Every arg in args needs to match. There are multiple different categories how an argument can match. Let `f` be the formal parameter's type and `a` the type of the argument.

 1. Exact match: `a` and `f` are of the same type.
2. Literal match: `a` is an integer literal of value `v` and `f` is a signed or unsigned integer type and `v` is in `f`'s range. Or: `a` is a floating-point literal of value `v` and `f` is a floating-point type and `v` is in `f`'s range.
3. Generic match: `f` is a generic type and `a` matches, for instance `a` is `int` and `f` is a generic (constrained) parameter type (like in `[T]` or `[T: int|char]`.
4. Subrange or subtype match: `a` is a `range[T]` and `T` matches `f` exactly. Or: `a` is a subtype of `f`.
5. Integral conversion match: `a` is convertible to `f` and `f` and `a` is some integer or floating-point type.
6. Conversion match: `a` is convertible to `f`, possibly via a user defined `converter`.

 These matching categories have a priority: An exact match is better than a literal match and that is better than a generic match etc. In the following `count(p, m)` counts the number of matches of the matching category `m` for the routine `p`.

 A routine `p` matches better than a routine `q` if the following algorithm returns true:



```
for each matching category m in ["exact match", "literal match",
                                "generic match", "subtype match",
                                "integral match", "conversion match"]:
  if count(p, m) > count(q, m): return true
  elif count(p, m) == count(q, m):
    discard "continue with next category m"
  else:
    return false
return "ambiguous"
```
 Some examples:

 
```
proc takesInt(x: int) = echo "int"
proc takesInt[T](x: T) = echo "T"
proc takesInt(x: int16) = echo "int16"

takesInt(4) # "int"
var x: int32
takesInt(x) # "T"
var y: int16
takesInt(y) # "int16"
var z: range[0..4] = 0
takesInt(z) # "T"
```

If this algorithm returns "ambiguous" further disambiguation is performed: If the argument `a` matches both the parameter type `f` of `p` and `g` of `q` via a subtyping relation, the inheritance depth is taken into account:

 
```
type
  A = object of RootObj
  B = object of A
  C = object of B

proc p(obj: A) =
  echo "A"

proc p(obj: B) =
  echo "B"

var c = C()
# not ambiguous, calls 'B', not 'A' since B is a subtype of A
# but not vice versa:
p(c)

proc pp(obj: A, obj2: B) = echo "A B"
proc pp(obj: B, obj2: A) = echo "B A"

# but this is ambiguous:
pp(c, c)
```

Likewise for generic matches the most specialized generic type (that still matches) is preferred:

 
```
proc gen[T](x: ref ref T) = echo "ref ref T"
proc gen[T](x: ref T) = echo "ref T"
proc gen[T](x: T) = echo "T"

var ri: ref int
gen(ri) # "ref T"
```
 ### Overloading based on 'var T'


If the formal parameter `f` is of type `var T` in addition to the ordinary type checking, the argument is checked to be an l-value. `var T` matches better than just `T` then.

 
```
proc sayHi(x: int): string =
  # matches a non-var int
  result = $x
proc sayHi(x: var int): string =
  # matches a var int
  result = $(x + 10)

proc sayHello(x: int) =
  var m = x # a mutable version of x
  echo sayHi(x) # matches the non-var version of sayHi
  echo sayHi(m) # matches the var version of sayHi

sayHello(3) # 3
            # 13
```
 ### Lazy type resolution for untyped


**Note**: An unresolved expression is an expression for which no symbol lookups and no type checking have been performed.

 Since templates and macros that are not declared as `immediate` participate in overloading resolution, it's essential to have a way to pass unresolved expressions to a template or macro. This is what the meta-type `untyped` accomplishes:

 
```
template rem(x: untyped) = discard

rem unresolvedExpression(undeclaredIdentifier)
```

A parameter of type `untyped` always matches any argument (as long as there is any argument passed to it).

 But one has to watch out because other overloads might trigger the argument's resolution:

 
```
template rem(x: untyped) = discard
proc rem[T](x: T) = discard

# undeclared identifier: 'unresolvedExpression'
rem unresolvedExpression(undeclaredIdentifier)
```

`untyped` and `varargs[untyped]` are the only metatype that are lazy in this sense, the other metatypes `typed` and `typedesc` are not lazy.

 ### Varargs matching


See [Varargs](#types-varargs).

 Statements and expressions
--------------------------


Nim uses the common statement/expression paradigm: Statements do not produce a value in contrast to expressions. However, some expressions are statements.

 Statements are separated into simple statements and complex statements. Simple statements are statements that cannot contain other statements like assignments, calls, or the `return` statement; complex statements can contain other statements. To avoid the dangling else problem, complex statements always have to be indented. The details can be found in the grammar.

 ### Statement list expression


Statements can also occur in an expression context that looks like `(stmt1; stmt2; ...; ex)`. This is called a statement list expression or `(;)`. The type of `(stmt1; stmt2; ...; ex)` is the type of `ex`. All the other statements must be of type `void`. (One can use `discard` to produce a `void` type.) `(;)` does not introduce a new scope.

 ### Discard statement


Example:

 
```
proc p(x, y: int): int =
  result = x + y

discard p(3, 4) # discard the return value of `p`
```

The `discard` statement evaluates its expression for side-effects and throws the expression's resulting value away, and should only be used when ignoring this value is known not to cause problems.

 Ignoring the return value of a procedure without using a discard statement is a static error.

 The return value can be ignored implicitly if the called proc/iterator has been declared with the discardable pragma:

 
```
proc p(x, y: int): int {.discardable.} =
  result = x + y

p(3, 4) # now valid
```

however the discardable pragma does not work on templates as templates substitute the AST in place. For example:

 
```
{.push discardable .}
template example(): string = "https://nim-lang.org"
{.pop.}

example()
```

This template will resolve into "<https://nim-lang.org>" which is a string literal and since {.discardable.} doesn't apply to literals, the compiler will error.

 An empty `discard` statement is often used as a null statement:

 
```
proc classify(s: string) =
  case s[0]
  of SymChars, '_': echo "an identifier"
  of '0'..'9': echo "a number"
  else: discard
```
 ### Void context


In a list of statements every expression except the last one needs to have the type `void`. In addition to this rule an assignment to the builtin `result` symbol also triggers a mandatory `void` context for the subsequent expressions:

 
```
proc invalid*(): string =
  result = "foo"
  "invalid"  # Error: value of type 'string' has to be discarded
```


```
proc valid*(): string =
  let x = 317
  "valid"
```
 ### Var statement


Var statements declare new local and global variables and initialize them. A comma-separated list of variables can be used to specify variables of the same type:

 
```
var
  a: int = 0
  x, y, z: int
```

If an initializer is given the type can be omitted: the variable is then of the same type as the initializing expression. Variables are always initialized with a default value if there is no initializing expression. The default value depends on the type and is always a zero in binary.

 

| Type | default value |
| --- | --- |
| any integer type | 0 |
| any float | 0.0 |
| char | '\0' |
| bool | false |
| ref or pointer type | nil |
| procedural type | nil |
| sequence | `@[]` |
| string | `""` |
| tuple[x: A, y: B, ...] | (default(A), default(B), ...) (analogous for objects) |
| array[0..., T] | [default(T), ...] |
| range[T] | default(T); this may be out of the valid range |
| T = enum | cast[T](0); this may be an invalid value |


The implicit initialization can be avoided for optimization reasons with the noinit pragma:

 
```
var
  a {.noInit.}: array[0..1023, char]
```

If a proc is annotated with the `noinit` pragma this refers to its implicit `result` variable:

 
```
proc returnUndefinedValue: int {.noinit.} = discard
```

The implicit initialization can be also prevented by the requiresInit type pragma. The compiler requires an explicit initialization for the object and all of its fields. However, it does a control flow analysis to prove the variable has been initialized and does not rely on syntactic properties:

 
```
type
  MyObject = object {.requiresInit.}

proc p() =
  # the following is valid:
  var x: MyObject
  if someCondition():
    x = a()
  else:
    x = a()
  # use x
```
 ### Let statement


A `let` statement declares new local and global single assignment variables and binds a value to them. The syntax is the same as that of the `var` statement, except that the keyword `var` is replaced by the keyword `let`. Let variables are not l-values and can thus not be passed to `var` parameters nor can their address be taken. They cannot be assigned new values.

 For let variables, the same pragmas are available as for ordinary variables.

 As `let` statements are immutable after creation they need to define a value when they are declared. The only exception to this is if the `{.importc.}` pragma (or any of the other `importX` pragmas) is applied, in this case the value is expected to come from native code, typically a C/C++ `const`.

 ### Tuple unpacking


In a `var` or `let` statement tuple unpacking can be performed. The special identifier `_` can be used to ignore some parts of the tuple:

 
```
proc returnsTuple(): (int, int, int) = (4, 2, 3)

let (x, _, z) = returnsTuple()
```
 ### Const section


A const section declares constants whose values are constant expressions:

 
```
import strutils
const
  roundPi = 3.1415
  constEval = contains("abc", 'b') # computed at compile time!
```

Once declared, a constant's symbol can be used as a constant expression.

 See [Constants and Constant Expressions](#constants-and-constant-expressions) for details.

 ### Static statement/expression


A static statement/expression explicitly requires compile-time execution. Even some code that has side effects is permitted in a static block:

 
```
static:
  echo "echo at compile time"
```

There are limitations on what Nim code can be executed at compile time; see [Restrictions on Compile-Time Execution](#restrictions-on-compileminustime-execution) for details. It's a static error if the compiler cannot execute the block at compile time.

 ### If statement


Example:

 
```
var name = readLine(stdin)

if name == "Andreas":
  echo "What a nice name!"
elif name == "":
  echo "Don't you have a name?"
else:
  echo "Boring name..."
```

The `if` statement is a simple way to make a branch in the control flow: The expression after the keyword `if` is evaluated, if it is true the corresponding statements after the `:` are executed. Otherwise the expression after the `elif` is evaluated (if there is an `elif` branch), if it is true the corresponding statements after the `:` are executed. This goes on until the last `elif`. If all conditions fail, the `else` part is executed. If there is no `else` part, execution continues with the next statement.

 In `if` statements new scopes begin immediately after the `if`/`elif`/`else` keywords and ends after the corresponding *then* block. For visualization purposes the scopes have been enclosed in `{| |}` in the following example:

 
```
if {| (let m = input =~ re"(\w+)=\w+"; m.isMatch):
  echo "key ", m[0], " value ", m[1]  |}
elif {| (let m = input =~ re""; m.isMatch):
  echo "new m in this scope"  |}
else: {|
  echo "m not declared here"  |}
```
 ### Case statement


Example:

 
```
case readline(stdin)
of "delete-everything", "restart-computer":
  echo "permission denied"
of "go-for-a-walk":     echo "please yourself"
else:                   echo "unknown command"

# indentation of the branches is also allowed; and so is an optional colon
# after the selecting expression:
case readline(stdin):
  of "delete-everything", "restart-computer":
    echo "permission denied"
  of "go-for-a-walk":     echo "please yourself"
  else:                   echo "unknown command"
```

The `case` statement is similar to the if statement, but it represents a multi-branch selection. The expression after the keyword `case` is evaluated and if its value is in a *slicelist* the corresponding statements (after the `of` keyword) are executed. If the value is not in any given *slicelist* the `else` part is executed. If there is no `else` part and not all possible values that `expr` can hold occur in a `slicelist`, a static error occurs. This holds only for expressions of ordinal types. "All possible values" of `expr` are determined by `expr`'s type. To suppress the static error an `else` part with an empty `discard` statement should be used.

 For non-ordinal types, it is not possible to list every possible value and so these always require an `else` part.

 Because case statements are checked for exhaustiveness during semantic analysis, the value in every `of` branch must be a constant expression. This restriction also allows the compiler to generate more performant code.

 As a special semantic extension, an expression in an `of` branch of a case statement may evaluate to a set or array constructor; the set or array is then expanded into a list of its elements:

 
```
const
  SymChars: set[char] = {'a'..'z', 'A'..'Z', '\x80'..'\xFF'}

proc classify(s: string) =
  case s[0]
  of SymChars, '_': echo "an identifier"
  of '0'..'9': echo "a number"
  else: echo "other"

# is equivalent to:
proc classify(s: string) =
  case s[0]
  of 'a'..'z', 'A'..'Z', '\x80'..'\xFF', '_': echo "an identifier"
  of '0'..'9': echo "a number"
  else: echo "other"
```

The `case` statement doesn't produce an l-value, so the following example won't work:

 
```
type
  Foo = ref object
    x: seq[string]

proc get_x(x: Foo): var seq[string] =
  # doesn't work
  case true
  of true:
    x.x
  else:
    x.x

var foo = Foo(x: @[])
foo.get_x().add("asd")
```

This can be fixed by explicitly using `return`:

 
```
proc get_x(x: Foo): var seq[string] =
  case true
  of true:
    return x.x
  else:
    return x.x
```
 ### When statement


Example:

 
```
when sizeof(int) == 2:
  echo "running on a 16 bit system!"
elif sizeof(int) == 4:
  echo "running on a 32 bit system!"
elif sizeof(int) == 8:
  echo "running on a 64 bit system!"
else:
  echo "cannot happen!"
```

The `when` statement is almost identical to the `if` statement with some exceptions:

 * Each condition (`expr`) has to be a constant expression (of type `bool`).
* The statements do not open a new scope.
* The statements that belong to the expression that evaluated to true are translated by the compiler, the other statements are not checked for semantics! However, each condition is checked for semantics.

 The `when` statement enables conditional compilation techniques. As a special syntactic extension, the `when` construct is also available within `object` definitions.

 ### When nimvm statement


`nimvm` is a special symbol, that may be used as an expression of `when nimvm` statement to differentiate execution path between compile-time and the executable.

 Example:

 
```
proc someProcThatMayRunInCompileTime(): bool =
  when nimvm:
    # This branch is taken at compile time.
    result = true
  else:
    # This branch is taken in the executable.
    result = false
const ctValue = someProcThatMayRunInCompileTime()
let rtValue = someProcThatMayRunInCompileTime()
assert(ctValue == true)
assert(rtValue == false)
```

`when nimvm` statement must meet the following requirements:

 * Its expression must always be `nimvm`. More complex expressions are not allowed.
* It must not contain `elif` branches.
* It must contain `else` branch.
* Code in branches must not affect semantics of the code that follows the `when nimvm` statement. E.g. it must not define symbols that are used in the following code.

 ### Return statement


Example:

 
```
return 40+2
```

The `return` statement ends the execution of the current procedure. It is only allowed in procedures. If there is an `expr`, this is syntactic sugar for:

 
```
result = expr
return result
```

`return` without an expression is a short notation for `return result` if the proc has a return type. The result variable is always the return value of the procedure. It is automatically declared by the compiler. As all variables, `result` is initialized to (binary) zero:

 
```
proc returnZero(): int =
  # implicitly returns 0
```
 ### Yield statement


Example:

 
```
yield (1, 2, 3)
```

The `yield` statement is used instead of the `return` statement in iterators. It is only valid in iterators. Execution is returned to the body of the for loop that called the iterator. Yield does not end the iteration process, but the execution is passed back to the iterator if the next iteration starts. See the section about iterators ([Iterators and the for statement](#iterators-and-the-for-statement)) for further information.

 ### Block statement


Example:

 
```
var found = false
block myblock:
  for i in 0..3:
    for j in 0..3:
      if a[j][i] == 7:
        found = true
        break myblock # leave the block, in this case both for-loops
echo found
```

The block statement is a means to group statements to a (named) `block`. Inside the block, the `break` statement is allowed to leave the block immediately. A `break` statement can contain a name of a surrounding block to specify which block is to leave.

 ### Break statement


Example:

 
```
break
```

The `break` statement is used to leave a block immediately. If `symbol` is given, it is the name of the enclosing block that is to leave. If it is absent, the innermost block is left.

 ### While statement


Example:

 
```
echo "Please tell me your password:"
var pw = readLine(stdin)
while pw != "12345":
  echo "Wrong password! Next try:"
  pw = readLine(stdin)
```

The `while` statement is executed until the `expr` evaluates to false. Endless loops are no error. `while` statements open an `implicit block`, so that they can be left with a `break` statement.

 ### Continue statement


A `continue` statement leads to the immediate next iteration of the surrounding loop construct. It is only allowed within a loop. A continue statement is syntactic sugar for a nested block:

 
```
while expr1:
  stmt1
  continue
  stmt2
```

Is equivalent to:

 
```
while expr1:
  block myBlockName:
    stmt1
    break myBlockName
    stmt2
```
 ### Assembler statement


The direct embedding of assembler code into Nim code is supported by the unsafe `asm` statement. Identifiers in the assembler code that refer to Nim identifiers shall be enclosed in a special character which can be specified in the statement's pragmas. The default special character is `'`'`:

 
```
{.push stackTrace:off.}
proc addInt(a, b: int): int =
  # a in eax, and b in edx
  asm """
      mov eax, `a`
      add eax, `b`
      jno theEnd
      call `raiseOverflow`
    theEnd:
  """
{.pop.}
```

If the GNU assembler is used, quotes and newlines are inserted automatically:

 
```
proc addInt(a, b: int): int =
  asm """
    addl %%ecx, %%eax
    jno 1
    call `raiseOverflow`
    1:
    :"=a"(`result`)
    :"a"(`a`), "c"(`b`)
  """
```

Instead of:

 
```
proc addInt(a, b: int): int =
  asm """
    "addl %%ecx, %%eax\n"
    "jno 1\n"
    "call `raiseOverflow`\n"
    "1: \n"
    :"=a"(`result`)
    :"a"(`a`), "c"(`b`)
  """
```
 ### Using statement


The using statement provides syntactic convenience in modules where the same parameter names and types are used over and over. Instead of:

 
```
proc foo(c: Context; n: Node) = ...
proc bar(c: Context; n: Node, counter: int) = ...
proc baz(c: Context; n: Node) = ...
```

One can tell the compiler about the convention that a parameter of name `c` should default to type `Context`, `n` should default to `Node` etc.:

 
```
using
  c: Context
  n: Node
  counter: int

proc foo(c, n) = ...
proc bar(c, n, counter) = ...
proc baz(c, n) = ...

proc mixedMode(c, n; x, y: int) =
  # 'c' is inferred to be of the type 'Context'
  # 'n' is inferred to be of the type 'Node'
  # But 'x' and 'y' are of type 'int'.
```

The `using` section uses the same indentation based grouping syntax as a `var` or `let` section.

 Note that `using` is not applied for `template` since the untyped template parameters default to the type `system.untyped`.

 Mixing parameters that should use the `using` declaration with parameters that are explicitly typed is possible and requires a semicolon between them.

 ### If expression


An `if expression` is almost like an if statement, but it is an expression. This feature is similar to `ternary operators` in other languages. Example:

 
```
var y = if x > 8: 9 else: 10
```

An if expression always results in a value, so the `else` part is required. `Elif` parts are also allowed.

 ### When expression


Just like an `if expression`, but corresponding to the when statement.

 ### Case expression


The `case expression` is again very similar to the case statement:

 
```
var favoriteFood = case animal
  of "dog": "bones"
  of "cat": "mice"
  elif animal.endsWith"whale": "plankton"
  else:
    echo "I'm not sure what to serve, but everybody loves ice cream"
    "ice cream"
```

As seen in the above example, the case expression can also introduce side effects. When multiple statements are given for a branch, Nim will use the last expression as the result value.

 ### Block expression


A `block expression` is almost like a block statement, but it is an expression that uses the last expression under the block as the value. It is similar to the statement list expression, but the statement list expression does not open a new block scope.

 
```
let a = block:
  var fib = @[0, 1]
  for i in 0..10:
    fib.add fib[^1] + fib[^2]
  fib
```
 ### Table constructor


A table constructor is syntactic sugar for an array constructor:

 
```
{"key1": "value1", "key2", "key3": "value2"}

# is the same as:
[("key1", "value1"), ("key2", "value2"), ("key3", "value2")]
```

The empty table can be written `{:}` (in contrast to the empty set which is `{}`) which is thus another way to write as the empty array constructor `[]`. This slightly unusual way of supporting tables has lots of advantages:

 * The order of the (key,value)-pairs is preserved, thus it is easy to support ordered dicts with for example `{key: val}.newOrderedTable`.
* A table literal can be put into a `const` section and the compiler can easily put it into the executable's data section just like it can for arrays and the generated data section requires a minimal amount of memory.
* Every table implementation is treated equally syntactically.
* Apart from the minimal syntactic sugar the language core does not need to know about tables.

 ### Type conversions


Syntactically a *type conversion* is like a procedure call, but a type name replaces the procedure name. A type conversion is always safe in the sense that a failure to convert a type to another results in an exception (if it cannot be determined statically).

 Ordinary procs are often preferred over type conversions in Nim: For instance, `$` is the `toString` operator by convention and `toFloat` and `toInt` can be used to convert from floating-point to integer or vice versa.

 Type conversion can also be used to disambiguate overloaded routines:

 
```
proc p(x: int) = echo "int"
proc p(x: string) = echo "string"

let procVar = (proc(x: string))(p)
procVar("a")
```

Since operations on unsigned numbers wrap around and are unchecked so are type conversion to unsigned integers and between unsigned integers. The rationale for this is mostly better interoperability with the C Programming language when algorithms are ported from C to Nim.

 Exception: Values that are converted to an unsigned type at compile time are checked so that code like `byte(-1)` does not compile.

 **Note**: Historically the operations were unchecked and the conversions were sometimes checked but starting with the revision 1.0.4 of this document and the language implementation the conversions too are now *always unchecked*.

 ### Type casts


*Type casts* are a crude mechanism to interpret the bit pattern of an expression as if it would be of another type. Type casts are only needed for low-level programming and are inherently unsafe.

 
```
cast[int](x)
```

The target type of a cast must be a concrete type, for instance, a target type that is a type class (which is non-concrete) would be invalid:

 
```
type Foo = int or float
var x = cast[Foo](1) # Error: cannot cast to a non concrete type: 'Foo'
```

Type casts should not be confused with *type conversions,* as mentioned in the prior section. Unlike type conversions, a type cast cannot change the underlying bit pattern of the data being casted (aside from that the size of the target type may differ from the source type). Casting resembles *type punning* in other languages or C++'s `reinterpret_cast` and `bit_cast` features.

 ### The addr operator


The `addr` operator returns the address of an l-value. If the type of the location is `T`, the `addr` operator result is of the type `ptr T`. An address is always an untraced reference. Taking the address of an object that resides on the stack is **unsafe**, as the pointer may live longer than the object on the stack and can thus reference a non-existing object. One can get the address of variables, but one can't use it on variables declared through `let` statements:

 
```
let t1 = "Hello"
var
  t2 = t1
  t3 : pointer = addr(t2)
echo repr(addr(t2))
# --> ref 0x7fff6b71b670 --> 0x10bb81050"Hello"
echo cast[ptr string](t3)[]
# --> Hello
# The following line doesn't compile:
echo repr(addr(t1))
# Error: expression has no address
```
 ### The unsafeAddr operator


For easier interoperability with other compiled languages such as C, retrieving the address of a `let` variable, a parameter or a `for` loop variable, the `unsafeAddr` operation can be used:

 
```
let myArray = [1, 2, 3]
foreignProcThatTakesAnAddr(unsafeAddr myArray)
```
 Procedures
----------


What most programming languages call methods or functions are called procedures in Nim. A procedure declaration consists of an identifier, zero or more formal parameters, a return value type and a block of code. Formal parameters are declared as a list of identifiers separated by either comma or semicolon. A parameter is given a type by `: typename`. The type applies to all parameters immediately before it, until either the beginning of the parameter list, a semicolon separator, or an already typed parameter, is reached. The semicolon can be used to make separation of types and subsequent identifiers more distinct.

 
```
# Using only commas
proc foo(a, b: int, c, d: bool): int

# Using semicolon for visual distinction
proc foo(a, b: int; c, d: bool): int

# Will fail: a is untyped since ';' stops type propagation.
proc foo(a; b: int; c, d: bool): int
```

A parameter may be declared with a default value which is used if the caller does not provide a value for the argument.

 
```
# b is optional with 47 as its default value
proc foo(a: int, b: int = 47): int
```

Parameters can be declared mutable and so allow the proc to modify those arguments, by using the type modifier `var`.

 
```
# "returning" a value to the caller through the 2nd argument
# Notice that the function uses no actual return value at all (ie void)
proc foo(inp: int, outp: var int) =
  outp = inp + 47
```

If the proc declaration has no body, it is a forward declaration. If the proc returns a value, the procedure body can access an implicitly declared variable named result that represents the return value. Procs can be overloaded. The overloading resolution algorithm determines which proc is the best match for the arguments. Example:

 
```
proc toLower(c: char): char = # toLower for characters
  if c in {'A'..'Z'}:
    result = chr(ord(c) + (ord('a') - ord('A')))
  else:
    result = c

proc toLower(s: string): string = # toLower for strings
  result = newString(len(s))
  for i in 0..len(s) - 1:
    result[i] = toLower(s[i]) # calls toLower for characters; no recursion!
```

Calling a procedure can be done in many different ways:

 
```
proc callme(x, y: int, s: string = "", c: char, b: bool = false) = ...

# call with positional arguments      # parameter bindings:
callme(0, 1, "abc", '\t', true)       # (x=0, y=1, s="abc", c='\t', b=true)
# call with named and positional arguments:
callme(y=1, x=0, "abd", '\t')         # (x=0, y=1, s="abd", c='\t', b=false)
# call with named arguments (order is not relevant):
callme(c='\t', y=1, x=0)              # (x=0, y=1, s="", c='\t', b=false)
# call as a command statement: no () needed:
callme 0, 1, "abc", '\t'              # (x=0, y=1, s="abc", c='\t', b=false)
```

A procedure may call itself recursively.

 Operators are procedures with a special operator symbol as identifier:

 
```
proc `$` (x: int): string =
  # converts an integer to a string; this is a prefix operator.
  result = intToStr(x)
```

Operators with one parameter are prefix operators, operators with two parameters are infix operators. (However, the parser distinguishes these from the operator's position within an expression.) There is no way to declare postfix operators: all postfix operators are built-in and handled by the grammar explicitly.

 Any operator can be called like an ordinary proc with the '`opr`' notation. (Thus an operator can have more than two parameters):

 
```
proc `*+` (a, b, c: int): int =
  # Multiply and add
  result = a * b + c

assert `*+`(3, 4, 6) == `+`(`*`(a, b), c)
```
 ### Export marker


If a declared symbol is marked with an asterisk it is exported from the current module:

 
```
proc exportedEcho*(s: string) = echo s
proc `*`*(a: string; b: int): string =
  result = newStringOfCap(a.len * b)
  for i in 1..b: result.add a

var exportedVar*: int
const exportedConst* = 78
type
  ExportedType* = object
    exportedField*: int
```
 ### Method call syntax


For object-oriented programming, the syntax `obj.method(args)` can be used instead of `method(obj, args)`. The parentheses can be omitted if there are no remaining arguments: `obj.len` (instead of `len(obj)`).

 This method call syntax is not restricted to objects, it can be used to supply any type of first argument for procedures:

 
```
echo "abc".len # is the same as echo len "abc"
echo "abc".toUpper()
echo {'a', 'b', 'c'}.card
stdout.writeLine("Hallo") # the same as writeLine(stdout, "Hallo")
```

Another way to look at the method call syntax is that it provides the missing postfix notation.

 The method call syntax conflicts with explicit generic instantiations: `p[T](x)` cannot be written as `x.p[T]` because `x.p[T]` is always parsed as `(x.p)[T]`.

 See also: [Limitations of the method call syntax](#templates-limitations-of-the-method-call-syntax).

 The `[: ]` notation has been designed to mitigate this issue: `x.p[:T]` is rewritten by the parser to `p[T](x)`, `x.p[:T](y)` is rewritten to `p[T](x, y)`. Note that `[: ]` has no AST representation, the rewrite is performed directly in the parsing step.

 ### Properties


Nim has no need for *get-properties*: Ordinary get-procedures that are called with the *method call syntax* achieve the same. But setting a value is different; for this, a special setter syntax is needed:

 
```
# Module asocket
type
  Socket* = ref object of RootObj
    host: int # cannot be accessed from the outside of the module

proc `host=`*(s: var Socket, value: int) {.inline.} =
  ## setter of hostAddr.
  ## This accesses the 'host' field and is not a recursive call to
  ## ``host=`` because the builtin dot access is preferred if it is
  ## available:
  s.host = value

proc host*(s: Socket): int {.inline.} =
  ## getter of hostAddr
  ## This accesses the 'host' field and is not a recursive call to
  ## ``host`` because the builtin dot access is preferred if it is
  ## available:
  s.host
```


```
# module B
import asocket
var s: Socket
new s
s.host = 34  # same as `host=`(s, 34)
```

A proc defined as `f=` (with the trailing `=`) is called a setter. A setter can be called explicitly via the common backticks notation:

 
```
proc `f=`(x: MyObject; value: string) =
  discard

`f=`(myObject, "value")
```

`f=` can be called implicitly in the pattern `x.f = value` if and only if the type of `x` does not have a field named `f` or if `f` is not visible in the current module. These rules ensure that object fields and accessors can have the same name. Within the module `x.f` is then always interpreted as field access and outside the module it is interpreted as an accessor proc call.

 ### Command invocation syntax


Routines can be invoked without the `()` if the call is syntactically a statement. This command invocation syntax also works for expressions, but then only a single argument may follow. This restriction means `echo f 1, f 2` is parsed as `echo(f(1), f(2))` and not as `echo(f(1, f(2)))`. The method call syntax may be used to provide one more argument in this case:

 
```
proc optarg(x: int, y: int = 0): int = x + y
proc singlearg(x: int): int = 20*x

echo optarg 1, " ", singlearg 2  # prints "1 40"

let fail = optarg 1, optarg 8   # Wrong. Too many arguments for a command call
let x = optarg(1, optarg 8)  # traditional procedure call with 2 arguments
let y = 1.optarg optarg 8    # same thing as above, w/o the parenthesis
assert x == y
```

The command invocation syntax also can't have complex expressions as arguments. For example: ([anonymous procs](#procedures-anonymous-procs)), `if`, `case` or `try`. Function calls with no arguments still need () to distinguish between a call and the function itself as a first-class value.

 ### Closures


Procedures can appear at the top level in a module as well as inside other scopes, in which case they are called nested procs. A nested proc can access local variables from its enclosing scope and if it does so it becomes a closure. Any captured variables are stored in a hidden additional argument to the closure (its environment) and they are accessed by reference by both the closure and its enclosing scope (i.e. any modifications made to them are visible in both places). The closure environment may be allocated on the heap or on the stack if the compiler determines that this would be safe.

 #### Creating closures in loops


Since closures capture local variables by reference it is often not wanted behavior inside loop bodies. See [closureScope](system#closureScope.t,untyped) and [capture](sugar#capture.m,openArray%5Btyped%5D,untyped) for details on how to change this behavior.

 ### Anonymous Procs


Unnamed procedures can be used as lambda expressions to pass into other procedures:

 
```
var cities = @["Frankfurt", "Tokyo", "New York", "Kyiv"]

cities.sort(proc (x,y: string): int =
    cmp(x.len, y.len))
```

Procs as expressions can appear both as nested procs and inside top-level executable code. The <sugar> module contains the `=>` macro which enables a more succinct syntax for anonymous procedures resembling lambdas as they are in languages like JavaScript, C#, etc.

 ### Func


The `func` keyword introduces a shortcut for a noSideEffect proc.

 
```
func binarySearch[T](a: openArray[T]; elem: T): int
```

Is short for:

 
```
proc binarySearch[T](a: openArray[T]; elem: T): int {.noSideEffect.}
```
 ### Nonoverloadable builtins


The following built-in procs cannot be overloaded for reasons of implementation simplicity (they require specialized semantic checking):



```
declared, defined, definedInScope, compiles, sizeof,
is, shallowCopy, getAst, astToStr, spawn, procCall
```
 Thus they act more like keywords than like ordinary identifiers; unlike a keyword however, a redefinition may shadow the definition in the `system` module. From this list the following should not be written in dot notation `x.f` since `x` cannot be type-checked before it gets passed to `f`:



```
declared, defined, definedInScope, compiles, getAst, astToStr
```
 ### Var parameters


The type of a parameter may be prefixed with the `var` keyword:

 
```
proc divmod(a, b: int; res, remainder: var int) =
  res = a div b
  remainder = a mod b

var
  x, y: int

divmod(8, 5, x, y) # modifies x and y
assert x == 1
assert y == 3
```

In the example, `res` and `remainder` are `var parameters`. Var parameters can be modified by the procedure and the changes are visible to the caller. The argument passed to a var parameter has to be an l-value. Var parameters are implemented as hidden pointers. The above example is equivalent to:

 
```
proc divmod(a, b: int; res, remainder: ptr int) =
  res[] = a div b
  remainder[] = a mod b

var
  x, y: int
divmod(8, 5, addr(x), addr(y))
assert x == 1
assert y == 3
```

In the examples, var parameters or pointers are used to provide two return values. This can be done in a cleaner way by returning a tuple:

 
```
proc divmod(a, b: int): tuple[res, remainder: int] =
  (a div b, a mod b)

var t = divmod(8, 5)

assert t.res == 1
assert t.remainder == 3
```

One can use tuple unpacking to access the tuple's fields:

 
```
var (x, y) = divmod(8, 5) # tuple unpacking
assert x == 1
assert y == 3
```

**Note**: `var` parameters are never necessary for efficient parameter passing. Since non-var parameters cannot be modified the compiler is always free to pass arguments by reference if it considers it can speed up execution.

 ### Var return type


A proc, converter, or iterator may return a `var` type which means that the returned value is an l-value and can be modified by the caller:

 
```
var g = 0

proc writeAccessToG(): var int =
  result = g

writeAccessToG() = 6
assert g == 6
```

It is a static error if the implicitly introduced pointer could be used to access a location beyond its lifetime:

 
```
proc writeAccessToG(): var int =
  var g = 0
  result = g # Error!
```

For iterators, a component of a tuple return type can have a `var` type too:

 
```
iterator mpairs(a: var seq[string]): tuple[key: int, val: var string] =
  for i in 0..a.high:
    yield (i, a[i])
```

In the standard library every name of a routine that returns a `var` type starts with the prefix `m` per convention.

 Memory safety for returning by `var T` is ensured by a simple borrowing rule: If `result` does not refer to a location pointing to the heap (that is in `result = X` the `X` involves a `ptr` or `ref` access) then it has to be derived from the routine's first parameter:
```
proc forward[T](x: var T): var T =
  result = x # ok, derived from the first parameter.

proc p(param: var int): var int =
  var x: int
  # we know 'forward' provides a view into the location derived from
  # its first argument 'x'.
  result = forward(x) # Error: location is derived from ``x``
                      # which is not p's first parameter and lives
                      # on the stack.
```

In other words, the lifetime of what `result` points to is attached to the lifetime of the first parameter and that is enough knowledge to verify memory safety at the call site.

 #### Future directions


Later versions of Nim can be more precise about the borrowing rule with a syntax like:

 
```
proc foo(other: Y; container: var X): var T from container
```

Here `var T from container` explicitly exposes that the location is derived from the second parameter (called 'container' in this case). The syntax `var T from p` specifies a type `varTy[T, 2]` which is incompatible with `varTy[T, 1]`.

 ### NRVO


**Note**: This section describes the current implementation. This part of the language specification will be changed. See <https://github.com/nim-lang/RFCs/issues/230> for more information.

 The return value is represented inside the body of a routine as the special result variable. This allows for a mechanism much like C++'s "named return value optimization" (NRVO). NRVO means that the stores to `result` inside `p` directly affect the destination `dest` in `let/var dest = p(args)` (definition of `dest`) and also in `dest = p(args)` (assignment to `dest`). This is achieved by rewriting `dest = p(args)` to `p'(args, dest)` where `p'` is a variation of `p` that returns `void` and receives a hidden mutable parameter representing `result`.

 Informally:

 
```
proc p(): BigT = ...

var x = p()
x = p()

# is roughly turned into:

proc p(result: var BigT) = ...

var x; p(x)
p(x)
```

Let `T`'s be `p`'s return type. NRVO applies for `T` if `sizeof(T) >= N` (where `N` is implementation dependent), in other words, it applies for "big" structures.

 If `p` can raise an exception, NRVO applies regardless. This can produce observable differences in behavior:

 
```
type
  BigT = array[16, int]

proc p(raiseAt: int): BigT =
  for i in 0..high(result):
    if i == raiseAt: raise newException(ValueError, "interception")
    result[i] = i

proc main =
  var x: BigT
  try:
    x = p(8)
  except ValueError:
    doAssert x == [0, 1, 2, 3, 4, 5, 6, 7, 0, 0, 0, 0, 0, 0, 0, 0]

main()
```

However, the current implementation produces a warning in these cases. There are different ways to deal with this warning:

 1. Disable the warning via `{.push warning[ObservableStores]: off.}` ... `{.pop.}`. Then one may need to ensure that `p` only raises *before* any stores to `result` happen.
2. One can use a temporary helper variable, for example instead of `x = p(8)` use `let tmp = p(8); x = tmp`.

 ### Overloading of the subscript operator


The `[]` subscript operator for arrays/openarrays/sequences can be overloaded.

 Methods
-------


Procedures always use static dispatch. Methods use dynamic dispatch. For dynamic dispatch to work on an object it should be a reference type.

 
```
type
  Expression = ref object of RootObj ## abstract base class for an expression
  Literal = ref object of Expression
    x: int
  PlusExpr = ref object of Expression
    a, b: Expression

method eval(e: Expression): int {.base.} =
  # override this base method
  raise newException(CatchableError, "Method without implementation override")

method eval(e: Literal): int = return e.x

method eval(e: PlusExpr): int =
  # watch out: relies on dynamic binding
  result = eval(e.a) + eval(e.b)

proc newLit(x: int): Literal =
  new(result)
  result.x = x

proc newPlus(a, b: Expression): PlusExpr =
  new(result)
  result.a = a
  result.b = b

echo eval(newPlus(newPlus(newLit(1), newLit(2)), newLit(4)))
```

In the example the constructors `newLit` and `newPlus` are procs because they should use static binding, but `eval` is a method because it requires dynamic binding.

 As can be seen in the example, base methods have to be annotated with the base pragma. The `base` pragma also acts as a reminder for the programmer that a base method `m` is used as the foundation to determine all the effects that a call to `m` might cause.

 **Note**: Compile-time execution is not (yet) supported for methods.

 **Note**: Starting from Nim 0.20, generic methods are deprecated.

 ### Multi-methods


**Note:** Starting from Nim 0.20, to use multi-methods one must explicitly pass `--multimethods:on` when compiling.

 In a multi-method all parameters that have an object type are used for the dispatching:

 
```
type
  Thing = ref object of RootObj
  Unit = ref object of Thing
    x: int

method collide(a, b: Thing) {.inline.} =
  quit "to override!"

method collide(a: Thing, b: Unit) {.inline.} =
  echo "1"

method collide(a: Unit, b: Thing) {.inline.} =
  echo "2"

var a, b: Unit
new a
new b
collide(a, b) # output: 2
```
 ### Inhibit dynamic method resolution via procCall


Dynamic method resolution can be inhibited via the builtin system.procCall. This is somewhat comparable to the super keyword that traditional OOP languages offer.

 
```
type
  Thing = ref object of RootObj
  Unit = ref object of Thing
    x: int

method m(a: Thing) {.base.} =
  echo "base"

method m(a: Unit) =
  # Call the base method:
  procCall m(Thing(a))
  echo "1"
```
 Iterators and the for statement
-------------------------------


The for statement is an abstract mechanism to iterate over the elements of a container. It relies on an iterator to do so. Like `while` statements, `for` statements open an implicit block, so that they can be left with a `break` statement.

 The `for` loop declares iteration variables - their scope reaches until the end of the loop body. The iteration variables' types are inferred by the return type of the iterator.

 An iterator is similar to a procedure, except that it can be called in the context of a `for` loop. Iterators provide a way to specify the iteration over an abstract type. A key role in the execution of a `for` loop plays the `yield` statement in the called iterator. Whenever a `yield` statement is reached the data is bound to the `for` loop variables and control continues in the body of the `for` loop. The iterator's local variables and execution state are automatically saved between calls. Example:

 
```
# this definition exists in the system module
iterator items*(a: string): char {.inline.} =
  var i = 0
  while i < len(a):
    yield a[i]
    inc(i)

for ch in items("hello world"): # `ch` is an iteration variable
  echo ch
```

The compiler generates code as if the programmer would have written this:

 
```
var i = 0
while i < len(a):
  var ch = a[i]
  echo ch
  inc(i)
```

If the iterator yields a tuple, there can be as many iteration variables as there are components in the tuple. The i'th iteration variable's type is the type of the i'th component. In other words, implicit tuple unpacking in a for loop context is supported.

 ### Implicit items/pairs invocations


If the for loop expression `e` does not denote an iterator and the for loop has exactly 1 variable, the for loop expression is rewritten to `items(e)`; ie. an `items` iterator is implicitly invoked:

 
```
for x in [1,2,3]: echo x
```

If the for loop has exactly 2 variables, a `pairs` iterator is implicitly invoked.

 Symbol lookup of the identifiers `items`/`pairs` is performed after the rewriting step, so that all overloads of `items`/`pairs` are taken into account.

 ### First-class iterators


There are 2 kinds of iterators in Nim: *inline* and *closure* iterators. An inline iterator is an iterator that's always inlined by the compiler leading to zero overhead for the abstraction, but may result in a heavy increase in code size.

 Caution: the body of a for loop over an inline iterator is inlined into each `yield` statement appearing in the iterator code, so ideally the code should be refactored to contain a single yield when possible to avoid code bloat.

 Inline iterators are second class citizens; They can be passed as parameters only to other inlining code facilities like templates, macros, and other inline iterators.

 In contrast to that, a closure iterator can be passed around more freely:

 
```
iterator count0(): int {.closure.} =
  yield 0

iterator count2(): int {.closure.} =
  var x = 1
  yield x
  inc x
  yield x

proc invoke(iter: iterator(): int {.closure.}) =
  for x in iter(): echo x

invoke(count0)
invoke(count2)
```

Closure iterators and inline iterators have some restrictions:

 1. For now, a closure iterator cannot be executed at compile time.
2. `return` is allowed in a closure iterator but not in an inline iterator (but rarely useful) and ends the iteration.
3. Neither inline nor closure iterators can be (directly)\* recursive.
4. Neither inline nor closure iterators have the special `result` variable.
5. Closure iterators are not supported by the js backend.

 (\*) Closure iterators can be co-recursive with a factory proc which results in similar syntax to a recursive iterator. More details follow.

 Iterators that are neither marked `{.closure.}` nor `{.inline.}` explicitly default to being inline, but this may change in future versions of the implementation.

 The `iterator` type is always of the calling convention `closure` implicitly; the following example shows how to use iterators to implement a collaborative tasking system:

 
```
# simple tasking:
type
  Task = iterator (ticker: int)

iterator a1(ticker: int) {.closure.} =
  echo "a1: A"
  yield
  echo "a1: B"
  yield
  echo "a1: C"
  yield
  echo "a1: D"

iterator a2(ticker: int) {.closure.} =
  echo "a2: A"
  yield
  echo "a2: B"
  yield
  echo "a2: C"

proc runTasks(t: varargs[Task]) =
  var ticker = 0
  while true:
    let x = t[ticker mod t.len]
    if finished(x): break
    x(ticker)
    inc ticker

runTasks(a1, a2)
```

The builtin `system.finished` can be used to determine if an iterator has finished its operation; no exception is raised on an attempt to invoke an iterator that has already finished its work.

 Note that `system.finished` is error prone to use because it only returns `true` one iteration after the iterator has finished:

 
```
iterator mycount(a, b: int): int {.closure.} =
  var x = a
  while x <= b:
    yield x
    inc x

var c = mycount # instantiate the iterator
while not finished(c):
  echo c(1, 3)

# Produces
1
2
3
0
```

Instead this code has to be used:

 
```
var c = mycount # instantiate the iterator
while true:
  let value = c(1, 3)
  if finished(c): break # and discard 'value'!
  echo value
```

It helps to think that the iterator actually returns a pair `(value, done)` and `finished` is used to access the hidden `done` field.

 Closure iterators are *resumable functions* and so one has to provide the arguments to every call. To get around this limitation one can capture parameters of an outer factory proc:

 
```
proc mycount(a, b: int): iterator (): int =
  result = iterator (): int =
    var x = a
    while x <= b:
      yield x
      inc x

let foo = mycount(1, 4)

for f in foo():
  echo f
```

The call can be made more like an inline iterator with a for loop macro:

 
```
import macros
macro toItr(x: ForLoopStmt): untyped =
  let expr = x[0]
  let call = x[1][1] # Get foo out of toItr(foo)
  let body = x[2]
  result = quote do:
    block:
      let itr = `call`
      for `expr` in itr():
          `body`

for f in toItr(mycount(1, 4)): # using early `proc mycount`
  echo f
```

Because of full backend function call aparatus involvment, closure iterator invocation is typically higher cost than inline iterators. Adornment by a macro wrapper at the call site like this is a possibly useful reminder.

 The factory `proc`, as an ordinary procedure, can be recursive. The above macro allows such recursion to look much like a recursive iterator would. For example:

 
```
proc recCountDown(n: int): iterator(): int =
  result = iterator(): int =
    if n > 0:
      yield n
      for e in toItr(recCountDown(n - 1)):
          yield e

for i in toItr(recCountDown(6)): # Emits: 6 5 4 3 2 1
  echo i
```
 Converters
----------


A converter is like an ordinary proc except that it enhances the "implicitly convertible" type relation (see [Convertible relation](#type-relations-convertible-relation)):

 
```
# bad style ahead: Nim is not C.
converter toBool(x: int): bool = x != 0

if 4:
  echo "compiles"
```

A converter can also be explicitly invoked for improved readability. Note that implicit converter chaining is not supported: If there is a converter from type A to type B and from type B to type C the implicit conversion from A to C is not provided.

 Type sections
-------------


Example:

 
```
type # example demonstrating mutually recursive types
  Node = ref object  # an object managed by the garbage collector (ref)
    le, ri: Node     # left and right subtrees
    sym: ref Sym     # leaves contain a reference to a Sym
  
  Sym = object       # a symbol
    name: string     # the symbol's name
    line: int        # the line the symbol was declared in
    code: Node       # the symbol's abstract syntax tree
```

A type section begins with the `type` keyword. It contains multiple type definitions. A type definition binds a type to a name. Type definitions can be recursive or even mutually recursive. Mutually recursive types are only possible within a single `type` section. Nominal types like `objects` or `enums` can only be defined in a `type` section.

 Exception handling
------------------

 ### Try statement


Example:

 
```
# read the first two lines of a text file that should contain numbers
# and tries to add them
var
  f: File
if open(f, "numbers.txt"):
  try:
    var a = readLine(f)
    var b = readLine(f)
    echo "sum: " & $(parseInt(a) + parseInt(b))
  except OverflowDefect:
    echo "overflow!"
  except ValueError:
    echo "could not convert string to integer"
  except IOError:
    echo "IO error!"
  except:
    echo "Unknown exception!"
  finally:
    close(f)
```

The statements after the `try` are executed in sequential order unless an exception `e` is raised. If the exception type of `e` matches any listed in an `except` clause the corresponding statements are executed. The statements following the `except` clauses are called exception handlers.

 The empty except clause is executed if there is an exception that is not listed otherwise. It is similar to an `else` clause in `if` statements.

 If there is a finally clause, it is always executed after the exception handlers.

 The exception is *consumed* in an exception handler. However, an exception handler may raise another exception. If the exception is not handled, it is propagated through the call stack. This means that often the rest of the procedure - that is not within a `finally` clause - is not executed (if an exception occurs).

 ### Try expression


Try can also be used as an expression; the type of the `try` branch then needs to fit the types of `except` branches, but the type of the `finally` branch always has to be `void`:

 
```
from strutils import parseInt

let x = try: parseInt("133a")
        except: -1
        finally: echo "hi"
```

To prevent confusing code there is a parsing limitation; if the `try` follows a `(` it has to be written as a one liner:

 
```
let x = (try: parseInt("133a") except: -1)
```
 ### Except clauses


Within an `except` clause it is possible to access the current exception using the following syntax:

 
```
try:
  # ...
except IOError as e:
  # Now use "e"
  echo "I/O error: " & e.msg
```

Alternatively, it is possible to use `getCurrentException` to retrieve the exception that has been raised:

 
```
try:
  # ...
except IOError:
  let e = getCurrentException()
  # Now use "e"
```

Note that `getCurrentException` always returns a `ref Exception` type. If a variable of the proper type is needed (in the example above, `IOError`), one must convert it explicitly:

 
```
try:
  # ...
except IOError:
  let e = (ref IOError)(getCurrentException())
  # "e" is now of the proper type
```

However, this is seldom needed. The most common case is to extract an error message from `e`, and for such situations, it is enough to use `getCurrentExceptionMsg`:

 
```
try:
  # ...
except:
  echo getCurrentExceptionMsg()
```
 ### Custom exceptions


Is it possible to create custom exceptions. A custom exception is a custom type:

 
```
type
  LoadError* = object of Exception
```

Ending the custom exception's name with `Error` is recommended.

 Custom exceptions can be raised like any others, e.g.:

 
```
raise newException(LoadError, "Failed to load data")
```
 ### Defer statement


Instead of a `try finally` statement a `defer` statement can be used, which avoids lexical nesting and offers more flexibility in terms of scoping as shown below.

 Any statements following the `defer` in the current block will be considered to be in an implicit try block:

 
```
proc main =
  var f = open("numbers.txt", fmWrite)
  defer: close(f)
  f.write "abc"
  f.write "def"
```

Is rewritten to:

 
```
proc main =
  var f = open("numbers.txt")
  try:
    f.write "abc"
    f.write "def"
  finally:
    close(f)
```

When `defer` is at the outermost scope of a template/macro, its scope extends to the block where the template is called from:

 
```
template safeOpenDefer(f, path) =
  var f = open(path, fmWrite)
  defer: close(f)

template safeOpenFinally(f, path, body) =
  var f = open(path, fmWrite)
  try: body # without `defer`, `body` must be specified as parameter
  finally: close(f)

block:
  safeOpenDefer(f, "/tmp/z01.txt")
  f.write "abc"
block:
  safeOpenFinally(f, "/tmp/z01.txt"):
    f.write "abc" # adds a lexical scope
block:
  var f = open("/tmp/z01.txt", fmWrite)
  try:
    f.write "abc" # adds a lexical scope
  finally: close(f)
```

Top-level `defer` statements are not supported since it's unclear what such a statement should refer to.

 ### Raise statement


Example:

 
```
raise newException(IOError, "IO failed")
```

Apart from built-in operations like array indexing, memory allocation, etc. the `raise` statement is the only way to raise an exception.

 If no exception name is given, the current exception is re-raised. The ReraiseDefect exception is raised if there is no exception to re-raise. It follows that the `raise` statement *always* raises an exception.

 ### Exception hierarchy


The exception tree is defined in the <system> module. Every exception inherits from `system.Exception`. Exceptions that indicate programming bugs inherit from `system.Defect` (which is a subtype of `Exception`) and are strictly speaking not catchable as they can also be mapped to an operation that terminates the whole process. If panics are turned into exceptions, these exceptions inherit from `Defect`.

 Exceptions that indicate any other runtime error that can be caught inherit from `system.CatchableError` (which is a subtype of `Exception`).

 ### Imported exceptions


It is possible to raise/catch imported C++ exceptions. Types imported using `importcpp` can be raised or caught. Exceptions are raised by value and caught by reference. Example:

 
```
type
  CStdException {.importcpp: "std::exception", header: "<exception>", inheritable.} = object
    ## does not inherit from `RootObj`, so we use `inheritable` instead
  CRuntimeError {.requiresInit, importcpp: "std::runtime_error", header: "<stdexcept>".} = object of CStdException
    ## `CRuntimeError` has no default constructor => `requiresInit`
proc what(s: CStdException): cstring {.importcpp: "((char *)#.what())".}
proc initRuntimeError(a: cstring): CRuntimeError {.importcpp: "std::runtime_error(@)", constructor.}
proc initStdException(): CStdException {.importcpp: "std::exception()", constructor.}

proc fn() =
  let a = initRuntimeError("foo")
  doAssert $a.what == "foo"
  var b: cstring
  try: raise initRuntimeError("foo2")
  except CStdException as e:
    doAssert e is CStdException
    b = e.what()
  doAssert $b == "foo2"
  
  try: raise initStdException()
  except CStdException: discard
  
  try: raise initRuntimeError("foo3")
  except CRuntimeError as e:
    b = e.what()
  except CStdException:
    doAssert false
  doAssert $b == "foo3"

fn()
```

**Note:** `getCurrentException()` and `getCurrentExceptionMsg()` are not available for imported exceptions from C++. One needs to use the `except ImportedException as x:` syntax and rely on functionality of the `x` object to get exception details.

 Effect system
-------------

 ### Exception tracking


Nim supports exception tracking. The raises pragma can be used to explicitly define which exceptions a proc/iterator/method/converter is allowed to raise. The compiler verifies this:

 
```
proc p(what: bool) {.raises: [IOError, OSError].} =
  if what: raise newException(IOError, "IO")
  else: raise newException(OSError, "OS")
```

An empty `raises` list (`raises: []`) means that no exception may be raised:

 
```
proc p(): bool {.raises: [].} =
  try:
    unsafeCall()
    result = true
  except:
    result = false
```

A `raises` list can also be attached to a proc type. This affects type compatibility:

 
```
type
  Callback = proc (s: string) {.raises: [IOError].}
var
  c: Callback

proc p(x: string) =
  raise newException(OSError, "OS")

c = p # type error
```

For a routine `p` the compiler uses inference rules to determine the set of possibly raised exceptions; the algorithm operates on `p`'s call graph:

 1. Every indirect call via some proc type `T` is assumed to raise `system.Exception` (the base type of the exception hierarchy) and thus any exception unless `T` has an explicit `raises` list. However, if the call is of the form `f(...)` where `f` is a parameter of the currently analyzed routine it is ignored. The call is optimistically assumed to have no effect. Rule 2 compensates for this case.
2. Every expression of some proc type within a call that is not a call itself (and not nil) is assumed to be called indirectly somehow and thus its raises list is added to `p`'s raises list.
3. Every call to a proc `q` which has an unknown body (due to a forward declaration or an `importc` pragma) is assumed to raise `system.Exception` unless `q` has an explicit `raises` list.
4. Every call to a method `m` is assumed to raise `system.Exception` unless `m` has an explicit `raises` list.
5. For every other call the analysis can determine an exact `raises` list.
6. For determining a `raises` list, the `raise` and `try` statements of `p` are taken into consideration.

 Rules 1-2 ensure the following works:

 
```
proc noRaise(x: proc()) {.raises: [].} =
  # unknown call that might raise anything, but valid:
  x()

proc doRaise() {.raises: [IOError].} =
  raise newException(IOError, "IO")

proc use() {.raises: [].} =
  # doesn't compile! Can raise IOError!
  noRaise(doRaise)
```

So in many cases a callback does not cause the compiler to be overly conservative in its effect analysis.

 Exceptions inheriting from `system.Defect` are not tracked with the `.raises: []` exception tracking mechanism. This is more consistent with the built-in operations. The following code is valid::

 
```
proc mydiv(a, b): int {.raises: [].} =
  a div b # can raise an DivByZeroDefect
```

And so is::

 
```
proc mydiv(a, b): int {.raises: [].} =
  if b == 0: raise newException(DivByZeroDefect, "division by zero")
  else: result = a div b
```

The reason for this is that `DivByZeroDefect` inherits from `Defect` and with `--panics:on` Defects become unrecoverable errors. (Since version 1.4 of the language.)

 ### Tag tracking


The exception tracking is part of Nim's effect system. Raising an exception is an *effect*. Other effects can also be defined. A user defined effect is a means to *tag* a routine and to perform checks against this tag:

 
```
type IO = object ## input/output effect
proc readLine(): string {.tags: [IO].} = discard

proc no_IO_please() {.tags: [].} =
  # the compiler prevents this:
  let x = readLine()
```

A tag has to be a type name. A `tags` list - like a `raises` list - can also be attached to a proc type. This affects type compatibility.

 The inference for tag tracking is analogous to the inference for exception tracking.

 ### Effects pragma


The `effects` pragma has been designed to assist the programmer with the effects analysis. It is a statement that makes the compiler output all inferred effects up to the `effects`'s position:

 
```
proc p(what: bool) =
  if what:
    raise newException(IOError, "IO")
    {.effects.}
  else:
    raise newException(OSError, "OS")
```

The compiler produces a hint message that `IOError` can be raised. `OSError` is not listed as it cannot be raised in the branch the `effects` pragma appears in.

 Generics
--------


Generics are Nim's means to parametrize procs, iterators or types with type parameters. Depending on the context, the brackets are used either to introduce type parameters or to instantiate a generic proc, iterator, or type.

 The following example shows a generic binary tree can be modeled:

 
```
type
  BinaryTree*[T] = ref object # BinaryTree is a generic type with
                              # generic param ``T``
    le, ri: BinaryTree[T]     # left and right subtrees; may be nil
    data: T                   # the data stored in a node

proc newNode*[T](data: T): BinaryTree[T] =
  # constructor for a node
  result = BinaryTree[T](le: nil, ri: nil, data: data)

proc add*[T](root: var BinaryTree[T], n: BinaryTree[T]) =
  # insert a node into the tree
  if root == nil:
    root = n
  else:
    var it = root
    while it != nil:
      # compare the data items; uses the generic ``cmp`` proc
      # that works for any type that has a ``==`` and ``<`` operator
      var c = cmp(it.data, n.data)
      if c < 0:
        if it.le == nil:
          it.le = n
          return
        it = it.le
      else:
        if it.ri == nil:
          it.ri = n
          return
        it = it.ri

proc add*[T](root: var BinaryTree[T], data: T) =
  # convenience proc:
  add(root, newNode(data))

iterator preorder*[T](root: BinaryTree[T]): T =
  # Preorder traversal of a binary tree.
  # This uses an explicit stack (which is more efficient than
  # a recursive iterator factory).
  var stack: seq[BinaryTree[T]] = @[root]
  while stack.len > 0:
    var n = stack.pop()
    while n != nil:
      yield n.data
      add(stack, n.ri)  # push right subtree onto the stack
      n = n.le          # and follow the left pointer

var
  root: BinaryTree[string] # instantiate a BinaryTree with ``string``
add(root, newNode("hello")) # instantiates ``newNode`` and ``add``
add(root, "world")          # instantiates the second ``add`` proc
for str in preorder(root):
  stdout.writeLine(str)
```

The `T` is called a generic type parameter or a type variable.

 ### Is operator


The `is` operator is evaluated during semantic analysis to check for type equivalence. It is therefore very useful for type specialization within generic code:

 
```
type
  Table[Key, Value] = object
    keys: seq[Key]
    values: seq[Value]
    when not (Key is string): # empty value for strings used for optimization
      deletedKeys: seq[bool]
```
 ### Type Classes


A type class is a special pseudo-type that can be used to match against types in the context of overload resolution or the `is` operator. Nim supports the following built-in type classes:

 

| type class | matches |
| --- | --- |
| `object` | any object type |
| `tuple` | any tuple type |
|  |  |
| `enum` | any enumeration |
| `proc` | any proc type |
| `ref` | any `ref` type |
| `ptr` | any `ptr` type |
| `var` | any `var` type |
| `distinct` | any distinct type |
| `array` | any array type |
| `set` | any set type |
| `seq` | any seq type |
| `auto` | any type |
| `any` | distinct auto (see below) |


Furthermore, every generic type automatically creates a type class of the same name that will match any instantiation of the generic type.

 Type classes can be combined using the standard boolean operators to form more complex type classes:

 
```
# create a type class that will match all tuple and object types
type RecordType = tuple or object

proc printFields[T: RecordType](rec: T) =
  for key, value in fieldPairs(rec):
    echo key, " = ", value
```

Whilst the syntax of type classes appears to resemble that of ADTs/algebraic data types in ML-like languages, it should be understood that type classes are static constraints to be enforced at type instantiations. Type classes are not really types in themselves but are instead a system of providing generic "checks" that ultimately *resolve* to some singular type. Type classes do not allow for runtime type dynamism, unlike object variants or methods.

 As an example, the following would not compile:

 
```
type TypeClass = int | string
var foo: TypeClass = 2 # foo's type is resolved to an int here
foo = "this will fail" # error here, because foo is an int
```

Nim allows for type classes and regular types to be specified as type constraints of the generic type parameter:

 
```
proc onlyIntOrString[T: int|string](x, y: T) = discard

onlyIntOrString(450, 616) # valid
onlyIntOrString(5.0, 0.0) # type mismatch
onlyIntOrString("xy", 50) # invalid as 'T' cannot be both at the same time
```
 ### Implicit generics


A type class can be used directly as the parameter's type.

 
```
# create a type class that will match all tuple and object types
type RecordType = tuple or object

proc printFields(rec: RecordType) =
  for key, value in fieldPairs(rec):
    echo key, " = ", value
```

Procedures utilizing type classes in such a manner are considered to be implicitly generic. They will be instantiated once for each unique combination of param types used within the program.

 By default, during overload resolution, each named type class will bind to exactly one concrete type. We call such type classes bind once types. Here is an example taken directly from the system module to illustrate this:

 
```
proc `==`*(x, y: tuple): bool =
  ## requires `x` and `y` to be of the same tuple type
  ## generic ``==`` operator for tuples that is lifted from the components
  ## of `x` and `y`.
  result = true
  for a, b in fields(x, y):
    if a != b: result = false
```

Alternatively, the `distinct` type modifier can be applied to the type class to allow each param matching the type class to bind to a different type. Such type classes are called bind many types.

 Procs written with the implicitly generic style will often need to refer to the type parameters of the matched generic type. They can be easily accessed using the dot syntax:

 
```
type Matrix[T, Rows, Columns] = object
  ...

proc `[]`(m: Matrix, row, col: int): Matrix.T =
  m.data[col * high(Matrix.Columns) + row]
```

Here are more examples that illustrate implicit generics:

 
```
proc p(t: Table; k: Table.Key): Table.Value

# is roughly the same as:

proc p[Key, Value](t: Table[Key, Value]; k: Key): Value
```


```
proc p(a: Table, b: Table)

# is roughly the same as:

proc p[Key, Value](a, b: Table[Key, Value])
```


```
proc p(a: Table, b: distinct Table)

# is roughly the same as:

proc p[Key, Value, KeyB, ValueB](a: Table[Key, Value], b: Table[KeyB, ValueB])
```

`typedesc` used as a parameter type also introduces an implicit generic. `typedesc` has its own set of rules:

 
```
proc p(a: typedesc)

# is roughly the same as:

proc p[T](a: typedesc[T])
```

`typedesc` is a "bind many" type class:

 
```
proc p(a, b: typedesc)

# is roughly the same as:

proc p[T, T2](a: typedesc[T], b: typedesc[T2])
```

A parameter of type `typedesc` is itself usable as a type. If it is used as a type, it's the underlying type. (In other words, one level of "typedesc"-ness is stripped off:

 
```
proc p(a: typedesc; b: a) = discard

# is roughly the same as:
proc p[T](a: typedesc[T]; b: T) = discard

# hence this is a valid call:
p(int, 4)
# as parameter 'a' requires a type, but 'b' requires a value.
```
 ### Generic inference restrictions


The types `var T` and `typedesc[T]` cannot be inferred in a generic instantiation. The following is not allowed:

 
```
proc g[T](f: proc(x: T); x: T) =
  f(x)

proc c(y: int) = echo y
proc v(y: var int) =
  y += 100
var i: int

# allowed: infers 'T' to be of type 'int'
g(c, 42)

# not valid: 'T' is not inferred to be of type 'var int'
g(v, i)

# also not allowed: explicit instantiation via 'var int'
g[var int](v, i)
```
 ### Symbol lookup in generics

 #### Open and Closed symbols


The symbol binding rules in generics are slightly subtle: There are "open" and "closed" symbols. A "closed" symbol cannot be re-bound in the instantiation context, an "open" symbol can. Per default overloaded symbols are open and every other symbol is closed.

 Open symbols are looked up in two different contexts: Both the context at definition and the context at instantiation are considered:

 
```
type
  Index = distinct int

proc `==` (a, b: Index): bool {.borrow.}

var a = (0, 0.Index)
var b = (0, 0.Index)

echo a == b # works!
```

In the example, the generic `==` for tuples (as defined in the system module) uses the `==` operators of the tuple's components. However, the `==` for the `Index` type is defined *after* the `==` for tuples; yet the example compiles as the instantiation takes the currently defined symbols into account too.

 ### Mixin statement


A symbol can be forced to be open by a mixin declaration:

 
```
proc create*[T](): ref T =
  # there is no overloaded 'init' here, so we need to state that it's an
  # open symbol explicitly:
  mixin init
  new result
  init result
```

`mixin` statements only make sense in templates and generics.

 ### Bind statement


The `bind` statement is the counterpart to the `mixin` statement. It can be used to explicitly declare identifiers that should be bound early (i.e. the identifiers should be looked up in the scope of the template/generic definition):

 
```
# Module A
var
  lastId = 0

template genId*: untyped =
  bind lastId
  inc(lastId)
  lastId
```


```
# Module B
import A

echo genId()
```

But a `bind` is rarely useful because symbol binding from the definition scope is the default.

 `bind` statements only make sense in templates and generics.

 ### Delegating bind statements


The following example outlines a problem that can arise when generic instantiations cross multiple different modules:

 
```
# module A
proc genericA*[T](x: T) =
  mixin init
  init(x)
```


```
import C

# module B
proc genericB*[T](x: T) =
  # Without the `bind init` statement C's init proc is
  # not available when `genericB` is instantiated:
  bind init
  genericA(x)
```


```
# module C
type O = object
proc init*(x: var O) = discard
```


```
# module main
import B, C

genericB O()
```

In module B has an `init` proc from module C in its scope that is not taken into account when `genericB` is instantiated which leads to the instantiation of `genericA`. The solution is to `forward`:idx these symbols by a `bind` statement inside `genericB`.

 Templates
---------


A template is a simple form of a macro: It is a simple substitution mechanism that operates on Nim's abstract syntax trees. It is processed in the semantic pass of the compiler.

 The syntax to *invoke* a template is the same as calling a procedure.

 Example:

 
```
template `!=` (a, b: untyped): untyped =
  # this definition exists in the System module
  not (a == b)

assert(5 != 6) # the compiler rewrites that to: assert(not (5 == 6))
```

The `!=`, `>`, `>=`, `in`, `notin`, `isnot` operators are in fact templates:

 `a > b` is transformed into `b < a`.  
`a in b` is transformed into `contains(b, a)`.  
`notin` and `isnot` have the obvious meanings.  



The "types" of templates can be the symbols `untyped`, `typed` or `typedesc`. These are "meta types", they can only be used in certain contexts. Regular types can be used too; this implies that `typed` expressions are expected.

 ### Typed vs untyped parameters


An `untyped` parameter means that symbol lookups and type resolution is not performed before the expression is passed to the template. This means that for example *undeclared* identifiers can be passed to the template:

 
```
template declareInt(x: untyped) =
  var x: int

declareInt(x) # valid
x = 3
```


```
template declareInt(x: typed) =
  var x: int

declareInt(x) # invalid, because x has not been declared and so it has no type
```

A template where every parameter is `untyped` is called an immediate template. For historical reasons templates can be explicitly annotated with an `immediate` pragma and then these templates do not take part in overloading resolution and the parameters' types are *ignored* by the compiler. Explicit immediate templates are now deprecated.

 **Note**: For historical reasons `stmt` was an alias for `typed` and `expr` was an alias for `untyped`, but they are removed.

 ### Passing a code block to a template


One can pass a block of statements as the last argument to a template following the special `:` syntax:

 
```
template withFile(f, fn, mode, actions: untyped): untyped =
  var f: File
  if open(f, fn, mode):
    try:
      actions
    finally:
      close(f)
  else:
    quit("cannot open: " & fn)

withFile(txt, "ttempl3.txt", fmWrite):  # special colon
  txt.writeLine("line 1")
  txt.writeLine("line 2")
```

In the example, the two `writeLine` statements are bound to the `actions` parameter.

 Usually to pass a block of code to a template the parameter that accepts the block needs to be of type `untyped`. Because symbol lookups are then delayed until template instantiation time:

 
```
template t(body: typed) =
  proc p = echo "hey"
  block:
    body

t:
  p()  # fails with 'undeclared identifier: p'
```

The above code fails with the error message that `p` is not declared. The reason for this is that the `p()` body is type-checked before getting passed to the `body` parameter and type checking in Nim implies symbol lookups. The same code works with `untyped` as the passed body is not required to be type-checked:

 
```
template t(body: untyped) =
  proc p = echo "hey"
  block:
    body

t:
  p()  # compiles
```
 ### Varargs of untyped


In addition to the `untyped` meta-type that prevents type checking there is also `varargs[untyped]` so that not even the number of parameters is fixed:

 
```
template hideIdentifiers(x: varargs[untyped]) = discard

hideIdentifiers(undeclared1, undeclared2)
```

However, since a template cannot iterate over varargs, this feature is generally much more useful for macros.

 ### Symbol binding in templates


A template is a hygienic macro and so opens a new scope. Most symbols are bound from the definition scope of the template:

 
```
# Module A
var
  lastId = 0

template genId*: untyped =
  inc(lastId)
  lastId
```


```
# Module B
import A

echo genId() # Works as 'lastId' has been bound in 'genId's defining scope
```

As in generics symbol binding can be influenced via `mixin` or `bind` statements.

 ### Identifier construction


In templates identifiers can be constructed with the backticks notation:

 
```
template typedef(name: untyped, typ: typedesc) =
  type
    `T name`* {.inject.} = typ
    `P name`* {.inject.} = ref `T name`

typedef(myint, int)
var x: PMyInt
```

In the example `name` is instantiated with `myint`, so `T name` becomes `Tmyint`.

 ### Lookup rules for template parameters


A parameter `p` in a template is even substituted in the expression `x.p`. Thus template arguments can be used as field names and a global symbol can be shadowed by the same argument name even when fully qualified:

 
```
# module 'm'

type
  Lev = enum
    levA, levB

var abclev = levB

template tstLev(abclev: Lev) =
  echo abclev, " ", m.abclev

tstLev(levA)
# produces: 'levA levA'
```

But the global symbol can properly be captured by a `bind` statement:

 
```
# module 'm'

type
  Lev = enum
    levA, levB

var abclev = levB

template tstLev(abclev: Lev) =
  bind m.abclev
  echo abclev, " ", m.abclev

tstLev(levA)
# produces: 'levA levB'
```
 ### Hygiene in templates


Per default templates are hygienic: Local identifiers declared in a template cannot be accessed in the instantiation context:

 
```
template newException*(exceptn: typedesc, message: string): untyped =
  var
    e: ref exceptn  # e is implicitly gensym'ed here
  new(e)
  e.msg = message
  e

# so this works:
let e = "message"
raise newException(IoError, e)
```

Whether a symbol that is declared in a template is exposed to the instantiation scope is controlled by the inject and gensym pragmas: gensym'ed symbols are not exposed but inject'ed are.

 The default for symbols of entity `type`, `var`, `let` and `const` is `gensym` and for `proc`, `iterator`, `converter`, `template`, `macro` is `inject`. However, if the name of the entity is passed as a template parameter, it is an inject'ed symbol:

 
```
template withFile(f, fn, mode: untyped, actions: untyped): untyped =
  block:
    var f: File  # since 'f' is a template param, it's injected implicitly
    ...

withFile(txt, "ttempl3.txt", fmWrite):
  txt.writeLine("line 1")
  txt.writeLine("line 2")
```

The `inject` and `gensym` pragmas are second class annotations; they have no semantics outside of a template definition and cannot be abstracted over:

 
```
{.pragma myInject: inject.}

template t() =
  var x {.myInject.}: int # does NOT work
```

To get rid of hygiene in templates, one can use the dirty pragma for a template. `inject` and `gensym` have no effect in `dirty` templates.

 `gensym`'ed symbols cannot be used as `field` in the `x.field` syntax. Nor can they be used in the `ObjectConstruction(field: value)` and `namedParameterCall(field = value)` syntactic constructs.

 The reason for this is that code like

 
```
type
  T = object
    f: int

template tmp(x: T) =
  let f = 34
  echo x.f, T(f: 4)
```

should work as expected.

 However, this means that the method call syntax is not available for `gensym`'ed symbols:

 
```
template tmp(x) =
  type
    T {.gensym.} = int
  
  echo x.T # invalid: instead use:  'echo T(x)'.

tmp(12)
```

**Note**: The Nim compiler prior to version 1 was more lenient about this requirement. Use the `--useVersion:0.19` switch for a transition period.

 ### Limitations of the method call syntax


The expression `x` in `x.f` needs to be semantically checked (that means symbol lookup and type checking) before it can be decided that it needs to be rewritten to `f(x)`. Therefore the dot syntax has some limitations when it is used to invoke templates/macros:

 
```
template declareVar(name: untyped) =
  const name {.inject.} = 45

# Doesn't compile:
unknownIdentifier.declareVar
```

Another common example is this:

 
```
from sequtils import toSeq

iterator something: string =
  yield "Hello"
  yield "World"

var info = something().toSeq
```

The problem here is that the compiler already decided that `something()` as an iterator is not callable in this context before `toSeq` gets its chance to convert it into a sequence.

 It is also not possible to use fully qualified identifiers with module symbol in method call syntax. The order in which the dot operator binds to symbols prohibits this.

 
```
import sequtils

var myItems = @[1,3,3,7]
let N1 = count(myItems, 3) # OK
let N2 = sequtils.count(myItems, 3) # fully qualified, OK
let N3 = myItems.count(3) # OK
let N4 = myItems.sequtils.count(3) # illegal, `myItems.sequtils` can't be resolved
```

This means that when for some reason a procedure needs a disambiguation through the module name, the call needs to be written in function call syntax.

 Macros
------


A macro is a special function that is executed at compile time. Normally the input for a macro is an abstract syntax tree (AST) of the code that is passed to it. The macro can then do transformations on it and return the transformed AST. This can be used to add custom language features and implement domain-specific languages.

 Macro invocation is a case where semantic analysis does **not** entirely proceed top to bottom and left to right. Instead, semantic analysis happens at least twice:

 * Semantic analysis recognizes and resolves the macro invocation.
* The compiler executes the macro body (which may invoke other procs).
* It replaces the AST of the macro invocation with the AST returned by the macro.
* It repeats semantic analysis of that region of the code.
* If the AST returned by the macro contains other macro invocations, this process iterates.

 While macros enable advanced compile-time code transformations, they cannot change Nim's syntax.

 ### Debug Example


The following example implements a powerful `debug` command that accepts a variable number of arguments:

 
```
# to work with Nim syntax trees, we need an API that is defined in the
# ``macros`` module:
import macros

macro debug(args: varargs[untyped]): untyped =
  # `args` is a collection of `NimNode` values that each contain the
  # AST for an argument of the macro. A macro always has to
  # return a `NimNode`. A node of kind `nnkStmtList` is suitable for
  # this use case.
  result = nnkStmtList.newTree()
  # iterate over any argument that is passed to this macro:
  for n in args:
    # add a call to the statement list that writes the expression;
    # `toStrLit` converts an AST to its string representation:
    result.add newCall("write", newIdentNode("stdout"), newLit(n.repr))
    # add a call to the statement list that writes ": "
    result.add newCall("write", newIdentNode("stdout"), newLit(": "))
    # add a call to the statement list that writes the expressions value:
    result.add newCall("writeLine", newIdentNode("stdout"), n)

var
  a: array[0..10, int]
  x = "some string"
a[0] = 42
a[1] = 45

debug(a[0], a[1], x)
```

The macro call expands to:

 
```
write(stdout, "a[0]")
write(stdout, ": ")
writeLine(stdout, a[0])

write(stdout, "a[1]")
write(stdout, ": ")
writeLine(stdout, a[1])

write(stdout, "x")
write(stdout, ": ")
writeLine(stdout, x)
```

Arguments that are passed to a `varargs` parameter are wrapped in an array constructor expression. This is why `debug` iterates over all of `n`'s children.

 ### BindSym


The above `debug` macro relies on the fact that `write`, `writeLine` and `stdout` are declared in the system module and thus visible in the instantiating context. There is a way to use bound identifiers (aka symbols) instead of using unbound identifiers. The `bindSym` builtin can be used for that:

 
```
import macros

macro debug(n: varargs[typed]): untyped =
  result = newNimNode(nnkStmtList, n)
  for x in n:
    # we can bind symbols in scope via 'bindSym':
    add(result, newCall(bindSym"write", bindSym"stdout", toStrLit(x)))
    add(result, newCall(bindSym"write", bindSym"stdout", newStrLitNode(": ")))
    add(result, newCall(bindSym"writeLine", bindSym"stdout", x))

var
  a: array[0..10, int]
  x = "some string"
a[0] = 42
a[1] = 45

debug(a[0], a[1], x)
```

The macro call expands to:

 
```
write(stdout, "a[0]")
write(stdout, ": ")
writeLine(stdout, a[0])

write(stdout, "a[1]")
write(stdout, ": ")
writeLine(stdout, a[1])

write(stdout, "x")
write(stdout, ": ")
writeLine(stdout, x)
```

However, the symbols `write`, `writeLine` and `stdout` are already bound and are not looked up again. As the example shows, `bindSym` does work with overloaded symbols implicitly.

 ### Case-Of Macro


In Nim it is possible to have a macro with the syntax of a *case-of* expression just with the difference that all of branches are passed to and processed by the macro implementation. It is then up the macro implementation to transform the *of-branches* into a valid Nim statement. The following example should show how this feature could be used for a lexical analyzer.

 
```
import macros

macro case_token(args: varargs[untyped]): untyped =
  echo args.treeRepr
  # creates a lexical analyzer from regular expressions
  # ... (implementation is an exercise for the reader ;-)
  discard

case_token: # this colon tells the parser it is a macro statement
of r"[A-Za-z_]+[A-Za-z_0-9]*":
  return tkIdentifier
of r"0-9+":
  return tkInteger
of r"[\+\-\*\?]+":
  return tkOperator
else:
  return tkUnknown
```

**Style note**: For code readability, it is the best idea to use the least powerful programming construct that still suffices. So the "check list" is:

 1. Use an ordinary proc/iterator, if possible.
2. Else: Use a generic proc/iterator, if possible.
3. Else: Use a template, if possible.
4. Else: Use a macro.

 ### For loop macro


A macro that takes as its only input parameter an expression of the special type `system.ForLoopStmt` can rewrite the entirety of a `for` loop:

 
```
import macros

macro enumerate(x: ForLoopStmt): untyped =
  expectKind x, nnkForStmt
  # check if the starting count is specified:
  var countStart = if x[^2].len == 2: newLit(0) else: x[^2][1]
  result = newStmtList()
  # we strip off the first for loop variable and use it as an integer counter:
  result.add newVarStmt(x[0], countStart)
  var body = x[^1]
  if body.kind != nnkStmtList:
    body = newTree(nnkStmtList, body)
  body.add newCall(bindSym"inc", x[0])
  var newFor = newTree(nnkForStmt)
  for i in 1..x.len-3:
    newFor.add x[i]
  # transform enumerate(X) to 'X'
  newFor.add x[^2][^1]
  newFor.add body
  result.add newFor
  # now wrap the whole macro in a block to create a new scope
  result = quote do:
    block: `result`

for a, b in enumerate(items([1, 2, 3])):
  echo a, " ", b

# without wrapping the macro in a block, we'd need to choose different
# names for `a` and `b` here to avoid redefinition errors
for a, b in enumerate(10, [1, 2, 3, 5]):
  echo a, " ", b
```
 Special Types
-------------

 ### static[T]


As their name suggests, static parameters must be constant expressions:

 
```
proc precompiledRegex(pattern: static string): RegEx =
  var res {.global.} = re(pattern)
  return res

precompiledRegex("/d+") # Replaces the call with a precompiled
                        # regex, stored in a global variable

precompiledRegex(paramStr(1)) # Error, command-line options
                              # are not constant expressions
```

For the purposes of code generation, all static params are treated as generic params - the proc will be compiled separately for each unique supplied value (or combination of values).

 Static params can also appear in the signatures of generic types:

 
```
type
  Matrix[M,N: static int; T: Number] = array[0..(M*N - 1), T]
    # Note how `Number` is just a type constraint here, while
    # `static int` requires us to supply an int value
  
  AffineTransform2D[T] = Matrix[3, 3, T]
  AffineTransform3D[T] = Matrix[4, 4, T]

var m1: AffineTransform3D[float]  # OK
var m2: AffineTransform2D[string] # Error, `string` is not a `Number`
```

Please note that `static T` is just a syntactic convenience for the underlying generic type `static[T]`. The type param can be omitted to obtain the type class of all constant expressions. A more specific type class can be created by instantiating `static` with another type class.

 One can force an expression to be evaluated at compile time as a constant expression by coercing it to a corresponding `static` type:

 
```
import math

echo static(fac(5)), " ", static[bool](16.isPowerOfTwo)
```

The compiler will report any failure to evaluate the expression or a possible type mismatch error.

 ### typedesc[T]


In many contexts, Nim treats the names of types as regular values. These values exist only during the compilation phase, but since all values must have a type, `typedesc` is considered their special type.

 `typedesc` acts as a generic type. For instance, the type of the symbol `int` is `typedesc[int]`. Just like with regular generic types, when the generic param is omitted, `typedesc` denotes the type class of all types. As a syntactic convenience, one can also use `typedesc` as a modifier.

 Procs featuring `typedesc` params are considered implicitly generic. They will be instantiated for each unique combination of supplied types and within the body of the proc, the name of each param will refer to the bound concrete type:

 
```
proc new(T: typedesc): ref T =
  echo "allocating ", T.name
  new(result)

var n = Node.new
var tree = new(BinaryTree[int])
```

When multiple type params are present, they will bind freely to different types. To force a bind-once behavior one can use an explicit generic param:

 
```
proc acceptOnlyTypePairs[T, U](A, B: typedesc[T]; C, D: typedesc[U])
```

Once bound, type params can appear in the rest of the proc signature:

 
```
template declareVariableWithType(T: typedesc, value: T) =
  var x: T = value

declareVariableWithType int, 42
```

Overload resolution can be further influenced by constraining the set of types that will match the type param. This works in practice by attaching attributes to types via templates. The constraint can be a concrete type or a type class.

 
```
template maxval(T: typedesc[int]): int = high(int)
template maxval(T: typedesc[float]): float = Inf

var i = int.maxval
var f = float.maxval
when false:
  var s = string.maxval # error, maxval is not implemented for string

template isNumber(t: typedesc[object]): string = "Don't think so."
template isNumber(t: typedesc[SomeInteger]): string = "Yes!"
template isNumber(t: typedesc[SomeFloat]): string = "Maybe, could be NaN."

echo "is int a number? ", isNumber(int)
echo "is float a number? ", isNumber(float)
echo "is RootObj a number? ", isNumber(RootObj)
```

Passing `typedesc` almost identical, just with the differences that the macro is not instantiated generically. The type expression is simply passed as a `NimNode` to the macro, like everything else.

 
```
import macros

macro forwardType(arg: typedesc): typedesc =
  # ``arg`` is of type ``NimNode``
  let tmp: NimNode = arg
  result = tmp

var tmp: forwardType(int)
```
 ### typeof operator


**Note**: `typeof(x)` can for historical reasons also be written as `type(x)` but `type(x)` is discouraged.

 One can obtain the type of a given expression by constructing a `typeof` value from it (in many other languages this is known as the typeof operator):

 
```
var x = 0
var y: typeof(x) # y has type int
```

If `typeof` is used to determine the result type of a proc/iterator/converter call `c(X)` (where `X` stands for a possibly empty list of arguments), the interpretation, where `c` is an iterator, is preferred over the other interpretations, but this behavior can be changed by passing `typeOfProc` as the second argument to `typeof`:

 
```
iterator split(s: string): string = discard
proc split(s: string): seq[string] = discard

# since an iterator is the preferred interpretation, `y` has the type ``string``:
assert typeof("a b c".split) is string

assert typeof("a b c".split, typeOfProc) is seq[string]
```
 Modules
-------


Nim supports splitting a program into pieces by a module concept. Each module needs to be in its own file and has its own namespace. Modules enable information hiding and separate compilation. A module may gain access to symbols of another module by the import statement. Recursive module dependencies are allowed, but slightly subtle. Only top-level symbols that are marked with an asterisk (`*`) are exported. A valid module name can only be a valid Nim identifier (and thus its filename is `identifier.nim`).

 The algorithm for compiling modules is:

 * compile the whole module as usual, following import statements recursively
* if there is a cycle only import the already parsed symbols (that are exported); if an unknown identifier occurs then abort

 This is best illustrated by an example:

 
```
# Module A
type
  T1* = int  # Module A exports the type ``T1``
import B     # the compiler starts parsing B

proc main() =
  var i = p(3) # works because B has been parsed completely here

main()
```


```
# Module B
import A  # A is not parsed here! Only the already known symbols
          # of A are imported.

proc p*(x: A.T1): A.T1 =
  # this works because the compiler has already
  # added T1 to A's interface symbol table
  result = x + 1
```
 #### Import statement


After the `import` statement a list of module names can follow or a single module name followed by an `except` list to prevent some symbols to be imported:

 
```
import strutils except `%`, toUpperAscii

# doesn't work then:
echo "$1" % "abc".toUpperAscii
```

It is not checked that the `except` list is really exported from the module. This feature allows us to compile against an older version of the module that does not export these identifiers.

 The `import` statement is only allowed at the top level.

 #### Include statement


The `include` statement does something fundamentally different than importing a module: it merely includes the contents of a file. The `include` statement is useful to split up a large module into several files:

 
```
include fileA, fileB, fileC
```

The `include` statement can be used outside of the top level, as such:

 
```
# Module A
echo "Hello World!"
```


```
# Module B
proc main() =
  include A

main() # => Hello World!
```
 #### Module names in imports


A module alias can be introduced via the `as` keyword:

 
```
import strutils as su, sequtils as qu

echo su.format("$1", "lalelu")
```

The original module name is then not accessible. The notations `path/to/module` or `"path/to/module"` can be used to refer to a module in subdirectories:

 
```
import lib/pure/os, "lib/pure/times"
```

Note that the module name is still `strutils` and not `lib/pure/strutils` and so one **cannot** do:

 
```
import lib/pure/strutils
echo lib/pure/strutils.toUpperAscii("abc")
```

Likewise, the following does not make sense as the name is `strutils` already:

 
```
import lib/pure/strutils as strutils
```
 #### Collective imports from a directory


The syntax `import dir / [moduleA, moduleB]` can be used to import multiple modules from the same directory.

 Path names are syntactically either Nim identifiers or string literals. If the path name is not a valid Nim identifier it needs to be a string literal:

 
```
import "gfx/3d/somemodule" # in quotes because '3d' is not a valid Nim identifier
```
 #### Pseudo import/include paths


A directory can also be a so-called "pseudo directory". They can be used to avoid ambiguity when there are multiple modules with the same path.

 There are two pseudo directories:

 1. `std`: The `std` pseudo directory is the abstract location of Nim's standard library. For example, the syntax `import std / strutils` is used to unambiguously refer to the standard library's `strutils` module.
2. `pkg`: The `pkg` pseudo directory is used to unambiguously refer to a Nimble package. However, for technical details that lie outside of the scope of this document its semantics are: *Use the search path to look for module name but ignore the standard library locations*. In other words, it is the opposite of `std`.

 #### From import statement


After the `from` statement, a module name follows followed by an `import` to list the symbols one likes to use without explicit full qualification:

 
```
from strutils import `%`

echo "$1" % "abc"
# always possible: full qualification:
echo strutils.replace("abc", "a", "z")
```

It's also possible to use `from module import nil` if one wants to import the module but wants to enforce fully qualified access to every symbol in `module`.

 #### Export statement


An `export` statement can be used for symbol forwarding so that client modules don't need to import a module's dependencies:

 
```
# module B
type MyObject* = object
```


```
# module A
import B
export B.MyObject

proc `$`*(x: MyObject): string = "my object"
```


```
# module C
import A

# B.MyObject has been imported implicitly here:
var x: MyObject
echo $x
```

When the exported symbol is another module, all of its definitions will be forwarded. One can use an `except` list to exclude some of the symbols.

 Notice that when exporting, one needs to specify only the module name:

 
```
import foo/bar/baz
export baz
```
 ### Scope rules


Identifiers are valid from the point of their declaration until the end of the block in which the declaration occurred. The range where the identifier is known is the scope of the identifier. The exact scope of an identifier depends on the way it was declared.

 #### Block scope


The *scope* of a variable declared in the declaration part of a block is valid from the point of declaration until the end of the block. If a block contains a second block, in which the identifier is redeclared, then inside this block, the second declaration will be valid. Upon leaving the inner block, the first declaration is valid again. An identifier cannot be redefined in the same block, except if valid for procedure or iterator overloading purposes.

 #### Tuple or object scope


The field identifiers inside a tuple or object definition are valid in the following places:

 * To the end of the tuple/object definition.
* Field designators of a variable of the given tuple/object type.
* In all descendant types of the object type.

 #### Module scope


All identifiers of a module are valid from the point of declaration until the end of the module. Identifiers from indirectly dependent modules are *not* available. The system module is automatically imported in every module.

 If a module imports an identifier by two different modules, each occurrence of the identifier has to be qualified unless it is an overloaded procedure or iterator in which case the overloading resolution takes place:

 
```
# Module A
var x*: string
```


```
# Module B
var x*: int
```


```
# Module C
import A, B
write(stdout, x) # error: x is ambiguous
write(stdout, A.x) # no error: qualifier used

var x = 4
write(stdout, x) # not ambiguous: uses the module C's x
```
 Compiler Messages
-----------------


The Nim compiler emits different kinds of messages: hint, warning, and error messages. An *error* message is emitted if the compiler encounters any static error.

 Pragmas
-------


Pragmas are Nim's method to give the compiler additional information / commands without introducing a massive number of new keywords. Pragmas are processed on the fly during semantic checking. Pragmas are enclosed in the special `{.` and `.}` curly brackets. Pragmas are also often used as a first implementation to play with a language feature before a nicer syntax to access the feature becomes available.

 ### deprecated pragma


The deprecated pragma is used to mark a symbol as deprecated:

 
```
proc p() {.deprecated.}
var x {.deprecated.}: char
```

This pragma can also take in an optional warning string to relay to developers.

 
```
proc thing(x: bool) {.deprecated: "use thong instead".}
```
 ### noSideEffect pragma


The `noSideEffect` pragma is used to mark a proc/iterator to have no side effects. This means that the proc/iterator only changes locations that are reachable from its parameters and the return value only depends on the arguments. If none of its parameters have the type `var T` or `ref T` or `ptr T` this means no locations are modified. It is a static error to mark a proc/iterator to have no side effect if the compiler cannot verify this.

 As a special semantic rule, the built-in [debugEcho](system#debugEcho,varargs%5Btyped,%5D) pretends to be free of side effects, so that it can be used for debugging routines marked as `noSideEffect`.

 `func` is syntactic sugar for a proc with no side effects:

 
```
func `+` (x, y: int): int
```

To override the compiler's side effect analysis a `{.noSideEffect.}` `cast` pragma block can be used:

 
```
func f() =
  {.cast(noSideEffect).}:
    echo "test"
```
 ### compileTime pragma


The `compileTime` pragma is used to mark a proc or variable to be used only during compile-time execution. No code will be generated for it. Compile-time procs are useful as helpers for macros. Since version 0.12.0 of the language, a proc that uses `system.NimNode` within its parameter types is implicitly declared `compileTime`:

 
```
proc astHelper(n: NimNode): NimNode =
  result = n
```

Is the same as:

 
```
proc astHelper(n: NimNode): NimNode {.compileTime.} =
  result = n
```

`compileTime` variables are available at runtime too. This simplifies certain idioms where variables are filled at compile-time (for example, lookup tables) but accessed at runtime:

 
```
import macros

var nameToProc {.compileTime.}: seq[(string, proc (): string {.nimcall.})]

macro registerProc(p: untyped): untyped =
  result = newTree(nnkStmtList, p)
  
  let procName = p[0]
  let procNameAsStr = $p[0]
  result.add quote do:
    nameToProc.add((`procNameAsStr`, `procName`))

proc foo: string {.registerProc.} = "foo"
proc bar: string {.registerProc.} = "bar"
proc baz: string {.registerProc.} = "baz"

doAssert nameToProc[2][1]() == "baz"
```
 ### noReturn pragma


The `noreturn` pragma is used to mark a proc that never returns.

 ### acyclic pragma


The `acyclic` pragma can be used for object types to mark them as acyclic even though they seem to be cyclic. This is an **optimization** for the garbage collector to not consider objects of this type as part of a cycle:

 
```
type
  Node = ref NodeObj
  NodeObj {.acyclic.} = object
    left, right: Node
    data: string
```

Or if we directly use a ref object:

 
```
type
  Node {.acyclic.} = ref object
    left, right: Node
    data: string
```

In the example, a tree structure is declared with the `Node` type. Note that the type definition is recursive and the GC has to assume that objects of this type may form a cyclic graph. The `acyclic` pragma passes the information that this cannot happen to the GC. If the programmer uses the `acyclic` pragma for data types that are in reality cyclic, the memory leaks can be the result, but memory safety is preserved.

 ### final pragma


The `final` pragma can be used for an object type to specify that it cannot be inherited from. Note that inheritance is only available for objects that inherit from an existing object (via the `object of SuperType` syntax) or that have been marked as `inheritable`.

 ### shallow pragma


The `shallow` pragma affects the semantics of a type: The compiler is allowed to make a shallow copy. This can cause serious semantic issues and break memory safety! However, it can speed up assignments considerably, because the semantics of Nim require deep copying of sequences and strings. This can be expensive, especially if sequences are used to build a tree structure:

 
```
type
  NodeKind = enum nkLeaf, nkInner
  Node {.shallow.} = object
    case kind: NodeKind
    of nkLeaf:
      strVal: string
    of nkInner:
      children: seq[Node]
```
 ### pure pragma


An object type can be marked with the `pure` pragma so that its type field which is used for runtime type identification is omitted. This used to be necessary for binary compatibility with other compiled languages.

 An enum type can be marked as `pure`. Then access of its fields always requires full qualification.

 ### asmNoStackFrame pragma


A proc can be marked with the `asmNoStackFrame` pragma to tell the compiler it should not generate a stack frame for the proc. There are also no exit statements like `return result;` generated and the generated C function is declared as `__declspec(naked)` or `__attribute__((naked))` (depending on the used C compiler).

 **Note**: This pragma should only be used by procs which consist solely of assembler statements.

 ### error pragma


The `error` pragma is used to make the compiler output an error message with the given content. The compilation does not necessarily abort after an error though.

 The `error` pragma can also be used to annotate a symbol (like an iterator or proc). The *usage* of the symbol then triggers a static error. This is especially useful to rule out that some operation is valid due to overloading and type conversions:

 
```
## check that underlying int values are compared and not the pointers:
proc `==`(x, y: ptr int): bool {.error.}
```
 ### fatal pragma


The `fatal` pragma is used to make the compiler output an error message with the given content. In contrast to the `error` pragma, the compilation is guaranteed to be aborted by this pragma. Example:

 
```
when not defined(objc):
  {.fatal: "Compile this program with the objc command!".}
```
 ### warning pragma


The `warning` pragma is used to make the compiler output a warning message with the given content. Compilation continues after the warning.

 ### hint pragma


The `hint` pragma is used to make the compiler output a hint message with the given content. Compilation continues after the hint.

 ### line pragma


The `line` pragma can be used to affect line information of the annotated statement, as seen in stack backtraces:

 
```
template myassert*(cond: untyped, msg = "") =
  if not cond:
    # change run-time line information of the 'raise' statement:
    {.line: instantiationInfo().}:
      raise newException(EAssertionFailed, msg)
```

If the `line` pragma is used with a parameter, the parameter needs be a `tuple[filename: string, line: int]`. If it is used without a parameter, `system.InstantiationInfo()` is used.

 ### linearScanEnd pragma


The `linearScanEnd` pragma can be used to tell the compiler how to compile a Nim case statement. Syntactically it has to be used as a statement:

 
```
case myInt
of 0:
  echo "most common case"
of 1:
  {.linearScanEnd.}
  echo "second most common case"
of 2: echo "unlikely: use branch table"
else: echo "unlikely too: use branch table for ", myInt
```

In the example, the case branches `0` and `1` are much more common than the other cases. Therefore the generated assembler code should test for these values first so that the CPU's branch predictor has a good chance to succeed (avoiding an expensive CPU pipeline stall). The other cases might be put into a jump table for O(1) overhead but at the cost of a (very likely) pipeline stall.

 The `linearScanEnd` pragma should be put into the last branch that should be tested against via linear scanning. If put into the last branch of the whole `case` statement, the whole `case` statement uses linear scanning.

 ### computedGoto pragma


The `computedGoto` pragma can be used to tell the compiler how to compile a Nim case in a `while true` statement. Syntactically it has to be used as a statement inside the loop:

 
```
type
  MyEnum = enum
    enumA, enumB, enumC, enumD, enumE

proc vm() =
  var instructions: array[0..100, MyEnum]
  instructions[2] = enumC
  instructions[3] = enumD
  instructions[4] = enumA
  instructions[5] = enumD
  instructions[6] = enumC
  instructions[7] = enumA
  instructions[8] = enumB
  
  instructions[12] = enumE
  var pc = 0
  while true:
    {.computedGoto.}
    let instr = instructions[pc]
    case instr
    of enumA:
      echo "yeah A"
    of enumC, enumD:
      echo "yeah CD"
    of enumB:
      echo "yeah B"
    of enumE:
      break
    inc(pc)

vm()
```

As the example shows `computedGoto` is mostly useful for interpreters. If the underlying backend (C compiler) does not support the computed goto extension the pragma is simply ignored.

 ### immediate pragma


The immediate pragma is obsolete. See [Typed vs untyped parameters](#templates-typed-vs-untyped-parameters).

 ### compilation option pragmas


The listed pragmas here can be used to override the code generation options for a proc/method/converter.

 The implementation currently provides the following possible options (various others may be added later).

 

| pragma | allowed values | description |
| --- | --- | --- |
| checks | on|off  | Turns the code generation for all runtime checks on or off. |
| boundChecks | on|off  | Turns the code generation for array bound checks on or off. |
| overflowChecks | on|off  | Turns the code generation for over- or underflow checks on or off. |
| nilChecks | on|off  | Turns the code generation for nil pointer checks on or off. |
| assertions | on|off  | Turns the code generation for assertions on or off. |
| warnings | on|off  | Turns the warning messages of the compiler on or off. |
| hints | on|off  | Turns the hint messages of the compiler on or off. |
| optimization | none|speed|size  | Optimize the code for speed or size, or disable optimization. |
| patterns | on|off  | Turns the term rewriting templates/macros on or off. |
| callconv | cdecl|... | Specifies the default calling convention for all procedures (and procedure types) that follow. |


Example:

 
```
{.checks: off, optimization: speed.}
# compile without runtime checks and optimize for speed
```
 ### push and pop pragmas


The push/pop pragmas are very similar to the option directive, but are used to override the settings temporarily. Example:

 
```
{.push checks: off.}
# compile this section without runtime checks as it is
# speed critical
# ... some code ...
{.pop.} # restore old settings
```

push/pop can switch on/off some standard library pragmas, example:

 
```
{.push inline.}
proc thisIsInlined(): int = 42
func willBeInlined(): float = 42.0
{.pop.}
proc notInlined(): int = 9

{.push discardable, boundChecks: off, compileTime, noSideEffect, experimental.}
template example(): string = "https://nim-lang.org"
{.pop.}

{.push deprecated, hint[LineTooLong]: off, used, stackTrace: off.}
proc sample(): bool = true
{.pop.}
```

For third party pragmas, it depends on its implementation but uses the same syntax.

 ### register pragma


The `register` pragma is for variables only. It declares the variable as `register`, giving the compiler a hint that the variable should be placed in a hardware register for faster access. C compilers usually ignore this though and for good reasons: Often they do a better job without it anyway.

 In highly specific cases (a dispatch loop of a bytecode interpreter for example) it may provide benefits, though.

 ### global pragma


The `global` pragma can be applied to a variable within a proc to instruct the compiler to store it in a global location and initialize it once at program startup.

 
```
proc isHexNumber(s: string): bool =
  var pattern {.global.} = re"[0-9a-fA-F]+"
  result = s.match(pattern)
```

When used within a generic proc, a separate unique global variable will be created for each instantiation of the proc. The order of initialization of the created global variables within a module is not defined, but all of them will be initialized after any top-level variables in their originating module and before any variable in a module that imports it.

 ### Disabling certain messages


Nim generates some warnings and hints ("line too long") that may annoy the user. A mechanism for disabling certain messages is provided: Each hint and warning message contains a symbol in brackets. This is the message's identifier that can be used to enable or disable it:

 
```
{.hint[LineTooLong]: off.} # turn off the hint about too long lines
```

This is often better than disabling all warnings at once.

 ### used pragma


Nim produces a warning for symbols that are not exported and not used either. The `used` pragma can be attached to a symbol to suppress this warning. This is particularly useful when the symbol was generated by a macro:

 
```
template implementArithOps(T) =
  proc echoAdd(a, b: T) {.used.} =
    echo a + b
  proc echoSub(a, b: T) {.used.} =
    echo a - b

# no warning produced for the unused 'echoSub'
implementArithOps(int)
echoAdd 3, 5
```

`used` can also be used as a top-level statement to mark a module as "used". This prevents the "Unused import" warning:

 
```
# module: debughelper.nim
when defined(nimHasUsed):
  # 'import debughelper' is so useful for debugging
  # that Nim shouldn't produce a warning for that import,
  # even if currently unused:
  {.used.}
```
 ### experimental pragma


The `experimental` pragma enables experimental language features. Depending on the concrete feature, this means that the feature is either considered too unstable for an otherwise stable release or that the future of the feature is uncertain (it may be removed at any time).

 Example:

 
```
import threadpool
{.experimental: "parallel".}

proc threadedEcho(s: string, i: int) =
  echo(s, " ", $i)

proc useParallel() =
  parallel:
    for i in 0..4:
      spawn threadedEcho("echo in parallel", i)

useParallel()
```

As a top-level statement, the experimental pragma enables a feature for the rest of the module it's enabled in. This is problematic for macro and generic instantiations that cross a module scope. Currently, these usages have to be put into a `.push/pop` environment:

 
```
# client.nim
proc useParallel*[T](unused: T) =
  # use a generic T here to show the problem.
  {.push experimental: "parallel".}
  parallel:
    for i in 0..4:
      echo "echo in parallel"
  
  {.pop.}
```


```
import client
useParallel(1)
```
 Implementation Specific Pragmas
-------------------------------


This section describes additional pragmas that the current Nim implementation supports but which should not be seen as part of the language specification.

 ### Bitsize pragma


The `bitsize` pragma is for object field members. It declares the field as a bitfield in C/C++.

 
```
type
  mybitfield = object
    flag {.bitsize:1.}: cuint
```

generates:

 
```
struct mybitfield {
  unsigned int flag:1;
};
```
 ### Align pragma


The align pragma is for variables and object field members. It modifies the alignment requirement of the entity being declared. The argument must be a constant power of 2. Valid non-zero alignments that are weaker than other align pragmas on the same declaration are ignored. Alignments that are weaker than the alignment requirement of the type are ignored.

 
```
type
  sseType = object
    sseData {.align(16).}: array[4, float32]
  
  # every object will be aligned to 128-byte boundary
  Data = object
    x: char
    cacheline {.align(128).}: array[128, char] # over-aligned array of char,

proc main() =
  echo "sizeof(Data) = ", sizeof(Data), " (1 byte + 127 bytes padding + 128-byte array)"
  # output: sizeof(Data) = 256 (1 byte + 127 bytes padding + 128-byte array)
  echo "alignment of sseType is ", alignof(sseType)
  # output: alignment of sseType is 16
  var d {.align(2048).}: Data # this instance of data is aligned even stricter

main()
```

This pragma has no effect on the JS backend.

 ### Volatile pragma


The `volatile` pragma is for variables only. It declares the variable as `volatile`, whatever that means in C/C++ (its semantics are not well defined in C/C++).

 **Note**: This pragma will not exist for the LLVM backend.

 ### NoDecl pragma


The `noDecl` pragma can be applied to almost any symbol (variable, proc, type, etc.) and is sometimes useful for interoperability with C: It tells Nim that it should not generate a declaration for the symbol in the C code. For example:

 
```
var
  EACCES {.importc, noDecl.}: cint # pretend EACCES was a variable, as
                                   # Nim does not know its value
```

However, the `header` pragma is often the better alternative.

 **Note**: This will not work for the LLVM backend.

 ### Header pragma


The `header` pragma is very similar to the `noDecl` pragma: It can be applied to almost any symbol and specifies that it should not be declared and instead, the generated code should contain an `#include`:

 
```
type
  PFile {.importc: "FILE*", header: "<stdio.h>".} = distinct pointer
    # import C's FILE* type; Nim will treat it as a new pointer type
```

The `header` pragma always expects a string constant. The string constant contains the header file: As usual for C, a system header file is enclosed in angle brackets: `<>`. If no angle brackets are given, Nim encloses the header file in `""` in the generated C code.

 **Note**: This will not work for the LLVM backend.

 ### IncompleteStruct pragma


The `incompleteStruct` pragma tells the compiler to not use the underlying C `struct` in a `sizeof` expression:

 
```
type
  DIR* {.importc: "DIR", header: "<dirent.h>",
         pure, incompleteStruct.} = object
```
 ### Compile pragma


The `compile` pragma can be used to compile and link a C/C++ source file with the project:

 
```
{.compile: "myfile.cpp".}
```

**Note**: Nim computes a SHA1 checksum and only recompiles the file if it has changed. One can use the `-f` command-line option to force the recompilation of the file.

 Since 1.4 the `compile` pragma is also available with this syntax:

 
```
{.compile("myfile.cpp", "--custom flags here").}
```

As can be seen in the example, this new variant allows for custom flags that are passed to the C compiler when the file is recompiled.

 ### Link pragma


The `link` pragma can be used to link an additional file with the project:

 
```
{.link: "myfile.o".}
```
 ### PassC pragma


The `passc` pragma can be used to pass additional parameters to the C compiler like one would using the command-line switch `--passc`:

 
```
{.passc: "-Wall -Werror".}
```

Note that one can use `gorge` from the [system module](system) to embed parameters from an external command that will be executed during semantic analysis:

 
```
{.passc: gorge("pkg-config --cflags sdl").}
```
 ### LocalPassc pragma


The `localPassc` pragma can be used to pass additional parameters to the C compiler, but only for the C/C++ file that is produced from the Nim module the pragma resides in:

 
```
# Module A.nim
# Produces: A.nim.cpp
{.localPassc: "-Wall -Werror".} # Passed when compiling A.nim.cpp
```
 ### PassL pragma


The `passL` pragma can be used to pass additional parameters to the linker like one would be using the command-line switch `--passL`:

 
```
{.passL: "-lSDLmain -lSDL".}
```

Note that one can use `gorge` from the [system module](system) to embed parameters from an external command that will be executed during semantic analysis:

 
```
{.passL: gorge("pkg-config --libs sdl").}
```
 ### Emit pragma


The `emit` pragma can be used to directly affect the output of the compiler's code generator. The code is then unportable to other code generators/backends. Its usage is highly discouraged! However, it can be extremely useful for interfacing with C++ or Objective C code.

 Example:

 
```
{.emit: """
static int cvariable = 420;
""".}

{.push stackTrace:off.}
proc embedsC() =
  var nimVar = 89
  # access Nim symbols within an emit section outside of string literals:
  {.emit: ["""fprintf(stdout, "%d\n", cvariable + (int)""", nimVar, ");"].}
{.pop.}

embedsC()
```

`nimbase.h` defines `NIM_EXTERNC` C macro that can be used for `extern "C"` code to work with both `nim c` and `nim cpp`, e.g.:

 
```
proc foobar() {.importc:"$1".}
{.emit: """
#include <stdio.h>
NIM_EXTERNC
void fun(){}
""".}
```

For backward compatibility, if the argument to the `emit` statement is a single string literal, Nim symbols can be referred to via backticks. This usage is however deprecated.

 For a toplevel emit statement the section where in the generated C/C++ file the code should be emitted can be influenced via the prefixes `/*TYPESECTION*/` or `/*VARSECTION*/` or `/*INCLUDESECTION*/`:

 
```
{.emit: """/*TYPESECTION*/
struct Vector3 {
public:
  Vector3(): x(5) {}
  Vector3(float x_): x(x_) {}
  float x;
};
""".}

type Vector3 {.importcpp: "Vector3", nodecl} = object
  x: cfloat

proc constructVector3(a: cfloat): Vector3 {.importcpp: "Vector3(@)", nodecl}
```
 ### ImportCpp pragma


**Note**: [c2nim](https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst) can parse a large subset of C++ and knows about the `importcpp` pragma pattern language. It is not necessary to know all the details described here.

 Similar to the [importc pragma for C](#foreign-function-interface-importc-pragma), the `importcpp` pragma can be used to import C++ methods or C++ symbols in general. The generated code then uses the C++ method calling syntax: `obj->method(arg)`. In combination with the `header` and `emit` pragmas this allows *sloppy* interfacing with libraries written in C++:

 
```
# Horrible example of how to interface with a C++ engine ... ;-)

{.link: "/usr/lib/libIrrlicht.so".}

{.emit: """
using namespace irr;
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
""".}

const
  irr = "<irrlicht/irrlicht.h>"

type
  IrrlichtDeviceObj {.header: irr,
                      importcpp: "IrrlichtDevice".} = object
  IrrlichtDevice = ptr IrrlichtDeviceObj

proc createDevice(): IrrlichtDevice {.
  header: irr, importcpp: "createDevice(@)".}
proc run(device: IrrlichtDevice): bool {.
  header: irr, importcpp: "#.run(@)".}
```

The compiler needs to be told to generate C++ (command `cpp`) for this to work. The conditional symbol `cpp` is defined when the compiler emits C++ code.

 #### Namespaces


The *sloppy interfacing* example uses `.emit` to produce `using namespace` declarations. It is usually much better to instead refer to the imported name via the `namespace::identifier` notation:

 
```
type
  IrrlichtDeviceObj {.header: irr,
                      importcpp: "irr::IrrlichtDevice".} = object
```
 #### Importcpp for enums


When `importcpp` is applied to an enum type the numerical enum values are annotated with the C++ enum type, like in this example: `((TheCppEnum)(3))`. (This turned out to be the simplest way to implement it.)

 #### Importcpp for procs


Note that the `importcpp` variant for procs uses a somewhat cryptic pattern language for maximum flexibility:

 * A hash `#` symbol is replaced by the first or next argument.
* A dot following the hash `#.` indicates that the call should use C++'s dot or arrow notation.
* An at symbol `@` is replaced by the remaining arguments, separated by commas.

 For example:

 
```
proc cppMethod(this: CppObj, a, b, c: cint) {.importcpp: "#.CppMethod(@)".}
var x: ptr CppObj
cppMethod(x[], 1, 2, 3)
```

Produces:

 
```
x->CppMethod(1, 2, 3)
```

As a special rule to keep backward compatibility with older versions of the `importcpp` pragma, if there is no special pattern character (any of `# ' @`) at all, C++'s dot or arrow notation is assumed, so the above example can also be written as:

 
```
proc cppMethod(this: CppObj, a, b, c: cint) {.importcpp: "CppMethod".}
```

Note that the pattern language naturally also covers C++'s operator overloading capabilities:

 
```
proc vectorAddition(a, b: Vec3): Vec3 {.importcpp: "# + #".}
proc dictLookup(a: Dict, k: Key): Value {.importcpp: "#[#]".}
```

* An apostrophe `'` followed by an integer `i` in the range 0..9 is replaced by the i'th parameter *type*. The 0th position is the result type. This can be used to pass types to C++ function templates. Between the `'` and the digit, an asterisk can be used to get to the base type of the type. (So it "takes away a star" from the type; `T*` becomes `T`.) Two stars can be used to get to the element type of the element type etc.

 For example:

 
```
type Input {.importcpp: "System::Input".} = object
proc getSubsystem*[T](): ptr T {.importcpp: "SystemManager::getSubsystem<'*0>()", nodecl.}

let x: ptr Input = getSubsystem[Input]()
```

Produces:

 
```
x = SystemManager::getSubsystem<System::Input>()
```

* `#@` is a special case to support a `cnew` operation. It is required so that the call expression is inlined directly, without going through a temporary location. This is only required to circumvent a limitation of the current code generator.

 For example C++'s `new` operator can be "imported" like this:

 
```
proc cnew*[T](x: T): ptr T {.importcpp: "(new '*0#@)", nodecl.}

# constructor of 'Foo':
proc constructFoo(a, b: cint): Foo {.importcpp: "Foo(@)".}

let x = cnew constructFoo(3, 4)
```

Produces:

 
```
x = new Foo(3, 4)
```

However, depending on the use case `new Foo` can also be wrapped like this instead:

 
```
proc newFoo(a, b: cint): ptr Foo {.importcpp: "new Foo(@)".}

let x = newFoo(3, 4)
```
 #### Wrapping constructors


Sometimes a C++ class has a private copy constructor and so code like `Class c = Class(1,2);` must not be generated but instead `Class c(1,2);`. For this purpose the Nim proc that wraps a C++ constructor needs to be annotated with the constructor pragma. This pragma also helps to generate faster C++ code since construction then doesn't invoke the copy constructor:

 
```
# a better constructor of 'Foo':
proc constructFoo(a, b: cint): Foo {.importcpp: "Foo(@)", constructor.}
```
 #### Wrapping destructors


Since Nim generates C++ directly, any destructor is called implicitly by the C++ compiler at the scope exits. This means that often one can get away with not wrapping the destructor at all! However, when it needs to be invoked explicitly, it needs to be wrapped. The pattern language provides everything that is required:

 
```
proc destroyFoo(this: var Foo) {.importcpp: "#.~Foo()".}
```
 #### Importcpp for objects


Generic `importcpp`'ed objects are mapped to C++ templates. This means that one can import C++'s templates rather easily without the need for a pattern language for object types:

 
```
type
  StdMap {.importcpp: "std::map", header: "<map>".} [K, V] = object
proc `[]=`[K, V](this: var StdMap[K, V]; key: K; val: V) {.
  importcpp: "#[#] = #", header: "<map>".}

var x: StdMap[cint, cdouble]
x[6] = 91.4
```

Produces:

 
```
std::map<int, double> x;
x[6] = 91.4;
```

* If more precise control is needed, the apostrophe `'` can be used in the supplied pattern to denote the concrete type parameters of the generic type. See the usage of the apostrophe operator in proc patterns for more details.

 
```
type
  VectorIterator {.importcpp: "std::vector<'0>::iterator".} [T] = object

var x: VectorIterator[cint]
```

Produces:

 
```
std::vector<int>::iterator x;
```
 ### ImportJs pragma


Similar to the [importcpp pragma for C++](#implementation-specific-pragmas-importcpp-pragma), the `importjs` pragma can be used to import Javascript methods or symbols in general. The generated code then uses the Javascript method calling syntax: `obj.method(arg)`.

 ### ImportObjC pragma


Similar to the [importc pragma for C](#foreign-function-interface-importc-pragma), the `importobjc` pragma can be used to import Objective C methods. The generated code then uses the Objective C method calling syntax: `[obj method param1: arg]`. In addition with the `header` and `emit` pragmas this allows *sloppy* interfacing with libraries written in Objective C:

 
```
# horrible example of how to interface with GNUStep ...

{.passL: "-lobjc".}
{.emit: """
#include <objc/Object.h>
@interface Greeter:Object
{
}

- (void)greet:(long)x y:(long)dummy;
@end

#include <stdio.h>
@implementation Greeter

- (void)greet:(long)x y:(long)dummy
{
  printf("Hello, World!\n");
}
@end

#include <stdlib.h>
""".}

type
  Id {.importc: "id", header: "<objc/Object.h>", final.} = distinct int

proc newGreeter: Id {.importobjc: "Greeter new", nodecl.}
proc greet(self: Id, x, y: int) {.importobjc: "greet", nodecl.}
proc free(self: Id) {.importobjc: "free", nodecl.}

var g = newGreeter()
g.greet(12, 34)
g.free()
```

The compiler needs to be told to generate Objective C (command `objc`) for this to work. The conditional symbol `objc` is defined when the compiler emits Objective C code.

 ### CodegenDecl pragma


The `codegenDecl` pragma can be used to directly influence Nim's code generator. It receives a format string that determines how the variable or proc is declared in the generated code.

 For variables, $1 in the format string represents the type of the variable and $2 is the name of the variable.

 The following Nim code:

 
```
var
  a {.codegenDecl: "$# progmem $#".}: int
```

will generate this C code:

 
```
int progmem a
```

For procedures $1 is the return type of the procedure, $2 is the name of the procedure and $3 is the parameter list.

 The following nim code:

 
```
proc myinterrupt() {.codegenDecl: "__interrupt $# $#$#".} =
  echo "realistic interrupt handler"
```

will generate this code:

 
```
__interrupt void myinterrupt()
```
 ### InjectStmt pragma


The `injectStmt` pragma can be used to inject a statement before every other statement in the current module. It is only supposed to be used for debugging:

 
```
{.injectStmt: gcInvariants().}

# ... complex code here that produces crashes ...
```
 ### compile-time define pragmas


The pragmas listed here can be used to optionally accept values from the -d/--define option at compile time.

 The implementation currently provides the following possible options (various others may be added later).

 

| pragma | description |
| --- | --- |
| intdefine | Reads in a build-time define as an integer |
| strdefine | Reads in a build-time define as a string |
| booldefine | Reads in a build-time define as a bool |



```
const FooBar {.intdefine.}: int = 5
echo FooBar
```


```
nim c -d:FooBar=42 foobar.nim
```
 In the above example, providing the -d flag causes the symbol `FooBar` to be overwritten at compile-time, printing out 42. If the `-d:FooBar=42` were to be omitted, the default value of 5 would be used. To see if a value was provided, `defined(FooBar)` can be used.

 The syntax `-d:flag` is actually just a shortcut for `-d:flag=true`.

 User-defined pragmas
--------------------

 ### pragma pragma


The `pragma` pragma can be used to declare user-defined pragmas. This is useful because Nim's templates and macros do not affect pragmas. User-defined pragmas are in a different module-wide scope than all other symbols. They cannot be imported from a module.

 Example:

 
```
when appType == "lib":
  {.pragma: rtl, exportc, dynlib, cdecl.}
else:
  {.pragma: rtl, importc, dynlib: "client.dll", cdecl.}

proc p*(a, b: int): int {.rtl.} =
  result = a+b
```

In the example, a new pragma named `rtl` is introduced that either imports a symbol from a dynamic library or exports the symbol for dynamic library generation.

 ### Custom annotations


It is possible to define custom typed pragmas. Custom pragmas do not affect code generation directly, but their presence can be detected by macros. Custom pragmas are defined using templates annotated with pragma `pragma`:

 
```
template dbTable(name: string, table_space: string = "") {.pragma.}
template dbKey(name: string = "", primary_key: bool = false) {.pragma.}
template dbForeignKey(t: typedesc) {.pragma.}
template dbIgnore {.pragma.}
```

Consider stylized example of possible Object Relation Mapping (ORM) implementation:

 
```
const tblspace {.strdefine.} = "dev" # switch for dev, test and prod environments

type
  User {.dbTable("users", tblspace).} = object
    id {.dbKey(primary_key = true).}: int
    name {.dbKey"full_name".}: string
    is_cached {.dbIgnore.}: bool
    age: int
  
  UserProfile {.dbTable("profiles", tblspace).} = object
    id {.dbKey(primary_key = true).}: int
    user_id {.dbForeignKey: User.}: int
    read_access: bool
    write_access: bool
    admin_acess: bool
```

In this example, custom pragmas are used to describe how Nim objects are mapped to the schema of the relational database. Custom pragmas can have zero or more arguments. In order to pass multiple arguments use one of template call syntaxes. All arguments are typed and follow standard overload resolution rules for templates. Therefore, it is possible to have default values for arguments, pass by name, varargs, etc.

 Custom pragmas can be used in all locations where ordinary pragmas can be specified. It is possible to annotate procs, templates, type and variable definitions, statements, etc.

 Macros module includes helpers which can be used to simplify custom pragma access `hasCustomPragma`, `getCustomPragmaVal`. Please consult the macros module documentation for details. These macros are not magic, everything they do can also be achieved by walking the AST of the object representation.

 More examples with custom pragmas:

 * Better serialization/deserialization control:

 
```
type MyObj = object
  a {.dontSerialize.}: int
  b {.defaultDeserialize: 5.}: int
  c {.serializationKey: "_c".}: string
```

* Adopting type for gui inspector in a game engine:

 
```
type MyComponent = object
  position {.editable, animatable.}: Vector3
  alpha {.editRange: [0.0..1.0], animatable.}: float32
```
 ### Macro pragmas


All macros and templates can also be used as pragmas. They can be attached to routines (procs, iterators, etc), type names, or type expressions. The compiler will perform the following simple syntactic transformations:

 
```
template command(name: string, def: untyped) = discard

proc p() {.command("print").} = discard
```

This is translated to:

 
```
command("print"):
  proc p() = discard
```



---

 
```
type
  AsyncEventHandler = proc (x: Event) {.async.}
```

This is translated to:

 
```
type
  AsyncEventHandler = async(proc (x: Event))
```



---

 
```
type
  MyObject {.schema: "schema.protobuf".} = object
```

This is translated to a call to the `schema` macro with a `nnkTypeDef` AST node capturing both the left-hand side and right-hand side of the definition. The macro can return a potentially modified `nnkTypeDef` tree which will replace the original row in the type section.

 When multiple macro pragmas are applied to the same definition, the compiler will apply them consequently from left to right. Each macro will receive as input the output of the previous one.

 Foreign function interface
--------------------------


Nim's FFI (foreign function interface) is extensive and only the parts that scale to other future backends (like the LLVM/JavaScript backends) are documented here.

 ### Importc pragma


The `importc` pragma provides a means to import a proc or a variable from C. The optional argument is a string containing the C identifier. If the argument is missing, the C name is the Nim identifier *exactly as spelled*:

 
```
proc printf(formatstr: cstring) {.header: "<stdio.h>", importc: "printf", varargs.}
```

When `importc` is applied to a `let` statement it can omit its value which will then be expected to come from C. This can be used to import a C `const`:

 
```
{.emit: "const int cconst = 42;".}

let cconst {.importc, nodecl.}: cint

assert cconst == 42
```

Note that this pragma has been abused in the past to also work in the js backend for js objects and functions. : Other backends do provide the same feature under the same name. Also, when the target language is not set to C, other pragmas are available:

 
> 
> * [importcpp](manual#implementation-specific-pragmas-importcpp-pragma)
> * [importobjc](manual#implementation-specific-pragmas-importobjc-pragma)
> * [importjs](manual#implementation-specific-pragmas-importjs-pragma)
> 
>  

 
```
proc p(s: cstring) {.importc: "prefix$1".}
```

In the example, the external name of `p` is set to `prefixp`. Only `$1` is available and a literal dollar sign must be written as `$$`.

 ### Exportc pragma


The `exportc` pragma provides a means to export a type, a variable, or a procedure to C. Enums and constants can't be exported. The optional argument is a string containing the C identifier. If the argument is missing, the C name is the Nim identifier *exactly as spelled*:

 
```
proc callme(formatstr: cstring) {.exportc: "callMe", varargs.}
```

Note that this pragma is somewhat of a misnomer: Other backends do provide the same feature under the same name.

 The string literal passed to `exportc` can be a format string:

 
```
proc p(s: string) {.exportc: "prefix$1".} =
  echo s
```

In the example the external name of `p` is set to `prefixp`. Only `$1` is available and a literal dollar sign must be written as `$$`.

 If the symbol should also be exported to a dynamic library, the `dynlib` pragma should be used in addition to the `exportc` pragma. See [Dynlib pragma for export](#foreign-function-interface-dynlib-pragma-for-export).

 ### Extern pragma


Like `exportc` or `importc`, the `extern` pragma affects name mangling. The string literal passed to `extern` can be a format string:

 
```
proc p(s: string) {.extern: "prefix$1".} =
  echo s
```

In the example, the external name of `p` is set to `prefixp`. Only `$1` is available and a literal dollar sign must be written as `$$`.

 ### Bycopy pragma


The `bycopy` pragma can be applied to an object or tuple type and instructs the compiler to pass the type by value to procs:

 
```
type
  Vector {.bycopy.} = object
    x, y, z: float
```
 ### Byref pragma


The `byref` pragma can be applied to an object or tuple type and instructs the compiler to pass the type by reference (hidden pointer) to procs.

 ### Varargs pragma


The `varargs` pragma can be applied to procedures only (and procedure types). It tells Nim that the proc can take a variable number of parameters after the last specified parameter. Nim string values will be converted to C strings automatically:

 
```
proc printf(formatstr: cstring) {.nodecl, varargs.}

printf("hallo %s", "world") # "world" will be passed as C string
```
 ### Union pragma


The `union` pragma can be applied to any `object` type. It means all of the object's fields are overlaid in memory. This produces a `union` instead of a `struct` in the generated C/C++ code. The object declaration then must not use inheritance or any GC'ed memory but this is currently not checked.

 **Future directions**: GC'ed memory should be allowed in unions and the GC should scan unions conservatively.

 ### Packed pragma


The `packed` pragma can be applied to any `object` type. It ensures that the fields of an object are packed back-to-back in memory. It is useful to store packets or messages from/to network or hardware drivers, and for interoperability with C. Combining packed pragma with inheritance is not defined, and it should not be used with GC'ed memory (ref's).

 **Future directions**: Using GC'ed memory in packed pragma will result in a static error. Usage with inheritance should be defined and documented.

 ### Dynlib pragma for import


With the `dynlib` pragma a procedure or a variable can be imported from a dynamic library (`.dll` files for Windows, `lib*.so` files for UNIX). The non-optional argument has to be the name of the dynamic library:

 
```
proc gtk_image_new(): PGtkWidget
  {.cdecl, dynlib: "libgtk-x11-2.0.so", importc.}
```

In general, importing a dynamic library does not require any special linker options or linking with import libraries. This also implies that no *devel* packages need to be installed.

 The `dynlib` import mechanism supports a versioning scheme:

 
```
proc Tcl_Eval(interp: pTcl_Interp, script: cstring): int {.cdecl,
  importc, dynlib: "libtcl(|8.5|8.4|8.3).so.(1|0)".}
```

At runtime the dynamic library is searched for (in this order):



```
libtcl.so.1
libtcl.so.0
libtcl8.5.so.1
libtcl8.5.so.0
libtcl8.4.so.1
libtcl8.4.so.0
libtcl8.3.so.1
libtcl8.3.so.0
```
 The `dynlib` pragma supports not only constant strings as an argument but also string expressions in general:

 
```
import os

proc getDllName: string =
  result = "mylib.dll"
  if fileExists(result): return
  result = "mylib2.dll"
  if fileExists(result): return
  quit("could not load dynamic library")

proc myImport(s: cstring) {.cdecl, importc, dynlib: getDllName().}
```

**Note**: Patterns like `libtcl(|8.5|8.4).so` are only supported in constant strings, because they are precompiled.

 **Note**: Passing variables to the `dynlib` pragma will fail at runtime because of order of initialization problems.

 **Note**: A `dynlib` import can be overridden with the `--dynlibOverride:name` command-line option. The Compiler User Guide contains further information.

 ### Dynlib pragma for export


With the `dynlib` pragma a procedure can also be exported to a dynamic library. The pragma then has no argument and has to be used in conjunction with the `exportc` pragma:

 
```
proc exportme(): int {.cdecl, exportc, dynlib.}
```

This is only useful if the program is compiled as a dynamic library via the `--app:lib` command-line option.

 Threads
-------


To enable thread support the `--threads:on` command-line switch needs to be used. The `system` module then contains several threading primitives. See the <threads> and <channels> modules for the low-level thread API. There are also high-level parallelism constructs available. See [spawn](manual_experimental#parallel-amp-spawn) for further details.

 Nim's memory model for threads is quite different than that of other common programming languages (C, Pascal, Java): Each thread has its own (garbage collected) heap, and sharing of memory is restricted to global variables. This helps to prevent race conditions. GC efficiency is improved quite a lot, because the GC never has to stop other threads and see what they reference.

 ### Thread pragma


A proc that is executed as a new thread of execution should be marked by the `thread` pragma for reasons of readability. The compiler checks for violations of the no heap sharing restriction: This restriction implies that it is invalid to construct a data structure that consists of memory allocated from different (thread-local) heaps.

 A thread proc is passed to `createThread` or `spawn` and invoked indirectly; so the `thread` pragma implies `procvar`.

 ### GC safety


We call a proc `p` GC safe when it doesn't access any global variable that contains GC'ed memory (`string`, `seq`, `ref` or a closure) either directly or indirectly through a call to a GC unsafe proc.

 The gcsafe annotation can be used to mark a proc to be gcsafe, otherwise this property is inferred by the compiler. Note that `noSideEffect` implies `gcsafe`. The only way to create a thread is via `spawn` or `createThread`. The invoked proc must not use `var` parameters nor must any of its parameters contain a `ref` or `closure` type. This enforces the *no heap sharing restriction*.

 Routines that are imported from C are always assumed to be `gcsafe`. To disable the GC-safety checking the `--threadAnalysis:off` command-line switch can be used. This is a temporary workaround to ease the porting effort from old code to the new threading model.

 To override the compiler's gcsafety analysis a `{.cast(gcsafe).}` pragma block can be used:

 
```
var
  someGlobal: string = "some string here"
  perThread {.threadvar.}: string

proc setPerThread() =
  {.cast(gcsafe).}:
    deepCopy(perThread, someGlobal)
```

See also:

 * [Shared heap memory management.](gc).

 ### Threadvar pragma


A variable can be marked with the `threadvar` pragma, which makes it a thread-local variable; Additionally, this implies all the effects of the `global` pragma.

 
```
var checkpoints* {.threadvar.}: seq[string]
```

Due to implementation restrictions thread-local variables cannot be initialized within the `var` section. (Every thread-local variable needs to be replicated at thread creation.)

 ### Threads and exceptions


The interaction between threads and exceptions is simple: A *handled* exception in one thread cannot affect any other thread. However, an *unhandled* exception in one thread terminates the whole *process*! 



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/manual.html>

Nim Compiler User Guide
=======================



> "Look at you, hacker. A pathetic creature of meat and bone, panting and sweating as you run through my corridors. How can you challenge a perfect, immortal machine?"
> 
> 

 Introduction
------------


This document describes the usage of the *Nim compiler* on the different supported platforms. It is not a definition of the Nim programming language (which is covered in the <manual>).

 Nim is free software; it is licensed under the [MIT License](http://www.opensource.org/licenses/mit-license.php).

 Compiler Usage
--------------

 ### Command-line switches


Basic command-line switches are:

 Usage:

 
```
nim command [options] [projectfile] [arguments]
```
 
Command: 


|  |  |
| --- | --- |
| compile, c | compile project with default code generator (C) |
| r | compile to $nimcache/projname, run with [arguments] using backend specified by `--backend` (default: c) |
| doc | generate the documentation for inputfile for backend specified by `--backend` (default: c) |


Arguments: arguments are passed to the program being run (if --run option is selected)

  Options: 

|  |  |
| --- | --- |
| -p, --path:PATH | add path to search paths |
| -d, --define:SYMBOL(:VAL) | define a conditional symbol (Optionally: Define the value for that symbol, see: "compile time define pragmas") |
| -u, --undef:SYMBOL | undefine a conditional symbol |
| -f, --forceBuild:on|off | force rebuilding of all modules |
| --stackTrace:on|off | turn stack tracing on|off |
| --lineTrace:on|off | turn line tracing on|off |
| --threads:on|off | turn support for multi-threading on|off |
| -x, --checks:on|off | turn all runtime checks on|off |
| -a, --assertions:on|off | turn assertions on|off |
| --opt:none|speed|size | optimize not at all or for speed|size Note: use -d:release for a release build! |
| --debugger:native | Use native debugger (gdb) |
| --app:console|gui|lib|staticlib | generate a console app|GUI app|DLL|static library |
| -r, --run | run the compiled program with given arguments |
| --fullhelp | show all command line switches |
| -h, --help | show this help |
| -v, --version | show detailed version information |

  Note, single letter options that take an argument require a colon. E.g. -p:PATH.

 

---

 Advanced command-line switches are:

 
Advanced commands: 

|  |  |
| --- | --- |
| compileToC, cc | compile project with C code generator |
| compileToCpp, cpp | compile project to C++ code |
| compileToOC, objc | compile project to Objective C code |
| js | compile project to Javascript |
| e | run a Nimscript file |
| rst2html | convert a reStructuredText file to HTML use `--docCmd:skip` to skip compiling snippets |
| rst2tex | convert a reStructuredText file to TeX |
| jsondoc | extract the documentation to a json file |
| ctags | create a tags file |
| buildIndex | build an index for the whole documentation |
| genDepend | generate a DOT file containing the module dependency graph |
| dump | dump all defined conditionals and search paths see also: --dump.format:json (useful with: `| jq`) |
| check | checks the project for syntax and semantic |

 Runtime checks (see -x): 

|  |  |
| --- | --- |
| --objChecks:on|off | turn obj conversion checks on|off |
| --fieldChecks:on|off | turn case variant field checks on|off |
| --rangeChecks:on|off | turn range checks on|off |
| --boundChecks:on|off | turn bound checks on|off |
| --overflowChecks:on|off | turn int over-/underflow checks on|off |
| --floatChecks:on|off | turn all floating point (NaN/Inf) checks on|off |
| --nanChecks:on|off | turn NaN checks on|off |
| --infChecks:on|off | turn Inf checks on|off |
| --refChecks:on|off | turn ref checks on|off (only for --newruntime) |

 Advanced options: 

|  |  |
| --- | --- |
| -o:FILE, --out:FILE | set the output filename |
| --outdir:DIR | set the path where the output file will be written |
| --usenimcache | will use `outdir=$$nimcache`, whichever it resolves to after all options have been processed |
| --stdout:on|off | output to stdout |
| --colors:on|off | turn compiler messages coloring on|off |
| --listFullPaths:on|off | list full paths in messages |
| -w:on|off|list, --warnings:on|off|list | turn all warnings on|off or list all available |
| --warning[X]:on|off | turn specific warning X on|off |
| --hints:on|off|list | turn all hints on|off or list all available |
| --hint[X]:on|off | turn specific hint X on|off |
| --warningAsError[X]:on|off | turn specific warning X into an error on|off |
| --styleCheck:off|hint|error | produce hints or errors for Nim identifiers that do not adhere to Nim's official style guide [https://nim-lang.org/docs/nep1.html](nep1) |
| --styleCheck:usages | only enforce consistent spellings of identifiers, do not enforce the style on declarations |
| --showAllMismatches:on|off | show all mismatching candidates in overloading resolution |
| --lib:PATH | set the system library path |
| --import:PATH | add an automatically imported module |
| --include:PATH | add an automatically included module |
| --nimcache:PATH | set the path used for generated files see also [https://nim-lang.org/docs/nimc.html#compiler-usage-generated-c-code-directory](nimc#compiler-usage-generated-c-code-directory) |
| -c, --compileOnly:on|off | compile Nim files only; do not assemble or link |
| --noLinking:on|off | compile Nim and generated files but do not link |
| --noMain:on|off | do not generate a main procedure |
| --genScript:on|off | generate a compile script (in the 'nimcache' subdirectory named 'compile\_$$project$$scriptext'), implies --compileOnly |
| --genDeps:on|off | generate a '.deps' file containing the dependencies |
| --os:SYMBOL | set the target operating system (cross-compilation) |
| --cpu:SYMBOL | set the target processor (cross-compilation) |
| --debuginfo:on|off | enables debug information |
| -t, --passC:OPTION | pass an option to the C compiler |
| -l, --passL:OPTION | pass an option to the linker |
| --cc:SYMBOL | specify the C compiler |
| --cincludes:DIR | modify the C compiler header search path |
| --clibdir:DIR | modify the linker library search path |
| --clib:LIBNAME | link an additional C library (you should omit platform-specific extensions) |
| --project | document the whole project (doc) |
| --docRoot:path | `nim doc --docRoot:/foo --project --outdir:docs /foo/sub/main.nim` generates: docs/sub/main.html if path == @pkg, will use nimble file enclosing dir if path == @path, will use first matching dir in `--path` if path == @default (the default and most useful), will use best match among @pkg,@path. if these are nonexistent, will use project path |
| -b, --backend:c|cpp|js|objc sets backend to use with commands like `nim doc` or `nim r` |  |
| --docCmd:cmd | if `cmd == skip`, skips runnableExamples else, runs runnableExamples with given options, e.g.: `--docCmd:"-d:foo --threads:on"` |
| --docSeeSrcUrl:url | activate 'see source' for doc command (see doc.item.seesrc in config/nimdoc.cfg) |
| --docInternal | also generate documentation for non-exported symbols |
| --lineDir:on|off | generation of #line directive on|off |
| --embedsrc:on|off | embeds the original source code as comments in the generated output |
| --threadanalysis:on|off | turn thread analysis on|off |
| --tlsEmulation:on|off | turn thread local storage emulation on|off |
| --taintMode:on|off | turn taint mode on|off |
| --implicitStatic:on|off | turn implicit compile time evaluation on|off |
| --trmacros:on|off | turn term rewriting macros on|off |
| --multimethods:on|off | turn multi-methods on|off |
| --memTracker:on|off | turn memory tracker on|off |
| --hotCodeReloading:on|off | turn support for hot code reloading on|off |
| --excessiveStackTrace:on|off | stack traces use full file paths |
| --stackTraceMsgs:on|off | enable user defined stack frame msgs via `setFrameMsg` |
| --nilseqs:on|off | allow 'nil' for strings/seqs for backwards compatibility |
| --seqsv2:on|off | use the new string/seq implementation based on destructors |
| --skipCfg:on|off | do not read the nim installation's configuration file |
| --skipUserCfg:on|off | do not read the user's configuration file |
| --skipParentCfg:on|off | do not read the parent dirs' configuration files |
| --skipProjCfg:on|off | do not read the project's configuration file |
| --gc:refc|arc|orc|markAndSweep|boehm|go|none|regions | select the GC to use; default is 'refc' |
| --exceptions:setjmp|cpp|goto | select the exception handling implementation |
| --index:on|off | turn index file generation on|off |
| --putenv:key=value | set an environment variable |
| --NimblePath:PATH | add a path for Nimble support |
| --noNimblePath | deactivate the Nimble path |
| --clearNimblePath | empty the list of Nimble package search paths |
| --cppCompileToNamespace:namespace | use the provided namespace for the generated C++ code, if no namespace is provided "Nim" will be used |
| --expandMacro:MACRO | dump every generated AST from MACRO |
| --expandArc:PROCNAME | show how PROCNAME looks like after diverse optimizations before the final backend phase (mostly ARC/ORC specific) |
| --excludePath:PATH | exclude a path from the list of search paths |
| --dynlibOverride:SYMBOL | marks SYMBOL so that dynlib:SYMBOL has no effect and can be statically linked instead; symbol matching is fuzzy so that --dynlibOverride:lua matches dynlib: "liblua.so.3" |
| --dynlibOverrideAll | disables the effects of the dynlib pragma |
| --listCmd | list the compilation commands; can be combined with `--hint:exec:on` and `--hint:link:on` |
| --asm | produce assembler code |
| --parallelBuild:0|1|... | perform a parallel build value = number of processors (0 for auto-detect) |
| --incremental:on|off | only recompile the changed modules (experimental!) |
| --verbosity:0|1|2|3 | set Nim's verbosity level (1 is default) |
| --errorMax:N | stop compilation after N errors; 0 means unlimited |
| --maxLoopIterationsVM:N | set max iterations for all VM loops |
| --experimental:$1 | enable experimental language feature |
| --legacy:$2 | enable obsolete/legacy language feature |
| --useVersion:1.0 | emulate Nim version X of the Nim compiler |
| --profiler:on|off | enable profiling; requires `import nimprof`, and works better with `--stackTrace:on` see also <https://nim-lang.github.io/Nim/estp.html> |
| --benchmarkVM:on|off | enable benchmarking of VM code with cpuTime() |
| --profileVM:on|off | enable compile time VM profiler |
| --sinkInference:on|off | en-/disable sink parameter inference (default: on) |
| --panics:on|off | turn panics into process terminations (default: off) |
| --deepcopy:on|off | enable 'system.deepCopy' for `--gc:arc|orc` |

  ### List of warnings


Each warning can be activated individually with `--warning[NAME]:on|off` or in a `push` pragma.

 

| Name | Description |
| --- | --- |
| CannotOpenFile | Some file not essential for the compiler's working could not be opened. |
| OctalEscape | The code contains an unsupported octal sequence. |
| Deprecated | The code uses a deprecated symbol. |
| ConfigDeprecated | The project makes use of a deprecated config file. |
| SmallLshouldNotBeUsed | The letter 'l' should not be used as an identifier. |
| EachIdentIsTuple | The code contains a confusing `var` declaration. |
| User | Some user-defined warning. |

 ### List of hints


Each hint can be activated individually with `--hint[NAME]:on|off` or in a `push` pragma.

 

| Name | Description |
| --- | --- |
| CC | Shows when the C compiler is called. |
| CodeBegin |  |
| CodeEnd |  |
| CondTrue |  |
| Conf | A config file was loaded. |
| ConvToBaseNotNeeded |  |
| ConvFromXtoItselfNotNeeded |  |
| Dependency |  |
| Exec | Program is executed. |
| ExprAlwaysX |  |
| ExtendedContext |  |
| GCStats | Dumps statistics about the Garbage Collector. |
| GlobalVar | Shows global variables declarations. |
| LineTooLong | Line exceeds the maximum length. |
| Link | Linking phase. |
| Name |  |
| Path | Search paths modifications. |
| Pattern |  |
| Performance |  |
| Processing | Artifact being compiled. |
| QuitCalled |  |
| Source | The source line that triggered a diagnostic message. |
| StackTrace |  |
| Success, SuccessX | Successful compilation of a library or a binary. |
| User |  |
| UserRaw |  |
| XDeclaredButNotUsed | Unused symbols in the code. |

 ### Verbosity levels




| Level | Description |
| --- | --- |
| 0 | Minimal output level for the compiler. |
| 1 | Displays compilation of all the compiled files, including those imported by other modules or through the [compile pragma](manual#implementation-specific-pragmas-compile-pragma). This is the default level. |
| 2 | Displays compilation statistics, enumerates the dynamic libraries that will be loaded by the final binary, and dumps to standard output the result of applying [a filter to the source code](filters) if any filter was used during compilation. |
| 3 | In addition to the previous levels dumps a debug stack trace for compiler developers. |

 ### Compile-time symbols


Through the `-d:x` or `--define:x` switch you can define compile-time symbols for conditional compilation. The defined switches can be checked in source code with the [when statement](manual#statements-and-expressions-when-statement) and [defined proc](system#defined,untyped). The typical use of this switch is to enable builds in release mode (`-d:release`) where optimizations are enabled for better performance. Another common use is the `-d:ssl` switch to activate SSL sockets.

 Additionally, you may pass a value along with the symbol: `-d:x=y` which may be used in conjunction with the [compile-time define pragmas](manual#implementation-specific-pragmas-compileminustime-define-pragmas) to override symbols during build time.

 Compile-time symbols are completely **case insensitive** and underscores are ignored too. `--define:FOO` and `--define:foo` are identical.

 Compile-time symbols starting with the `nim` prefix are reserved for the implementation and should not be used elsewhere.

 ### Configuration files


**Note:** The *project file name* is the name of the `.nim` file that is passed as a command-line argument to the compiler.

 The `nim` executable processes configuration files in the following directories (in this order; later files overwrite previous settings):

 1. `$nim/config/nim.cfg`, `/etc/nim/nim.cfg` (UNIX) or `<Nim's installation directory>\config\nim.cfg` (Windows). This file can be skipped with the `--skipCfg` command line option.
2. If environment variable `XDG_CONFIG_HOME` is defined, `$XDG_CONFIG_HOME/nim/nim.cfg` or `~/.config/nim/nim.cfg` (POSIX) or `%APPDATA%/nim/nim.cfg` (Windows). This file can be skipped with the `--skipUserCfg` command line option.
3. `$parentDir/nim.cfg` where `$parentDir` stands for any parent directory of the project file's path. These files can be skipped with the `--skipParentCfg` command-line option.
4. `$projectDir/nim.cfg` where `$projectDir` stands for the project file's path. This file can be skipped with the `--skipProjCfg` command-line option.
5. A project can also have a project-specific configuration file named `$project.nim.cfg` that resides in the same directory as `$project.nim`. This file can be skipped with the `--skipProjCfg` command-line option.

 Command-line settings have priority over configuration file settings.

 The default build of a project is a debug build. To compile a release build define the `release` symbol:



```
nim c -d:release myproject.nim
```
 
> 
> To compile a dangerous release build define the `danger` symbol:
> 
> 
> 
> ```
> nim c -d:danger myproject.nim
> ```
>  

 ### Search path handling


Nim has the concept of a global search path (PATH) that is queried to determine where to find imported modules or include files. If multiple files are found an ambiguity error is produced.

 `nim dump` shows the contents of the PATH.

 However before the PATH is used the current directory is checked for the file's existence. So if PATH contains `$lib` and `$lib/bar` and the directory structure looks like this:



```
$lib/x.nim
$lib/bar/x.nim
foo/x.nim
foo/main.nim
other.nim
```
 And `main` imports `x`, `foo/x` is imported. If `other` imports `x` then both `$lib/x.nim` and `$lib/bar/x.nim` match but `$lib/x.nim` is used as it is the first match.

 ### Generated C code directory


The generated files that Nim produces all go into a subdirectory called `nimcache`. Its full path is

 * `$XDG_CACHE_HOME/nim/$projectname(_r|_d)` or `~/.cache/nim/$projectname(_r|_d)` on Posix
* `$HOME/nimcache/$projectname(_r|_d)` on Windows.

 The `_r` suffix is used for release builds, `_d` is for debug builds.

 This makes it easy to delete all generated files.

 The `--nimcache` [compiler switch](#compiler-usage-commandminusline-switches) can be used to to change the `nimcache` directory.

 However, the generated C code is not platform-independent. C code generated for Linux does not compile on Windows, for instance. The comment on top of the C file lists the OS, CPU, and CC the file has been compiled for.

 Compiler Selection
------------------


To change the compiler from the default compiler (at the command line):



```
nim c --cc:llvm_gcc --compile_only myfile.nim
```
 This uses the configuration defined in `config\nim.cfg` for `lvm_gcc`.

 If nimcache already contains compiled code from a different compiler for the same project, add the `-f` flag to force all files to be recompiled.

 The default compiler is defined at the top of `config\nim.cfg`. Changing this setting affects the compiler used by `koch` to (re)build Nim.

 To use the `CC` environment variable, use `nim c --cc:env myfile.nim`. To use the `CXX` environment variable, use `nim cpp --cc:env myfile.nim`. `--cc:env` is available since Nim version 1.4.

 Cross-compilation
-----------------


To cross compile, use for example:



```
nim c --cpu:i386 --os:linux --compileOnly --genScript myproject.nim
```
 Then move the C code and the compile script `compile_myproject.sh` to your Linux i386 machine and run the script.

 Another way is to make Nim invoke a cross compiler toolchain:



```
nim c --cpu:arm --os:linux myproject.nim
```
 For cross compilation, the compiler invokes a C compiler named like `$cpu.$os.$cc` (for example arm.linux.gcc) and the configuration system is used to provide meaningful defaults. For example for `ARM` your configuration file should contain something like:



```
arm.linux.gcc.path = "/usr/bin"
arm.linux.gcc.exe = "arm-linux-gcc"
arm.linux.gcc.linkerexe = "arm-linux-gcc"
```
 Cross-compilation for Windows
-----------------------------


To cross-compile for Windows from Linux or macOS using the MinGW-w64 toolchain:



```
nim c -d:mingw myproject.nim
```
 Use `--cpu:i386` or `--cpu:amd64` to switch the CPU architecture.

 The MinGW-w64 toolchain can be installed as follows:



```
Ubuntu: apt install mingw-w64
CentOS: yum install mingw32-gcc | mingw64-gcc - requires EPEL
OSX: brew install mingw-w64
```
 Cross-compilation for Android
-----------------------------


There are two ways to compile for Android: terminal programs (Termux) and with the NDK (Android Native Development Kit).

 The first one is to treat Android as a simple Linux and use [Termux](https://wiki.termux.com) to connect and run the Nim compiler directly on android as if it was Linux. These programs are console-only programs that can't be distributed in the Play Store.

 Use regular `nim c` inside termux to make Android terminal programs.

 Normal Android apps are written in Java, to use Nim inside an Android app you need a small Java stub that calls out to a native library written in Nim using the [NDK](https://developer.android.com/ndk). You can also use [native-activity](https://developer.android.com/ndk/samples/sample_na) to have the Java stub be auto-generated for you.

 Use `nim c -c --cpu:arm --os:android -d:androidNDK --noMain:on` to generate the C source files you need to include in your Android Studio project. Add the generated C files to CMake build script in your Android project. Then do the final compile with Android Studio which uses Gradle to call CMake to compile the project.

 Because Nim is part of a library it can't have its own c style `main()` so you would need to define your own `android_main` and init the Java environment, or use a library like SDL2 or GLFM to do it. After the Android stuff is done, it's very important to call `NimMain()` in order to initialize Nim's garbage collector and to run the top level statements of your program.

 
```
proc NimMain() {.importc.}
proc glfmMain*(display: ptr GLFMDisplay) {.exportc.} =
  NimMain() # initialize garbage collector memory, types and stack
```
 Cross-compilation for iOS
-------------------------


To cross-compile for iOS you need to be on a macOS computer and use XCode. Normal languages for iOS development are Swift and Objective C. Both of these use LLVM and can be compiled into object files linked together with C, C++ or Objective C code produced by Nim.

 Use `nim c -c --os:ios --noMain:on` to generate C files and include them in your XCode project. Then you can use XCode to compile, link, package and sign everything.

 Because Nim is part of a library it can't have its own c style `main()` so you would need to define `main` that calls `autoreleasepool` and `UIApplicationMain` to do it, or use a library like SDL2 or GLFM. After the iOS setup is done, it's very important to call `NimMain()` to initialize Nim's garbage collector and to run the top-level statements of your program.

 
```
proc NimMain() {.importc.}
proc glfmMain*(display: ptr GLFMDisplay) {.exportc.} =
  NimMain() # initialize garbage collector memory, types and stack
```

Note: XCode's "make clean" gets confused about the generated nim.c files, so you need to clean those files manually to do a clean build.

 Cross-compilation for Nintendo Switch
-------------------------------------


Simply add --os:nintendoswitch to your usual `nim c` or `nim cpp` command and set the `passC` and `passL` command line switches to something like:

 
```
nim c ... --passC="-I$DEVKITPRO/libnx/include" ...
--passL="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
```

or setup a nim.cfg file like so:

 
```
#nim.cfg
--passC="-I$DEVKITPRO/libnx/include"
--passL="-specs=$DEVKITPRO/libnx/switch.specs -L$DEVKITPRO/libnx/lib -lnx"
```

The DevkitPro setup must be the same as the default with their new installer [here for Mac/Linux](https://github.com/devkitPro/pacman/releases) or [here for Windows](https://github.com/devkitPro/installer/releases).

 For example, with the above-mentioned config:



```
nim c --os:nintendoswitch switchhomebrew.nim
```
 This will generate a file called `switchhomebrew.elf` which can then be turned into an nro file with the `elf2nro` tool in the DevkitPro release. Examples can be found at [the nim-libnx github repo](https://github.com/jyapayne/nim-libnx.git).

 There are a few things that don't work because the DevkitPro libraries don't support them. They are:

 1. Waiting for a subprocess to finish. A subprocess can be started, but right now it can't be waited on, which sort of makes subprocesses a bit hard to use
2. Dynamic calls. DevkitPro libraries have no dlopen/dlclose functions.
3. Command line parameters. It doesn't make sense to have these for a console anyways, so no big deal here.
4. mqueue. Sadly there are no mqueue headers.
5. ucontext. No headers for these either. No coroutines for now :(
6. nl\_types. No headers for this.

 DLL generation
--------------


Nim supports the generation of DLLs. However, there must be only one instance of the GC per process/address space. This instance is contained in `nimrtl.dll`. This means that every generated Nim DLL depends on `nimrtl.dll`. To generate the "nimrtl.dll" file, use the command:



```
nim c -d:release lib/nimrtl.nim
```
 To link against `nimrtl.dll` use the command:



```
nim c -d:useNimRtl myprog.nim
```
 **Note**: Currently the creation of `nimrtl.dll` with thread support has never been tested and is unlikely to work!

 Additional compilation switches
-------------------------------


The standard library supports a growing number of `useX` conditional defines affecting how some features are implemented. This section tries to give a complete list.

 

| Define | Effect |
| --- | --- |
| `release` | Turns on the optimizer. More aggressive optimizations are possible, e.g.: `--passC:-ffast-math` (but see issue #10305) |
| `danger` | Turns off all runtime checks and turns on the optimizer. |
| `useFork` | Makes `osproc` use `fork` instead of `posix_spawn`. |
| `useNimRtl` | Compile and link against `nimrtl.dll`. |
| `useMalloc` | Makes Nim use C's malloc instead of Nim's own memory manager, albeit prefixing each allocation with its size to support clearing memory on reallocation. This only works with `gc:none` and with `--newruntime`. |
| `useRealtimeGC` | Enables support of Nim's GC for *soft* realtime systems. See the documentation of the <gc> for further information. |
| `logGC` | Enable GC logging to stdout. |
| `nodejs` | The JS target is actually `node.js`. |
| `ssl` | Enables OpenSSL support for the sockets module. |
| `memProfiler` | Enables memory profiling for the native GC. |
| `uClibc` | Use uClibc instead of libc. (Relevant for Unix-like OSes) |
| `checkAbi` | When using types from C headers, add checks that compare what's in the Nim file with what's in the C header. This may become enabled by default in the future. |
| `tempDir` | This symbol takes a string as its value, like `--define:tempDir:/some/temp/path` to override the temporary directory returned by `os.getTempDir()`. The value **should** end with a directory separator character. (Relevant for the Android platform) |
| `useShPath` | This symbol takes a string as its value, like `--define:useShPath:/opt/sh/bin/sh` to override the path for the `sh` binary, in cases where it is not located in the default location `/bin/sh`. |
| `noSignalHandler` | Disable the crash handler from `system.nim`. |
| `globalSymbols` | Load all `{.dynlib.}` libraries with the `RTLD_GLOBAL` flag on Posix systems to resolve symbols in subsequently loaded libraries. |

 Additional Features
-------------------


This section describes Nim's additional features that are not listed in the Nim manual. Some of the features here only make sense for the C code generator and are subject to change.

 ### LineDir option


The `lineDir` option can be turned on or off. If turned on the generated C code contains `#line` directives. This may be helpful for debugging with GDB.

 ### StackTrace option


If the `stackTrace` option is turned on, the generated C contains code to ensure that proper stack traces are given if the program crashes or some uncaught exception is raised.

 ### LineTrace option


The `lineTrace` option implies the `stackTrace` option. If turned on, the generated C contains code to ensure that proper stack traces with line number information are given if the program crashes or an uncaught exception is raised.

 DynlibOverride
--------------


By default Nim's `dynlib` pragma causes the compiler to generate `GetProcAddress` (or their Unix counterparts) calls to bind to a DLL. With the `dynlibOverride` command line switch this can be prevented and then via `--passL` the static library can be linked against. For instance, to link statically against Lua this command might work on Linux:



```
nim c --dynlibOverride:lua --passL:liblua.lib program.nim
```
 Backend language options
------------------------


The typical compiler usage involves using the `compile` or `c` command to transform a `.nim` file into one or more `.c` files which are then compiled with the platform's C compiler into a static binary. However, there are other commands to compile to C++, Objective-C, or JavaScript. More details can be read in the [Nim Backend Integration document](backends).

 Nim documentation tools
-----------------------


Nim provides the doc command to generate HTML documentation from `.nim` source files. Only exported symbols will appear in the output. For more details [see the docgen documentation](https://nim-lang.org/docs/docgen.html).

 Nim idetools integration
------------------------


Nim provides language integration with external IDEs through the idetools command. See the documentation of <idetools> for further information.

 Nim for embedded systems
------------------------


While the default Nim configuration is targeted for optimal performance on modern PC hardware and operating systems with ample memory, it is very well possible to run Nim code and a good part of the Nim standard libraries on small embedded microprocessors with only a few kilobytes of memory.

 A good start is to use the `any` operating target together with the `malloc` memory allocator and the `arc` garbage collector. For example:

 `nim c --os:any --gc:arc -d:useMalloc [...] x.nim`

 * `--gc:arc` will enable the reference counting memory management instead of the default garbage collector. This enables Nim to use heap memory which is required for strings and seqs, for example.
* The `--os:any` target makes sure Nim does not depend on any specific operating system primitives. Your platform should support only some basic ANSI C library `stdlib` and `stdio` functions which should be available on almost any platform.
* The `-d:useMalloc` option configures Nim to use only the standard C memory manage primitives `malloc()`, `free()`, `realloc()`.

 If your platform does not provide these functions it should be trivial to provide an implementation for them and link these to your program.

 For targets with very restricted memory, it might be beneficial to pass some additional flags to both the Nim compiler and the C compiler and/or linker to optimize the build for size. For example, the following flags can be used when targeting a gcc compiler:

 `--opt:size --passC:-flto --passL:-flto`

 The `--opt:size` flag instructs Nim to optimize code generation for small size (with the help of the C compiler), the `flto` flags enable link-time optimization in the compiler and linker.

 Check the `Cross-compilation` section for instructions on how to compile the program for your target.

 Nim for realtime systems
------------------------


See the documentation of Nim's soft realtime [GC](gc) for further information.

 Signal handling in Nim
----------------------


The Nim programming language has no concept of Posix's signal handling mechanisms. However, the standard library offers some rudimentary support for signal handling, in particular, segmentation faults are turned into fatal errors that produce a stack trace. This can be disabled with the `-d:noSignalHandler` switch.

 Optimizing for Nim
------------------


Nim has no separate optimizer, but the C code that is produced is very efficient. Most C compilers have excellent optimizers, so usually it is not needed to optimize one's code. Nim has been designed to encourage efficient code: The most readable code in Nim is often the most efficient too.

 However, sometimes one has to optimize. Do it in the following order:

 1. switch off the embedded debugger (it is **slow**!)
2. turn on the optimizer and turn off runtime checks
3. profile your code to find where the bottlenecks are
4. try to find a better algorithm
5. do low-level optimizations

 This section can only help you with the last item.

 ### Optimizing string handling


String assignments are sometimes expensive in Nim: They are required to copy the whole string. However, the compiler is often smart enough to not copy strings. Due to the argument passing semantics, strings are never copied when passed to subroutines. The compiler does not copy strings that are a result of a procedure call, because the callee returns a new string anyway. Thus it is efficient to do:

 
```
var s = procA() # assignment will not copy the string; procA allocates a new
                # string already
```

However, it is not efficient to do:

 
```
var s = varA    # assignment has to copy the whole string into a new buffer!
```

For `let` symbols a copy is not always necessary:

 
```
let s = varA    # may only copy a pointer if it safe to do so
```

If you know what you're doing, you can also mark single-string (or sequence) objects as shallow:

 
```
var s = "abc"
shallow(s) # mark 's' as a shallow string
var x = s  # now might not copy the string!
```

Usage of `shallow` is always safe once you know the string won't be modified anymore, similar to Ruby's freeze.

 The compiler optimizes string case statements: A hashing scheme is used for them if several different string constants are used. So code like this is reasonably efficient:

 
```
case normalize(k.key)
of "name": c.name = v
of "displayname": c.displayName = v
of "version": c.version = v
of "os": c.oses = split(v, {';'})
of "cpu": c.cpus = split(v, {';'})
of "authors": c.authors = split(v, {';'})
of "description": c.description = v
of "app":
  case normalize(v)
  of "console": c.app = appConsole
  of "gui": c.app = appGUI
  else: quit(errorStr(p, "expected: console or gui"))
of "license": c.license = UnixToNativePath(k.value)
else: quit(errorStr(p, "unknown variable: " & k.key))
```


 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nimc.html>

Nim's Memory Management
=======================

 
> "The road to hell is paved with good intentions."
> 
> 

 Introduction
------------


This document describes how the multi-paradigm memory management strategies work. How to tune the garbage collectors for your needs, like (soft) realtime systems, and how the memory management strategies that are not garbage collectors work.

 Multi-paradigm Memory Management Strategies
-------------------------------------------


To choose the memory management strategy use the `--gc:` switch.

 * `--gc:refc`. This is the default GC. It's a deferred reference counting based garbage collector with a simple Mark&Sweep backup GC in order to collect cycles. Heaps are thread-local.
* `--gc:markAndSweep`. Simple Mark-And-Sweep based garbage collector. Heaps are thread-local.
* `--gc:boehm`. Boehm based garbage collector, it offers a shared heap.
* `--gc:go`. Go's garbage collector, useful for interoperability with Go. Offers a shared heap.
* `--gc:arc`. Plain reference counting with [move semantic optimizations](destructors#move-semantics), offers a shared heap. It offers deterministic performance for hard realtime systems. Reference cycles cause memory leaks, beware.
* `--gc:orc`. Same as `--gc:arc` but adds a cycle collector based on "trial deletion". Unfortunately, that makes its performance profile hard to reason about so it is less useful for hard real-time systems.
* `--gc:none`. No memory management strategy nor a garbage collector. Allocated memory is simply never freed. You should use `--gc:arc` instead.

 

| Memory Management | Heap | Reference Cycles | Stop-The-World | Command line switch |
| --- | --- | --- | --- | --- |
| RefC | Local | Cycle Collector | No | `--gc:refc` |
| Mark & Sweep | Local | Cycle Collector | No | `--gc:markAndSweep` |
| ARC | Shared | Leak | No | `--gc:arc` |
| ORC | Shared | Cycle Collector | No | `--gc:orc` |
| Boehm | Shared | Cycle Collector | Yes | `--gc:boehm` |
| Go | Shared | Cycle Collector | Yes | `--gc:go` |
| None | Manual | Manual | Manual | `--gc:none` |


JavaScript's garbage collector is used for the [JavaScript and NodeJS](backends#backends-the-javascript-target) compilation targets. The [NimScript](nims) target uses the memory management strategy built into the Nim compiler.

 Tweaking the refc GC
--------------------

 ### Cycle collector


The cycle collector can be en-/disabled independently from the other parts of the garbage collector with `GC_enableMarkAndSweep` and `GC_disableMarkAndSweep`.

 ### Soft real-time support


To enable real-time support, the symbol useRealtimeGC needs to be defined via `--define:useRealtimeGC` (you can put this into your config file as well). With this switch the garbage collector supports the following operations:

 
```
proc GC_setMaxPause*(maxPauseInUs: int)
proc GC_step*(us: int, strongAdvice = false, stackSize = -1)
```

The unit of the parameters `maxPauseInUs` and `us` is microseconds.

 These two procs are the two modus operandi of the real-time garbage collector:

 (1) GC\_SetMaxPause Mode

 
> You can call `GC_SetMaxPause` at program startup and then each triggered garbage collector run tries to not take longer than `maxPause` time. However, it is possible (and common) that the work is nevertheless not evenly distributed as each call to `new` can trigger the garbage collector and thus take `maxPause` time.
> 
> 

 (2) GC\_step Mode

 
> 
> This allows the garbage collector to perform some work for up to `us` time. This is useful to call in the main loop to ensure the garbage collector can do its work. To bind all garbage collector activity to a `GC_step` call, deactivate the garbage collector with `GC_disable` at program startup. If `strongAdvice` is set to `true`, then the garbage collector will be forced to perform the collection cycle. Otherwise, the garbage collector may decide not to do anything, if there is not much garbage to collect. You may also specify the current stack size via `stackSize` parameter. It can improve performance when you know that there are no unique Nim references below a certain point on the stack. Make sure the size you specify is greater than the potential worst-case size.
> 
>  It can improve performance when you know that there are no unique Nim references below a certain point on the stack. Make sure the size you specify is greater than the potential worst-case size.
> 
>  

 These procs provide a "best effort" real-time guarantee; in particular the cycle collector is not aware of deadlines. Deactivate it to get more predictable real-time behaviour. Tests show that a 1ms max pause time will be met in almost all cases on modern CPUs (with the cycle collector disabled).

 ### Time measurement with garbage collectors


The garbage collectors' way of measuring time uses (see `lib/system/timers.nim` for the implementation):

 1. `QueryPerformanceCounter` and `QueryPerformanceFrequency` on Windows.
2. `mach_absolute_time` on Mac OS X.
3. `gettimeofday` on Posix systems.

 As such it supports a resolution of nanoseconds internally; however, the API uses microseconds for convenience.

 Define the symbol `reportMissedDeadlines` to make the garbage collector output whenever it missed a deadline. The reporting will be enhanced and supported by the API in later versions of the collector.

 ### Tweaking the garbage collector


The collector checks whether there is still time left for its work after every `workPackage`'th iteration. This is currently set to 100 which means that up to 100 objects are traversed and freed before it checks again. Thus `workPackage` affects the timing granularity and may need to be tweaked in highly specialized environments or for older hardware.

 Keeping track of memory
-----------------------


If you need to pass around memory allocated by Nim to C, you can use the procs `GC_ref` and `GC_unref` to mark objects as referenced to avoid them being freed by the garbage collector. Other useful procs from <system> you can use to keep track of memory are:

 * `getTotalMem()` Returns the amount of total memory managed by the garbage collector.
* `getOccupiedMem()` Bytes reserved by the garbage collector and used by objects.
* `getFreeMem()` Bytes reserved by the garbage collector and not in use.
* `GC_getStatistics()` Garbage collector statistics as a human-readable string.

 These numbers are usually only for the running thread, not for the whole heap, with the exception of `--gc:boehm` and `--gc:go`.

 In addition to `GC_ref` and `GC_unref` you can avoid the garbage collector by manually allocating memory with procs like `alloc`, `alloc0`, `allocShared`, `allocShared0` or `allocCStringArray`. The garbage collector won't try to free them, you need to call their respective *dealloc* pairs (`dealloc`, `deallocShared`, `deallocCStringArray`, etc) when you are done with them or they will leak.

 Heap dump
---------


The heap dump feature is still in its infancy, but it already proved useful for us, so it might be useful for you. To get a heap dump, compile with `-d:nimTypeNames` and call `dumpNumberOfInstances` at a strategic place in your program. This produces a list of the used types in your program and for every type the total amount of object instances for this type as well as the total amount of bytes these instances take up. This list is currently unsorted! You need to use external shell script hacking to sort it.

 The numbers count the number of objects in all garbage collector heaps, they refer to all running threads, not only to the current thread. (The current thread would be the thread that calls `dumpNumberOfInstances`.) This might change in later versions. 

 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/gc.html>

Source Code Filters
===================


A `Source Code Filter (SCF)` transforms the input character stream to an in-memory output stream before parsing. A filter can be used to provide templating systems or preprocessors.

 To use a filter for a source file the `#?` notation is used:



```
#? stdtmpl(subsChar = '$', metaChar = '#')
#proc generateXML(name, age: string): string =
#  result = ""
<xml>
  <name>$name</name>
  <age>$age</age>
</xml>
```
 As the example shows, passing arguments to a filter can be done just like an ordinary procedure call with named or positional arguments. The available parameters depend on the invoked filter. Before version 0.12.0 of the language `#!` was used instead of `#?`.

 **Hint:** With `--hint[codeBegin]:on` or `--verbosity:2` (or higher) while compiling or `nim check`, Nim lists the processed code after each filter application.

 Usage
-----


First, put your SCF code in a separate file with filters specified in the first line. **Note:** You can name your SCF file with any file extension you want, but the conventional extension is `.nimf` (it used to be `.tmpl` but that was too generic, for example preventing github to recognize it as Nim source file).

 If we use `generateXML` code shown above and call the SCF file `xmlGen.nimf` In your `main.nim`:

 
```
include "xmlGen.nimf"

echo generateXML("John Smith","42")
```
 Pipe operator
-------------


Filters can be combined with the `|` pipe operator:



```
#? strip(startswith="<") | stdtmpl
#proc generateXML(name, age: string): string =
#  result = ""
<xml>
  <name>$name</name>
  <age>$age</age>
</xml>
```
 Available filters
-----------------

 ### Replace filter


The replace filter replaces substrings in each line.

 Parameters and their defaults:

 
`sub: string = ""` the substring that is searched for `by: string = ""` the string the substring is replaced with  ### Strip filter


The strip filter simply removes leading and trailing whitespace from each line.

 Parameters and their defaults:

 
`startswith: string = ""` strip only the lines that start with *startswith* (ignoring leading whitespace). If empty every line is stripped. `leading: bool = true` strip leading whitespace `trailing: bool = true` strip trailing whitespace  ### StdTmpl filter


The stdtmpl filter provides a simple templating engine for Nim. The filter uses a line based parser: Lines prefixed with a *meta character* (default: `#`) contain Nim code, other lines are verbatim. Because indentation-based parsing is not suited for a templating engine, control flow statements need `end X` delimiters.

 Parameters and their defaults:

 
`metaChar: char = '#'` prefix for a line that contains Nim code `subsChar: char = '$'` prefix for a Nim expression within a template line `conc: string = " & "` the operation for concatenation `emit: string = "result.add"` the operation to emit a string literal `toString: string = "$"` the operation that is applied to each expression  Example:



```
#? stdtmpl | standard
#proc generateHTMLPage(title, currentTab, content: string,
#                      tabs: openArray[string]): string =
#  result = ""
<head><title>$title</title></head>
<body>
  <div id="menu">
    <ul>
  #for tab in items(tabs):
    #if currentTab == tab:
    <li><a id="selected"
    #else:
    <li><a
    #end if
    href="${tab}.html">$tab</a></li>
  #end for
    </ul>
  </div>
  <div id="content">
    $content
    A dollar: $$.
  </div>
</body>
```
 The filter transforms this into:

 
```
proc generateHTMLPage(title, currentTab, content: string,
                      tabs: openArray[string]): string =
  result = ""
  result.add("<head><title>" & $(title) & "</title></head>\n" &
    "<body>\n" &
    "  <div id=\"menu\">\n" &
    "    <ul>\n")
  for tab in items(tabs):
    if currentTab == tab:
      result.add("    <li><a id=\"selected\" \n")
    else:
      result.add("    <li><a\n")
    #end
    result.add("    href=\"" & $(tab) & ".html\">" & $(tab) & "</a></li>\n")
  #end
  result.add("    </ul>\n" &
    "  </div>\n" &
    "  <div id=\"content\">\n" &
    "    " & $(content) & "\n" &
    "    A dollar: $.\n" &
    "  </div>\n" &
    "</body>\n")
```

Each line that does not start with the meta character (ignoring leading whitespace) is converted to a string literal that is added to `result`.

 The substitution character introduces a Nim expression *e* within the string literal. *e* is converted to a string with the *toString* operation which defaults to `$`. For strong type checking, set `toString` to the empty string. *e* must match this PEG pattern:



```
e <- [a-zA-Z\128-\255][a-zA-Z0-9\128-\255_.]* / '{' x '}'
x <- '{' x+ '}' / [^}]*
```
 To produce a single substitution character it has to be doubled: `$$` produces `$`.

 The template engine is quite flexible. It is easy to produce a procedure that writes the template code directly to a file:



```
#? stdtmpl(emit="f.write") | standard
#proc writeHTMLPage(f: File, title, currentTab, content: string,
#                   tabs: openArray[string]) =
<head><title>$title</title></head>
<body>
  <div id="menu">
    <ul>
  #for tab in items(tabs):
    #if currentTab == tab:
    <li><a id="selected"
    #else:
    <li><a
    #end if
    href="${tab}.html" title = "$title - $tab">$tab</a></li>
  #end for
    </ul>
  </div>
  <div id="content">
    $content
    A dollar: $$.
  </div>
</body>
```


 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/filters.html>

Internals of the Nim Compiler
=============================



> "Abstraction is layering ignorance on top of reality." -- Richard Gabriel
> 
> 

 Directory structure
-------------------


The Nim project's directory structure is:

 

| Path | Purpose |
| --- | --- |
| `bin` | generated binary files |
| `build` | generated C code for the installation |
| `compiler` | the Nim compiler itself; note that this code has been translated from a bootstrapping version written in Pascal, so the code is **not** a poster child of good Nim code |
| `config` | configuration files for Nim |
| `dist` | additional packages for the distribution |
| `doc` | the documentation; it is a bunch of reStructuredText files |
| `lib` | the Nim library |
| `web` | website of Nim; generated by `nimweb` from the `*.txt` and `*.nimf` files |

 Bootstrapping the compiler
--------------------------


Compiling the compiler is a simple matter of running:



```
nim c koch.nim
./koch boot
```
 For a release version use:



```
nim c koch.nim
./koch boot -d:release
```
 And for a debug version compatible with GDB:



```
nim c koch.nim
./koch boot --debuginfo --linedir:on
```
 The `koch` program is Nim's maintenance script. It is a replacement for make and shell scripting with the advantage that it is much more portable. More information about its options can be found in the <koch> documentation.

 Coding Guidelines
-----------------


* Use CamelCase, not underscored\_identifiers.
* Indent with two spaces.
* Max line length is 80 characters.
* Provide spaces around binary operators if that enhances readability.
* Use a space after a colon, but not before it.
* [deprecated] Start types with a capital `T`, unless they are pointers/references which start with `P`.

 See also the [API naming design](apis) document.

 Porting to new platforms
------------------------


Porting Nim to a new architecture is pretty easy, since C is the most portable programming language (within certain limits) and Nim generates C code, porting the code generator is not necessary.

 POSIX-compliant systems on conventional hardware are usually pretty easy to port: Add the platform to `platform` (if it is not already listed there), check that the OS, System modules work and recompile Nim.

 The only case where things aren't as easy is when the garbage collector needs some assembler tweaking to work. The standard version of the GC uses C's `setjmp` function to store all registers on the hardware stack. It may be necessary that the new platform needs to replace this generic code by some assembler code.

 Runtime type information
------------------------


*Runtime type information* (RTTI) is needed for several aspects of the Nim programming language:

 
Garbage collection The most important reason for RTTI. Generating traversal procedures produces bigger code and is likely to be slower on modern hardware as dynamic procedure binding is hard to predict. Complex assignments Sequences and strings are implemented as pointers to resizeable buffers, but Nim requires copying for assignments. Apart from RTTI the compiler could generate copy procedures for any type that needs one. However, this would make the code bigger and the RTTI is likely already there for the GC.  We already know the type information as a graph in the compiler. Thus we need to serialize this graph as RTTI for C code generation. Look at the file `lib/system/hti.nim` for more information.

 Rebuilding the compiler
-----------------------


After an initial build via `sh build_all.sh` on posix or `build_all.bat` on windows, you can rebuild the compiler as follows:

 * `nim c koch` if you need to rebuild koch
* `./koch boot -d:release` this ensures the compiler can rebuild itself (use `koch` instead of `./koch` on windows), which builds the compiler 3 times.

 A faster approach if you don't need to run the full bootstrapping implied by `koch boot`, is the following:

 * `pathto/nim c --lib:lib -d:release -o:bin/nim_temp compiler/nim.nim`

 Where `pathto/nim` is any nim binary sufficiently recent (e.g. `bin/nim_cources` built during bootstrap or `$HOME/.nimble/bin/nim` installed by `choosenim 1.2.0`)

 You can pass any additional options such as `-d:leanCompiler` if you don't need certain features or `-d:debug --stacktrace:on --excessiveStackTrace --stackTraceMsgs` for debugging the compiler. See also [Debugging the compiler](intern#debugging-the-compiler).

 Debugging the compiler
----------------------


You can of course use GDB or Visual Studio to debug the compiler (via `--debuginfo --lineDir:on`). However, there are also lots of procs that aid in debugging:

 
```
# pretty prints the Nim AST
echo renderTree(someNode)
# outputs some JSON representation
debug(someNode)
# pretty prints some type
echo typeToString(someType)
debug(someType)
echo symbol.name.s
debug(symbol)
# pretty prints the Nim ast, but annotates symbol IDs:
echo renderTree(someNode, {renderIds})
if `??`(conf, n.info, "temp.nim"):
  # only output when it comes from "temp.nim"
  echo renderTree(n)
if `??`(conf, n.info, "temp.nim"):
  # why does it process temp.nim here?
  writeStackTrace()
```

These procs may not be imported by a module. You can import them directly for debugging:

 
```
from astalgo import debug
from types import typeToString
from renderer import renderTree
from msgs import `??`
```

To create a new compiler for each run, use `koch temp`:



```
./koch temp c /tmp/test.nim
```
 `koch temp` creates a debug build of the compiler, which is useful to create stacktraces for compiler debugging. See also [Rebuilding the compiler](intern#rebuilding-the-compiler) if you need more control.

 Bisecting for regressions
-------------------------


`koch temp` returns 125 as the exit code in case the compiler compilation fails. This exit code tells `git bisect` to skip the current commit.:



```
git bisect start bad-commit good-commit
git bisect run ./koch temp -r c test-source.nim
```
 You can also bisect using custom options to build the compiler, for example if you don't need a debug version of the compiler (which runs slower), you can replace `./koch temp` by explicit compilation command, see [Rebuilding the compiler](intern#rebuilding-the-compiler).

 The compiler's architecture
---------------------------


Nim uses the classic compiler architecture: A lexer/scanner feds tokens to a parser. The parser builds a syntax tree that is used by the code generator. This syntax tree is the interface between the parser and the code generator. It is essential to understand most of the compiler's code.

 In order to compile Nim correctly, type-checking has to be separated from parsing. Otherwise generics cannot work.

 ### Short description of Nim's modules




| Module | Description |
| --- | --- |
| nim | main module: parses the command line and calls `main.MainCommand` |
| main | implements the top-level command dispatching |
| nimconf | implements the config file reader |
| syntaxes | dispatcher for the different parsers and filters |
| filter\_tmpl | standard template filter (`#? stdtempl`) |
| lexbase | buffer handling of the lexical analyser |
| lexer | lexical analyser |
| parser | Nim's parser |
| renderer | Nim code renderer (AST back to its textual form) |
| options | contains global and local compiler options |
| ast | type definitions of the abstract syntax tree (AST) and node constructors |
| astalgo | algorithms for containers of AST nodes; converting the AST to YAML; the symbol table |
| passes | implement the passes manager for passes over the AST |
| trees | some algorithms for nodes; this module is less important |
| types | module for traversing type graphs; also contain several helpers for dealing with types |
|  |  |
| sigmatch | contains the matching algorithm that is used for proc calls |
| semexprs | contains the semantic checking phase for expressions |
| semstmts | contains the semantic checking phase for statements |
| semtypes | contains the semantic checking phase for types |
| seminst | instantiation of generic procs and types |
| semfold | contains code to deal with constant folding |
| semthreads | deep program analysis for threads |
| evals | contains an AST interpreter for compile time evaluation |
| pragmas | semantic checking of pragmas |
|  |  |
| idents | implements a general mapping from identifiers to an internal representation (`PIdent`) that is used so that a simple id-comparison suffices to establish whether two Nim identifiers are equivalent |
| ropes | implements long strings represented as trees for lazy evaluation; used mainly by the code generators |
|  |  |
| transf | transformations on the AST that need to be done before code generation |
| cgen | main file of the C code generator |
| ccgutils | contains helpers for the C code generator |
| ccgtypes | the generator for C types |
| ccgstmts | the generator for statements |
| ccgexprs | the generator for expressions |
| extccomp | this module calls the C compiler and linker; interesting if you want to add support for a new C compiler |

 ### The syntax tree


The syntax tree consists of nodes which may have an arbitrary number of children. Types and symbols are represented by other nodes, because they may contain cycles. The AST changes its shape after semantic checking. This is needed to make life easier for the code generators. See the "ast" module for the type definitions. The <macros> module contains many examples how the AST represents each syntactic structure.

 How the RTL is compiled
-----------------------


The `system` module contains the part of the RTL which needs support by compiler magic (and the stuff that needs to be in it because the spec says so). The C code generator generates the C code for it, just like any other module. However, calls to some procedures like `addInt` are inserted by the CCG. Therefore the module `magicsys` contains a table (`compilerprocs`) with all symbols that are marked as `compilerproc`. `compilerprocs` are needed by the code generator. A `magic` proc is not the same as a `compilerproc`: A `magic` is a proc that needs compiler magic for its semantic checking, a `compilerproc` is a proc that is used by the code generator.

 Compilation cache
-----------------


The implementation of the compilation cache is tricky: There are lots of issues to be solved for the front- and backend.

 ### General approach: AST replay


We store a module's AST of a successful semantic check in a SQLite database. There are plenty of features that require a sub sequence to be re-applied, for example:

 
```
{.compile: "foo.c".} # even if the module is loaded from the DB,
                     # "foo.c" needs to be compiled/linked.
```

The solution is to **re-play** the module's top level statements. This solves the problem without having to special case the logic that fills the internal seqs which are affected by the pragmas.

 In fact, this describes how the AST should be stored in the database, as a "shallow" tree. Let's assume we compile module `m` with the following contents:

 
```
import strutils

var x*: int = 90
{.compile: "foo.c".}
proc p = echo "p"
proc q = echo "q"
static:
  echo "static"
```

Conceptually this is the AST we store for the module:

 
```
import strutils

var x*
{.compile: "foo.c".}
proc p
proc q
static:
  echo "static"
```

The symbol's `ast` field is loaded lazily, on demand. This is where most savings come from, only the shallow outer AST is reconstructed immediately.

 It is also important that the replay involves the `import` statement so that dependencies are resolved properly.

 ### Shared global compiletime state


Nim allows `.global, compiletime` variables that can be filled by macro invocations across different modules. This feature breaks modularity in a severe way. Plenty of different solutions have been proposed:

 * Restrict the types of global compiletime variables to `Set[T]` or similar unordered, only-growable collections so that we can track the module's write effects to these variables and reapply the changes in a different order.
* In every module compilation, reset the variable to its default value.
* Provide a restrictive API that can load/save the compiletime state to a file.

 (These solutions are not mutually exclusive.)

 Since we adopt the "replay the top level statements" idea, the natural solution to this problem is to emit pseudo top level statements that reflect the mutations done to the global variable. However, this is MUCH harder than it sounds, for example `squeaknim` uses this snippet:

 
```
apicall.add(") module: '" & dllName & "'>\C" &
            "\t^self externalCallFailed\C!\C\C")
stCode.add(st & "\C\t\"Generated by NimSqueak\"\C\t" & apicall)
```

We can "replay" `stCode.add` only if the values of `st` and `apicall` are known. And even then a hash table's `add` with its hashing mechanism is too hard to replay.

 In practice, things are worse still, consider `someGlobal[i][j].add arg`. We only know the root is `someGlobal` but the concrete path to the data is unknown as is the value that is added. We could compute a "diff" between the global states and use that to compute a symbol patchset, but this is quite some work, expensive to do at runtime (it would need to run after every module has been compiled) and would also break for hash tables.

 We need an API that hides the complex aliasing problems by not relying on Nim's global variables. The obvious solution is to use string keys instead of global variables:

 
```
proc cachePut*(key: string; value: string)
proc cacheGet*(key: string): string
```

However, the values being strings/json is quite problematic: Many lookup tables that are built at compiletime embed *proc vars* and types which have no obvious string representation... Seems like AST diffing is still the best idea as it will not require to use an alien API and works with some existing Nimble packages, at least.

 On the other hand, in Nim's future I would like to replace the VM by native code. A diff algorithm wouldn't work for that. Instead the native code would work with an API like `put`, `get`:

 
```
proc cachePut*(key: string; value: NimNode)
proc cacheGet*(key: string): NimNode
```

The API should embrace the AST diffing notion: See the module `macrocache` for the final details.

 ### Methods and type converters


In the following sections *global* means *shared between modules* or *property of the whole program*.

 Nim contains language features that are *global*. The best example for that are multi methods: Introducing a new method with the same name and some compatible object parameter means that the method's dispatcher needs to take the new method into account. So the dispatching logic is only completely known after the whole program has been translated!

 Other features that are *implicitly* triggered cause problems for modularity too. Type converters fall into this category:

 
```
# module A
converter toBool(x: int): bool =
  result = x != 0
```


```
# module B
import A

if 1:
  echo "ugly, but should work"
```

If in the above example module `B` is re-compiled, but `A` is not then `B` needs to be aware of `toBool` even though `toBool` is not referenced in `B` *explicitly*.

 Both the multi method and the type converter problems are solved by the AST replay implementation.

 #### Generics


We cache generic instantiations and need to ensure this caching works well with the incremental compilation feature. Since the cache is attached to the `PSym` datastructure, it should work without any special logic.

 ### Backend issues


* Init procs must not be "forgotten" to be called.
* Files must not be "forgotten" to be linked.
* Method dispatchers are global.
* DLL loading via `dlsym` is global.
* Emulated thread vars are global.

 However the biggest problem is that dead code elimination breaks modularity! To see why, consider this scenario: The module `G` (for example the huge Gtk2 module...) is compiled with dead code elimination turned on. So none of `G`'s procs is generated at all.

 Then module `B` is compiled that requires `G.P1`. Ok, no problem, `G.P1` is loaded from the symbol file and `G.c` now contains `G.P1`.

 Then module `A` (that depends on `B` and `G`) is compiled and `B` and `G` are left unchanged. `A` requires `G.P2`.

 So now `G.c` MUST contain both `P1` and `P2`, but we haven't even loaded `P1` from the symbol file, nor do we want to because we then quickly would restore large parts of the whole program.

 #### Solution


The backend must have some logic so that if the currently processed module is from the compilation cache, the `ast` field is not accessed. Instead the generated C(++) for the symbol's body needs to be cached too and inserted back into the produced C file. This approach seems to deal with all the outlined problems above.

 Debugging Nim's memory management
---------------------------------


The following paragraphs are mostly a reminder for myself. Things to keep in mind:

 * If an assertion in Nim's memory manager or GC fails, the stack trace keeps allocating memory! Thus a stack overflow may happen, hiding the real issue.
* What seem to be C code generation problems is often a bug resulting from not producing prototypes, so that some types default to `cint`. Testing without the `-w` option helps!

 The Garbage Collector
---------------------

 ### Introduction


I use the term *cell* here to refer to everything that is traced (sequences, refs, strings). This section describes how the GC works.

 The basic algorithm is *Deferrent Reference Counting* with cycle detection. References on the stack are not counted for better performance and easier C code generation.

 Each cell has a header consisting of a RC and a pointer to its type descriptor. However the program does not know about these, so they are placed at negative offsets. In the GC code the type `PCell` denotes a pointer decremented by the right offset, so that the header can be accessed easily. It is extremely important that `pointer` is not confused with a `PCell` as this would lead to a memory corruption.

 ### The CellSet data structure


The GC depends on an extremely efficient datastructure for storing a set of pointers - this is called a `TCellSet` in the source code. Inserting, deleting and searching are done in constant time. However, modifying a `TCellSet` during traversal leads to undefined behaviour.

 
```
type
  TCellSet # hidden

proc cellSetInit(s: var TCellSet) # initialize a new set
proc cellSetDeinit(s: var TCellSet) # empty the set and free its memory
proc incl(s: var TCellSet, elem: PCell) # include an element
proc excl(s: var TCellSet, elem: PCell) # exclude an element

proc `in`(elem: PCell, s: TCellSet): bool # tests membership

iterator elements(s: TCellSet): (elem: PCell)
```

All the operations have to perform efficiently. Because a Cellset can become huge a hash table alone is not suitable for this.

 We use a mixture of bitset and hash table for this. The hash table maps *pages* to a page descriptor. The page descriptor contains a bit for any possible cell address within this page. So including a cell is done as follows:

 * Find the page descriptor for the page the cell belongs to.
* Set the appropriate bit in the page descriptor indicating that the cell points to the start of a memory block.

 Removing a cell is analogous - the bit has to be set to zero. Single page descriptors are never deleted from the hash table. This is not needed as the data structures needs to be rebuilt periodically anyway.

 Complete traversal is done in this way:



```
for each page descriptor d:
  for each bit in d:
    if bit == 1:
      traverse the pointer belonging to this bit
```
 ### Further complications


In Nim the compiler cannot always know if a reference is stored on the stack or not. This is caused by var parameters. Consider this example:

 
```
proc setRef(r: var ref TNode) =
  new(r)

proc usage =
  var
    r: ref TNode
  setRef(r) # here we should not update the reference counts, because
            # r is on the stack
  setRef(r.left) # here we should update the refcounts!
```

We have to decide at runtime whether the reference is on the stack or not. The generated code looks roughly like this:

 
```
void setref(TNode** ref) {
  unsureAsgnRef(ref, newObj(TNode_TI, sizeof(TNode)))
}
void usage(void) {
  setRef(&r)
  setRef(&r->left)
}
```

Note that for systems with a continuous stack (which most systems have) the check whether the ref is on the stack is very cheap (only two comparisons).

 Code generation for closures
----------------------------


Code generation for closures is implemented by lambda lifting.

 ### Design


A `closure` proc var can call ordinary procs of the default Nim calling convention. But not the other way round! A closure is implemented as a `tuple[prc, env]`. `env` can be nil implying a call without a closure. This means that a call through a closure generates an `if` but the interoperability is worth the cost of the `if`. Thunk generation would be possible too, but it's slightly more effort to implement.

 Tests with GCC on Amd64 showed that it's really beneficial if the 'environment' pointer is passed as the last argument, not as the first argument.

 Proper thunk generation is harder because the proc that is to wrap could stem from a complex expression:

 
```
receivesClosure(returnsDefaultCC[i])
```

A thunk would need to call 'returnsDefaultCC[i]' somehow and that would require an *additional* closure generation... Ok, not really, but it requires to pass the function to call. So we'd end up with 2 indirect calls instead of one. Another much more severe problem which this solution is that it's not GC-safe to pass a proc pointer around via a generic `ref` type.

 Example code:

 
```
proc add(x: int): proc (y: int): int {.closure.} =
  return proc (y: int): int =
    return x + y

var add2 = add(2)
echo add2(5) #OUT 7
```

This should produce roughly this code:

 
```
type
  PEnv = ref object
    x: int # data

proc anon(y: int, c: PEnv): int =
  return y + c.x

proc add(x: int): tuple[prc, data] =
  var env: PEnv
  new env
  env.x = x
  result = (anon, env)

var add2 = add(2)
let tmp = if add2.data == nil: add2.prc(5) else: add2.prc(5, add2.data)
echo tmp
```

Beware of nesting:

 
```
proc add(x: int): proc (y: int): proc (z: int): int {.closure.} {.closure.} =
  return lambda (y: int): proc (z: int): int {.closure.} =
    return lambda (z: int): int =
      return x + y + z

var add24 = add(2)(4)
echo add24(5) #OUT 11
```

This should produce roughly this code:

 
```
type
  PEnvX = ref object
    x: int # data
  
  PEnvY = ref object
    y: int
    ex: PEnvX

proc lambdaZ(z: int, ey: PEnvY): int =
  return ey.ex.x + ey.y + z

proc lambdaY(y: int, ex: PEnvX): tuple[prc, data: PEnvY] =
  var ey: PEnvY
  new ey
  ey.y = y
  ey.ex = ex
  result = (lambdaZ, ey)

proc add(x: int): tuple[prc, data: PEnvX] =
  var ex: PEnvX
  ex.x = x
  result = (labmdaY, ex)

var tmp = add(2)
var tmp2 = tmp.fn(4, tmp.data)
var add24 = tmp2.fn(4, tmp2.data)
echo add24(5)
```

We could get rid of nesting environments by always inlining inner anon procs. More useful is escape analysis and stack allocation of the environment, however.

 ### Alternative


Process the closure of all inner procs in one pass and accumulate the environments. This is however not always possible.

 ### Accumulator



```
proc getAccumulator(start: int): proc (): int {.closure} =
  var i = start
  return lambda: int =
    inc i
    return i

proc p =
  var delta = 7
  proc accumulator(start: int): proc(): int =
    var x = start-1
    result = proc (): int =
      x = x + delta
      inc delta
      return x
  
  var a = accumulator(3)
  var b = accumulator(4)
  echo a() + b()
```
 ### Internals


Lambda lifting is implemented as part of the `transf` pass. The `transf` pass generates code to setup the environment and to pass it around. However, this pass does not change the types! So we have some kind of mismatch here; on the one hand the proc expression becomes an explicit tuple, on the other hand the tyProc(ccClosure) type is not changed. For C code generation it's also important the hidden formal param is `void*` and not something more specialized. However the more specialized env type needs to passed to the backend somehow. We deal with this by modifying `s.ast[paramPos]` to contain the formal hidden parameter, but not `s.typ`!

 ### Integer literals:


In Nim, there is a redundant way to specify the type of an integer literal. First of all, it should be unsurprising that every node has a node kind. The node of an integer literal can be any of the following values:

 
> nkIntLit, nkInt8Lit, nkInt16Lit, nkInt32Lit, nkInt64Lit, nkUIntLit, nkUInt8Lit, nkUInt16Lit, nkUInt32Lit, nkUInt64Lit
> 
> 

 On top of that, there is also the `typ` field for the type. It the kind of the `typ` field can be one of the following ones, and it should be matching the literal kind:

 
> tyInt, tyInt8, tyInt16, tyInt32, tyInt64, tyUInt, tyUInt8, tyUInt16, tyUInt32, tyUInt64
> 
> 

 Then there is also the integer literal type. This is a specific type that is implicitly convertible into the requested type if the requested type can hold the value. For this to work, the type needs to know the concrete value of the literal. For example an expression `321` will be of type `int literal(321)`. This type is implicitly convertible to all integer types and ranges that contain the value `321`. That would be all builtin integer types except `uint8` and `int8` where `321` would be out of range. When this literal type is assigned to a new `var` or `let` variable, it's type will be resolved to just `int`, not `int literal(321)` unlike constants. A constant keeps the full `int literal(321)` type. Here is an example where that difference matters.

 
```
proc foo(arg: int8) =
  echo "def"

const tmp1 = 123
foo(tmp1)  # OK

let tmp2 = 123
foo(tmp2) # Error
```

In a context with multiple overloads, the integer literal kind will always prefer the `int` type over all other types. If none of the overloads is of type `int`, then there will be an error because of ambiguity.

 
```
proc foo(arg: int) =
  echo "abc"
proc foo(arg: int8) =
  echo "def"
foo(123) # output: abc

proc bar(arg: int16) =
  echo "abc"
proc bar(arg: int8) =
  echo "def"

bar(123) # Error ambiguous call
```

In the compiler these integer literal types are represented with the node kind `nkIntLit`, type kind `tyInt` and the member `n` of the type pointing back to the integer literal node in the ast containing the integer value. These are the properties that hold true for integer literal types.

 
> n.kind == nkIntLit n.typ.kind == tyInt n.typ.n == n
> 
> 

 Other literal types, such as `uint literal(123)` that would automatically convert to other integer types, but prefers to become a `uint` are not part of the Nim language.

 In an unchecked AST, the `typ` field is nil. The type checker will set the `typ` field accordingly to the node kind. Nodes of kind `nkIntLit` will get the integer literal type (e.g. `int literal(123)`). Nodes of kind `nkUIntLit` will get type `uint` (kind `tyUint`), etc.

 This also means that it is not possible to write a literal in an unchecked AST that will after sem checking just be of type `int` and not implicitly convertible to other integer types. This only works for all integer types that are not `int`. 



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/intern.html>

Index
=====

 Modules: <aliases>, <asciitables>, <ast>, <astalgo>, <bitsets>, <btrees>, <ccgmerge>, <ccgutils>, <cgen>, <cgendata>, <cgmeth>, <closureiters>, <cmdlinehelper>, <commands>, <condsyms>, <depends>, <dfa>, <docgen>, <docgen2>, <enumtostr>, <evaltempl>, <extccomp>, <filter_tmpl>, <filters>, <gorgeimpl>, <guards>, <idents>, <idgen>, <importer>, <incremental>, <index>, <injectdestructors>, <int128>, <isolation_check>, <jsgen>, <lambdalifting>, <lexer>, <liftdestructors>, <liftlocals>, <lineinfos>, <linter>, <llstream>, <lookups>, <lowerings>, <macrocacheimpl>, <magicsys>, <main>, <modulegraphs>, <modulepaths>, <modules>, <msgs>, <ndi>, <nimblecmd>, <nimconf>, <nimfix/prettybase>, <nimlexbase>, <nimpaths>, <nimsets>, <nodejs>, <nversion>, <optimizer>, <options>, <parampatterns>, <parser>, <passaux>, <passes>, <pathutils>, <patterns>, <platform>, <plugins/active>, <plugins/itersgen>, <plugins/locals>, <pluginsupport>, <pragmas>, <prefixmatches>, <procfind>, <renderer>, <renderverbatim>, <reorder>, <rod>, <rodutils>, <ropes>, <saturate>, <scriptconfig>, <sem>, <semdata>, <semfold>, <semmacrosanity>, <semparallel>, <sempass2>, <semtypinst>, <sighashes>, <sigmatch>, <sourcemap>, <spawn>, <strutils2>, <syntaxes>, <transf>, <trees>, <treetab>, <typeallowed>, <types>, <typesrenderer>, <varpartitions>, <vm>, <vmconv>, <vmdef>, <vmdeps>, <vmgen>, <vmmarshal>, <vmprofiler>, <wordrecg>.  

### API symbols

 
[`$`:](#%60%24%60)
* [ast: `$`(s: PSym): string](ast#%24%2CPSym)
* [ast: `$`(x: TLockLevel): string](ast#%24%2CTLockLevel)
* [int128: `$`(a: Int128): string](int128#%24%2CInt128)
* [lexer: `$`(tok: Token): string](lexer#%24%2CToken)
* [modulegraphs: `$`(u: SigHash): string](modulegraphs#%24%2CSigHash)
* [msgs: `$`(conf: ConfigRef; info: TLineInfo): string](msgs#%24%2CConfigRef%2CTLineInfo)
* [msgs: `$`(info: TLineInfo): string](msgs#%24%2CTLineInfo)
* [nimblecmd: `$`(ver: Version): string](nimblecmd#%24%2CVersion)
* [options: `$`(c: IdeCmd): string](options#%24%2CIdeCmd)
* [pathutils: `$`(x: AnyPath): string](pathutils#%24%2CAnyPath)
* [renderer: `$`(n: PNode): string](renderer#%24%2CPNode)
* [ropes: `$`(r: Rope): string](ropes#%24%2CRope)
* [sigmatch: `$`(suggest: Suggest): string](sigmatch#%24%2CSuggest)
* [sourcemap: `$`(sourceNode: SourceNode): string](sourcemap#%24%2CSourceNode)
* [types: `$`(typ: PType): string](types#%24.t%2CPType)
* [varpartitions: `$`(config: ConfigRef; g: MutationInfo): string](varpartitions#%24%2CConfigRef%2CMutationInfo)
 [`%`:](#%60%25%60)
* [ropes: `%`(frmt: static[FormatStr]; args: openArray[Rope]): Rope](ropes#%25%2Cstatic%5BFormatStr%5D%2CopenArray%5BRope%5D)
 [`&`:](#%60%26amp%3B%60)
* [ropes: `&`(a: openArray[Rope]): Rope](ropes#%26%2CopenArray%5BRope%5D)
* [ropes: `&`(a, b: Rope): Rope](ropes#%26%2CRope%2CRope)
* [ropes: `&`(a: Rope; b: string): Rope](ropes#%26%2CRope%2Cstring)
* [ropes: `&`(a: string; b: Rope): Rope](ropes#%26%2Cstring%2CRope)
 [`<=`:](#%60%26lt%3B%3D%60)
* [int128: `<=`(a: BiggestInt; b: Int128): bool](int128#%3C%3D%2CBiggestInt%2CInt128)
* [int128: `<=`(a: Int128; b: BiggestInt): bool](int128#%3C%3D%2CInt128%2CBiggestInt)
* [int128: `<=`(a, b: Int128): bool](int128#%3C%3D%2CInt128%2CInt128)
 [`<`:](#%60%26lt%3B%60)
* [int128: `<`(a: BiggestInt; b: Int128): bool](int128#%3C%2CBiggestInt%2CInt128)
* [int128: `<`(a: Int128; b: BiggestInt): bool](int128#%3C%2CInt128%2CBiggestInt)
* [int128: `<`(a, b: Int128): bool](int128#%3C%2CInt128%2CInt128)
* [nimblecmd: `<`(ver: Version; ver2: Version): bool](nimblecmd#%3C%2CVersion%2CVersion)
 [`\*=`:](#%60%2A%3D%60)
* [int128: `\*=`(a: var Int128; b: Int128)](int128#%2A%3D%2CInt128%2CInt128)
* [int128: `\*=`(a: var Int128; b: int32): Int128](int128#%2A%3D%2CInt128%2Cint32)
 [`\*`:](#%60%2A%60)
* [int128: `\*`(lhs, rhs: Int128): Int128](int128#%2A%2CInt128%2CInt128)
* [int128: `\*`(a: Int128; b: int32): Int128](int128#%2A%2CInt128%2Cint32)
 [`+=`:](#%60%2B%3D%60)
* [int128: `+=`(a: var Int128; b: Int128)](int128#%2B%3D%2CInt128%2CInt128)
 [`+`:](#%60%2B%60)
* [int128: `+`(a: BiggestInt; b: Int128): Int128](int128#%2B%2CBiggestInt%2CInt128)
* [int128: `+`(a: Int128; b: BiggestInt): Int128](int128#%2B%2CInt128%2CBiggestInt)
* [int128: `+`(a, b: Int128): Int128](int128#%2B%2CInt128%2CInt128)
 [`-=`:](#%60-%3D%60)
* [int128: `-=`(a: var Int128; b: Int128)](int128#-%3D%2CInt128%2CInt128)
 [`-`:](#%60-%60)
* [int128: `-`(a: BiggestInt; b: Int128): Int128](int128#-%2CBiggestInt%2CInt128)
* [int128: `-`(a: Int128): Int128](int128#-%2CInt128)
* [int128: `-`(a: Int128; b: BiggestInt): Int128](int128#-%2CInt128%2CBiggestInt)
* [int128: `-`(a, b: Int128): Int128](int128#-%2CInt128%2CInt128)
 [`/`:](#%60/%60)
* [pathutils: `/`(base: AbsoluteDir; f: RelativeDir): AbsoluteDir](pathutils#/%2CAbsoluteDir%2CRelativeDir)
* [pathutils: `/`(base: AbsoluteDir; f: RelativeFile): AbsoluteFile](pathutils#/%2CAbsoluteDir%2CRelativeFile)
 [`==`:](#%60%3D%3D%60)
* [int128: `==`(a: BiggestInt; b: Int128): bool](int128#%3D%3D%2CBiggestInt%2CInt128)
* [int128: `==`(a: Int128; b: BiggestInt): bool](int128#%3D%3D%2CInt128%2CBiggestInt)
* [int128: `==`(a, b: Int128): bool](int128#%3D%3D%2CInt128%2CInt128)
* [lineinfos: `==`(a, b: FileIndex): bool](lineinfos#%3D%3D%2CFileIndex%2CFileIndex)
* [modulegraphs: `==`(a, b: SigHash): bool](modulegraphs#%3D%3D%2CSigHash%2CSigHash)
* [msgs: `==`(a, b: TLineInfo): bool](msgs#%3D%3D%2CTLineInfo%2CTLineInfo)
* [pathutils: `==`[T: AnyPath](x, y: T): bool](pathutils#%3D%3D%2CT%2CT)
 [`??`:](#%60%3F%3F%60)
* [msgs: `??`(conf: ConfigRef; info: TLineInfo; filename: string): bool](msgs#%3F%3F%2CConfigRef%2CTLineInfo%2Cstring)
 [`[]=`:](#%60%5B%5D%3D%60)
* [ast: `[]=`(n: Indexable; i: BackwardsIndex; x: Indexable)](ast#%5B%5D%3D.t%2CIndexable%2CBackwardsIndex%2CIndexable)
* [ast: `[]=`(n: Indexable; i: int; x: Indexable)](ast#%5B%5D%3D.t%2CIndexable%2Cint%2CIndexable)
 [`[]`:](#%60%5B%5D%60)
* [ast: `[]`(n: Indexable; i: BackwardsIndex): Indexable](ast#%5B%5D.t%2CIndexable%2CBackwardsIndex)
* [ast: `[]`(n: Indexable; i: int): Indexable](ast#%5B%5D.t%2CIndexable%2Cint)
 [`div`:](#%60div%60)
* [int128: `div`(a, b: Int128): Int128](int128#div%2CInt128%2CInt128)
 [`mod`:](#%60mod%60)
* [int128: `mod`(a, b: Int128): Int128](int128#mod%2CInt128%2CInt128)
 [`shl`:](#%60shl%60)
* [int128: `shl`(a: Int128; b: int): Int128](int128#shl%2CInt128%2Cint)
 [`shr`:](#%60shr%60)
* [int128: `shr`(a: Int128; b: int): Int128](int128#shr%2CInt128%2Cint)
 [`|\*|`:](#%60%7C%2A%7C%60)
* [saturate: `|\*|`(a, b: BiggestInt): BiggestInt](saturate#%7C%2A%7C%2CBiggestInt%2CBiggestInt)
 [`|+|`:](#%60%7C%2B%7C%60)
* [saturate: `|+|`(a, b: BiggestInt): BiggestInt](saturate#%7C%2B%7C%2CBiggestInt%2CBiggestInt)
 [`|-|`:](#%60%7C-%7C%60)
* [saturate: `|-|`(a, b: BiggestInt): BiggestInt](saturate#%7C-%7C%2CBiggestInt%2CBiggestInt)
 [`|abs|`:](#%60%7Cabs%7C%60)
* [saturate: `|abs|`(a: BiggestInt): BiggestInt](saturate#%7Cabs%7C%2CBiggestInt)
 [`|div|`:](#%60%7Cdiv%7C%60)
* [saturate: `|div|`(a, b: BiggestInt): BiggestInt](saturate#%7Cdiv%7C%2CBiggestInt%2CBiggestInt)
 [`|mod|`:](#%60%7Cmod%7C%60)
* [saturate: `|mod|`(a, b: BiggestInt): BiggestInt](saturate#%7Cmod%7C%2CBiggestInt%2CBiggestInt)
 [`~`:](#%60~%60)
* [ropes: `~`(r: string): Rope](ropes#~.t%2Cstring)
 [abs:](#abs)
* [int128: abs(a: Int128): Int128](int128#abs%2CInt128)
 [AbsoluteDir:](#AbsoluteDir)
* [pathutils: AbsoluteDir](pathutils#AbsoluteDir)
 [AbsoluteFile:](#AbsoluteFile)
* [pathutils: AbsoluteFile](pathutils#AbsoluteFile)
 [absOutFile:](#absOutFile)
* [options: absOutFile(conf: ConfigRef): AbsoluteFile](options#absOutFile%2CConfigRef)
 [abstractInst:](#abstractInst)
* [types: abstractInst](types#abstractInst)
 [abstractInstOwned:](#abstractInstOwned)
* [types: abstractInstOwned](types#abstractInstOwned)
 [abstractPtrs:](#abstractPtrs)
* [types: abstractPtrs](types#abstractPtrs)
 [abstractRange:](#abstractRange)
* [types: abstractRange](types#abstractRange)
 [abstractVar:](#abstractVar)
* [types: abstractVar](types#abstractVar)
 [abstractVarRange:](#abstractVarRange)
* [ast: abstractVarRange](ast#abstractVarRange)
 [add:](#add)
* [ast: add(father, son: Indexable)](ast#add%2CIndexable%2CIndexable)
* [btrees: add[Key, Val](b: var BTree[Key, Val]; key: Key; val: Val)](btrees#add%2CBTree%5BKey%2CVal%5D%2CKey%2CVal)
* [ropes: add(a: var Rope; b: Rope)](ropes#add%2CRope%2CRope)
* [ropes: add(a: var Rope; b: string)](ropes#add%2CRope%2Cstring)
 [addAsgnFact:](#addAsgnFact)
* [guards: addAsgnFact(m: var TModel; key, value: PNode)](guards#addAsgnFact%2CTModel%2CPNode%2CPNode)
 [addCaseBranchFacts:](#addCaseBranchFacts)
* [guards: addCaseBranchFacts(m: var TModel; n: PNode; i: int)](guards#addCaseBranchFacts%2CTModel%2CPNode%2Cint)
 [addCmdPrefix:](#addCmdPrefix)
* [cmdlinehelper: addCmdPrefix(result: var string; kind: CmdLineKind)](cmdlinehelper#addCmdPrefix%2Cstring%2CCmdLineKind)
 [addCompileOption:](#addCompileOption)
* [extccomp: addCompileOption(conf: ConfigRef; option: string)](extccomp#addCompileOption%2CConfigRef%2Cstring)
 [addCompileOptionCmd:](#addCompileOptionCmd)
* [extccomp: addCompileOptionCmd(conf: ConfigRef; option: string)](extccomp#addCompileOptionCmd%2CConfigRef%2Cstring)
 [addConverter:](#addConverter)
* [semdata: addConverter(c: PContext; conv: PSym)](semdata#addConverter%2CPContext%2CPSym)
 [addDecl:](#addDecl)
* [lookups: addDecl(c: PContext; sym: PSym)](lookups#addDecl%2CPContext%2CPSym)
* [lookups: addDecl(c: PContext; sym: PSym; info: TLineInfo)](lookups#addDecl%2CPContext%2CPSym%2CTLineInfo)
 [addDeclAt:](#addDeclAt)
* [lookups: addDeclAt(c: PContext; scope: PScope; sym: PSym)](lookups#addDeclAt%2CPContext%2CPScope%2CPSym)
 [addDep:](#addDep)
* [modulegraphs: addDep(g: ModuleGraph; m: PSym; dep: FileIndex)](modulegraphs#addDep%2CModuleGraph%2CPSym%2CFileIndex)
 [addDiscriminantFact:](#addDiscriminantFact)
* [guards: addDiscriminantFact(m: var TModel; n: PNode)](guards#addDiscriminantFact%2CTModel%2CPNode)
 [addExternalFileToCompile:](#addExternalFileToCompile)
* [extccomp: addExternalFileToCompile(conf: ConfigRef; filename: AbsoluteFile)](extccomp#addExternalFileToCompile%2CConfigRef%2CAbsoluteFile)
* [extccomp: addExternalFileToCompile(conf: ConfigRef; c: var Cfile)](extccomp#addExternalFileToCompile%2CConfigRef%2CCfile)
 [addExternalFileToLink:](#addExternalFileToLink)
* [extccomp: addExternalFileToLink(conf: ConfigRef; filename: AbsoluteFile)](extccomp#addExternalFileToLink%2CConfigRef%2CAbsoluteFile)
 [addf:](#addf)
* [ropes: addf(c: var Rope; frmt: FormatStr; args: openArray[Rope])](ropes#addf.t%2CRope%2CFormatStr%2CopenArray%5BRope%5D)
 [addFact:](#addFact)
* [guards: addFact(m: var TModel; nn: PNode)](guards#addFact%2CTModel%2CPNode)
 [addFactLe:](#addFactLe)
* [guards: addFactLe(m: var TModel; a, b: PNode)](guards#addFactLe%2CTModel%2CPNode%2CPNode)
 [addFactLt:](#addFactLt)
* [guards: addFactLt(m: var TModel; a, b: PNode)](guards#addFactLt%2CTModel%2CPNode%2CPNode)
 [addFactNeg:](#addFactNeg)
* [guards: addFactNeg(m: var TModel; n: PNode)](guards#addFactNeg%2CTModel%2CPNode)
 [addField:](#addField)
* [lowerings: addField(obj: PType; s: PSym; cache: IdentCache)](lowerings#addField%2CPType%2CPSym%2CIdentCache)
 [addFileExt:](#addFileExt)
* [pathutils: addFileExt(x: AbsoluteFile; ext: string): AbsoluteFile](pathutils#addFileExt%2CAbsoluteFile%2Cstring)
* [pathutils: addFileExt(x: RelativeFile; ext: string): RelativeFile](pathutils#addFileExt%2CRelativeFile%2Cstring)
 [addFileToCompile:](#addFileToCompile)
* [extccomp: addFileToCompile(conf: ConfigRef; cf: Cfile)](extccomp#addFileToCompile%2CConfigRef%2CCfile)
 [addIncludeDep:](#addIncludeDep)
* [modulegraphs: addIncludeDep(g: ModuleGraph; module, includeFile: FileIndex)](modulegraphs#addIncludeDep%2CModuleGraph%2CFileIndex%2CFileIndex)
 [addInt128:](#addInt128)
* [int128: addInt128(result: var string; value: Int128)](int128#addInt128%2Cstring%2CInt128)
 [addInterfaceDecl:](#addInterfaceDecl)
* [lookups: addInterfaceDecl(c: PContext; sym: PSym)](lookups#addInterfaceDecl%2CPContext%2CPSym)
 [addInterfaceDeclAt:](#addInterfaceDeclAt)
* [lookups: addInterfaceDeclAt(c: PContext; scope: PScope; sym: PSym)](lookups#addInterfaceDeclAt%2CPContext%2CPScope%2CPSym)
 [addInterfaceOverloadableSymAt:](#addInterfaceOverloadableSymAt)
* [lookups: addInterfaceOverloadableSymAt(c: PContext; scope: PScope; sym: PSym)](lookups#addInterfaceOverloadableSymAt%2CPContext%2CPScope%2CPSym)
 [addLinkOption:](#addLinkOption)
* [extccomp: addLinkOption(conf: ConfigRef; option: string)](extccomp#addLinkOption%2CConfigRef%2Cstring)
 [addLinkOptionCmd:](#addLinkOptionCmd)
* [extccomp: addLinkOptionCmd(conf: ConfigRef; option: string)](extccomp#addLinkOptionCmd%2CConfigRef%2Cstring)
 [addLocalCompileOption:](#addLocalCompileOption)
* [extccomp: addLocalCompileOption(conf: ConfigRef; option: string; nimfile: AbsoluteFile)](extccomp#addLocalCompileOption%2CConfigRef%2Cstring%2CAbsoluteFile)
 [addMapping:](#addMapping)
* [sourcemap: addMapping(map: SourceMapGenerator; mapping: Mapping)](sourcemap#addMapping%2CSourceMapGenerator%2CMapping)
 [addModuleDep:](#addModuleDep)
* [incremental: addModuleDep(incr: var IncrementalCtx; conf: ConfigRef; module, fileIdx: FileIndex; isIncludeFile: bool)](incremental#addModuleDep.t%2CIncrementalCtx%2CConfigRef%2CFileIndex%2CFileIndex%2Cbool)
* [rod: addModuleDep(g: ModuleGraph; module, fileIdx: FileIndex; isIncludeFile: bool)](rod#addModuleDep.t%2CModuleGraph%2CFileIndex%2CFileIndex%2Cbool)
 [addOverloadableSymAt:](#addOverloadableSymAt)
* [lookups: addOverloadableSymAt(c: PContext; scope: PScope; fn: PSym)](lookups#addOverloadableSymAt%2CPContext%2CPScope%2CPSym)
 [addParam:](#addParam)
* [ast: addParam(procType: PType; param: PSym)](ast#addParam%2CPType%2CPSym)
 [addPath:](#addPath)
* [nimblecmd: addPath(conf: ConfigRef; path: AbsoluteDir; info: TLineInfo)](nimblecmd#addPath%2CConfigRef%2CAbsoluteDir%2CTLineInfo)
 [addPattern:](#addPattern)
* [semdata: addPattern(c: PContext; p: PSym)](semdata#addPattern%2CPContext%2CPSym)
 [addPrelimDecl:](#addPrelimDecl)
* [lookups: addPrelimDecl(c: PContext; sym: PSym)](lookups#addPrelimDecl%2CPContext%2CPSym)
 [addSonNilAllowed:](#addSonNilAllowed)
* [ast: addSonNilAllowed(father, son: PNode)](ast#addSonNilAllowed%2CPNode%2CPNode)
 [addSonSkipIntLit:](#addSonSkipIntLit)
* [magicsys: addSonSkipIntLit(father, son: PType)](magicsys#addSonSkipIntLit%2CPType%2CPType)
 [addSym:](#addSym)
* [lookups: addSym(scope: PScope; s: PSym)](lookups#addSym.t%2CPScope%2CPSym)
 [addToHex:](#addToHex)
* [int128: addToHex(result: var string; arg: Int128)](int128#addToHex%2Cstring%2CInt128)
 [addToLib:](#addToLib)
* [semdata: addToLib(lib: PLib; sym: PSym)](semdata#addToLib%2CPLib%2CPSym)
 [addTypeHeader:](#addTypeHeader)
* [types: addTypeHeader(result: var string; conf: ConfigRef; typ: PType; prefer: TPreferedDesc = preferMixed; getDeclarationPath = true)](types#addTypeHeader%2Cstring%2CConfigRef%2CPType%2CTPreferedDesc)
 [addUniqueField:](#addUniqueField)
* [lowerings: addUniqueField(obj: PType; s: PSym; cache: IdentCache): PSym](lowerings#addUniqueField%2CPType%2CPSym%2CIdentCache)
 [addUniqueSym:](#addUniqueSym)
* [lookups: addUniqueSym(scope: PScope; s: PSym): PSym](lookups#addUniqueSym%2CPScope%2CPSym)
 [addVar:](#addVar)
* [lowerings: addVar(father, v: PNode)](lowerings#addVar%2CPNode%2CPNode)
* [lowerings: addVar(father, v, value: PNode)](lowerings#addVar%2CPNode%2CPNode%2CPNode)
 [aliases:](#aliases)
* [dfa: aliases(obj, field: PNode): bool](dfa#aliases%2CPNode%2CPNode)
 [alignTable:](#alignTable)
* [asciitables: alignTable(s: string; delim = ' '; fill = ' '; sep = " "): string](asciitables#alignTable%2Cstring%2Cchar%2Cchar%2Cstring)
 [allowCast:](#allowCast)
* [TSandboxFlag.allowCast](vmdef#allowCast)
 [AllowCommonBase:](#AllowCommonBase)
* [TTypeCmpFlag.AllowCommonBase](types#AllowCommonBase)
 [allowInfiniteLoops:](#allowInfiniteLoops)
* [TSandboxFlag.allowInfiniteLoops](vmdef#allowInfiniteLoops)
 [allowSemcheckedAstModification:](#allowSemcheckedAstModification)
* [LegacyFeature.allowSemcheckedAstModification](options#allowSemcheckedAstModification)
 [allRoutinePragmas:](#allRoutinePragmas)
* [pragmas: allRoutinePragmas](pragmas#allRoutinePragmas)
 [analyseObjectWithTypeField:](#analyseObjectWithTypeField)
* [types: analyseObjectWithTypeField(t: PType): TTypeFieldResult](types#analyseObjectWithTypeField%2CPType)
 [annotateType:](#annotateType)
* [semmacrosanity: annotateType(n: PNode; t: PType; conf: ConfigRef)](semmacrosanity#annotateType%2CPNode%2CPType%2CConfigRef)
 [AnyPath:](#AnyPath)
* [pathutils: AnyPath](pathutils#AnyPath)
 [Apo:](#Apo)
* [nimlexbase: Apo](nimlexbase#Apo)
 [appendToModule:](#appendToModule)
* [ast: appendToModule(m: PSym; n: PNode)](ast#appendToModule%2CPSym%2CPNode)
 [applyRule:](#applyRule)
* [patterns: applyRule(c: PContext; s: PSym; n: PNode): PNode](patterns#applyRule%2CPContext%2CPSym%2CPNode)
 [aqNoAlias:](#aqNoAlias)
* [TAliasRequest.aqNoAlias](parampatterns#aqNoAlias)
 [aqNone:](#aqNone)
* [TAliasRequest.aqNone](parampatterns#aqNone)
 [aqShouldAlias:](#aqShouldAlias)
* [TAliasRequest.aqShouldAlias](parampatterns#aqShouldAlias)
 [arDiscriminant:](#arDiscriminant)
* [TAssignableResult.arDiscriminant](parampatterns#arDiscriminant)
 [argtypeMatches:](#argtypeMatches)
* [sigmatch: argtypeMatches(c: PContext; f, a: PType; fromHlo = false): bool](sigmatch#argtypeMatches%2CPContext%2CPType%2CPType)
 [arLentValue:](#arLentValue)
* [TAssignableResult.arLentValue](parampatterns#arLentValue)
 [arLocalLValue:](#arLocalLValue)
* [TAssignableResult.arLocalLValue](parampatterns#arLocalLValue)
 [arLValue:](#arLValue)
* [TAssignableResult.arLValue](parampatterns#arLValue)
 [arMaybe:](#arMaybe)
* [TAnalysisResult.arMaybe](aliases#arMaybe)
 [arNo:](#arNo)
* [TAnalysisResult.arNo](aliases#arNo)
 [arNone:](#arNone)
* [TAssignableResult.arNone](parampatterns#arNone)
 [arStrange:](#arStrange)
* [TAssignableResult.arStrange](parampatterns#arStrange)
 [arYes:](#arYes)
* [TAnalysisResult.arYes](aliases#arYes)
 [asink:](#asink)
* [ast: asink(t: PType): PSym](ast#asink.t%2CPType)
 [assignIfDefault:](#assignIfDefault)
* [options: assignIfDefault[T](result: var T; val: T; def = default(T))](options#assignIfDefault%2CT%2CT%2Ctypeof%28default%28T%29%29)
 [assignment:](#assignment)
* [ast: assignment(t: PType): PSym](ast#assignment.t%2CPType)
 [assignType:](#assignType)
* [ast: assignType(dest, src: PType)](ast#assignType%2CPType%2CPType)
 [astdef:](#astdef)
* [ast: astdef(s: PSym): PNode](ast#astdef%2CPSym)
 [attachedAsgn:](#attachedAsgn)
* [TTypeAttachedOp.attachedAsgn](ast#attachedAsgn)
 [attachedDeepCopy:](#attachedDeepCopy)
* [TTypeAttachedOp.attachedDeepCopy](ast#attachedDeepCopy)
 [attachedDestructor:](#attachedDestructor)
* [TTypeAttachedOp.attachedDestructor](ast#attachedDestructor)
 [attachedDispose:](#attachedDispose)
* [TTypeAttachedOp.attachedDispose](ast#attachedDispose)
 [AttachedOpToStr:](#AttachedOpToStr)
* [ast: AttachedOpToStr](ast#AttachedOpToStr)
 [attachedSink:](#attachedSink)
* [TTypeAttachedOp.attachedSink](ast#attachedSink)
 [attachedTrace:](#attachedTrace)
* [TTypeAttachedOp.attachedTrace](ast#attachedTrace)
 [backendC:](#backendC)
* [TBackend.backendC](options#backendC)
 [backendCpp:](#backendCpp)
* [TBackend.backendCpp](options#backendCpp)
 [backendInvalid:](#backendInvalid)
* [TBackend.backendInvalid](options#backendInvalid)
 [backendJs:](#backendJs)
* [TBackend.backendJs](options#backendJs)
 [backendObjc:](#backendObjc)
* [TBackend.backendObjc](options#backendObjc)
 [BACKSPACE:](#BACKSPACE)
* [nimlexbase: BACKSPACE](nimlexbase#BACKSPACE)
 [base:](#base)
* [types: base(t: PType): PType](types#base%2CPType)
 [base10:](#base10)
* [NumericalBase.base10](lexer#base10)
 [base16:](#base16)
* [NumericalBase.base16](lexer#base16)
 [base2:](#base2)
* [NumericalBase.base2](lexer#base2)
 [base8:](#base8)
* [NumericalBase.base8](lexer#base8)
 [baseOfDistinct:](#baseOfDistinct)
* [types: baseOfDistinct(t: PType): PType](types#baseOfDistinct%2CPType)
 [beforeRetNeeded:](#beforeRetNeeded)
* [TCProcFlag.beforeRetNeeded](cgendata#beforeRetNeeded)
 [BEL:](#BEL)
* [nimlexbase: BEL](nimlexbase#BEL)
 [bigEndian:](#bigEndian)
* [TEndian.bigEndian](platform#bigEndian)
 [bindConcreteTypeToUserTypeClass:](#bindConcreteTypeToUserTypeClass)
* [types: bindConcreteTypeToUserTypeClass(tc, concrete: PType)](types#bindConcreteTypeToUserTypeClass.t%2CPType%2CPType)
 [bitand:](#bitand)
* [int128: bitand(a, b: Int128): Int128](int128#bitand%2CInt128%2CInt128)
 [bitnot:](#bitnot)
* [int128: bitnot(a: Int128): Int128](int128#bitnot%2CInt128)
 [bitor:](#bitor)
* [int128: bitor(a, b: Int128): Int128](int128#bitor%2CInt128%2CInt128)
 [bitSetCard:](#bitSetCard)
* [bitsets: bitSetCard(x: TBitSet): BiggestInt](bitsets#bitSetCard%2CTBitSet)
 [bitSetContains:](#bitSetContains)
* [bitsets: bitSetContains(x, y: TBitSet): bool](bitsets#bitSetContains%2CTBitSet%2CTBitSet)
 [bitSetDiff:](#bitSetDiff)
* [bitsets: bitSetDiff(x: var TBitSet; y: TBitSet)](bitsets#bitSetDiff%2CTBitSet%2CTBitSet)
 [bitSetEquals:](#bitSetEquals)
* [bitsets: bitSetEquals(x, y: TBitSet): bool](bitsets#bitSetEquals%2CTBitSet%2CTBitSet)
 [bitSetExcl:](#bitSetExcl)
* [bitsets: bitSetExcl(x: var TBitSet; elem: BiggestInt)](bitsets#bitSetExcl%2CTBitSet%2CBiggestInt)
 [bitSetIn:](#bitSetIn)
* [bitsets: bitSetIn(x: TBitSet; e: BiggestInt): bool](bitsets#bitSetIn%2CTBitSet%2CBiggestInt)
 [bitSetIncl:](#bitSetIncl)
* [bitsets: bitSetIncl(x: var TBitSet; elem: BiggestInt)](bitsets#bitSetIncl%2CTBitSet%2CBiggestInt)
 [bitSetInit:](#bitSetInit)
* [bitsets: bitSetInit(b: var TBitSet; length: int)](bitsets#bitSetInit%2CTBitSet%2Cint)
 [bitSetIntersect:](#bitSetIntersect)
* [bitsets: bitSetIntersect(x: var TBitSet; y: TBitSet)](bitsets#bitSetIntersect%2CTBitSet%2CTBitSet)
 [bitSetSymDiff:](#bitSetSymDiff)
* [bitsets: bitSetSymDiff(x: var TBitSet; y: TBitSet)](bitsets#bitSetSymDiff%2CTBitSet%2CTBitSet)
 [bitSetUnion:](#bitSetUnion)
* [bitsets: bitSetUnion(x: var TBitSet; y: TBitSet)](bitsets#bitSetUnion%2CTBitSet%2CTBitSet)
 [bitxor:](#bitxor)
* [int128: bitxor(a, b: Int128): Int128](int128#bitxor%2CInt128%2CInt128)
 [BModule:](#BModule)
* [cgendata: BModule](cgendata#BModule)
 [BModuleList:](#BModuleList)
* [cgendata: BModuleList](cgendata#BModuleList)
 [bodyPos:](#bodyPos)
* [ast: bodyPos](ast#bodyPos)
 [boolArg:](#boolArg)
* [filters: boolArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: bool): bool](filters#boolArg%2CConfigRef%2CPNode%2Cstring%2Cint%2Cbool)
 [borrowChecking:](#borrowChecking)
* [Goal.borrowChecking](varpartitions#borrowChecking)
 [BProc:](#BProc)
* [cgendata: BProc](cgendata#BProc)
 [bracketKind:](#bracketKind)
* [renderer: bracketKind(g: TSrcGen; n: PNode): BracketKind](renderer#bracketKind%2CTSrcGen%2CPNode)
 [BTree:](#BTree)
* [btrees: BTree](btrees#BTree)
 [buildAdd:](#buildAdd)
* [guards: buildAdd(a: PNode; b: BiggestInt; o: Operators): PNode](guards#buildAdd%2CPNode%2CBiggestInt%2COperators)
 [buildCall:](#buildCall)
* [guards: buildCall(op: PSym; a: PNode): PNode](guards#buildCall%2CPSym%2CPNode)
* [guards: buildCall(op: PSym; a, b: PNode): PNode](guards#buildCall%2CPSym%2CPNode%2CPNode)
 [buildLe:](#buildLe)
* [guards: buildLe(o: Operators; a, b: PNode): PNode](guards#buildLe%2COperators%2CPNode%2CPNode)
 [byteExcess:](#byteExcess)
* [vmdef: byteExcess](vmdef#byteExcess)
 [cacheTypeInst:](#cacheTypeInst)
* [semtypinst: cacheTypeInst(inst: PType)](semtypinst#cacheTypeInst%2CPType)
 [callCCompiler:](#callCCompiler)
* [extccomp: callCCompiler(conf: ConfigRef)](extccomp#callCCompiler%2CConfigRef)
 [callCodegenProc:](#callCodegenProc)
* [lowerings: callCodegenProc(g: ModuleGraph; name: string; info: TLineInfo = unknownLineInfo; arg1, arg2, arg3, optionalArgs: PNode = nil): PNode](lowerings#callCodegenProc%2CModuleGraph%2Cstring%2CTLineInfo%2CPNode%2CPNode%2CPNode%2CPNode)
 [callOperator:](#callOperator)
* [Feature.callOperator](options#callOperator)
 [canAlias:](#canAlias)
* [isolation\_check: canAlias(arg, ret: PType): bool](isolation_check#canAlias%2CPType%2CPType)
 [CandidateError:](#CandidateError)
* [sigmatch: CandidateError](sigmatch#CandidateError)
 [CandidateErrors:](#CandidateErrors)
* [sigmatch: CandidateErrors](sigmatch#CandidateErrors)
 [canFormAcycle:](#canFormAcycle)
* [types: canFormAcycle(typ: PType): bool](types#canFormAcycle%2CPType)
 [canon:](#canon)
* [guards: canon(n: PNode; o: Operators): PNode](guards#canon%2CPNode%2COperators)
 [canonicalizePath:](#canonicalizePath)
* [options: canonicalizePath(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile](options#canonicalizePath%2CConfigRef%2CAbsoluteFile)
 [canonValue:](#canonValue)
* [vmgen: canonValue(n: PNode): PNode](vmgen#canonValue%2CPNode)
 [canRaise:](#canRaise)
* [ast: canRaise(fn: PNode): bool](ast#canRaise%2CPNode)
 [canRaiseConservative:](#canRaiseConservative)
* [ast: canRaiseConservative(fn: PNode): bool](ast#canRaiseConservative%2CPNode)
 [cardSet:](#cardSet)
* [nimsets: cardSet(conf: ConfigRef; a: PNode): BiggestInt](nimsets#cardSet%2CConfigRef%2CPNode)
 [carryPass:](#carryPass)
* [passes: carryPass(g: ModuleGraph; p: TPass; module: PSym; m: TPassData): TPassData](passes#carryPass%2CModuleGraph%2CTPass%2CPSym%2CTPassData)
 [carryPasses:](#carryPasses)
* [passes: carryPasses(g: ModuleGraph; nodes: PNode; module: PSym; passes: openArray[TPass])](passes#carryPasses%2CModuleGraph%2CPNode%2CPSym%2CopenArray%5BTPass%5D)
 [caseStmtMacros:](#caseStmtMacros)
* [Feature.caseStmtMacros](options#caseStmtMacros)
 [castToInt64:](#castToInt64)
* [int128: castToInt64(arg: Int128): int64](int128#castToInt64%2CInt128)
 [castToUInt64:](#castToUInt64)
* [int128: castToUInt64(arg: Int128): uint64](int128#castToUInt64%2CInt128)
 [CC:](#CC)
* [extccomp: CC](extccomp#CC)
 [ccBcc:](#ccBcc)
* [TSystemCC.ccBcc](options#ccBcc)
 [ccCDecl:](#ccCDecl)
* [TCallingConvention.ccCDecl](ast#ccCDecl)
 [ccCLang:](#ccCLang)
* [TSystemCC.ccCLang](options#ccCLang)
 [ccClangCl:](#ccClangCl)
* [TSystemCC.ccClangCl](options#ccClangCl)
 [ccClosure:](#ccClosure)
* [TCallingConvention.ccClosure](ast#ccClosure)
 [ccEnv:](#ccEnv)
* [TSystemCC.ccEnv](options#ccEnv)
 [ccFastCall:](#ccFastCall)
* [TCallingConvention.ccFastCall](ast#ccFastCall)
 [ccGcc:](#ccGcc)
* [TSystemCC.ccGcc](options#ccGcc)
 [ccgKeywordsHigh:](#ccgKeywordsHigh)
* [wordrecg: ccgKeywordsHigh](wordrecg#ccgKeywordsHigh)
 [ccgKeywordsLow:](#ccgKeywordsLow)
* [wordrecg: ccgKeywordsLow](wordrecg#ccgKeywordsLow)
 [ccHasSaneOverflow:](#ccHasSaneOverflow)
* [extccomp: ccHasSaneOverflow(conf: ConfigRef): bool](extccomp#ccHasSaneOverflow%2CConfigRef)
 [ccIcc:](#ccIcc)
* [TSystemCC.ccIcc](options#ccIcc)
 [ccIcl:](#ccIcl)
* [TSystemCC.ccIcl](options#ccIcl)
 [ccInline:](#ccInline)
* [TCallingConvention.ccInline](ast#ccInline)
 [ccLLVM\_Gcc:](#ccLLVM_Gcc)
* [TSystemCC.ccLLVM\_Gcc](options#ccLLVM_Gcc)
 [ccNimCall:](#ccNimCall)
* [TCallingConvention.ccNimCall](ast#ccNimCall)
 [ccNintendoSwitch:](#ccNintendoSwitch)
* [TSystemCC.ccNintendoSwitch](options#ccNintendoSwitch)
 [ccNoConvention:](#ccNoConvention)
* [TCallingConvention.ccNoConvention](ast#ccNoConvention)
 [ccNoInline:](#ccNoInline)
* [TCallingConvention.ccNoInline](ast#ccNoInline)
 [ccNone:](#ccNone)
* [TSystemCC.ccNone](options#ccNone)
 [ccSafeCall:](#ccSafeCall)
* [TCallingConvention.ccSafeCall](ast#ccSafeCall)
 [ccStdCall:](#ccStdCall)
* [TCallingConvention.ccStdCall](ast#ccStdCall)
 [ccSysCall:](#ccSysCall)
* [TCallingConvention.ccSysCall](ast#ccSysCall)
 [ccTcc:](#ccTcc)
* [TSystemCC.ccTcc](options#ccTcc)
 [ccThisCall:](#ccThisCall)
* [TCallingConvention.ccThisCall](ast#ccThisCall)
 [ccVcc:](#ccVcc)
* [TSystemCC.ccVcc](options#ccVcc)
 [Cell:](#Cell)
* [asciitables: Cell](asciitables#Cell)
 [Cfile:](#Cfile)
* [options: Cfile](options#Cfile)
 [CfileFlag:](#CfileFlag)
* [options: CfileFlag](options#CfileFlag)
 [CfileList:](#CfileList)
* [options: CfileList](options#CfileList)
 [cfsData:](#cfsData)
* [TCFileSection.cfsData](cgendata#cfsData)
 [cfsDatInitProc:](#cfsDatInitProc)
* [TCFileSection.cfsDatInitProc](cgendata#cfsDatInitProc)
 [cfsDebugInit:](#cfsDebugInit)
* [TCFileSection.cfsDebugInit](cgendata#cfsDebugInit)
 [cfsDynLibDeinit:](#cfsDynLibDeinit)
* [TCFileSection.cfsDynLibDeinit](cgendata#cfsDynLibDeinit)
 [cfsDynLibInit:](#cfsDynLibInit)
* [TCFileSection.cfsDynLibInit](cgendata#cfsDynLibInit)
 [cfsFieldInfo:](#cfsFieldInfo)
* [TCFileSection.cfsFieldInfo](cgendata#cfsFieldInfo)
 [cfsForwardTypes:](#cfsForwardTypes)
* [TCFileSection.cfsForwardTypes](cgendata#cfsForwardTypes)
 [cfsFrameDefines:](#cfsFrameDefines)
* [TCFileSection.cfsFrameDefines](cgendata#cfsFrameDefines)
 [cfsHeaders:](#cfsHeaders)
* [TCFileSection.cfsHeaders](cgendata#cfsHeaders)
 [cfsInitProc:](#cfsInitProc)
* [TCFileSection.cfsInitProc](cgendata#cfsInitProc)
 [cfsMergeInfo:](#cfsMergeInfo)
* [TCFileSection.cfsMergeInfo](cgendata#cfsMergeInfo)
 [cfsProcHeaders:](#cfsProcHeaders)
* [TCFileSection.cfsProcHeaders](cgendata#cfsProcHeaders)
 [cfsProcs:](#cfsProcs)
* [TCFileSection.cfsProcs](cgendata#cfsProcs)
 [cfsSeqTypes:](#cfsSeqTypes)
* [TCFileSection.cfsSeqTypes](cgendata#cfsSeqTypes)
 [cfsTypeInfo:](#cfsTypeInfo)
* [TCFileSection.cfsTypeInfo](cgendata#cfsTypeInfo)
 [cfsTypeInit1:](#cfsTypeInit1)
* [TCFileSection.cfsTypeInit1](cgendata#cfsTypeInit1)
 [cfsTypeInit2:](#cfsTypeInit2)
* [TCFileSection.cfsTypeInit2](cgendata#cfsTypeInit2)
 [cfsTypeInit3:](#cfsTypeInit3)
* [TCFileSection.cfsTypeInit3](cgendata#cfsTypeInit3)
 [cfsTypes:](#cfsTypes)
* [TCFileSection.cfsTypes](cgendata#cfsTypes)
 [cfsVars:](#cfsVars)
* [TCFileSection.cfsVars](cgendata#cfsVars)
 [cgDeclFrmt:](#cgDeclFrmt)
* [cgen: cgDeclFrmt(s: PSym): string](cgen#cgDeclFrmt.t%2CPSym)
 [cgenModules:](#cgenModules)
* [cgendata: cgenModules(g: BModuleList): BModule](cgendata#cgenModules.i%2CBModuleList)
 [cgenPass:](#cgenPass)
* [cgen: cgenPass](cgen#cgenPass)
 [cgenWriteModules:](#cgenWriteModules)
* [cgen: cgenWriteModules(backend: RootRef; config: ConfigRef)](cgen#cgenWriteModules%2CRootRef%2CConfigRef)
 [changeDetectedViaJsonBuildInstructions:](#changeDetectedViaJsonBuildInstructions)
* [extccomp: changeDetectedViaJsonBuildInstructions(conf: ConfigRef; projectfile: AbsoluteFile): bool](extccomp#changeDetectedViaJsonBuildInstructions%2CConfigRef%2CAbsoluteFile)
 [changeFileExt:](#changeFileExt)
* [pathutils: changeFileExt(x: AbsoluteFile; ext: string): AbsoluteFile](pathutils#changeFileExt%2CAbsoluteFile%2Cstring)
* [pathutils: changeFileExt(x: RelativeFile; ext: string): RelativeFile](pathutils#changeFileExt%2CRelativeFile%2Cstring)
 [charArg:](#charArg)
* [filters: charArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: char): char](filters#charArg%2CConfigRef%2CPNode%2Cstring%2Cint%2Cchar)
 [checkAmbiguity:](#checkAmbiguity)
* [TLookupFlag.checkAmbiguity](lookups#checkAmbiguity)
 [checkBorrowedLocations:](#checkBorrowedLocations)
* [varpartitions: checkBorrowedLocations(par: var Partitions; body: PNode; config: ConfigRef)](varpartitions#checkBorrowedLocations%2CPartitions%2CPNode%2CConfigRef)
 [checkConstructedType:](#checkConstructedType)
* [semtypinst: checkConstructedType(conf: ConfigRef; info: TLineInfo; typ: PType)](semtypinst#checkConstructedType%2CConfigRef%2CTLineInfo%2CPType)
 [checkFieldAccess:](#checkFieldAccess)
* [guards: checkFieldAccess(m: TModel; n: PNode; conf: ConfigRef)](guards#checkFieldAccess%2CTModel%2CPNode%2CConfigRef)
 [checkForSideEffects:](#checkForSideEffects)
* [parampatterns: checkForSideEffects(n: PNode): TSideEffectAnalysis](parampatterns#checkForSideEffects%2CPNode)
 [checkForSink:](#checkForSink)
* [sempass2: checkForSink(config: ConfigRef; owner: PSym; arg: PNode)](sempass2#checkForSink%2CConfigRef%2CPSym%2CPNode)
 [checkIsolate:](#checkIsolate)
* [isolation\_check: checkIsolate(n: PNode): bool](isolation_check#checkIsolate%2CPNode)
 [checkMethodEffects:](#checkMethodEffects)
* [sempass2: checkMethodEffects(g: ModuleGraph; disp, branch: PSym)](sempass2#checkMethodEffects%2CModuleGraph%2CPSym%2CPSym)
 [checkMinSonsLen:](#checkMinSonsLen)
* [semdata: checkMinSonsLen(n: PNode; length: int; conf: ConfigRef)](semdata#checkMinSonsLen%2CPNode%2Cint%2CConfigRef)
 [checkModule:](#checkModule)
* [TLookupFlag.checkModule](lookups#checkModule)
 [checkModuleName:](#checkModuleName)
* [modulepaths: checkModuleName(conf: ConfigRef; n: PNode; doLocalError = true): FileIndex](modulepaths#checkModuleName%2CConfigRef%2CPNode)
 [checkPragmaUse:](#checkPragmaUse)
* [linter: checkPragmaUse(conf: ConfigRef; info: TLineInfo; w: TSpecialWord; pragmaName: string)](linter#checkPragmaUse%2CConfigRef%2CTLineInfo%2CTSpecialWord%2Cstring)
 [checkPureEnumFields:](#checkPureEnumFields)
* [TLookupFlag.checkPureEnumFields](lookups#checkPureEnumFields)
 [checkSonsLen:](#checkSonsLen)
* [semdata: checkSonsLen(n: PNode; length: int; conf: ConfigRef)](semdata#checkSonsLen%2CPNode%2Cint%2CConfigRef)
 [ChecksOptions:](#ChecksOptions)
* [options: ChecksOptions](options#ChecksOptions)
 [checkUndeclared:](#checkUndeclared)
* [TLookupFlag.checkUndeclared](lookups#checkUndeclared)
 [checkUnsignedConversions:](#checkUnsignedConversions)
* [LegacyFeature.checkUnsignedConversions](options#checkUnsignedConversions)
 [Child:](#Child)
* [sourcemap: Child](sourcemap#Child)
 [child:](#child)
* [sourcemap: child(node: SourceNode): Child](sourcemap#child%2CSourceNode)
* [sourcemap: child(s: string): Child](sourcemap#child%2Cstring)
 [classify:](#classify)
* [types: classify(t: PType): OrdinalType](types#classify%2CPType)
 [classifyViewType:](#classifyViewType)
* [typeallowed: classifyViewType(t: PType): ViewTypeKind](typeallowed#classifyViewType%2CPType)
 [clearNimblePath:](#clearNimblePath)
* [options: clearNimblePath(conf: ConfigRef)](options#clearNimblePath%2CConfigRef)
 [clearPasses:](#clearPasses)
* [passes: clearPasses(g: ModuleGraph)](passes#clearPasses%2CModuleGraph)
 [close:](#close)
* [ndi: close(f: var NdiFile; conf: ConfigRef)](ndi#close%2CNdiFile%2CConfigRef)
 [closeBaseLexer:](#closeBaseLexer)
* [nimlexbase: closeBaseLexer(L: var TBaseLexer)](nimlexbase#closeBaseLexer%2CTBaseLexer)
 [closeLexer:](#closeLexer)
* [lexer: closeLexer(lex: var Lexer)](lexer#closeLexer%2CLexer)
 [closeParser:](#closeParser)
* [parser: closeParser(p: var Parser)](parser#closeParser%2CParser)
 [closeScope:](#closeScope)
* [lookups: closeScope(c: PContext)](lookups#closeScope%2CPContext)
 [closeShadowScope:](#closeShadowScope)
* [lookups: closeShadowScope(c: PContext)](lookups#closeShadowScope%2CPContext)
 [cmdCheck:](#cmdCheck)
* [TCommands.cmdCheck](options#cmdCheck)
 [cmdCompileToBackend:](#cmdCompileToBackend)
* [TCommands.cmdCompileToBackend](options#cmdCompileToBackend)
 [cmdCompileToC:](#cmdCompileToC)
* [TCommands.cmdCompileToC](options#cmdCompileToC)
 [cmdCompileToCpp:](#cmdCompileToCpp)
* [TCommands.cmdCompileToCpp](options#cmdCompileToCpp)
 [cmdCompileToJS:](#cmdCompileToJS)
* [TCommands.cmdCompileToJS](options#cmdCompileToJS)
 [cmdCompileToLLVM:](#cmdCompileToLLVM)
* [TCommands.cmdCompileToLLVM](options#cmdCompileToLLVM)
 [cmdCompileToOC:](#cmdCompileToOC)
* [TCommands.cmdCompileToOC](options#cmdCompileToOC)
 [cmdDef:](#cmdDef)
* [TCommands.cmdDef](options#cmdDef)
 [cmdDoc:](#cmdDoc)
* [TCommands.cmdDoc](options#cmdDoc)
 [cmdDump:](#cmdDump)
* [TCommands.cmdDump](options#cmdDump)
 [cmdGenDepend:](#cmdGenDepend)
* [TCommands.cmdGenDepend](options#cmdGenDepend)
 [cmdIdeTools:](#cmdIdeTools)
* [TCommands.cmdIdeTools](options#cmdIdeTools)
 [cmdInteractive:](#cmdInteractive)
* [TCommands.cmdInteractive](options#cmdInteractive)
 [cmdInterpret:](#cmdInterpret)
* [TCommands.cmdInterpret](options#cmdInterpret)
 [cmdJsonScript:](#cmdJsonScript)
* [TCommands.cmdJsonScript](options#cmdJsonScript)
 [cmdNone:](#cmdNone)
* [TCommands.cmdNone](options#cmdNone)
 [cmdParse:](#cmdParse)
* [TCommands.cmdParse](options#cmdParse)
 [cmdPretty:](#cmdPretty)
* [TCommands.cmdPretty](options#cmdPretty)
 [cmdRst2html:](#cmdRst2html)
* [TCommands.cmdRst2html](options#cmdRst2html)
 [cmdRst2tex:](#cmdRst2tex)
* [TCommands.cmdRst2tex](options#cmdRst2tex)
 [cmdRun:](#cmdRun)
* [TCommands.cmdRun](options#cmdRun)
 [cmdScan:](#cmdScan)
* [TCommands.cmdScan](options#cmdScan)
 [cmp:](#cmp)
* [int128: cmp(a, b: Int128): int](int128#cmp%2CInt128%2CInt128)
 [cmpCandidates:](#cmpCandidates)
* [sigmatch: cmpCandidates(a, b: TCandidate): int](sigmatch#cmpCandidates%2CTCandidate%2CTCandidate)
 [cmpIgnoreStyle:](#cmpIgnoreStyle)
* [idents: cmpIgnoreStyle(a, b: cstring; blen: int): int](idents#cmpIgnoreStyle%2Ccstring%2Ccstring%2Cint)
 [cmpPaths:](#cmpPaths)
* [pathutils: cmpPaths(x, y: AbsoluteDir): int](pathutils#cmpPaths%2CAbsoluteDir%2CAbsoluteDir)
 [cmpTypes:](#cmpTypes)
* [sigmatch: cmpTypes(c: PContext; f, a: PType): TTypeRelation](sigmatch#cmpTypes%2CPContext%2CPType%2CPType)
 [CoConsiderOwned:](#CoConsiderOwned)
* [ConsiderFlag.CoConsiderOwned](sighashes#CoConsiderOwned)
 [CodegenFlag:](#CodegenFlag)
* [cgendata: CodegenFlag](cgendata#CodegenFlag)
 [codeReordering:](#codeReordering)
* [Feature.codeReordering](options#codeReordering)
 [CoDistinct:](#CoDistinct)
* [ConsiderFlag.CoDistinct](sighashes#CoDistinct)
 [CoHashTypeInsideNode:](#CoHashTypeInsideNode)
* [ConsiderFlag.CoHashTypeInsideNode](sighashes#CoHashTypeInsideNode)
 [CoIgnoreRange:](#CoIgnoreRange)
* [ConsiderFlag.CoIgnoreRange](sighashes#CoIgnoreRange)
 [ColOffset:](#ColOffset)
* [msgs: ColOffset](msgs#ColOffset)
 [commandBuildIndex:](#commandBuildIndex)
* [docgen: commandBuildIndex(conf: ConfigRef; dir: string; outFile = RelativeFile"")](docgen#commandBuildIndex%2CConfigRef%2Cstring)
 [commandDoc:](#commandDoc)
* [docgen: commandDoc(cache: IdentCache; conf: ConfigRef)](docgen#commandDoc%2CIdentCache%2CConfigRef)
 [commandJson:](#commandJson)
* [docgen: commandJson(cache: IdentCache; conf: ConfigRef)](docgen#commandJson%2CIdentCache%2CConfigRef)
 [commandLineDesc:](#commandLineDesc)
* [msgs: commandLineDesc](msgs#commandLineDesc)
 [commandLineIdx:](#commandLineIdx)
* [lineinfos: commandLineIdx](lineinfos#commandLineIdx)
 [commandRst2Html:](#commandRst2Html)
* [docgen: commandRst2Html(cache: IdentCache; conf: ConfigRef)](docgen#commandRst2Html%2CIdentCache%2CConfigRef)
 [commandRst2TeX:](#commandRst2TeX)
* [docgen: commandRst2TeX(cache: IdentCache; conf: ConfigRef)](docgen#commandRst2TeX%2CIdentCache%2CConfigRef)
 [commandTags:](#commandTags)
* [docgen: commandTags(cache: IdentCache; conf: ConfigRef)](docgen#commandTags%2CIdentCache%2CConfigRef)
 [commonOptimizations:](#commonOptimizations)
* [transf: commonOptimizations(g: ModuleGraph; c: PSym; n: PNode): PNode](transf#commonOptimizations%2CModuleGraph%2CPSym%2CPNode)
 [commonSuperclass:](#commonSuperclass)
* [types: commonSuperclass(a, b: PType): PType](types#commonSuperclass%2CPType%2CPType)
 [commonType:](#commonType)
* [sem: commonType(x: PType; y: PNode): PType](sem#commonType%2CPType%2CPNode)
* [sem: commonType(x, y: PType): PType](sem#commonType%2CPType%2CPType)
 [commonTypeBegin:](#commonTypeBegin)
* [sem: commonTypeBegin(): PType](sem#commonTypeBegin.t)
 [compareTypes:](#compareTypes)
* [types: compareTypes(x, y: PType; cmp: TDistinctCompare = dcEq; flags: TTypeCmpFlags = {}): bool](types#compareTypes%2CPType%2CPType%2CTDistinctCompare%2CTTypeCmpFlags)
 [compatibleEffects:](#compatibleEffects)
* [types: compatibleEffects(formal, actual: PType): EffectsCompat](types#compatibleEffects%2CPType%2CPType)
 [compilationCachePresent:](#compilationCachePresent)
* [options: compilationCachePresent(conf: ConfigRef): untyped](options#compilationCachePresent.t%2CConfigRef)
 [compileModule:](#compileModule)
* [modules: compileModule(graph: ModuleGraph; fileIdx: FileIndex; flags: TSymFlags): PSym](modules#compileModule%2CModuleGraph%2CFileIndex%2CTSymFlags)
 [compileProject:](#compileProject)
* [modules: compileProject(graph: ModuleGraph; projectFileIdx = InvalidFileIdx)](modules#compileProject%2CModuleGraph)
 [CompilesId:](#CompilesId)
* [ast: CompilesId](ast#CompilesId)
 [compileSystemModule:](#compileSystemModule)
* [modules: compileSystemModule(graph: ModuleGraph)](modules#compileSystemModule%2CModuleGraph)
 [compiletimeFFI:](#compiletimeFFI)
* [Feature.compiletimeFFI](options#compiletimeFFI)
 [complement:](#complement)
* [nimsets: complement(conf: ConfigRef; a: PNode): PNode](nimsets#complement%2CConfigRef%2CPNode)
 [completeCfilePath:](#completeCfilePath)
* [extccomp: completeCfilePath(conf: ConfigRef; cfile: AbsoluteFile; createSubDir: bool = true): AbsoluteFile](extccomp#completeCfilePath%2CConfigRef%2CAbsoluteFile%2Cbool)
 [completeGeneratedFilePath:](#completeGeneratedFilePath)
* [options: completeGeneratedFilePath(conf: ConfigRef; f: AbsoluteFile; createSubDir: bool = true): AbsoluteFile](options#completeGeneratedFilePath%2CConfigRef%2CAbsoluteFile%2Cbool)
 [computeCursors:](#computeCursors)
* [varpartitions: computeCursors(s: PSym; n: PNode; config: ConfigRef)](varpartitions#computeCursors%2CPSym%2CPNode%2CConfigRef)
 [computeGraphPartitions:](#computeGraphPartitions)
* [varpartitions: computeGraphPartitions(s: PSym; n: PNode; config: ConfigRef; goals: set[Goal]): Partitions](varpartitions#computeGraphPartitions%2CPSym%2CPNode%2CConfigRef%2Cset%5BGoal%5D)
 [computeSize:](#computeSize)
* [types: computeSize(conf: ConfigRef; typ: PType): BiggestInt](types#computeSize%2CConfigRef%2CPType)
 [ConcreteTypes:](#ConcreteTypes)
* [ast: ConcreteTypes](ast#ConcreteTypes)
 [config:](#config)
* [cgendata: config(m: BModule): ConfigRef](cgendata#config.t%2CBModule)
* [cgendata: config(p: BProc): ConfigRef](cgendata#config.t%2CBProc)
* [jsgen: config(p: PProc): ConfigRef](jsgen#config.t%2CPProc)
* [semdata: config(c: PContext): ConfigRef](semdata#config.t%2CPContext)
 [ConfigRef:](#ConfigRef)
* [options: ConfigRef](options#ConfigRef)
 [connectCallbacks:](#connectCallbacks)
* [modules: connectCallbacks(graph: ModuleGraph)](modules#connectCallbacks%2CModuleGraph)
 [ConsiderFlag:](#ConsiderFlag)
* [sighashes: ConsiderFlag](sighashes#ConsiderFlag)
 [considerGenSyms:](#considerGenSyms)
* [semdata: considerGenSyms(c: PContext; n: PNode)](semdata#considerGenSyms%2CPContext%2CPNode)
 [considerQuotedIdent:](#considerQuotedIdent)
* [lookups: considerQuotedIdent(c: PContext; n: PNode; origin: PNode = nil): PIdent](lookups#considerQuotedIdent%2CPContext%2CPNode%2CPNode)
 [ConstantDataTypes:](#ConstantDataTypes)
* [ast: ConstantDataTypes](ast#ConstantDataTypes)
 [constParameters:](#constParameters)
* [Goal.constParameters](varpartitions#constParameters)
 [constPragmas:](#constPragmas)
* [pragmas: constPragmas](pragmas#constPragmas)
 [constructCfg:](#constructCfg)
* [dfa: constructCfg(s: PSym; body: PNode): ControlFlowGraph](dfa#constructCfg%2CPSym%2CPNode)
 [contains:](#contains)
* [btrees: contains[Key, Val](b: BTree[Key, Val]; key: Key): bool](btrees#contains%2CBTree%5BKey%2CVal%5D%2CKey)
 [containsCompileTimeOnly:](#containsCompileTimeOnly)
* [types: containsCompileTimeOnly(t: PType): bool](types#containsCompileTimeOnly%2CPType)
 [containsGarbageCollectedRef:](#containsGarbageCollectedRef)
* [types: containsGarbageCollectedRef(typ: PType): bool](types#containsGarbageCollectedRef%2CPType)
 [containsGenericType:](#containsGenericType)
* [types: containsGenericType(t: PType): bool](types#containsGenericType%2CPType)
 [containsHiddenPointer:](#containsHiddenPointer)
* [types: containsHiddenPointer(typ: PType): bool](types#containsHiddenPointer%2CPType)
 [containsManagedMemory:](#containsManagedMemory)
* [types: containsManagedMemory(typ: PType): bool](types#containsManagedMemory%2CPType)
 [containsNode:](#containsNode)
* [ast: containsNode(n: PNode; kinds: TNodeKinds): bool](ast#containsNode%2CPNode%2CTNodeKinds)
 [containsObject:](#containsObject)
* [types: containsObject(t: PType): bool](types#containsObject%2CPType)
 [containsSets:](#containsSets)
* [nimsets: containsSets(conf: ConfigRef; a, b: PNode): bool](nimsets#containsSets%2CConfigRef%2CPNode%2CPNode)
 [containsTyRef:](#containsTyRef)
* [types: containsTyRef(typ: PType): bool](types#containsTyRef%2CPType)
 [ControlFlowGraph:](#ControlFlowGraph)
* [dfa: ControlFlowGraph](dfa#ControlFlowGraph)
 [converterPragmas:](#converterPragmas)
* [pragmas: converterPragmas](pragmas#converterPragmas)
 [CoOwnerSig:](#CoOwnerSig)
* [ConsiderFlag.CoOwnerSig](sighashes#CoOwnerSig)
 [CoProc:](#CoProc)
* [ConsiderFlag.CoProc](sighashes#CoProc)
 [copyFile:](#copyFile)
* [pathutils: copyFile(source, dest: AbsoluteFile)](pathutils#copyFile%2CAbsoluteFile%2CAbsoluteFile)
 [copyIdTable:](#copyIdTable)
* [ast: copyIdTable(dest: var TIdTable; src: TIdTable)](ast#copyIdTable%2CTIdTable%2CTIdTable)
 [copyNode:](#copyNode)
* [ast: copyNode(src: PNode): PNode](ast#copyNode%2CPNode)
 [copyObjectSet:](#copyObjectSet)
* [ast: copyObjectSet(dest: var TObjectSet; src: TObjectSet)](ast#copyObjectSet%2CTObjectSet%2CTObjectSet)
 [copyrightYear:](#copyrightYear)
* [options: copyrightYear](options#copyrightYear)
 [copyStrTable:](#copyStrTable)
* [ast: copyStrTable(dest: var TStrTable; src: TStrTable)](ast#copyStrTable%2CTStrTable%2CTStrTable)
 [copySym:](#copySym)
* [ast: copySym(s: PSym): PSym](ast#copySym%2CPSym)
 [copyTree:](#copyTree)
* [ast: copyTree(src: PNode): PNode](ast#copyTree%2CPNode)
 [copyTreeWithoutNode:](#copyTreeWithoutNode)
* [ast: copyTreeWithoutNode(src, skippedNode: PNode): PNode](ast#copyTreeWithoutNode%2CPNode%2CPNode)
 [copyType:](#copyType)
* [ast: copyType(t: PType; owner: PSym; keepId: bool): PType](ast#copyType%2CPType%2CPSym%2Cbool)
 [CoType:](#CoType)
* [ConsiderFlag.CoType](sighashes#CoType)
 [countDefinedSymbols:](#countDefinedSymbols)
* [condsyms: countDefinedSymbols(symbols: StringTableRef): int](condsyms#countDefinedSymbols%2CStringTableRef)
 [cpExact:](#cpExact)
* [TCheckPointResult.cpExact](sigmatch#cpExact)
 [cpFuzzy:](#cpFuzzy)
* [TCheckPointResult.cpFuzzy](sigmatch#cpFuzzy)
 [cpNone:](#cpNone)
* [TCheckPointResult.cpNone](sigmatch#cpNone)
 [cppDefine:](#cppDefine)
* [options: cppDefine(c: ConfigRef; define: string)](options#cppDefine%2CConfigRef%2Cstring)
 [cppNimSharedKeywords:](#cppNimSharedKeywords)
* [wordrecg: cppNimSharedKeywords](wordrecg#cppNimSharedKeywords)
 [cpsInit:](#cpsInit)
* [TCProcSection.cpsInit](cgendata#cpsInit)
 [cpsLocals:](#cpsLocals)
* [TCProcSection.cpsLocals](cgendata#cpsLocals)
 [cpsStmts:](#cpsStmts)
* [TCProcSection.cpsStmts](cgendata#cpsStmts)
 [CPU:](#CPU)
* [platform: CPU](platform#CPU)
 [cpuAlpha:](#cpuAlpha)
* [TSystemCPU.cpuAlpha](platform#cpuAlpha)
 [cpuAmd64:](#cpuAmd64)
* [TSystemCPU.cpuAmd64](platform#cpuAmd64)
 [cpuArm:](#cpuArm)
* [TSystemCPU.cpuArm](platform#cpuArm)
 [cpuArm64:](#cpuArm64)
* [TSystemCPU.cpuArm64](platform#cpuArm64)
 [cpuAVR:](#cpuAVR)
* [TSystemCPU.cpuAVR](platform#cpuAVR)
 [cpuEsp:](#cpuEsp)
* [TSystemCPU.cpuEsp](platform#cpuEsp)
 [cpuHppa:](#cpuHppa)
* [TSystemCPU.cpuHppa](platform#cpuHppa)
 [cpuI386:](#cpuI386)
* [TSystemCPU.cpuI386](platform#cpuI386)
 [cpuIa64:](#cpuIa64)
* [TSystemCPU.cpuIa64](platform#cpuIa64)
 [cpuJS:](#cpuJS)
* [TSystemCPU.cpuJS](platform#cpuJS)
 [cpuM68k:](#cpuM68k)
* [TSystemCPU.cpuM68k](platform#cpuM68k)
 [cpuMips:](#cpuMips)
* [TSystemCPU.cpuMips](platform#cpuMips)
 [cpuMips64:](#cpuMips64)
* [TSystemCPU.cpuMips64](platform#cpuMips64)
 [cpuMips64el:](#cpuMips64el)
* [TSystemCPU.cpuMips64el](platform#cpuMips64el)
 [cpuMipsel:](#cpuMipsel)
* [TSystemCPU.cpuMipsel](platform#cpuMipsel)
 [cpuMSP430:](#cpuMSP430)
* [TSystemCPU.cpuMSP430](platform#cpuMSP430)
 [cpuNimVM:](#cpuNimVM)
* [TSystemCPU.cpuNimVM](platform#cpuNimVM)
 [cpuNone:](#cpuNone)
* [TSystemCPU.cpuNone](platform#cpuNone)
 [cpuPowerpc:](#cpuPowerpc)
* [TSystemCPU.cpuPowerpc](platform#cpuPowerpc)
 [cpuPowerpc64:](#cpuPowerpc64)
* [TSystemCPU.cpuPowerpc64](platform#cpuPowerpc64)
 [cpuPowerpc64el:](#cpuPowerpc64el)
* [TSystemCPU.cpuPowerpc64el](platform#cpuPowerpc64el)
 [cpuRiscV32:](#cpuRiscV32)
* [TSystemCPU.cpuRiscV32](platform#cpuRiscV32)
 [cpuRiscV64:](#cpuRiscV64)
* [TSystemCPU.cpuRiscV64](platform#cpuRiscV64)
 [cpuSparc:](#cpuSparc)
* [TSystemCPU.cpuSparc](platform#cpuSparc)
 [cpuSparc64:](#cpuSparc64)
* [TSystemCPU.cpuSparc64](platform#cpuSparc64)
 [cpuVm:](#cpuVm)
* [TSystemCPU.cpuVm](platform#cpuVm)
 [cpuWasm32:](#cpuWasm32)
* [TSystemCPU.cpuWasm32](platform#cpuWasm32)
 [CR:](#CR)
* [nimlexbase: CR](nimlexbase#CR)
 [createClosureIterStateType:](#createClosureIterStateType)
* [lambdalifting: createClosureIterStateType(g: ModuleGraph; iter: PSym): PType](lambdalifting#createClosureIterStateType%2CModuleGraph%2CPSym)
 [createDir:](#createDir)
* [pathutils: createDir(x: AbsoluteDir)](pathutils#createDir%2CAbsoluteDir)
 [createDocLink:](#createDocLink)
* [lineinfos: createDocLink(urlSuffix: string): string](lineinfos#createDocLink%2Cstring)
 [createMagic:](#createMagic)
* [modulegraphs: createMagic(g: ModuleGraph; name: string; m: TMagic): PSym](modulegraphs#createMagic%2CModuleGraph%2Cstring%2CTMagic)
 [createModuleAlias:](#createModuleAlias)
* [ast: createModuleAlias(s: PSym; newIdent: PIdent; info: TLineInfo; options: TOptions): PSym](ast#createModuleAlias%2CPSym%2CPIdent%2CTLineInfo%2CTOptions)
 [createObj:](#createObj)
* [lowerings: createObj(g: ModuleGraph; owner: PSym; info: TLineInfo; final = true): PType](lowerings#createObj%2CModuleGraph%2CPSym%2CTLineInfo)
 [createTypeBoundOps:](#createTypeBoundOps)
* [liftdestructors: createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType; info: TLineInfo)](liftdestructors#createTypeBoundOps%2CModuleGraph%2CPContext%2CPType%2CTLineInfo)
 [csEmpty:](#csEmpty)
* [TCandidateState.csEmpty](sigmatch#csEmpty)
 [csMatch:](#csMatch)
* [TCandidateState.csMatch](sigmatch#csMatch)
 [csNoMatch:](#csNoMatch)
* [TCandidateState.csNoMatch](sigmatch#csNoMatch)
 [ctArray:](#ctArray)
* [TCTypeKind.ctArray](cgendata#ctArray)
 [ctBool:](#ctBool)
* [TCTypeKind.ctBool](cgendata#ctBool)
 [ctChar:](#ctChar)
* [TCTypeKind.ctChar](cgendata#ctChar)
 [ctCString:](#ctCString)
* [TCTypeKind.ctCString](cgendata#ctCString)
 [ctfeWhitelist:](#ctfeWhitelist)
* [ast: ctfeWhitelist](ast#ctfeWhitelist)
 [ctFloat:](#ctFloat)
* [TCTypeKind.ctFloat](cgendata#ctFloat)
 [ctFloat128:](#ctFloat128)
* [TCTypeKind.ctFloat128](cgendata#ctFloat128)
 [ctFloat32:](#ctFloat32)
* [TCTypeKind.ctFloat32](cgendata#ctFloat32)
 [ctFloat64:](#ctFloat64)
* [TCTypeKind.ctFloat64](cgendata#ctFloat64)
 [ctInt:](#ctInt)
* [TCTypeKind.ctInt](cgendata#ctInt)
 [ctInt16:](#ctInt16)
* [TCTypeKind.ctInt16](cgendata#ctInt16)
 [ctInt32:](#ctInt32)
* [TCTypeKind.ctInt32](cgendata#ctInt32)
 [ctInt64:](#ctInt64)
* [TCTypeKind.ctInt64](cgendata#ctInt64)
 [ctInt8:](#ctInt8)
* [TCTypeKind.ctInt8](cgendata#ctInt8)
 [ctNimSeq:](#ctNimSeq)
* [TCTypeKind.ctNimSeq](cgendata#ctNimSeq)
 [ctNimStr:](#ctNimStr)
* [TCTypeKind.ctNimStr](cgendata#ctNimStr)
 [ctProc:](#ctProc)
* [TCTypeKind.ctProc](cgendata#ctProc)
 [ctPtr:](#ctPtr)
* [TCTypeKind.ctPtr](cgendata#ctPtr)
 [ctPtrToArray:](#ctPtrToArray)
* [TCTypeKind.ctPtrToArray](cgendata#ctPtrToArray)
 [ctStruct:](#ctStruct)
* [TCTypeKind.ctStruct](cgendata#ctStruct)
 [ctUInt:](#ctUInt)
* [TCTypeKind.ctUInt](cgendata#ctUInt)
 [ctUInt16:](#ctUInt16)
* [TCTypeKind.ctUInt16](cgendata#ctUInt16)
 [ctUInt32:](#ctUInt32)
* [TCTypeKind.ctUInt32](cgendata#ctUInt32)
 [ctUInt64:](#ctUInt64)
* [TCTypeKind.ctUInt64](cgendata#ctUInt64)
 [ctUInt8:](#ctUInt8)
* [TCTypeKind.ctUInt8](cgendata#ctUInt8)
 [ctVoid:](#ctVoid)
* [TCTypeKind.ctVoid](cgendata#ctVoid)
 [cursorInference:](#cursorInference)
* [Goal.cursorInference](varpartitions#cursorInference)
 [cyclicTree:](#cyclicTree)
* [trees: cyclicTree(n: PNode): bool](trees#cyclicTree%2CPNode)
 [dataPointer:](#dataPointer)
* [strutils2: dataPointer[T](a: T): pointer](strutils2#dataPointer%2CT)
 [dcEq:](#dcEq)
* [TDistinctCompare.dcEq](types#dcEq)
 [dcEqIgnoreDistinct:](#dcEqIgnoreDistinct)
* [TDistinctCompare.dcEqIgnoreDistinct](types#dcEqIgnoreDistinct)
 [dcEqOrDistinctOf:](#dcEqOrDistinctOf)
* [TDistinctCompare.dcEqOrDistinctOf](types#dcEqOrDistinctOf)
 [debug:](#debug)
* [astalgo: debug(n: PNode; conf: ConfigRef = nil)](astalgo#debug%2CPNode%2CConfigRef)
* [astalgo: debug(n: PSym; conf: ConfigRef = nil)](astalgo#debug%2CPSym%2CConfigRef)
* [astalgo: debug(n: PType; conf: ConfigRef = nil)](astalgo#debug%2CPType%2CConfigRef)
* [astalgo: debug(x: PSym | PType | PNode)](astalgo#debug.t)
* [astalgo: debug(x: auto)](astalgo#debug.t%2Cauto)
 [debugEchoCode:](#debugEchoCode)
* [vmgen: debugEchoCode](vmgen#debugEchoCode)
 [debugIds:](#debugIds)
* [idgen: debugIds](idgen#debugIds)
 [debugScopes:](#debugScopes)
* [lookups: debugScopes(c: PContext; limit = 0)](lookups#debugScopes%2CPContext%2Cint)
 [declarativeDefs:](#declarativeDefs)
* [ast: declarativeDefs](ast#declarativeDefs)
 [decodeStr:](#decodeStr)
* [rodutils: decodeStr(s: cstring; pos: var int): string](rodutils#decodeStr%2Ccstring%2Cint)
 [decodeStrArray:](#decodeStrArray)
* [rodutils: decodeStrArray(s: cstring): string](rodutils#decodeStrArray.i%2Ccstring)
 [decodeVBiggestInt:](#decodeVBiggestInt)
* [rodutils: decodeVBiggestInt(s: cstring; pos: var int): BiggestInt](rodutils#decodeVBiggestInt%2Ccstring%2Cint)
 [decodeVInt:](#decodeVInt)
* [rodutils: decodeVInt(s: cstring; pos: var int): int](rodutils#decodeVInt%2Ccstring%2Cint)
 [decodeVIntArray:](#decodeVIntArray)
* [rodutils: decodeVIntArray(s: cstring): int](rodutils#decodeVIntArray.i%2Ccstring)
 [deduplicate:](#deduplicate)
* [nimsets: deduplicate(conf: ConfigRef; a: PNode): PNode](nimsets#deduplicate%2CConfigRef%2CPNode)
 [def:](#def)
* [InstrKind.def](dfa#def)
 [DefaultConfig:](#DefaultConfig)
* [options: DefaultConfig](options#DefaultConfig)
 [DefaultConfigNims:](#DefaultConfigNims)
* [options: DefaultConfigNims](options#DefaultConfigNims)
 [DefaultGlobalOptions:](#DefaultGlobalOptions)
* [options: DefaultGlobalOptions](options#DefaultGlobalOptions)
 [DefaultOptions:](#DefaultOptions)
* [options: DefaultOptions](options#DefaultOptions)
 [defaultParamSeparator:](#defaultParamSeparator)
* [typesrenderer: defaultParamSeparator](typesrenderer#defaultParamSeparator)
 [definedSymbolNames:](#definedSymbolNames)
* [condsyms: definedSymbolNames(symbols: StringTableRef): string](condsyms#definedSymbolNames.i%2CStringTableRef)
 [defineSymbol:](#defineSymbol)
* [condsyms: defineSymbol(symbols: StringTableRef; symbol: string; value: string = "true")](condsyms#defineSymbol%2CStringTableRef%2Cstring%2Cstring)
 [delSon:](#delSon)
* [ast: delSon(father: PNode; idx: int)](ast#delSon%2CPNode%2Cint)
 [demanglePackageName:](#demanglePackageName)
* [options: demanglePackageName(path: string): string](options#demanglePackageName%2Cstring)
 [depConfigFields:](#depConfigFields)
* [options: depConfigFields(fn)](options#depConfigFields.t)
 [describeArgs:](#describeArgs)
* [sigmatch: describeArgs(c: PContext; n: PNode; startIdx = 1; prefer = preferName): string](sigmatch#describeArgs%2CPContext%2CPNode%2Cint)
 [destructor:](#destructor)
* [ast: destructor(t: PType): PSym](ast#destructor.t%2CPType)
* [Feature.destructor](options#destructor)
 [detailedInfo:](#detailedInfo)
* [ast: detailedInfo(sym: PSym): string](ast#detailedInfo.t%2CPSym)
 [differ:](#differ)
* [linter: differ(line: string; a, b: int; x: string): string](linter#differ%2Cstring%2Cint%2Cint%2Cstring)
 [diffSets:](#diffSets)
* [nimsets: diffSets(conf: ConfigRef; a, b: PNode): PNode](nimsets#diffSets%2CConfigRef%2CPNode%2CPNode)
 [directViewType:](#directViewType)
* [typeallowed: directViewType(t: PType): ViewTypeKind](typeallowed#directViewType%2CPType)
 [dirExists:](#dirExists)
* [pathutils: dirExists(x: AbsoluteDir): bool](pathutils#dirExists%2CAbsoluteDir)
 [disabledSf:](#disabledSf)
* [SymbolFilesOption.disabledSf](options#disabledSf)
 [disableNimblePath:](#disableNimblePath)
* [options: disableNimblePath(conf: ConfigRef)](options#disableNimblePath%2CConfigRef)
 [discardSons:](#discardSons)
* [ast: discardSons(father: PNode)](ast#discardSons%2CPNode)
 [dispatcherPos:](#dispatcherPos)
* [ast: dispatcherPos](ast#dispatcherPos)
 [divMod:](#divMod)
* [int128: divMod(dividend, divisor: Int128): tuple[quotient, remainder: Int128]](int128#divMod%2CInt128%2CInt128)
 [doAbort:](#doAbort)
* [TErrorHandling.doAbort](msgs#doAbort)
 [DocConfig:](#DocConfig)
* [options: DocConfig](options#DocConfig)
 [docCss:](#docCss)
* [nimpaths: docCss](nimpaths#docCss)
 [docgen2JsonPass:](#docgen2JsonPass)
* [docgen2: docgen2JsonPass](docgen2#docgen2JsonPass)
 [docgen2Pass:](#docgen2Pass)
* [docgen2: docgen2Pass](docgen2#docgen2Pass)
 [docHackJs:](#docHackJs)
* [nimpaths: docHackJs](nimpaths#docHackJs)
 [docHackJsFname:](#docHackJsFname)
* [nimpaths: docHackJsFname](nimpaths#docHackJsFname)
 [docHackNim:](#docHackNim)
* [nimpaths: docHackNim](nimpaths#docHackNim)
 [docRootDefault:](#docRootDefault)
* [options: docRootDefault](options#docRootDefault)
 [DocTexConfig:](#DocTexConfig)
* [options: DocTexConfig](options#DocTexConfig)
 [documentRaises:](#documentRaises)
* [docgen: documentRaises(cache: IdentCache; n: PNode)](docgen#documentRaises%2CIdentCache%2CPNode)
 [doesImply:](#doesImply)
* [guards: doesImply(facts: TModel; prop: PNode): TImplication](guards#doesImply%2CTModel%2CPNode)
 [doNothing:](#doNothing)
* [TErrorHandling.doNothing](msgs#doNothing)
 [dontInlineConstant:](#dontInlineConstant)
* [trees: dontInlineConstant(orig, cnst: PNode): bool](trees#dontInlineConstant%2CPNode%2CPNode)
 [doRaise:](#doRaise)
* [TErrorHandling.doRaise](msgs#doRaise)
 [dotdotMangle:](#dotdotMangle)
* [nimpaths: dotdotMangle](nimpaths#dotdotMangle)
 [dotOperators:](#dotOperators)
* [Feature.dotOperators](options#dotOperators)
 [dump:](#dump)
* [vmprofiler: dump(conf: ConfigRef; pd: ProfileData): string](vmprofiler#dump%2CConfigRef%2CProfileData)
 [dynamicBindSym:](#dynamicBindSym)
* [Feature.dynamicBindSym](options#dynamicBindSym)
 [eat:](#eat)
* [parser: eat(p: var Parser; tokType: TokType)](parser#eat%2CParser%2CTokType)
 [echoCfg:](#echoCfg)
* [dfa: echoCfg(c: ControlFlowGraph; start = 0; last = -1)](dfa#echoCfg%2CControlFlowGraph%2Cint)
 [echoCode:](#echoCode)
* [vmgen: echoCode(c: PCtx; start = 0; last = -1)](vmgen#echoCode%2CPCtx%2Cint)
 [efAllowDestructor:](#efAllowDestructor)
* [TExprFlag.efAllowDestructor](semdata#efAllowDestructor)
 [efAllowStmt:](#efAllowStmt)
* [TExprFlag.efAllowStmt](semdata#efAllowStmt)
 [efCompat:](#efCompat)
* [EffectsCompat.efCompat](types#efCompat)
 [efDetermineType:](#efDetermineType)
* [TExprFlag.efDetermineType](semdata#efDetermineType)
 [efExplain:](#efExplain)
* [TExprFlag.efExplain](semdata#efExplain)
 [effectListLen:](#effectListLen)
* [ast: effectListLen](ast#effectListLen)
 [EffectsCompat:](#EffectsCompat)
* [types: EffectsCompat](types#EffectsCompat)
 [effectSpec:](#effectSpec)
* [trees: effectSpec(n: PNode; effectType: TSpecialWord): PNode](trees#effectSpec%2CPNode%2CTSpecialWord)
 [efFromHlo:](#efFromHlo)
* [TExprFlag.efFromHlo](semdata#efFromHlo)
 [efInCall:](#efInCall)
* [TExprFlag.efInCall](semdata#efInCall)
 [efInTypeof:](#efInTypeof)
* [TExprFlag.efInTypeof](semdata#efInTypeof)
 [efLockLevelsDiffer:](#efLockLevelsDiffer)
* [EffectsCompat.efLockLevelsDiffer](types#efLockLevelsDiffer)
 [efLValue:](#efLValue)
* [TExprFlag.efLValue](semdata#efLValue)
 [efNeedStatic:](#efNeedStatic)
* [TExprFlag.efNeedStatic](semdata#efNeedStatic)
 [efNoEvaluateGeneric:](#efNoEvaluateGeneric)
* [TExprFlag.efNoEvaluateGeneric](semdata#efNoEvaluateGeneric)
 [efNoSem2Check:](#efNoSem2Check)
* [TExprFlag.efNoSem2Check](semdata#efNoSem2Check)
 [efNoSemCheck:](#efNoSemCheck)
* [TExprFlag.efNoSemCheck](semdata#efNoSemCheck)
 [efNoUndeclared:](#efNoUndeclared)
* [TExprFlag.efNoUndeclared](semdata#efNoUndeclared)
 [efOperand:](#efOperand)
* [TExprFlag.efOperand](semdata#efOperand)
 [efPreferNilResult:](#efPreferNilResult)
* [TExprFlag.efPreferNilResult](semdata#efPreferNilResult)
 [efPreferStatic:](#efPreferStatic)
* [TExprFlag.efPreferStatic](semdata#efPreferStatic)
 [efRaisesDiffer:](#efRaisesDiffer)
* [EffectsCompat.efRaisesDiffer](types#efRaisesDiffer)
 [efRaisesUnknown:](#efRaisesUnknown)
* [EffectsCompat.efRaisesUnknown](types#efRaisesUnknown)
 [efTagsDiffer:](#efTagsDiffer)
* [EffectsCompat.efTagsDiffer](types#efTagsDiffer)
 [efTagsUnknown:](#efTagsUnknown)
* [EffectsCompat.efTagsUnknown](types#efTagsUnknown)
 [efWantIterator:](#efWantIterator)
* [TExprFlag.efWantIterator](semdata#efWantIterator)
 [efWantStmt:](#efWantStmt)
* [TExprFlag.efWantStmt](semdata#efWantStmt)
 [efWantValue:](#efWantValue)
* [TExprFlag.efWantValue](semdata#efWantValue)
 [elementType:](#elementType)
* [vmconv: elementType(T: typedesc): typedesc](vmconv#elementType.t%2Ctypedesc)
 [ElemSize:](#ElemSize)
* [bitsets: ElemSize](bitsets#ElemSize)
 [elemType:](#elemType)
* [types: elemType(t: PType): PType](types#elemType%2CPType)
 [emConst:](#emConst)
* [TEvalMode.emConst](vmdef#emConst)
 [emOptimize:](#emOptimize)
* [TEvalMode.emOptimize](vmdef#emOptimize)
 [emptyRange:](#emptyRange)
* [nimsets: emptyRange(a, b: PNode): bool](nimsets#emptyRange%2CPNode%2CPNode)
 [emRepl:](#emRepl)
* [TEvalMode.emRepl](vmdef#emRepl)
 [emStaticExpr:](#emStaticExpr)
* [TEvalMode.emStaticExpr](vmdef#emStaticExpr)
 [emStaticStmt:](#emStaticStmt)
* [TEvalMode.emStaticStmt](vmdef#emStaticStmt)
 [encode:](#encode)
* [sourcemap: encode(i: int): string](sourcemap#encode%2Cint)
 [encodeStr:](#encodeStr)
* [rodutils: encodeStr(s: string; result: var string)](rodutils#encodeStr%2Cstring%2Cstring)
 [encodeVBiggestInt:](#encodeVBiggestInt)
* [rodutils: encodeVBiggestInt(x: BiggestInt; result: var string)](rodutils#encodeVBiggestInt%2CBiggestInt%2Cstring)
 [encodeVInt:](#encodeVInt)
* [rodutils: encodeVInt(x: int; result: var string)](rodutils#encodeVInt%2Cint%2Cstring)
 [EndianToStr:](#EndianToStr)
* [platform: EndianToStr](platform#EndianToStr)
 [EndOfFile:](#EndOfFile)
* [nimlexbase: EndOfFile](nimlexbase#EndOfFile)
 [endsWith:](#endsWith)
* [llstream: endsWith(x: string; s: set[char]): bool](llstream#endsWith%2Cstring%2Cset%5Bchar%5D)
 [endsWithOpr:](#endsWithOpr)
* [llstream: endsWithOpr(x: string): bool](llstream#endsWithOpr%2Cstring)
 [ensuresEffects:](#ensuresEffects)
* [ast: ensuresEffects](ast#ensuresEffects)
 [enter:](#enter)
* [vmprofiler: enter(prof: var Profiler; c: PCtx; tos: PStackFrame)](vmprofiler#enter%2CProfiler%2CPCtx%2CPStackFrame)
 [enumFieldPragmas:](#enumFieldPragmas)
* [pragmas: enumFieldPragmas](pragmas#enumFieldPragmas)
 [enumHasHoles:](#enumHasHoles)
* [types: enumHasHoles(t: PType): bool](types#enumHasHoles%2CPType)
 [envName:](#envName)
* [lambdalifting: envName](lambdalifting#envName)
 [eqTypeFlags:](#eqTypeFlags)
* [ast: eqTypeFlags](ast#eqTypeFlags)
 [equalParams:](#equalParams)
* [types: equalParams(a, b: PNode): TParamsEquality](types#equalParams%2CPNode%2CPNode)
 [equalSets:](#equalSets)
* [nimsets: equalSets(conf: ConfigRef; a, b: PNode): bool](nimsets#equalSets%2CConfigRef%2CPNode%2CPNode)
 [equalsFile:](#equalsFile)
* [ropes: equalsFile(r: Rope; filename: AbsoluteFile): bool](ropes#equalsFile%2CRope%2CAbsoluteFile)
* [ropes: equalsFile(r: Rope; f: File): bool](ropes#equalsFile%2CRope%2CFile)
 [eraseVoidParams:](#eraseVoidParams)
* [semtypinst: eraseVoidParams(t: PType)](semtypinst#eraseVoidParams%2CPType)
 [ERecoverableError:](#ERecoverableError)
* [lineinfos: ERecoverableError](lineinfos#ERecoverableError)
 [errArgsNeedRunOption:](#errArgsNeedRunOption)
* [lineinfos: errArgsNeedRunOption](lineinfos#errArgsNeedRunOption)
 [errCannotOpenFile:](#errCannotOpenFile)
* [TMsgKind.errCannotOpenFile](lineinfos#errCannotOpenFile)
 [errGeneralParseError:](#errGeneralParseError)
* [TMsgKind.errGeneralParseError](lineinfos#errGeneralParseError)
 [errGenerated:](#errGenerated)
* [TMsgKind.errGenerated](lineinfos#errGenerated)
 [errGridTableNotImplemented:](#errGridTableNotImplemented)
* [TMsgKind.errGridTableNotImplemented](lineinfos#errGridTableNotImplemented)
 [errIllFormedAstX:](#errIllFormedAstX)
* [TMsgKind.errIllFormedAstX](lineinfos#errIllFormedAstX)
 [errInternal:](#errInternal)
* [TMsgKind.errInternal](lineinfos#errInternal)
 [errInvalidDirectiveX:](#errInvalidDirectiveX)
* [TMsgKind.errInvalidDirectiveX](lineinfos#errInvalidDirectiveX)
 [errMax:](#errMax)
* [lineinfos: errMax](lineinfos#errMax)
 [errMin:](#errMin)
* [lineinfos: errMin](lineinfos#errMin)
 [errNewSectionExpected:](#errNewSectionExpected)
* [TMsgKind.errNewSectionExpected](lineinfos#errNewSectionExpected)
 [ErrorHandler:](#ErrorHandler)
* [lexer: ErrorHandler](lexer#ErrorHandler)
 [errorNode:](#errorNode)
* [semdata: errorNode(c: PContext; n: PNode): PNode](semdata#errorNode%2CPContext%2CPNode)
 [errorSym:](#errorSym)
* [lookups: errorSym(c: PContext; n: PNode): PSym](lookups#errorSym%2CPContext%2CPNode)
 [errorType:](#errorType)
* [semdata: errorType(c: PContext): PType](semdata#errorType%2CPContext)
* [semfold: errorType(g: ModuleGraph): PType](semfold#errorType%2CModuleGraph)
 [errorUndeclaredIdentifier:](#errorUndeclaredIdentifier)
* [lookups: errorUndeclaredIdentifier(c: PContext; info: TLineInfo; name: string)](lookups#errorUndeclaredIdentifier%2CPContext%2CTLineInfo%2Cstring)
 [errorUseQualifier:](#errorUseQualifier)
* [lookups: errorUseQualifier(c: PContext; info: TLineInfo; s: PSym)](lookups#errorUseQualifier%2CPContext%2CTLineInfo%2CPSym)
 [errProveInit:](#errProveInit)
* [TMsgKind.errProveInit](lineinfos#errProveInit)
 [errUnknown:](#errUnknown)
* [TMsgKind.errUnknown](lineinfos#errUnknown)
 [errUser:](#errUser)
* [TMsgKind.errUser](lineinfos#errUser)
 [errXExpected:](#errXExpected)
* [TMsgKind.errXExpected](lineinfos#errXExpected)
 [errXMustBeCompileTime:](#errXMustBeCompileTime)
* [lineinfos: errXMustBeCompileTime](lineinfos#errXMustBeCompileTime)
 [ESC:](#ESC)
* [nimlexbase: ESC](nimlexbase#ESC)
 [eStdErr:](#eStdErr)
* [TErrorOutput.eStdErr](lineinfos#eStdErr)
 [eStdOut:](#eStdOut)
* [TErrorOutput.eStdOut](lineinfos#eStdOut)
 [ESuggestDone:](#ESuggestDone)
* [lineinfos: ESuggestDone](lineinfos#ESuggestDone)
 [evalConstExpr:](#evalConstExpr)
* [vm: evalConstExpr(module: PSym; g: ModuleGraph; e: PNode): PNode](vm#evalConstExpr%2CPSym%2CModuleGraph%2CPNode)
 [evalExpr:](#evalExpr)
* [vm: evalExpr(c: PCtx; n: PNode): PNode](vm#evalExpr%2CPCtx%2CPNode)
 [evalFrom:](#evalFrom)
* [importer: evalFrom(c: PContext; n: PNode): PNode](importer#evalFrom%2CPContext%2CPNode)
 [evalImport:](#evalImport)
* [importer: evalImport(c: PContext; n: PNode): PNode](importer#evalImport%2CPContext%2CPNode)
 [evalImportExcept:](#evalImportExcept)
* [importer: evalImportExcept(c: PContext; n: PNode): PNode](importer#evalImportExcept%2CPContext%2CPNode)
 [evalMacroCall:](#evalMacroCall)
* [vm: evalMacroCall(module: PSym; g: ModuleGraph; templInstCounter: ref int; n, nOrig: PNode; sym: PSym): PNode](vm#evalMacroCall%2CPSym%2CModuleGraph%2Cref.int%2CPNode%2CPNode%2CPSym)
 [evalOnce:](#evalOnce)
* [lowerings: evalOnce(g: ModuleGraph; value: PNode; owner: PSym): PNode](lowerings#evalOnce%2CModuleGraph%2CPNode%2CPSym)
 [evalOp:](#evalOp)
* [semfold: evalOp(m: TMagic; n, a, b, c: PNode; g: ModuleGraph): PNode](semfold#evalOp%2CTMagic%2CPNode%2CPNode%2CPNode%2CPNode%2CModuleGraph)
 [evalPass:](#evalPass)
* [vm: evalPass](vm#evalPass)
 [evalStaticExpr:](#evalStaticExpr)
* [vm: evalStaticExpr(module: PSym; g: ModuleGraph; e: PNode; prc: PSym): PNode](vm#evalStaticExpr%2CPSym%2CModuleGraph%2CPNode%2CPSym)
 [evalStaticStmt:](#evalStaticStmt)
* [vm: evalStaticStmt(module: PSym; g: ModuleGraph; e: PNode; prc: PSym)](vm#evalStaticStmt%2CPSym%2CModuleGraph%2CPNode%2CPSym)
 [evalStmt:](#evalStmt)
* [vm: evalStmt(c: PCtx; n: PNode)](vm#evalStmt%2CPCtx%2CPNode)
 [evalTemplate:](#evalTemplate)
* [evaltempl: evalTemplate(n: PNode; tmpl, genSymOwner: PSym; conf: ConfigRef; ic: IdentCache; instID: ref int; fromHlo = false): PNode](evaltempl#evalTemplate%2CPNode%2CPSym%2CPSym%2CConfigRef%2CIdentCache%2Cref.int)
 [evalTemplateLimit:](#evalTemplateLimit)
* [evaltempl: evalTemplateLimit](evaltempl#evalTemplateLimit)
 [ExactConstraints:](#ExactConstraints)
* [TTypeCmpFlag.ExactConstraints](types#ExactConstraints)
 [exactEquals:](#exactEquals)
* [msgs: exactEquals(a, b: TLineInfo): bool](msgs#exactEquals%2CTLineInfo%2CTLineInfo)
 [ExactGcSafety:](#ExactGcSafety)
* [TTypeCmpFlag.ExactGcSafety](types#ExactGcSafety)
 [ExactGenericParams:](#ExactGenericParams)
* [TTypeCmpFlag.ExactGenericParams](types#ExactGenericParams)
 [exactReplica:](#exactReplica)
* [ast: exactReplica(t: PType): PType](ast#exactReplica%2CPType)
 [ExactTypeDescValues:](#ExactTypeDescValues)
* [TTypeCmpFlag.ExactTypeDescValues](types#ExactTypeDescValues)
 [excCpp:](#excCpp)
* [ExceptionSystem.excCpp](options#excCpp)
 [exceptionEffects:](#exceptionEffects)
* [ast: exceptionEffects](ast#exceptionEffects)
 [ExceptionSystem:](#ExceptionSystem)
* [options: ExceptionSystem](options#ExceptionSystem)
 [excGoto:](#excGoto)
* [ExceptionSystem.excGoto](options#excGoto)
 [excNone:](#excNone)
* [ExceptionSystem.excNone](options#excNone)
 [excQuirky:](#excQuirky)
* [ExceptionSystem.excQuirky](options#excQuirky)
 [excSetjmp:](#excSetjmp)
* [ExceptionSystem.excSetjmp](options#excSetjmp)
 [execExternalProgram:](#execExternalProgram)
* [extccomp: execExternalProgram(conf: ConfigRef; cmd: string; msg = hintExecuting)](extccomp#execExternalProgram%2CConfigRef%2Cstring)
 [execProc:](#execProc)
* [vm: execProc(c: PCtx; sym: PSym; args: openArray[PNode]): PNode](vm#execProc%2CPCtx%2CPSym%2CopenArray%5BPNode%5D)
 [existsConfigVar:](#existsConfigVar)
* [options: existsConfigVar(conf: ConfigRef; key: string): bool](options#existsConfigVar%2CConfigRef%2Cstring)
 [expectIdent:](#expectIdent)
* [parser: expectIdent(p: Parser)](parser#expectIdent%2CParser)
 [expectIdentOrKeyw:](#expectIdentOrKeyw)
* [parser: expectIdentOrKeyw(p: Parser)](parser#expectIdentOrKeyw%2CParser)
 [explanationsBaseUrl:](#explanationsBaseUrl)
* [lineinfos: explanationsBaseUrl](lineinfos#explanationsBaseUrl)
 [ExportableSymKinds:](#ExportableSymKinds)
* [ast: ExportableSymKinds](ast#ExportableSymKinds)
 [exprPragmas:](#exprPragmas)
* [pragmas: exprPragmas](pragmas#exprPragmas)
 [exprRoot:](#exprRoot)
* [parampatterns: exprRoot(n: PNode): PSym](parampatterns#exprRoot%2CPNode)
 [exprStructuralEquivalent:](#exprStructuralEquivalent)
* [trees: exprStructuralEquivalent(a, b: PNode; strictSymEquality = false): bool](trees#exprStructuralEquivalent%2CPNode%2CPNode)
 [extractFilename:](#extractFilename)
* [pathutils: extractFilename(x: AbsoluteFile): string](pathutils#extractFilename%2CAbsoluteFile)
 [extractRange:](#extractRange)
* [trees: extractRange(k: TNodeKind; n: PNode; a, b: int): PNode](trees#extractRange%2CTNodeKind%2CPNode%2Cint%2Cint)
 [extractRunnableExamplesSource:](#extractRunnableExamplesSource)
* [renderverbatim: extractRunnableExamplesSource(conf: ConfigRef; n: PNode): string](renderverbatim#extractRunnableExamplesSource%2CConfigRef%2CPNode)
 [fakePackageName:](#fakePackageName)
* [options: fakePackageName(conf: ConfigRef; path: AbsoluteFile): string](options#fakePackageName%2CConfigRef%2CAbsoluteFile)
 [fastLog2:](#fastLog2)
* [int128: fastLog2(a: Int128): int](int128#fastLog2%2CInt128)
 [fatal:](#fatal)
* [msgs: fatal(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")](msgs#fatal.t%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring)
 [fatalMax:](#fatalMax)
* [lineinfos: fatalMax](lineinfos#fatalMax)
 [fatalMin:](#fatalMin)
* [lineinfos: fatalMin](lineinfos#fatalMin)
 [Feature:](#Feature)
* [options: Feature](options#Feature)
 [FF:](#FF)
* [nimlexbase: FF](nimlexbase#FF)
 [fieldPragmas:](#fieldPragmas)
* [pragmas: fieldPragmas](pragmas#fieldPragmas)
 [fieldVisible:](#fieldVisible)
* [sigmatch: fieldVisible(c: PContext; f: PSym): bool](sigmatch#fieldVisible%2CPContext%2CPSym)
 [fileExists:](#fileExists)
* [pathutils: fileExists(x: AbsoluteFile): bool](pathutils#fileExists%2CAbsoluteFile)
 [fileIdx:](#fileIdx)
* [ast: fileIdx(c: PSym): FileIndex](ast#fileIdx.t%2CPSym)
 [FileIndex:](#FileIndex)
* [lineinfos: FileIndex](lineinfos#FileIndex)
 [fileInfoIdx:](#fileInfoIdx)
* [msgs: fileInfoIdx(conf: ConfigRef; filename: AbsoluteFile): FileIndex](msgs#fileInfoIdx%2CConfigRef%2CAbsoluteFile)
* [msgs: fileInfoIdx(conf: ConfigRef; filename: AbsoluteFile; isKnownFile: var bool): FileIndex](msgs#fileInfoIdx%2CConfigRef%2CAbsoluteFile%2Cbool)
 [fileInfoKnown:](#fileInfoKnown)
* [msgs: fileInfoKnown(conf: ConfigRef; filename: AbsoluteFile): bool](msgs#fileInfoKnown%2CConfigRef%2CAbsoluteFile)
 [filename:](#filename)
* [ast: filename(c: PSym): string](ast#filename.t%2CPSym)
* [semdata: filename(c: PContext): string](semdata#filename%2CPContext)
 [FilenameOption:](#FilenameOption)
* [msgs: FilenameOption](msgs#FilenameOption)
 [fillObjectFields:](#fillObjectFields)
* [cgen: fillObjectFields(m: BModule; typ: PType)](cgen#fillObjectFields%2CBModule%2CPType)
 [fillTypeS:](#fillTypeS)
* [semdata: fillTypeS(dest: PType; kind: TTypeKind; c: PContext)](semdata#fillTypeS%2CPType%2CTTypeKind%2CPContext)
 [filterReplace:](#filterReplace)
* [filters: filterReplace(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile; call: PNode): PLLStream](filters#filterReplace%2CConfigRef%2CPLLStream%2CAbsoluteFile%2CPNode)
 [filterStrip:](#filterStrip)
* [filters: filterStrip(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile; call: PNode): PLLStream](filters#filterStrip%2CConfigRef%2CPLLStream%2CAbsoluteFile%2CPNode)
 [filterTmpl:](#filterTmpl)
* [filter\_tmpl: filterTmpl(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile; call: PNode): PLLStream](filter_tmpl#filterTmpl%2CConfigRef%2CPLLStream%2CAbsoluteFile%2CPNode)
 [findFile:](#findFile)
* [options: findFile(conf: ConfigRef; f: string; suppressStdlib = false): AbsoluteFile](options#findFile%2CConfigRef%2Cstring)
 [findModule:](#findModule)
* [options: findModule(conf: ConfigRef; modulename, currentModule: string): AbsoluteFile](options#findModule%2CConfigRef%2Cstring%2Cstring)
 [findNodeJs:](#findNodeJs)
* [nodejs: findNodeJs(): string](nodejs#findNodeJs)
 [findPragma:](#findPragma)
* [trees: findPragma(n: PNode; which: TSpecialWord): PNode](trees#findPragma%2CPNode%2CTSpecialWord)
 [findProjectNimFile:](#findProjectNimFile)
* [options: findProjectNimFile(conf: ConfigRef; pkg: string): string](options#findProjectNimFile%2CConfigRef%2Cstring)
 [findStr:](#findStr)
* [wordrecg: findStr[T: enum](a: Slice[T]; s: string; default: T): T](wordrecg#findStr%2CSlice%5BT%3A%20enum%5D%2Cstring%2CT)
 [findUnresolvedStatic:](#findUnresolvedStatic)
* [ast: findUnresolvedStatic(n: PNode): PNode](ast#findUnresolvedStatic%2CPNode)
 [finishDoc2Pass:](#finishDoc2Pass)
* [docgen2: finishDoc2Pass(project: string)](docgen2#finishDoc2Pass%2Cstring)
 [firstABxInstr:](#firstABxInstr)
* [vmdef: firstABxInstr](vmdef#firstABxInstr)
 [FirstCallConv:](#FirstCallConv)
* [pragmas: FirstCallConv](pragmas#FirstCallConv)
 [firstFloat:](#firstFloat)
* [types: firstFloat(t: PType): BiggestFloat](types#firstFloat%2CPType)
 [firstIdentExcluding:](#firstIdentExcluding)
* [astalgo: firstIdentExcluding(ti: var TIdentIter; tab: TStrTable; s: PIdent; excluding: IntSet): PSym](astalgo#firstIdentExcluding%2CTIdentIter%2CTStrTable%2CPIdent%2CIntSet)
 [firstOrd:](#firstOrd)
* [types: firstOrd(conf: ConfigRef; t: PType): Int128](types#firstOrd%2CConfigRef%2CPType)
 [fitsRegister:](#fitsRegister)
* [vmgen: fitsRegister(t: PType): bool](vmgen#fitsRegister%2CPType)
 [flattenStmts:](#flattenStmts)
* [trees: flattenStmts(n: PNode): PNode](trees#flattenStmts%2CPNode)
 [floatInt64Align:](#floatInt64Align)
* [options: floatInt64Align(conf: ConfigRef): int16](options#floatInt64Align%2CConfigRef)
 [FloatLike:](#FloatLike)
* [OrdinalType.FloatLike](types#FloatLike)
 [floatRangeCheck:](#floatRangeCheck)
* [types: floatRangeCheck(x: BiggestFloat; t: PType): bool](types#floatRangeCheck%2CBiggestFloat%2CPType)
 [foAbs:](#foAbs)
* [FilenameOption.foAbs](msgs#foAbs)
 [foldAlignOf:](#foldAlignOf)
* [types: foldAlignOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode](types#foldAlignOf.t%2CConfigRef%2CPNode%2CPNode)
 [foldOffsetOf:](#foldOffsetOf)
* [types: foldOffsetOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode](types#foldOffsetOf.t%2CConfigRef%2CPNode%2CPNode)
 [foldSizeOf:](#foldSizeOf)
* [types: foldSizeOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode](types#foldSizeOf.t%2CConfigRef%2CPNode%2CPNode)
 [foMagicSauce:](#foMagicSauce)
* [FilenameOption.foMagicSauce](msgs#foMagicSauce)
 [foName:](#foName)
* [FilenameOption.foName](msgs#foName)
 [forceCopy:](#forceCopy)
* [strutils2: forceCopy(result: var string; a: string)](strutils2#forceCopy%2Cstring%2Cstring)
 [foRelProject:](#foRelProject)
* [FilenameOption.foRelProject](msgs#foRelProject)
 [fork:](#fork)
* [InstrKind.fork](dfa#fork)
 [forLoopMacros:](#forLoopMacros)
* [Feature.forLoopMacros](options#forLoopMacros)
 [formatMsg:](#formatMsg)
* [msgs: formatMsg(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string): string](msgs#formatMsg%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring)
 [FormatStr:](#FormatStr)
* [ropes: FormatStr](ropes#FormatStr)
 [forVarPragmas:](#forVarPragmas)
* [pragmas: forVarPragmas](pragmas#forVarPragmas)
 [foStacktrace:](#foStacktrace)
* [FilenameOption.foStacktrace](msgs#foStacktrace)
 [frameDeclared:](#frameDeclared)
* [CodegenFlag.frameDeclared](cgendata#frameDeclared)
 [frEmbedded:](#frEmbedded)
* [TTypeFieldResult.frEmbedded](types#frEmbedded)
 [freshVarForClosureIter:](#freshVarForClosureIter)
* [lambdalifting: freshVarForClosureIter(g: ModuleGraph; s, owner: PSym): PNode](lambdalifting#freshVarForClosureIter%2CModuleGraph%2CPSym%2CPSym)
 [frHeader:](#frHeader)
* [TTypeFieldResult.frHeader](types#frHeader)
 [frNone:](#frNone)
* [TTypeFieldResult.frNone](types#frNone)
 [fromLit:](#fromLit)
* [vmconv: fromLit(a: PNode; T: typedesc): auto](vmconv#fromLit%2CPNode%2Ctypedesc)
 [fromSystem:](#fromSystem)
* [astalgo: fromSystem(op: PSym): bool](astalgo#fromSystem%2CPSym)
 [Full:](#Full)
* [InstrTargetKind.Full](dfa#Full)
 [gCacheIntTries:](#gCacheIntTries)
* [ropes: gCacheIntTries](ropes#gCacheIntTries)
 [gCacheMisses:](#gCacheMisses)
* [ropes: gCacheMisses](ropes#gCacheMisses)
 [gCacheTries:](#gCacheTries)
* [ropes: gCacheTries](ropes#gCacheTries)
 [gcArc:](#gcArc)
* [TGCMode.gcArc](options#gcArc)
 [gcBoehm:](#gcBoehm)
* [TGCMode.gcBoehm](options#gcBoehm)
 [gcGo:](#gcGo)
* [TGCMode.gcGo](options#gcGo)
 [gcHooks:](#gcHooks)
* [TGCMode.gcHooks](options#gcHooks)
 [gcMarkAndSweep:](#gcMarkAndSweep)
* [TGCMode.gcMarkAndSweep](options#gcMarkAndSweep)
 [gCmdLineInfo:](#gCmdLineInfo)
* [msgs: gCmdLineInfo](msgs#gCmdLineInfo)
 [gcNone:](#gcNone)
* [TGCMode.gcNone](options#gcNone)
 [gcOrc:](#gcOrc)
* [TGCMode.gcOrc](options#gcOrc)
 [gcRefc:](#gcRefc)
* [TGCMode.gcRefc](options#gcRefc)
 [gcRegions:](#gcRegions)
* [TGCMode.gcRegions](options#gcRegions)
 [GcTypeKinds:](#GcTypeKinds)
* [ast: GcTypeKinds](ast#GcTypeKinds)
 [gcUnselected:](#gcUnselected)
* [TGCMode.gcUnselected](options#gcUnselected)
 [gcV2:](#gcV2)
* [TGCMode.gcV2](options#gcV2)
 [gen:](#gen)
* [sourcemap: gen(map: SourceMapGenerator): SourceMap](sourcemap#gen%2CSourceMapGenerator)
 [genAddrOf:](#genAddrOf)
* [lowerings: genAddrOf(n: PNode; typeKind = tyPtr): PNode](lowerings#genAddrOf%2CPNode)
 [genCaseObjDiscMapping:](#genCaseObjDiscMapping)
* [enumtostr: genCaseObjDiscMapping(t: PType; field: PSym; info: TLineInfo; g: ModuleGraph): PSym](enumtostr#genCaseObjDiscMapping%2CPType%2CPSym%2CTLineInfo%2CModuleGraph)
 [gendependPass:](#gendependPass)
* [depends: gendependPass](depends#gendependPass)
 [genDeref:](#genDeref)
* [lowerings: genDeref(n: PNode; k = nkHiddenDeref): PNode](lowerings#genDeref%2CPNode)
 [genEnumToStrProc:](#genEnumToStrProc)
* [enumtostr: genEnumToStrProc(t: PType; info: TLineInfo; g: ModuleGraph): PSym](enumtostr#genEnumToStrProc%2CPType%2CTLineInfo%2CModuleGraph)
 [generateDoc:](#generateDoc)
* [docgen: generateDoc(d: PDoc; n, orig: PNode; docFlags: DocFlags = kDefault)](docgen#generateDoc%2CPDoc%2CPNode%2CPNode%2CDocFlags)
 [generateDot:](#generateDot)
* [depends: generateDot(graph: ModuleGraph; project: AbsoluteFile)](depends#generateDot%2CModuleGraph%2CAbsoluteFile)
 [generateIndex:](#generateIndex)
* [docgen: generateIndex(d: PDoc)](docgen#generateIndex%2CPDoc)
 [generateJson:](#generateJson)
* [docgen: generateJson(d: PDoc; n: PNode; includeComments: bool = true)](docgen#generateJson%2CPDoc%2CPNode%2Cbool)
 [generateMethodDispatchers:](#generateMethodDispatchers)
* [cgmeth: generateMethodDispatchers(g: ModuleGraph): PNode](cgmeth#generateMethodDispatchers%2CModuleGraph)
 [generateTags:](#generateTags)
* [docgen: generateTags(d: PDoc; n: PNode; r: var Rope)](docgen#generateTags%2CPDoc%2CPNode%2CRope)
 [generateTypeInstance:](#generateTypeInstance)
* [semtypinst: generateTypeInstance(p: PContext; pt: TIdTable; info: TLineInfo; t: PType): PType](semtypinst#generateTypeInstance%2CPContext%2CTIdTable%2CTLineInfo%2CPType)
* [semtypinst: generateTypeInstance(p: PContext; pt: TIdTable; arg: PNode; t: PType): untyped](semtypinst#generateTypeInstance.t%2CPContext%2CTIdTable%2CPNode%2CPType)
 [genericParamsInMacroCall:](#genericParamsInMacroCall)
* [vm: genericParamsInMacroCall(macroSym: PSym; call: PNode): (PSym, PNode)](vm#genericParamsInMacroCall.i%2CPSym%2CPNode)
 [genericParamsPos:](#genericParamsPos)
* [ast: genericParamsPos](ast#genericParamsPos)
 [GenericTypes:](#GenericTypes)
* [ast: GenericTypes](ast#GenericTypes)
 [genExpr:](#genExpr)
* [vmgen: genExpr(c: PCtx; n: PNode; requiresValue = true): int](vmgen#genExpr%2CPCtx%2CPNode)
 [genFieldDefect:](#genFieldDefect)
* [renderer: genFieldDefect(field: PSym; disc: PSym): string](renderer#genFieldDefect%2CPSym%2CPSym)
 [genHigh:](#genHigh)
* [lowerings: genHigh(g: ModuleGraph; n: PNode): PNode](lowerings#genHigh%2CModuleGraph%2CPNode)
 [genLen:](#genLen)
* [lowerings: genLen(g: ModuleGraph; n: PNode): PNode](lowerings#genLen%2CModuleGraph%2CPNode)
 [genMergeInfo:](#genMergeInfo)
* [ccgmerge: genMergeInfo(m: BModule): Rope](ccgmerge#genMergeInfo%2CBModule)
 [genPrefix:](#genPrefix)
* [lowerings: genPrefix](lowerings#genPrefix)
 [genProc:](#genProc)
* [vmgen: genProc(c: PCtx; s: PSym): int](vmgen#genProc%2CPCtx%2CPSym)
 [genSectionEnd:](#genSectionEnd)
* [ccgmerge: genSectionEnd(fs: TCFileSection; conf: ConfigRef): Rope](ccgmerge#genSectionEnd%2CTCFileSection%2CConfigRef)
* [ccgmerge: genSectionEnd(ps: TCProcSection; conf: ConfigRef): Rope](ccgmerge#genSectionEnd%2CTCProcSection%2CConfigRef)
 [genSectionStart:](#genSectionStart)
* [ccgmerge: genSectionStart(fs: TCFileSection; conf: ConfigRef): Rope](ccgmerge#genSectionStart%2CTCFileSection%2CConfigRef)
* [ccgmerge: genSectionStart(ps: TCProcSection; conf: ConfigRef): Rope](ccgmerge#genSectionStart%2CTCProcSection%2CConfigRef)
 [genSourceMap:](#genSourceMap)
* [sourcemap: genSourceMap(source: string; outFile: string): (Rope, SourceMap)](sourcemap#genSourceMap%2Cstring%2Cstring)
 [genStmt:](#genStmt)
* [vmgen: genStmt(c: PCtx; n: PNode): int](vmgen#genStmt%2CPCtx%2CPNode)
 [genSubDir:](#genSubDir)
* [options: genSubDir](options#genSubDir)
 [get:](#get)
* [semdata: get(p: PProcCon; key: PSym): PSym](semdata#get%2CPProcCon%2CPSym)
 [getAlign:](#getAlign)
* [types: getAlign(conf: ConfigRef; typ: PType): BiggestInt](types#getAlign%2CConfigRef%2CPType)
 [getBody:](#getBody)
* [ast: getBody(s: PSym): PNode](ast#getBody.t%2CPSym)
 [getBool:](#getBool)
* [vm: getBool(a: VmArgs; i: Natural): bool](vm#getBool%2CVmArgs%2CNatural)
 [getClockStr:](#getClockStr)
* [options: getClockStr(): string](options#getClockStr)
 [getClosureIterResult:](#getClosureIterResult)
* [lambdalifting: getClosureIterResult(g: ModuleGraph; iter: PSym): PSym](lambdalifting#getClosureIterResult%2CModuleGraph%2CPSym)
 [getColNumber:](#getColNumber)
* [nimlexbase: getColNumber(L: TBaseLexer; pos: int): int](nimlexbase#getColNumber%2CTBaseLexer%2Cint)
 [getCompileCFileCmd:](#getCompileCFileCmd)
* [extccomp: getCompileCFileCmd(conf: ConfigRef; cfile: Cfile; isMainFile = false; produceOutput = false): string](extccomp#getCompileCFileCmd%2CConfigRef%2CCfile)
 [getCompilerProc:](#getCompilerProc)
* [magicsys: getCompilerProc(g: ModuleGraph; name: string): PSym](magicsys#getCompilerProc%2CModuleGraph%2Cstring)
 [getConfigVar:](#getConfigVar)
* [options: getConfigVar(conf: ConfigRef; key: string; default = ""): string](options#getConfigVar%2CConfigRef%2Cstring%2Cstring)
 [getConstExpr:](#getConstExpr)
* [semfold: getConstExpr(m: PSym; n: PNode; g: ModuleGraph): PNode](semfold#getConstExpr%2CPSym%2CPNode%2CModuleGraph)
 [getCurrentLine:](#getCurrentLine)
* [nimlexbase: getCurrentLine(L: TBaseLexer; marker: bool = true): string](nimlexbase#getCurrentLine%2CTBaseLexer%2Cbool)
 [getCurrOwner:](#getCurrOwner)
* [semdata: getCurrOwner(c: PContext): PSym](semdata#getCurrOwner%2CPContext)
 [getDateStr:](#getDateStr)
* [options: getDateStr(): string](options#getDateStr)
 [getDispatcher:](#getDispatcher)
* [cgmeth: getDispatcher(s: PSym): PSym](cgmeth#getDispatcher%2CPSym)
 [getDocHacksJs:](#getDocHacksJs)
* [nimpaths: getDocHacksJs(nimr: string; nim = getCurrentCompilerExe(); forceRebuild = false): string](nimpaths#getDocHacksJs%2Cstring)
 [getEnvParam:](#getEnvParam)
* [lambdalifting: getEnvParam(routine: PSym): PSym](lambdalifting#getEnvParam%2CPSym)
 [getFieldFromObj:](#getFieldFromObj)
* [lowerings: getFieldFromObj(t: PType; v: PSym): PSym](lowerings#getFieldFromObj%2CPType%2CPSym)
 [getFloat:](#getFloat)
* [ast: getFloat(a: PNode): BiggestFloat](ast#getFloat%2CPNode)
* [vm: getFloat(a: VmArgs; i: Natural): BiggestFloat](vm#getFloat%2CVmArgs%2CNatural)
 [getFloatLitType:](#getFloatLitType)
* [magicsys: getFloatLitType(g: ModuleGraph; literal: PNode): PType](magicsys#getFloatLitType%2CModuleGraph%2CPNode)
 [getFloatValue:](#getFloatValue)
* [types: getFloatValue(n: PNode): BiggestFloat](types#getFloatValue%2CPNode)
 [getGenSym:](#getGenSym)
* [semdata: getGenSym(c: PContext; s: PSym): PSym](semdata#getGenSym%2CPContext%2CPSym)
 [getGlobalValue:](#getGlobalValue)
* [vm: getGlobalValue(c: PCtx; s: PSym): PNode](vm#getGlobalValue%2CPCtx%2CPSym)
 [getHash:](#getHash)
* [msgs: getHash(conf: ConfigRef; fileIdx: FileIndex): string](msgs#getHash%2CConfigRef%2CFileIndex)
 [getID:](#getID)
* [idgen: getID(): int](idgen#getID)
 [getIdent:](#getIdent)
* [idents: getIdent(ic: IdentCache; identifier: cstring; length: int; h: Hash): PIdent](idents#getIdent%2CIdentCache%2Ccstring%2Cint%2CHash)
* [idents: getIdent(ic: IdentCache; identifier: string): PIdent](idents#getIdent%2CIdentCache%2Cstring)
* [idents: getIdent(ic: IdentCache; identifier: string; h: Hash): PIdent](idents#getIdent%2CIdentCache%2Cstring%2CHash)
 [getIndentWidth:](#getIndentWidth)
* [lexer: getIndentWidth(fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache; config: ConfigRef): int](lexer#getIndentWidth%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef)
 [getInfoContext:](#getInfoContext)
* [msgs: getInfoContext(conf: ConfigRef; index: int): TLineInfo](msgs#getInfoContext%2CConfigRef%2Cint)
 [getInfoContextLen:](#getInfoContextLen)
* [msgs: getInfoContextLen(conf: ConfigRef): int](msgs#getInfoContextLen%2CConfigRef)
 [getInt:](#getInt)
* [ast: getInt(a: PNode): Int128](ast#getInt%2CPNode)
* [vm: getInt(a: VmArgs; i: Natural): BiggestInt](vm#getInt%2CVmArgs%2CNatural)
 [getInt64:](#getInt64)
* [ast: getInt64(a: PNode): int64](ast#getInt64%2CPNode)
 [getIntLitType:](#getIntLitType)
* [magicsys: getIntLitType(g: ModuleGraph; literal: PNode): PType](magicsys#getIntLitType%2CModuleGraph%2CPNode)
 [getLineInfo:](#getLineInfo)
* [lexer: getLineInfo(L: Lexer; tok: Token): TLineInfo](lexer#getLineInfo%2CLexer%2CToken)
 [getMagic:](#getMagic)
* [trees: getMagic(op: PNode): TMagic](trees#getMagic%2CPNode)
 [getMagicEqSymForType:](#getMagicEqSymForType)
* [magicsys: getMagicEqSymForType(g: ModuleGraph; t: PType; info: TLineInfo): PSym](magicsys#getMagicEqSymForType%2CModuleGraph%2CPType%2CTLineInfo)
 [getModule:](#getModule)
* [astalgo: getModule(s: PSym): PSym](astalgo#getModule%2CPSym)
* [modulegraphs: getModule(g: ModuleGraph; fileIdx: FileIndex): PSym](modulegraphs#getModule%2CModuleGraph%2CFileIndex)
 [getModuleName:](#getModuleName)
* [modulepaths: getModuleName(conf: ConfigRef; n: PNode): string](modulepaths#getModuleName%2CConfigRef%2CPNode)
 [getNamedParamFromList:](#getNamedParamFromList)
* [astalgo: getNamedParamFromList(list: PNode; ident: PIdent): PSym](astalgo#getNamedParamFromList%2CPNode%2CPIdent)
 [getNextTok:](#getNextTok)
* [renderer: getNextTok(r: var TSrcGen; kind: var TokType; literal: var string)](renderer#getNextTok%2CTSrcGen%2CTokType%2Cstring)
 [getNimbleFile:](#getNimbleFile)
* [options: getNimbleFile(conf: ConfigRef; path: string): string](options#getNimbleFile%2CConfigRef%2Cstring)
 [getnimblePkg:](#getnimblePkg)
* [ast: getnimblePkg(a: PSym): PSym](ast#getnimblePkg%2CPSym)
 [getnimblePkgId:](#getnimblePkgId)
* [ast: getnimblePkgId(a: PSym): int](ast#getnimblePkgId%2CPSym)
 [getNimcacheDir:](#getNimcacheDir)
* [options: getNimcacheDir(conf: ConfigRef): AbsoluteDir](options#getNimcacheDir%2CConfigRef)
 [getNimScriptSymbol:](#getNimScriptSymbol)
* [magicsys: getNimScriptSymbol(g: ModuleGraph; name: string): PSym](magicsys#getNimScriptSymbol%2CModuleGraph%2Cstring)
 [getNode:](#getNode)
* [vm: getNode(a: VmArgs; i: Natural): PNode](vm#getNode%2CVmArgs%2CNatural)
 [getNullValue:](#getNullValue)
* [vmgen: getNullValue(typ: PType; info: TLineInfo; conf: ConfigRef): PNode](vmgen#getNullValue%2CPType%2CTLineInfo%2CConfigRef)
 [getOrDefault:](#getOrDefault)
* [btrees: getOrDefault[Key, Val](b: BTree[Key, Val]; key: Key): Val](btrees#getOrDefault%2CBTree%5BKey%2CVal%5D%2CKey)
 [getOrdValue:](#getOrdValue)
* [types: getOrdValue(n: PNode; onError = high(Int128)): Int128](types#getOrdValue%2CPNode)
 [getOutFile:](#getOutFile)
* [options: getOutFile(conf: ConfigRef; filename: RelativeFile; ext: string): AbsoluteFile](options#getOutFile%2CConfigRef%2CRelativeFile%2Cstring)
 [getPackageName:](#getPackageName)
* [options: getPackageName(conf: ConfigRef; path: string): string](options#getPackageName%2CConfigRef%2Cstring)
 [getPathVersion:](#getPathVersion)
* [nimblecmd: getPathVersion(p: string): tuple[name, version: string]](nimblecmd#getPathVersion%2Cstring)
 [getPlugin:](#getPlugin)
* [active: getPlugin(ic: IdentCache; fn: PSym): Transformation](plugins/active#getPlugin%2CIdentCache%2CPSym)
 [getPragmaStmt:](#getPragmaStmt)
* [ccgutils: getPragmaStmt(n: PNode; w: TSpecialWord): PNode](ccgutils#getPragmaStmt%2CPNode%2CTSpecialWord)
 [getPragmaVal:](#getPragmaVal)
* [pragmas: getPragmaVal(procAst: PNode; name: TSpecialWord): PNode](pragmas#getPragmaVal%2CPNode%2CTSpecialWord)
 [getPrecedence:](#getPrecedence)
* [lexer: getPrecedence(ident: PIdent): int](lexer#getPrecedence%2CPIdent)
* [lexer: getPrecedence(tok: Token): int](lexer#getPrecedence%2CToken)
 [getPrefixDir:](#getPrefixDir)
* [options: getPrefixDir(conf: ConfigRef): AbsoluteDir](options#getPrefixDir%2CConfigRef)
 [getProcHeader:](#getProcHeader)
* [types: getProcHeader(conf: ConfigRef; sym: PSym; prefer: TPreferedDesc = preferName; getDeclarationPath = true): string](types#getProcHeader%2CConfigRef%2CPSym%2CTPreferedDesc)
 [getRelativePathFromConfigPath:](#getRelativePathFromConfigPath)
* [options: getRelativePathFromConfigPath(conf: ConfigRef; f: AbsoluteFile): RelativeFile](options#getRelativePathFromConfigPath%2CConfigRef%2CAbsoluteFile)
 [getReturnType:](#getReturnType)
* [types: getReturnType(s: PSym): PType](types#getReturnType%2CPSym)
 [getRoot:](#getRoot)
* [trees: getRoot(n: PNode): PSym](trees#getRoot%2CPNode)
 [getSize:](#getSize)
* [types: getSize(conf: ConfigRef; typ: PType): BiggestInt](types#getSize%2CConfigRef%2CPType)
 [getStateField:](#getStateField)
* [lambdalifting: getStateField(g: ModuleGraph; owner: PSym): PSym](lambdalifting#getStateField%2CModuleGraph%2CPSym)
 [getStr:](#getStr)
* [ast: getStr(a: PNode): string](ast#getStr%2CPNode)
 [getString:](#getString)
* [vm: getString(a: VmArgs; i: Natural): string](vm#getString%2CVmArgs%2CNatural)
 [getStrOrChar:](#getStrOrChar)
* [ast: getStrOrChar(a: PNode): string](ast#getStrOrChar%2CPNode)
 [getSymFromList:](#getSymFromList)
* [astalgo: getSymFromList(list: PNode; ident: PIdent; start: int = 0): PSym](astalgo#getSymFromList%2CPNode%2CPIdent%2Cint)
 [getSymRepr:](#getSymRepr)
* [lookups: getSymRepr(conf: ConfigRef; s: PSym): string](lookups#getSymRepr%2CConfigRef%2CPSym)
 [getSysMagic:](#getSysMagic)
* [magicsys: getSysMagic(g: ModuleGraph; info: TLineInfo; name: string; m: TMagic): PSym](magicsys#getSysMagic%2CModuleGraph%2CTLineInfo%2Cstring%2CTMagic)
 [getSysSym:](#getSysSym)
* [magicsys: getSysSym(g: ModuleGraph; info: TLineInfo; name: string): PSym](magicsys#getSysSym%2CModuleGraph%2CTLineInfo%2Cstring)
 [getSystemConfigPath:](#getSystemConfigPath)
* [nimconf: getSystemConfigPath(conf: ConfigRef; filename: RelativeFile): AbsoluteFile](nimconf#getSystemConfigPath%2CConfigRef%2CRelativeFile)
 [getSysType:](#getSysType)
* [magicsys: getSysType(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType](magicsys#getSysType%2CModuleGraph%2CTLineInfo%2CTTypeKind)
 [getTok:](#getTok)
* [parser: getTok(p: var Parser)](parser#getTok%2CParser)
 [getTokSym:](#getTokSym)
* [renderer: getTokSym(r: TSrcGen): PSym](renderer#getTokSym%2CTSrcGen)
 [getUniqueType:](#getUniqueType)
* [ccgutils: getUniqueType(key: PType): PType](ccgutils#getUniqueType.t%2CPType)
 [getUserConfigPath:](#getUserConfigPath)
* [nimconf: getUserConfigPath(filename: RelativeFile): AbsoluteFile](nimconf#getUserConfigPath%2CRelativeFile)
 [gFrontEndId:](#gFrontEndId)
* [idgen: gFrontEndId](idgen#gFrontEndId)
 [ggDebug:](#ggDebug)
* [ast: ggDebug](ast#ggDebug)
 [globalAssert:](#globalAssert)
* [msgs: globalAssert(conf: ConfigRef; cond: untyped; info: TLineInfo = unknownLineInfo; arg = "")](msgs#globalAssert.t%2CConfigRef%2Cuntyped%2CTLineInfo%2Cstring)
 [globalError:](#globalError)
* [msgs: globalError(conf: ConfigRef; info: TLineInfo; arg: string)](msgs#globalError.t%2CConfigRef%2CTLineInfo%2Cstring)
* [msgs: globalError(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")](msgs#globalError.t%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring)
 [gloptNone:](#gloptNone)
* [TGlobalOption.gloptNone](options#gloptNone)
 [Goal:](#Goal)
* [varpartitions: Goal](varpartitions#Goal)
 [goto:](#goto)
* [InstrKind.goto](dfa#goto)
 [GrowthFactor:](#GrowthFactor)
* [ast: GrowthFactor](ast#GrowthFactor)
 [handleCR:](#handleCR)
* [nimlexbase: handleCR(L: var TBaseLexer; pos: int): int](nimlexbase#handleCR%2CTBaseLexer%2Cint)
 [handleDocOutputOptions:](#handleDocOutputOptions)
* [docgen: handleDocOutputOptions(conf: ConfigRef)](docgen#handleDocOutputOptions%2CConfigRef)
 [handleLF:](#handleLF)
* [nimlexbase: handleLF(L: var TBaseLexer; pos: int): int](nimlexbase#handleLF%2CTBaseLexer%2Cint)
 [handleStdinInput:](#handleStdinInput)
* [commands: handleStdinInput(conf: ConfigRef)](commands#handleStdinInput%2CConfigRef)
 [harmlessOptions:](#harmlessOptions)
* [options: harmlessOptions](options#harmlessOptions)
 [hasAssume:](#hasAssume)
* [TInfoCCProp.hasAssume](extccomp#hasAssume)
 [hasAttribute:](#hasAttribute)
* [TInfoCCProp.hasAttribute](extccomp#hasAttribute)
 [hasComputedGoto:](#hasComputedGoto)
* [TInfoCCProp.hasComputedGoto](extccomp#hasComputedGoto)
 [hasCpp:](#hasCpp)
* [TInfoCCProp.hasCpp](extccomp#hasCpp)
 [hasCurFramePointer:](#hasCurFramePointer)
* [TCProcFlag.hasCurFramePointer](cgendata#hasCurFramePointer)
 [hasDeclspec:](#hasDeclspec)
* [TInfoCCProp.hasDeclspec](extccomp#hasDeclspec)
 [hasDestructor:](#hasDestructor)
* [ast: hasDestructor(t: PType): bool](ast#hasDestructor.t%2CPType)
 [hasDisabledAsgn:](#hasDisabledAsgn)
* [ast: hasDisabledAsgn(t: PType): bool](ast#hasDisabledAsgn%2CPType)
 [hasFauxMatch:](#hasFauxMatch)
* [sigmatch: hasFauxMatch(c: TCandidate): bool](sigmatch#hasFauxMatch.t%2CTCandidate)
 [hasFFI:](#hasFFI)
* [options: hasFFI](options#hasFFI)
 [hasGcGuard:](#hasGcGuard)
* [TInfoCCProp.hasGcGuard](extccomp#hasGcGuard)
 [hasGnuAsm:](#hasGnuAsm)
* [TInfoCCProp.hasGnuAsm](extccomp#hasGnuAsm)
 [hash:](#hash)
* [lineinfos: hash(i: TLineInfo): Hash](lineinfos#hash%2CTLineInfo)
* [modulegraphs: hash(x: FileIndex): Hash](modulegraphs#hash%2CFileIndex)
* [modulegraphs: hash(u: SigHash): Hash](modulegraphs#hash%2CSigHash)
 [hasHint:](#hasHint)
* [options: hasHint(conf: ConfigRef; note: TNoteKind): bool](options#hasHint%2CConfigRef%2CTNoteKind)
 [hashNode:](#hashNode)
* [astalgo: hashNode(p: RootRef): Hash](astalgo#hashNode%2CRootRef)
 [hashNonProc:](#hashNonProc)
* [sighashes: hashNonProc(s: PSym): SigHash](sighashes#hashNonProc%2CPSym)
 [hashOwner:](#hashOwner)
* [sighashes: hashOwner(s: PSym): SigHash](sighashes#hashOwner%2CPSym)
 [hashProc:](#hashProc)
* [sighashes: hashProc(s: PSym): SigHash](sighashes#hashProc%2CPSym)
 [hashString:](#hashString)
* [ccgutils: hashString(conf: ConfigRef; s: string): BiggestInt](ccgutils#hashString%2CConfigRef%2Cstring)
 [hashType:](#hashType)
* [sighashes: hashType(t: PType; flags: set[ConsiderFlag] = {CoType}): SigHash](sighashes#hashType%2CPType%2Cset%5BConsiderFlag%5D)
 [hasNext:](#hasNext)
* [btrees: hasNext[Key, Val](b: BTree[Key, Val]; index: int): bool](btrees#hasNext%2CBTree%5BKey%2CVal%5D%2Cint)
 [hasNilSon:](#hasNilSon)
* [ast: hasNilSon(n: PNode): bool](ast#hasNilSon%2CPNode)
 [hasPattern:](#hasPattern)
* [ast: hasPattern(s: PSym): bool](ast#hasPattern%2CPSym)
 [hasPragma:](#hasPragma)
* [pragmas: hasPragma(n: PNode; pragma: TSpecialWord): bool](pragmas#hasPragma%2CPNode%2CTSpecialWord)
 [hasSideEffect:](#hasSideEffect)
* [varpartitions: hasSideEffect(c: var Partitions; info: var MutationInfo): bool](varpartitions#hasSideEffect%2CPartitions%2CMutationInfo)
 [hasSonWith:](#hasSonWith)
* [ast: hasSonWith(n: PNode; kind: TNodeKind): bool](ast#hasSonWith%2CPNode%2CTNodeKind)
 [hasSubnodeWith:](#hasSubnodeWith)
* [ast: hasSubnodeWith(n: PNode; kind: TNodeKind): bool](ast#hasSubnodeWith%2CPNode%2CTNodeKind)
 [hasSwitchRange:](#hasSwitchRange)
* [TInfoCCProp.hasSwitchRange](extccomp#hasSwitchRange)
 [hasTinyCBackend:](#hasTinyCBackend)
* [options: hasTinyCBackend](options#hasTinyCBackend)
 [hasWarn:](#hasWarn)
* [options: hasWarn(conf: ConfigRef; note: TNoteKind): bool](options#hasWarn%2CConfigRef%2CTNoteKind)
 [hcrOn:](#hcrOn)
* [options: hcrOn(conf: ConfigRef): bool](options#hcrOn%2CConfigRef)
 [hExt:](#hExt)
* [extccomp: hExt](extccomp#hExt)
 [high:](#high)
* [int128: high(t: typedesc[Int128]): Int128](int128#high.t%2Ctypedesc%5BInt128%5D)
 [highBound:](#highBound)
* [guards: highBound(conf: ConfigRef; x: PNode; o: Operators): PNode](guards#highBound%2CConfigRef%2CPNode%2COperators)
 [hintCC:](#hintCC)
* [TMsgKind.hintCC](lineinfos#hintCC)
 [hintCodeBegin:](#hintCodeBegin)
* [TMsgKind.hintCodeBegin](lineinfos#hintCodeBegin)
 [hintCodeEnd:](#hintCodeEnd)
* [TMsgKind.hintCodeEnd](lineinfos#hintCodeEnd)
 [hintConditionAlwaysFalse:](#hintConditionAlwaysFalse)
* [TMsgKind.hintConditionAlwaysFalse](lineinfos#hintConditionAlwaysFalse)
 [hintConditionAlwaysTrue:](#hintConditionAlwaysTrue)
* [TMsgKind.hintConditionAlwaysTrue](lineinfos#hintConditionAlwaysTrue)
 [hintConf:](#hintConf)
* [TMsgKind.hintConf](lineinfos#hintConf)
 [hintConvFromXtoItselfNotNeeded:](#hintConvFromXtoItselfNotNeeded)
* [TMsgKind.hintConvFromXtoItselfNotNeeded](lineinfos#hintConvFromXtoItselfNotNeeded)
 [hintConvToBaseNotNeeded:](#hintConvToBaseNotNeeded)
* [TMsgKind.hintConvToBaseNotNeeded](lineinfos#hintConvToBaseNotNeeded)
 [hintDependency:](#hintDependency)
* [TMsgKind.hintDependency](lineinfos#hintDependency)
 [hintExecuting:](#hintExecuting)
* [TMsgKind.hintExecuting](lineinfos#hintExecuting)
 [hintExpandMacro:](#hintExpandMacro)
* [TMsgKind.hintExpandMacro](lineinfos#hintExpandMacro)
 [hintExprAlwaysX:](#hintExprAlwaysX)
* [TMsgKind.hintExprAlwaysX](lineinfos#hintExprAlwaysX)
 [hintExtendedContext:](#hintExtendedContext)
* [TMsgKind.hintExtendedContext](lineinfos#hintExtendedContext)
 [hintGCStats:](#hintGCStats)
* [TMsgKind.hintGCStats](lineinfos#hintGCStats)
 [hintGlobalVar:](#hintGlobalVar)
* [TMsgKind.hintGlobalVar](lineinfos#hintGlobalVar)
 [hintLineTooLong:](#hintLineTooLong)
* [TMsgKind.hintLineTooLong](lineinfos#hintLineTooLong)
 [hintLinking:](#hintLinking)
* [TMsgKind.hintLinking](lineinfos#hintLinking)
 [hintMax:](#hintMax)
* [lineinfos: hintMax](lineinfos#hintMax)
 [hintMin:](#hintMin)
* [lineinfos: hintMin](lineinfos#hintMin)
 [hintMsgOrigin:](#hintMsgOrigin)
* [TMsgKind.hintMsgOrigin](lineinfos#hintMsgOrigin)
 [hintName:](#hintName)
* [TMsgKind.hintName](lineinfos#hintName)
 [hintPath:](#hintPath)
* [TMsgKind.hintPath](lineinfos#hintPath)
 [hintPattern:](#hintPattern)
* [TMsgKind.hintPattern](lineinfos#hintPattern)
 [hintPerformance:](#hintPerformance)
* [TMsgKind.hintPerformance](lineinfos#hintPerformance)
 [hintProcessing:](#hintProcessing)
* [TMsgKind.hintProcessing](lineinfos#hintProcessing)
 [hintQuitCalled:](#hintQuitCalled)
* [TMsgKind.hintQuitCalled](lineinfos#hintQuitCalled)
 [hintSource:](#hintSource)
* [TMsgKind.hintSource](lineinfos#hintSource)
 [hintStackTrace:](#hintStackTrace)
* [TMsgKind.hintStackTrace](lineinfos#hintStackTrace)
 [hintSuccess:](#hintSuccess)
* [TMsgKind.hintSuccess](lineinfos#hintSuccess)
 [hintSuccessX:](#hintSuccessX)
* [TMsgKind.hintSuccessX](lineinfos#hintSuccessX)
 [hintUser:](#hintUser)
* [TMsgKind.hintUser](lineinfos#hintUser)
 [hintUserRaw:](#hintUserRaw)
* [TMsgKind.hintUserRaw](lineinfos#hintUserRaw)
 [hintXCannotRaiseY:](#hintXCannotRaiseY)
* [TMsgKind.hintXCannotRaiseY](lineinfos#hintXCannotRaiseY)
 [hintXDeclaredButNotUsed:](#hintXDeclaredButNotUsed)
* [TMsgKind.hintXDeclaredButNotUsed](lineinfos#hintXDeclaredButNotUsed)
 [htmldocsDir:](#htmldocsDir)
* [options: htmldocsDir](options#htmldocsDir)
 [htmldocsDirname:](#htmldocsDirname)
* [nimpaths: htmldocsDirname](nimpaths#htmldocsDirname)
 [HtmlExt:](#HtmlExt)
* [options: HtmlExt](options#HtmlExt)
 [ideChk:](#ideChk)
* [IdeCmd.ideChk](options#ideChk)
 [IdeCmd:](#IdeCmd)
* [options: IdeCmd](options#IdeCmd)
 [ideCon:](#ideCon)
* [IdeCmd.ideCon](options#ideCon)
 [ideDef:](#ideDef)
* [IdeCmd.ideDef](options#ideDef)
 [ideDus:](#ideDus)
* [IdeCmd.ideDus](options#ideDus)
 [ideHighlight:](#ideHighlight)
* [IdeCmd.ideHighlight](options#ideHighlight)
 [ideKnown:](#ideKnown)
* [IdeCmd.ideKnown](options#ideKnown)
 [ideMod:](#ideMod)
* [IdeCmd.ideMod](options#ideMod)
 [ideMsg:](#ideMsg)
* [IdeCmd.ideMsg](options#ideMsg)
 [ideNone:](#ideNone)
* [IdeCmd.ideNone](options#ideNone)
 [IdentCache:](#IdentCache)
* [idents: IdentCache](idents#IdentCache)
 [identLen:](#identLen)
* [linter: identLen(line: string; start: int): int](linter#identLen%2Cstring%2Cint)
 [ideOutline:](#ideOutline)
* [IdeCmd.ideOutline](options#ideOutline)
 [ideProject:](#ideProject)
* [IdeCmd.ideProject](options#ideProject)
 [ideSug:](#ideSug)
* [IdeCmd.ideSug](options#ideSug)
 [ideUse:](#ideUse)
* [IdeCmd.ideUse](options#ideUse)
 [idNodeTableGet:](#idNodeTableGet)
* [astalgo: idNodeTableGet(t: TIdNodeTable; key: PIdObj): PNode](astalgo#idNodeTableGet%2CTIdNodeTable%2CPIdObj)
 [idNodeTablePut:](#idNodeTablePut)
* [astalgo: idNodeTablePut(t: var TIdNodeTable; key: PIdObj; val: PNode)](astalgo#idNodeTablePut%2CTIdNodeTable%2CPIdObj%2CPNode)
 [idOrSig:](#idOrSig)
* [sighashes: idOrSig(s: PSym; currentModule: string; sigCollisions: var CountTable[SigHash]): Rope](sighashes#idOrSig%2CPSym%2Cstring%2CCountTable%5BSigHash%5D)
 [idSynchronizationPoint:](#idSynchronizationPoint)
* [idgen: idSynchronizationPoint(idRange: int)](idgen#idSynchronizationPoint%2Cint)
 [idTableGet:](#idTableGet)
* [astalgo: idTableGet(t: TIdTable; key: int): RootRef](astalgo#idTableGet%2CTIdTable%2Cint)
* [astalgo: idTableGet(t: TIdTable; key: PIdObj): RootRef](astalgo#idTableGet%2CTIdTable%2CPIdObj)
 [idTableHasObjectAsKey:](#idTableHasObjectAsKey)
* [astalgo: idTableHasObjectAsKey(t: TIdTable; key: PIdObj): bool](astalgo#idTableHasObjectAsKey%2CTIdTable%2CPIdObj)
 [idTablePairs:](#idTablePairs)
* [astalgo: idTablePairs(t: TIdTable): tuple[key: PIdObj, val: RootRef]](astalgo#idTablePairs.i%2CTIdTable)
 [idTablePut:](#idTablePut)
* [astalgo: idTablePut(t: var TIdTable; key: PIdObj; val: RootRef)](astalgo#idTablePut%2CTIdTable%2CPIdObj%2CRootRef)
 [IgnoreCC:](#IgnoreCC)
* [TTypeCmpFlag.IgnoreCC](types#IgnoreCC)
 [IgnoreTupleFields:](#IgnoreTupleFields)
* [TTypeCmpFlag.IgnoreTupleFields](types#IgnoreTupleFields)
 [iiTableGet:](#iiTableGet)
* [astalgo: iiTableGet(t: TIITable; key: int): int](astalgo#iiTableGet%2CTIITable%2Cint)
 [iiTablePut:](#iiTablePut)
* [astalgo: iiTablePut(t: var TIITable; key, val: int)](astalgo#iiTablePut%2CTIITable%2Cint%2Cint)
 [illegalCustomPragma:](#illegalCustomPragma)
* [pragmas: illegalCustomPragma(c: PContext; n: PNode; s: PSym)](pragmas#illegalCustomPragma%2CPContext%2CPNode%2CPSym)
 [illFormedAst:](#illFormedAst)
* [semdata: illFormedAst(n: PNode; conf: ConfigRef)](semdata#illFormedAst%2CPNode%2CConfigRef)
 [illFormedAstLocal:](#illFormedAstLocal)
* [semdata: illFormedAstLocal(n: PNode; conf: ConfigRef)](semdata#illFormedAstLocal%2CPNode%2CConfigRef)
 [immutableView:](#immutableView)
* [ViewTypeKind.immutableView](typeallowed#immutableView)
 [implicitDeref:](#implicitDeref)
* [Feature.implicitDeref](options#implicitDeref)
 [implicitPragmas:](#implicitPragmas)
* [pragmas: implicitPragmas(c: PContext; sym: PSym; n: PNode; validPragmas: TSpecialWords)](pragmas#implicitPragmas%2CPContext%2CPSym%2CPNode%2CTSpecialWords)
 [impliesNotNil:](#impliesNotNil)
* [guards: impliesNotNil(m: TModel; arg: PNode): TImplication](guards#impliesNotNil%2CTModel%2CPNode)
 [impNo:](#impNo)
* [TImplication.impNo](ast#impNo)
 [importAllSymbols:](#importAllSymbols)
* [importer: importAllSymbols(c: PContext; fromMod: PSym)](importer#importAllSymbols%2CPContext%2CPSym)
 [importantComments:](#importantComments)
* [options: importantComments(conf: ConfigRef): bool](options#importantComments%2CConfigRef)
 [importcCond:](#importcCond)
* [vmgen: importcCond(s: PSym): bool](vmgen#importcCond%2CPSym)
 [importcCondVar:](#importcCondVar)
* [vmgen: importcCondVar(s: PSym): bool](vmgen#importcCondVar%2CPSym)
 [importModule:](#importModule)
* [modules: importModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PSym](modules#importModule%2CModuleGraph%2CPSym%2CFileIndex)
 [importPureEnumField:](#importPureEnumField)
* [importer: importPureEnumField(c: PContext; s: PSym)](importer#importPureEnumField%2CPContext%2CPSym)
 [impUnknown:](#impUnknown)
* [TImplication.impUnknown](ast#impUnknown)
 [impYes:](#impYes)
* [TImplication.impYes](ast#impYes)
 [inc:](#inc)
* [int128: inc(a: var Int128; y: uint32 = 1)](int128#inc%2CInt128%2Cuint32)
 [inCheckpoint:](#inCheckpoint)
* [sigmatch: inCheckpoint(current, trackPos: TLineInfo): TCheckPointResult](sigmatch#inCheckpoint%2CTLineInfo%2CTLineInfo)
 [inclDynlibOverride:](#inclDynlibOverride)
* [options: inclDynlibOverride(conf: ConfigRef; lib: string)](options#inclDynlibOverride%2CConfigRef%2Cstring)
 [includeHeader:](#includeHeader)
* [cgendata: includeHeader(this: BModule; header: string)](cgendata#includeHeader%2CBModule%2Cstring)
 [includeModule:](#includeModule)
* [modules: includeModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PNode](modules#includeModule%2CModuleGraph%2CPSym%2CFileIndex)
* [reorder: includeModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PNode](reorder#includeModule%2CModuleGraph%2CPSym%2CFileIndex)
 [includesStringh:](#includesStringh)
* [CodegenFlag.includesStringh](cgendata#includesStringh)
 [incompleteType:](#incompleteType)
* [ast: incompleteType(t: PType): bool](ast#incompleteType.t%2CPType)
 [IncrementalCtx:](#IncrementalCtx)
* [incremental: IncrementalCtx](incremental#IncrementalCtx)
 [indAndComment:](#indAndComment)
* [parser: indAndComment(p: var Parser; n: PNode)](parser#indAndComment%2CParser%2CPNode)
 [index:](#index)
* [sourcemap: index[T](elements: seq[T]; element: T): int](sourcemap#index%2Cseq%5BT%5D%2CT)
 [indirectAccess:](#indirectAccess)
* [lowerings: indirectAccess(a: PNode; b: int; info: TLineInfo): PNode](lowerings#indirectAccess%2CPNode%2Cint%2CTLineInfo)
* [lowerings: indirectAccess(a: PNode; b: PSym; info: TLineInfo): PNode](lowerings#indirectAccess%2CPNode%2CPSym%2CTLineInfo)
* [lowerings: indirectAccess(a: PNode; b: string; info: TLineInfo; cache: IdentCache): PNode](lowerings#indirectAccess%2CPNode%2Cstring%2CTLineInfo%2CIdentCache)
* [lowerings: indirectAccess(a, b: PSym; info: TLineInfo): PNode](lowerings#indirectAccess%2CPSym%2CPSym%2CTLineInfo)
 [inferStaticParam:](#inferStaticParam)
* [sigmatch: inferStaticParam(c: var TCandidate; lhs: PNode; rhs: BiggestInt): bool](sigmatch#inferStaticParam%2CTCandidate%2CPNode%2CBiggestInt)
 [inheritanceDiff:](#inheritanceDiff)
* [types: inheritanceDiff(a, b: PType): int](types#inheritanceDiff%2CPType%2CPType)
 [IniExt:](#IniExt)
* [options: IniExt](options#IniExt)
 [init:](#init)
* [incremental: init(incr: IncrementalCtx)](incremental#init.t%2CIncrementalCtx)
 [initBTree:](#initBTree)
* [btrees: initBTree[Key, Val](): BTree[Key, Val]](btrees#initBTree)
 [initCandidate:](#initCandidate)
* [sigmatch: initCandidate(ctx: PContext; c: var TCandidate; callee: PSym; binding: PNode; calleeScope = -1; diagnosticsEnabled = false)](sigmatch#initCandidate%2CPContext%2CTCandidate%2CPSym%2CPNode)
* [sigmatch: initCandidate(ctx: PContext; c: var TCandidate; callee: PType)](sigmatch#initCandidate%2CPContext%2CTCandidate%2CPType)
 [initDefines:](#initDefines)
* [condsyms: initDefines(symbols: StringTableRef)](condsyms#initDefines%2CStringTableRef)
 [initDefinesProg:](#initDefinesProg)
* [cmdlinehelper: initDefinesProg(self: NimProg; conf: ConfigRef; name: string)](cmdlinehelper#initDefinesProg%2CNimProg%2CConfigRef%2Cstring)
 [initIdentIter:](#initIdentIter)
* [astalgo: initIdentIter(ti: var TIdentIter; tab: TStrTable; s: PIdent): PSym](astalgo#initIdentIter%2CTIdentIter%2CTStrTable%2CPIdent)
 [initIdNodeTable:](#initIdNodeTable)
* [ast: initIdNodeTable(x: var TIdNodeTable)](ast#initIdNodeTable%2CTIdNodeTable)
 [initIdTable:](#initIdTable)
* [ast: initIdTable(x: var TIdTable)](ast#initIdTable%2CTIdTable)
 [initIiTable:](#initIiTable)
* [astalgo: initIiTable(x: var TIITable)](astalgo#initIiTable%2CTIITable)
 [initLayeredTypeMap:](#initLayeredTypeMap)
* [semtypinst: initLayeredTypeMap(pt: TIdTable): LayeredIdTable](semtypinst#initLayeredTypeMap%2CTIdTable)
 [initMsgConfig:](#initMsgConfig)
* [lineinfos: initMsgConfig(): MsgConfig](lineinfos#initMsgConfig)
 [initNodeTable:](#initNodeTable)
* [ast: initNodeTable(x: var TNodeTable)](ast#initNodeTable%2CTNodeTable)
 [initObjectSet:](#initObjectSet)
* [ast: initObjectSet(x: var TObjectSet)](ast#initObjectSet%2CTObjectSet)
 [initOperators:](#initOperators)
* [guards: initOperators(g: ModuleGraph): Operators](guards#initOperators%2CModuleGraph)
 [initOverloadIter:](#initOverloadIter)
* [lookups: initOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym](lookups#initOverloadIter%2CTOverloadIter%2CPContext%2CPNode)
 [initStrTable:](#initStrTable)
* [ast: initStrTable(x: var TStrTable)](ast#initStrTable%2CTStrTable)
 [initTabIter:](#initTabIter)
* [astalgo: initTabIter(ti: var TTabIter; tab: TStrTable): PSym](astalgo#initTabIter%2CTTabIter%2CTStrTable)
 [initToken:](#initToken)
* [lexer: initToken(L: var Token)](lexer#initToken%2CToken)
 [initTokRender:](#initTokRender)
* [renderer: initTokRender(r: var TSrcGen; n: PNode; renderFlags: TRenderFlags = {})](renderer#initTokRender%2CTSrcGen%2CPNode%2CTRenderFlags)
 [initTypeVars:](#initTypeVars)
* [semtypinst: initTypeVars(p: PContext; typeMap: LayeredIdTable; info: TLineInfo; owner: PSym): TReplTypeVars](semtypinst#initTypeVars%2CPContext%2CLayeredIdTable%2CTLineInfo%2CPSym)
 [initVars:](#initVars)
* [extccomp: initVars(conf: ConfigRef)](extccomp#initVars%2CConfigRef)
 [injectDestructorCalls:](#injectDestructorCalls)
* [injectdestructors: injectDestructorCalls(g: ModuleGraph; owner: PSym; n: PNode): PNode](injectdestructors#injectDestructorCalls%2CModuleGraph%2CPSym%2CPNode)
 [inSet:](#inSet)
* [nimsets: inSet(s: PNode; elem: PNode): bool](nimsets#inSet%2CPNode%2CPNode)
 [instAllTypeBoundOp:](#instAllTypeBoundOp)
* [semtypinst: instAllTypeBoundOp(c: PContext; info: TLineInfo)](semtypinst#instAllTypeBoundOp%2CPContext%2CTLineInfo)
 [InstantiationInfo:](#InstantiationInfo)
* [msgs: InstantiationInfo](msgs#InstantiationInfo)
 [instCopyType:](#instCopyType)
* [semtypinst: instCopyType(cl: var TReplTypeVars; t: PType): PType](semtypinst#instCopyType%2CTReplTypeVars%2CPType)
 [instGenericConvertersArg:](#instGenericConvertersArg)
* [sem: instGenericConvertersArg(c: PContext; a: PNode; x: TCandidate)](sem#instGenericConvertersArg%2CPContext%2CPNode%2CTCandidate)
 [instGenericConvertersSons:](#instGenericConvertersSons)
* [sem: instGenericConvertersSons(c: PContext; n: PNode; x: TCandidate)](sem#instGenericConvertersSons%2CPContext%2CPNode%2CTCandidate)
 [Instr:](#Instr)
* [dfa: Instr](dfa#Instr)
 [InstrKind:](#InstrKind)
* [dfa: InstrKind](dfa#InstrKind)
 [InstrTargetKind:](#InstrTargetKind)
* [dfa: InstrTargetKind](dfa#InstrTargetKind)
 [instrTargets:](#instrTargets)
* [dfa: instrTargets(insloc, loc: PNode): InstrTargetKind](dfa#instrTargets%2CPNode%2CPNode)
 [instTypeBoundOp:](#instTypeBoundOp)
* [sigmatch: instTypeBoundOp(c: PContext; dc: PSym; t: PType; info: TLineInfo; op: TTypeAttachedOp; col: int): PSym](sigmatch#instTypeBoundOp%2CPContext%2CPSym%2CPType%2CTLineInfo%2CTTypeAttachedOp%2Cint)
 [Int128:](#Int128)
* [int128: Int128](int128#Int128)
 [IntegralTypes:](#IntegralTypes)
* [ast: IntegralTypes](ast#IntegralTypes)
 [interestingCaseExpr:](#interestingCaseExpr)
* [guards: interestingCaseExpr(m: PNode): bool](guards#interestingCaseExpr%2CPNode)
 [internalAssert:](#internalAssert)
* [msgs: internalAssert(conf: ConfigRef; e: bool)](msgs#internalAssert.t%2CConfigRef%2Cbool)
 [internalError:](#internalError)
* [msgs: internalError(conf: ConfigRef; errMsg: string)](msgs#internalError.t%2CConfigRef%2Cstring)
* [msgs: internalError(conf: ConfigRef; info: TLineInfo; errMsg: string)](msgs#internalError.t%2CConfigRef%2CTLineInfo%2Cstring)
 [interp:](#interp)
* [nimpaths: interp(path: string; nimr: string): string](nimpaths#interp%2Cstring%2Cstring)
 [intersectSets:](#intersectSets)
* [nimsets: intersectSets(conf: ConfigRef; a, b: PNode): PNode](nimsets#intersectSets%2CConfigRef%2CPNode%2CPNode)
 [IntLike:](#IntLike)
* [OrdinalType.IntLike](types#IntLike)
 [invalidateFacts:](#invalidateFacts)
* [guards: invalidateFacts(s: var seq[PNode]; n: PNode)](guards#invalidateFacts%2Cseq%5BPNode%5D%2CPNode)
* [guards: invalidateFacts(m: var TModel; n: PNode)](guards#invalidateFacts%2CTModel%2CPNode)
 [InvalidFileIdx:](#InvalidFileIdx)
* [lineinfos: InvalidFileIdx](lineinfos#InvalidFileIdx)
 [invalidGenericInst:](#invalidGenericInst)
* [types: invalidGenericInst(f: PType): bool](types#invalidGenericInst%2CPType)
 [InvalidKey:](#InvalidKey)
* [astalgo: InvalidKey](astalgo#InvalidKey)
 [invalidPragma:](#invalidPragma)
* [pragmas: invalidPragma(c: PContext; n: PNode)](pragmas#invalidPragma%2CPContext%2CPNode)
 [isAddrNode:](#isAddrNode)
* [astalgo: isAddrNode(n: PNode): bool](astalgo#isAddrNode%2CPNode)
 [isAnalysableFieldAccess:](#isAnalysableFieldAccess)
* [dfa: isAnalysableFieldAccess(orig: PNode; owner: PSym): bool](dfa#isAnalysableFieldAccess%2CPNode%2CPSym)
 [isAssignable:](#isAssignable)
* [parampatterns: isAssignable(owner: PSym; n: PNode; isUnsafeAddr = false): TAssignableResult](parampatterns#isAssignable%2CPSym%2CPNode)
 [isAtom:](#isAtom)
* [ast: isAtom(n: PNode): bool](ast#isAtom%2CPNode)
 [isBothMetaConvertible:](#isBothMetaConvertible)
* [TTypeRelation.isBothMetaConvertible](sigmatch#isBothMetaConvertible)
 [isCallExpr:](#isCallExpr)
* [ast: isCallExpr(n: PNode): bool](ast#isCallExpr%2CPNode)
 [isCaseObj:](#isCaseObj)
* [trees: isCaseObj(n: PNode): bool](trees#isCaseObj%2CPNode)
 [isClosure:](#isClosure)
* [ast: isClosure(typ: PType): bool](ast#isClosure%2CPType)
 [isClosureIterator:](#isClosureIterator)
* [ast: isClosureIterator(typ: PType): bool](ast#isClosureIterator%2CPType)
 [isCompileTimeOnly:](#isCompileTimeOnly)
* [types: isCompileTimeOnly(t: PType): bool](types#isCompileTimeOnly%2CPType)
 [isCompileTimeProc:](#isCompileTimeProc)
* [ast: isCompileTimeProc(s: PSym): bool](ast#isCompileTimeProc%2CPSym)
 [isConstExpr:](#isConstExpr)
* [trees: isConstExpr(n: PNode): bool](trees#isConstExpr%2CPNode)
 [isConvertible:](#isConvertible)
* [TTypeRelation.isConvertible](sigmatch#isConvertible)
 [isDeepConstExpr:](#isDeepConstExpr)
* [trees: isDeepConstExpr(n: PNode; preventInheritance = false): bool](trees#isDeepConstExpr%2CPNode)
 [isDefectException:](#isDefectException)
* [types: isDefectException(t: PType): bool](types#isDefectException%2CPType)
 [isDefined:](#isDefined)
* [options: isDefined(conf: ConfigRef; symbol: string): bool](options#isDefined%2CConfigRef%2Cstring)
 [isDirty:](#isDirty)
* [modulegraphs: isDirty(g: ModuleGraph; m: PSym): bool](modulegraphs#isDirty%2CModuleGraph%2CPSym)
 [isDiscriminantField:](#isDiscriminantField)
* [astalgo: isDiscriminantField(n: PNode): bool](astalgo#isDiscriminantField%2CPNode)
 [isDynlibOverride:](#isDynlibOverride)
* [options: isDynlibOverride(conf: ConfigRef; lib: string): bool](options#isDynlibOverride%2CConfigRef%2Cstring)
 [isEmpty:](#isEmpty)
* [pathutils: isEmpty(x: AnyPath): bool](pathutils#isEmpty%2CAnyPath)
 [isEmptyContainer:](#isEmptyContainer)
* [types: isEmptyContainer(t: PType): bool](types#isEmptyContainer%2CPType)
 [isEmptyType:](#isEmptyType)
* [ast: isEmptyType(t: PType): bool](ast#isEmptyType%2CPType)
 [isEqual:](#isEqual)
* [TTypeRelation.isEqual](sigmatch#isEqual)
 [isException:](#isException)
* [types: isException(t: PType): bool](types#isException%2CPType)
 [isFinal:](#isFinal)
* [types: isFinal(t: PType): bool](types#isFinal%2CPType)
 [isFloatLit:](#isFloatLit)
* [types: isFloatLit(t: PType): bool](types#isFloatLit%2CPType)
 [isFromIntLit:](#isFromIntLit)
* [TTypeRelation.isFromIntLit](sigmatch#isFromIntLit)
 [isGCedMem:](#isGCedMem)
* [ast: isGCedMem(t: PType): bool](ast#isGCedMem%2CPType)
 [isGeneric:](#isGeneric)
* [TTypeRelation.isGeneric](sigmatch#isGeneric)
 [isGenericAlias:](#isGenericAlias)
* [types: isGenericAlias(t: PType): bool](types#isGenericAlias%2CPType)
 [isGenericRoutine:](#isGenericRoutine)
* [ast: isGenericRoutine(s: PSym): bool](ast#isGenericRoutine%2CPSym)
 [isHeaderFile:](#isHeaderFile)
* [CodegenFlag.isHeaderFile](cgendata#isHeaderFile)
 [isImportedException:](#isImportedException)
* [ast: isImportedException(t: PType; conf: ConfigRef): bool](ast#isImportedException%2CPType%2CConfigRef)
 [isInferred:](#isInferred)
* [TTypeRelation.isInferred](sigmatch#isInferred)
 [isInferredConvertible:](#isInferredConvertible)
* [TTypeRelation.isInferredConvertible](sigmatch#isInferredConvertible)
 [isInfixAs:](#isInfixAs)
* [ast: isInfixAs(n: PNode): bool](ast#isInfixAs%2CPNode)
 [isInlineIterator:](#isInlineIterator)
* [ast: isInlineIterator(typ: PType): bool](ast#isInlineIterator%2CPType)
 [isIntConv:](#isIntConv)
* [TTypeRelation.isIntConv](sigmatch#isIntConv)
 [isIntLit:](#isIntLit)
* [types: isIntLit(t: PType): bool](types#isIntLit%2CPType)
 [isIterator:](#isIterator)
* [lambdalifting: isIterator(owner: PSym): bool](lambdalifting#isIterator.t%2CPSym)
 [isKeyword:](#isKeyword)
* [lexer: isKeyword(kind: TokType): bool](lexer#isKeyword%2CTokType)
* [renderer: isKeyword(i: PIdent): bool](renderer#isKeyword%2CPIdent)
 [isLValue:](#isLValue)
* [parampatterns: isLValue(n: PNode): bool](parampatterns#isLValue%2CPNode)
 [isMetaType:](#isMetaType)
* [ast: isMetaType(t: PType): bool](ast#isMetaType%2CPType)
 [isNimIdentifier:](#isNimIdentifier)
* [lexer: isNimIdentifier(s: string): bool](lexer#isNimIdentifier%2Cstring)
 [isNone:](#isNone)
* [TTypeRelation.isNone](sigmatch#isNone)
 [isNoSideEffectPragma:](#isNoSideEffectPragma)
* [trees: isNoSideEffectPragma(n: PNode): bool](trees#isNoSideEffectPragma%2CPNode)
 [isOperator:](#isOperator)
* [parser: isOperator(tok: Token): bool](parser#isOperator%2CToken)
 [isOrdinalType:](#isOrdinalType)
* [types: isOrdinalType(t: PType; allowEnumWithHoles: bool = false): bool](types#isOrdinalType%2CPType%2Cbool)
 [isPartOf:](#isPartOf)
* [aliases: isPartOf(a, b: PNode): TAnalysisResult](aliases#isPartOf%2CPNode%2CPNode)
 [isPureObject:](#isPureObject)
* [types: isPureObject(typ: PType): bool](types#isPureObject%2CPType)
 [isRange:](#isRange)
* [trees: isRange(n: PNode): bool](trees#isRange%2CPNode)
 [isResolvedUserTypeClass:](#isResolvedUserTypeClass)
* [types: isResolvedUserTypeClass(t: PType): bool](types#isResolvedUserTypeClass.t%2CPType)
 [isRoutine:](#isRoutine)
* [ast: isRoutine(s: PSym): bool](ast#isRoutine%2CPSym)
 [isRunnableExamples:](#isRunnableExamples)
* [ast: isRunnableExamples(n: PNode): bool](ast#isRunnableExamples%2CPNode)
 [isShadowScope:](#isShadowScope)
* [lookups: isShadowScope(s: PScope): bool](lookups#isShadowScope%2CPScope)
 [isSinkParam:](#isSinkParam)
* [ast: isSinkParam(s: PSym): bool](ast#isSinkParam%2CPSym)
 [isSinkType:](#isSinkType)
* [ast: isSinkType(t: PType): bool](ast#isSinkType%2CPType)
 [isSinkTypeForParam:](#isSinkTypeForParam)
* [types: isSinkTypeForParam(t: PType): bool](types#isSinkTypeForParam%2CPType)
 [isSubrange:](#isSubrange)
* [TTypeRelation.isSubrange](sigmatch#isSubrange)
 [isSubtype:](#isSubtype)
* [TTypeRelation.isSubtype](sigmatch#isSubtype)
 [isTopLevel:](#isTopLevel)
* [semdata: isTopLevel(c: PContext): bool](semdata#isTopLevel%2CPContext)
 [isTracked:](#isTracked)
* [sigmatch: isTracked(current, trackPos: TLineInfo; tokenLen: int): bool](sigmatch#isTracked%2CTLineInfo%2CTLineInfo%2Cint)
 [isTrue:](#isTrue)
* [trees: isTrue(n: PNode): bool](trees#isTrue%2CPNode)
 [isTupleRecursive:](#isTupleRecursive)
* [types: isTupleRecursive(t: PType): bool](types#isTupleRecursive%2CPType)
 [isUnresolvedStatic:](#isUnresolvedStatic)
* [ast: isUnresolvedStatic(t: PType): bool](ast#isUnresolvedStatic%2CPType)
 [isUnsigned:](#isUnsigned)
* [types: isUnsigned(t: PType): bool](types#isUnsigned%2CPType)
 [isVSCompatible:](#isVSCompatible)
* [extccomp: isVSCompatible(conf: ConfigRef): bool](extccomp#isVSCompatible%2CConfigRef)
 [items:](#items)
* [ast: items(n: PNode): PNode](ast#items.i%2CPNode)
* [astalgo: items(tab: TStrTable): PSym](astalgo#items.i%2CTStrTable)
* [ropes: items(r: Rope): char](ropes#items.i%2CRope)
 [iteratorPragmas:](#iteratorPragmas)
* [pragmas: iteratorPragmas](pragmas#iteratorPragmas)
 [iterOverType:](#iterOverType)
* [types: iterOverType(t: PType; iter: TTypeIter; closure: RootRef): bool](types#iterOverType%2CPType%2CTTypeIter%2CRootRef)
 [iterToProcImpl:](#iterToProcImpl)
* [itersgen: iterToProcImpl(c: PContext; n: PNode): PNode](plugins/itersgen#iterToProcImpl%2CPContext%2CPNode)
 [jmpDiff:](#jmpDiff)
* [vmdef: jmpDiff(x: TInstr): int](vmdef#jmpDiff.t%2CTInstr)
 [JSgenPass:](#JSgenPass)
* [jsgen: JSgenPass](jsgen#JSgenPass)
 [JsonExt:](#JsonExt)
* [options: JsonExt](options#JsonExt)
 [kAlreadyGiven:](#kAlreadyGiven)
* [MismatchKind.kAlreadyGiven](sigmatch#kAlreadyGiven)
 [kExtraArg:](#kExtraArg)
* [MismatchKind.kExtraArg](sigmatch#kExtraArg)
 [kMissingParam:](#kMissingParam)
* [MismatchKind.kMissingParam](sigmatch#kMissingParam)
 [kPositionalAlreadyGiven:](#kPositionalAlreadyGiven)
* [MismatchKind.kPositionalAlreadyGiven](sigmatch#kPositionalAlreadyGiven)
 [kTypeMismatch:](#kTypeMismatch)
* [MismatchKind.kTypeMismatch](sigmatch#kTypeMismatch)
 [kUnknown:](#kUnknown)
* [MismatchKind.kUnknown](sigmatch#kUnknown)
 [kUnknownNamedParam:](#kUnknownNamedParam)
* [MismatchKind.kUnknownNamedParam](sigmatch#kUnknownNamedParam)
 [kVarNeeded:](#kVarNeeded)
* [MismatchKind.kVarNeeded](sigmatch#kVarNeeded)
 [lambdaPragmas:](#lambdaPragmas)
* [pragmas: lambdaPragmas](pragmas#lambdaPragmas)
 [largeInstrs:](#largeInstrs)
* [vmdef: largeInstrs](vmdef#largeInstrs)
 [LastCallConv:](#LastCallConv)
* [pragmas: LastCallConv](pragmas#LastCallConv)
 [lastFloat:](#lastFloat)
* [types: lastFloat(t: PType): BiggestFloat](types#lastFloat%2CPType)
 [lastOptionEntry:](#lastOptionEntry)
* [semdata: lastOptionEntry(c: PContext): POptionEntry](semdata#lastOptionEntry%2CPContext)
 [lastOrd:](#lastOrd)
* [types: lastOrd(conf: ConfigRef; t: PType): Int128](types#lastOrd%2CConfigRef%2CPType)
 [lastOverloadScope:](#lastOverloadScope)
* [lookups: lastOverloadScope(o: TOverloadIter): int](lookups#lastOverloadScope%2CTOverloadIter)
 [lastSon:](#lastSon)
* [ast: lastSon(n: Indexable): Indexable](ast#lastSon%2CIndexable)
 [LayeredIdTable:](#LayeredIdTable)
* [semtypinst: LayeredIdTable](semtypinst#LayeredIdTable)
 [leave:](#leave)
* [vmprofiler: leave(prof: var Profiler; c: PCtx)](vmprofiler#leave%2CProfiler%2CPCtx)
 [leaves:](#leaves)
* [ropes: leaves(r: Rope): string](ropes#leaves.i%2CRope)
 [LegacyFeature:](#LegacyFeature)
* [options: LegacyFeature](options#LegacyFeature)
 [len:](#len)
* [ast: len(n: Indexable): int](ast#len%2CIndexable)
* [btrees: len[Key, Val](b: BTree[Key, Val]): int](btrees#len%2CBTree%5BKey%2CVal%5D)
* [ropes: len(a: Rope): int](ropes#len%2CRope)
 [lengthOrd:](#lengthOrd)
* [types: lengthOrd(conf: ConfigRef; t: PType): Int128](types#lengthOrd%2CConfigRef%2CPType)
 [letPragmas:](#letPragmas)
* [pragmas: letPragmas](pragmas#letPragmas)
 [Letters:](#Letters)
* [linter: Letters](linter#Letters)
 [leValue:](#leValue)
* [astalgo: leValue(a, b: PNode): bool](astalgo#leValue%2CPNode%2CPNode)
 [leValueConv:](#leValueConv)
* [semfold: leValueConv(a, b: PNode): bool](semfold#leValueConv%2CPNode%2CPNode)
 [Lexer:](#Lexer)
* [lexer: Lexer](lexer#Lexer)
 [lexMessage:](#lexMessage)
* [lexer: lexMessage(L: Lexer; msg: TMsgKind; arg = "")](lexer#lexMessage%2CLexer%2CTMsgKind%2Cstring)
 [lexMessageTok:](#lexMessageTok)
* [lexer: lexMessageTok(L: Lexer; msg: TMsgKind; tok: Token; arg = "")](lexer#lexMessageTok%2CLexer%2CTMsgKind%2CToken%2Cstring)
 [LF:](#LF)
* [nimlexbase: LF](nimlexbase#LF)
 [lfDynamicLib:](#lfDynamicLib)
* [TLocFlag.lfDynamicLib](ast#lfDynamicLib)
 [lfEnforceDeref:](#lfEnforceDeref)
* [TLocFlag.lfEnforceDeref](ast#lfEnforceDeref)
 [lfExportLib:](#lfExportLib)
* [TLocFlag.lfExportLib](ast#lfExportLib)
 [lfFullExternalName:](#lfFullExternalName)
* [TLocFlag.lfFullExternalName](ast#lfFullExternalName)
 [lfHeader:](#lfHeader)
* [TLocFlag.lfHeader](ast#lfHeader)
 [lfImportCompilerProc:](#lfImportCompilerProc)
* [TLocFlag.lfImportCompilerProc](ast#lfImportCompilerProc)
 [lfIndirect:](#lfIndirect)
* [TLocFlag.lfIndirect](ast#lfIndirect)
 [lfNoDecl:](#lfNoDecl)
* [TLocFlag.lfNoDecl](ast#lfNoDecl)
 [lfNoDeepCopy:](#lfNoDeepCopy)
* [TLocFlag.lfNoDeepCopy](ast#lfNoDeepCopy)
 [lfPrepareForMutation:](#lfPrepareForMutation)
* [TLocFlag.lfPrepareForMutation](ast#lfPrepareForMutation)
 [lfSingleUse:](#lfSingleUse)
* [TLocFlag.lfSingleUse](ast#lfSingleUse)
 [libDynamic:](#libDynamic)
* [TLibKind.libDynamic](ast#libDynamic)
 [libHeader:](#libHeader)
* [TLibKind.libHeader](ast#libHeader)
 [liftForLoop:](#liftForLoop)
* [lambdalifting: liftForLoop(g: ModuleGraph; body: PNode; owner: PSym): PNode](lambdalifting#liftForLoop%2CModuleGraph%2CPNode%2CPSym)
 [liftIterSym:](#liftIterSym)
* [lambdalifting: liftIterSym(g: ModuleGraph; n: PNode; owner: PSym): PNode](lambdalifting#liftIterSym%2CModuleGraph%2CPNode%2CPSym)
 [liftIterToProc:](#liftIterToProc)
* [lambdalifting: liftIterToProc(g: ModuleGraph; fn: PSym; body: PNode; ptrType: PType): PNode](lambdalifting#liftIterToProc%2CModuleGraph%2CPSym%2CPNode%2CPType)
 [liftLambdas:](#liftLambdas)
* [lambdalifting: liftLambdas(g: ModuleGraph; fn: PSym; body: PNode; tooEarly: var bool): PNode](lambdalifting#liftLambdas%2CModuleGraph%2CPSym%2CPNode%2Cbool)
 [liftLambdasForTopLevel:](#liftLambdasForTopLevel)
* [lambdalifting: liftLambdasForTopLevel(module: PSym; body: PNode): PNode](lambdalifting#liftLambdasForTopLevel%2CPSym%2CPNode)
 [liftLocalsIfRequested:](#liftLocalsIfRequested)
* [liftlocals: liftLocalsIfRequested(prc: PSym; n: PNode; cache: IdentCache; conf: ConfigRef): PNode](liftlocals#liftLocalsIfRequested%2CPSym%2CPNode%2CIdentCache%2CConfigRef)
 [liftParallel:](#liftParallel)
* [semparallel: liftParallel(g: ModuleGraph; owner: PSym; n: PNode): PNode](semparallel#liftParallel%2CModuleGraph%2CPSym%2CPNode)
 [liftTypeBoundOps:](#liftTypeBoundOps)
* [liftdestructors: liftTypeBoundOps(c: PContext; typ: PType; info: TLineInfo)](liftdestructors#liftTypeBoundOps.t%2CPContext%2CPType%2CTLineInfo)
 [liMessage:](#liMessage)
* [msgs: liMessage(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string; eh: TErrorHandling; info2: InstantiationInfo; isRaw = false)](msgs#liMessage%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring%2CTErrorHandling%2CInstantiationInfo)
 [lineInfoToStr:](#lineInfoToStr)
* [astalgo: lineInfoToStr(conf: ConfigRef; info: TLineInfo): Rope](astalgo#lineInfoToStr%2CConfigRef%2CTLineInfo)
 [linkTo:](#linkTo)
* [ast: linkTo(s: PSym; t: PType): PSym](ast#linkTo%2CPSym%2CPType)
* [ast: linkTo(t: PType; s: PSym): PType](ast#linkTo%2CPType%2CPSym)
 [lintReport:](#lintReport)
* [msgs: lintReport(conf: ConfigRef; info: TLineInfo; beau, got: string)](msgs#lintReport.t%2CConfigRef%2CTLineInfo%2Cstring%2Cstring)
 [listCPUnames:](#listCPUnames)
* [platform: listCPUnames(): seq[string]](platform#listCPUnames)
 [listHints:](#listHints)
* [msgs: listHints(conf: ConfigRef)](msgs#listHints%2CConfigRef)
 [listOSnames:](#listOSnames)
* [platform: listOSnames(): seq[string]](platform#listOSnames)
 [listSymbolNames:](#listSymbolNames)
* [astalgo: listSymbolNames(symbols: openArray[PSym]): string](astalgo#listSymbolNames%2CopenArray%5BPSym%5D)
 [listWarnings:](#listWarnings)
* [msgs: listWarnings(conf: ConfigRef)](msgs#listWarnings%2CConfigRef)
 [littleEndian:](#littleEndian)
* [TEndian.littleEndian](platform#littleEndian)
 [llsFile:](#llsFile)
* [TLLStreamKind.llsFile](llstream#llsFile)
 [llsNone:](#llsNone)
* [TLLStreamKind.llsNone](llstream#llsNone)
 [llsStdIn:](#llsStdIn)
* [TLLStreamKind.llsStdIn](llstream#llsStdIn)
 [llsString:](#llsString)
* [TLLStreamKind.llsString](llstream#llsString)
 [llStreamClose:](#llStreamClose)
* [llstream: llStreamClose(s: PLLStream)](llstream#llStreamClose%2CPLLStream)
 [llStreamOpen:](#llStreamOpen)
* [llstream: llStreamOpen(): PLLStream](llstream#llStreamOpen)
* [llstream: llStreamOpen(filename: AbsoluteFile; mode: FileMode): PLLStream](llstream#llStreamOpen%2CAbsoluteFile%2CFileMode)
* [llstream: llStreamOpen(f: File): PLLStream](llstream#llStreamOpen%2CFile)
* [llstream: llStreamOpen(data: string): PLLStream](llstream#llStreamOpen%2Cstring)
 [llStreamOpenStdIn:](#llStreamOpenStdIn)
* [llstream: llStreamOpenStdIn(r: TLLRepl = llReadFromStdin): PLLStream](llstream#llStreamOpenStdIn%2CTLLRepl)
 [llStreamRead:](#llStreamRead)
* [llstream: llStreamRead(s: PLLStream; buf: pointer; bufLen: int): int](llstream#llStreamRead%2CPLLStream%2Cpointer%2Cint)
 [llStreamReadAll:](#llStreamReadAll)
* [llstream: llStreamReadAll(s: PLLStream): string](llstream#llStreamReadAll%2CPLLStream)
 [llStreamReadLine:](#llStreamReadLine)
* [llstream: llStreamReadLine(s: PLLStream; line: var string): bool](llstream#llStreamReadLine%2CPLLStream%2Cstring)
 [llStreamWrite:](#llStreamWrite)
* [llstream: llStreamWrite(s: PLLStream; data: char)](llstream#llStreamWrite%2CPLLStream%2Cchar)
* [llstream: llStreamWrite(s: PLLStream; buf: pointer; buflen: int)](llstream#llStreamWrite%2CPLLStream%2Cpointer%2Cint)
* [llstream: llStreamWrite(s: PLLStream; data: string)](llstream#llStreamWrite%2CPLLStream%2Cstring)
 [llStreamWriteln:](#llStreamWriteln)
* [llstream: llStreamWriteln(s: PLLStream; data: string)](llstream#llStreamWriteln%2CPLLStream%2Cstring)
 [loadAny:](#loadAny)
* [vmmarshal: loadAny(s: string; t: PType; cache: IdentCache; conf: ConfigRef): PNode](vmmarshal#loadAny%2Cstring%2CPType%2CIdentCache%2CConfigRef)
 [loadConfigs:](#loadConfigs)
* [nimconf: loadConfigs(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef)](nimconf#loadConfigs%2CRelativeFile%2CIdentCache%2CConfigRef)
 [loadConfigsAndRunMainCommand:](#loadConfigsAndRunMainCommand)
* [cmdlinehelper: loadConfigsAndRunMainCommand(self: NimProg; cache: IdentCache; conf: ConfigRef; graph: ModuleGraph): bool](cmdlinehelper#loadConfigsAndRunMainCommand%2CNimProg%2CIdentCache%2CConfigRef%2CModuleGraph)
 [loadMaxIds:](#loadMaxIds)
* [idgen: loadMaxIds(conf: ConfigRef; project: AbsoluteFile)](idgen#loadMaxIds%2CConfigRef%2CAbsoluteFile)
 [loadModuleSym:](#loadModuleSym)
* [rod: loadModuleSym(g: ModuleGraph; fileIdx: FileIndex; fullpath: AbsoluteFile): ( PSym, int)](rod#loadModuleSym%2CModuleGraph%2CFileIndex%2CAbsoluteFile)
 [loadNode:](#loadNode)
* [rod: loadNode(g: ModuleGraph; module: PSym): PNode](rod#loadNode.t%2CModuleGraph%2CPSym)
 [localError:](#localError)
* [msgs: localError(conf: ConfigRef; info: TLineInfo; arg: string)](msgs#localError.t%2CConfigRef%2CTLineInfo%2Cstring)
* [msgs: localError(conf: ConfigRef; info: TLineInfo; format: string; params: openArray[string])](msgs#localError.t%2CConfigRef%2CTLineInfo%2Cstring%2CopenArray%5Bstring%5D)
* [msgs: localError(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")](msgs#localError.t%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring)
 [localSearchInScope:](#localSearchInScope)
* [lookups: localSearchInScope(c: PContext; s: PIdent): PSym](lookups#localSearchInScope%2CPContext%2CPIdent)
 [locCall:](#locCall)
* [TLocKind.locCall](ast#locCall)
 [locData:](#locData)
* [TLocKind.locData](ast#locData)
 [locExpr:](#locExpr)
* [TLocKind.locExpr](ast#locExpr)
 [locField:](#locField)
* [TLocKind.locField](ast#locField)
 [locGlobalVar:](#locGlobalVar)
* [TLocKind.locGlobalVar](ast#locGlobalVar)
 [locLocalVar:](#locLocalVar)
* [TLocKind.locLocalVar](ast#locLocalVar)
 [locNone:](#locNone)
* [TLocKind.locNone](ast#locNone)
 [locOther:](#locOther)
* [TLocKind.locOther](ast#locOther)
 [locParam:](#locParam)
* [TLocKind.locParam](ast#locParam)
 [locProc:](#locProc)
* [TLocKind.locProc](ast#locProc)
 [locTemp:](#locTemp)
* [TLocKind.locTemp](ast#locTemp)
 [log:](#log)
* [msgs: log(s: string)](msgs#log%2Cstring)
 [lookUp:](#lookUp)
* [lookups: lookUp(c: PContext; n: PNode): PSym](lookups#lookUp%2CPContext%2CPNode)
 [lookupInRecord:](#lookupInRecord)
* [astalgo: lookupInRecord(n: PNode; field: PIdent): PSym](astalgo#lookupInRecord%2CPNode%2CPIdent)
 [low:](#low)
* [int128: low(t: typedesc[Int128]): Int128](int128#low.t%2Ctypedesc%5BInt128%5D)
 [lowBound:](#lowBound)
* [guards: lowBound(conf: ConfigRef; x: PNode): PNode](guards#lowBound%2CConfigRef%2CPNode)
 [lowerSwap:](#lowerSwap)
* [lowerings: lowerSwap(g: ModuleGraph; n: PNode; owner: PSym): PNode](lowerings#lowerSwap%2CModuleGraph%2CPNode%2CPSym)
 [lowerTupleUnpacking:](#lowerTupleUnpacking)
* [lowerings: lowerTupleUnpacking(g: ModuleGraph; n: PNode; owner: PSym): PNode](lowerings#lowerTupleUnpacking%2CModuleGraph%2CPNode%2CPSym)
 [lowerTupleUnpackingForAsgn:](#lowerTupleUnpackingForAsgn)
* [lowerings: lowerTupleUnpackingForAsgn(g: ModuleGraph; n: PNode; owner: PSym): PNode](lowerings#lowerTupleUnpackingForAsgn%2CModuleGraph%2CPNode%2CPSym)
 [Lrz:](#Lrz)
* [nimlexbase: Lrz](nimlexbase#Lrz)
 [mAbsI:](#mAbsI)
* [TMagic.mAbsI](ast#mAbsI)
 [mAccessEnv:](#mAccessEnv)
* [TMagic.mAccessEnv](ast#mAccessEnv)
 [macroPragmas:](#macroPragmas)
* [pragmas: macroPragmas](pragmas#macroPragmas)
 [mAddF64:](#mAddF64)
* [TMagic.mAddF64](ast#mAddF64)
 [mAddI:](#mAddI)
* [TMagic.mAddI](ast#mAddI)
 [mAddr:](#mAddr)
* [TMagic.mAddr](ast#mAddr)
 [mAddU:](#mAddU)
* [TMagic.mAddU](ast#mAddU)
 [mainCommand:](#mainCommand)
* [main: mainCommand(graph: ModuleGraph)](main#mainCommand%2CModuleGraph)
 [mainCommandArg:](#mainCommandArg)
* [options: mainCommandArg(conf: ConfigRef): string](options#mainCommandArg%2CConfigRef)
 [makeAndType:](#makeAndType)
* [semdata: makeAndType(c: PContext; t1, t2: PType): PType](semdata#makeAndType%2CPContext%2CPType%2CPType)
 [makeClosure:](#makeClosure)
* [lambdalifting: makeClosure(g: ModuleGraph; prc: PSym; env: PNode; info: TLineInfo): PNode](lambdalifting#makeClosure%2CModuleGraph%2CPSym%2CPNode%2CTLineInfo)
 [makeCString:](#makeCString)
* [msgs: makeCString(s: string): Rope](msgs#makeCString%2Cstring)
 [makeInstPair:](#makeInstPair)
* [semdata: makeInstPair(s: PSym; inst: PInstantiation): TInstantiationPair](semdata#makeInstPair%2CPSym%2CPInstantiation)
 [makeModule:](#makeModule)
* [modules: makeModule(graph: ModuleGraph; filename: AbsoluteFile): PSym](modules#makeModule%2CModuleGraph%2CAbsoluteFile)
* [modules: makeModule(graph: ModuleGraph; filename: string): PSym](modules#makeModule%2CModuleGraph%2Cstring)
 [makeNotType:](#makeNotType)
* [semdata: makeNotType(c: PContext; t1: PType): PType](semdata#makeNotType%2CPContext%2CPType)
 [makeOrType:](#makeOrType)
* [semdata: makeOrType(c: PContext; t1, t2: PType): PType](semdata#makeOrType%2CPContext%2CPType%2CPType)
 [makePass:](#makePass)
* [passes: makePass(open: TPassOpen = nil; process: TPassProcess = nil; close: TPassClose = nil; isFrontend = false): TPass](passes#makePass%2CTPassOpen%2CTPassProcess%2CTPassClose)
 [makePtrType:](#makePtrType)
* [semdata: makePtrType(c: PContext; baseType: PType): PType](semdata#makePtrType%2CPContext%2CPType)
* [semdata: makePtrType(owner: PSym; baseType: PType): PType](semdata#makePtrType%2CPSym%2CPType)
 [makeRangeType:](#makeRangeType)
* [semdata: makeRangeType(c: PContext; first, last: BiggestInt; info: TLineInfo; intType: PType = nil): PType](semdata#makeRangeType%2CPContext%2CBiggestInt%2CBiggestInt%2CTLineInfo%2CPType)
 [makeRangeWithStaticExpr:](#makeRangeWithStaticExpr)
* [semdata: makeRangeWithStaticExpr(c: PContext; n: PNode): PType](semdata#makeRangeWithStaticExpr%2CPContext%2CPNode)
 [makeSingleLineCString:](#makeSingleLineCString)
* [ccgutils: makeSingleLineCString(s: string): string](ccgutils#makeSingleLineCString%2Cstring)
 [makeStaticExpr:](#makeStaticExpr)
* [semdata: makeStaticExpr(c: PContext; n: PNode): PNode](semdata#makeStaticExpr%2CPContext%2CPNode)
 [makeStdinModule:](#makeStdinModule)
* [modules: makeStdinModule(graph: ModuleGraph): PSym](modules#makeStdinModule%2CModuleGraph)
 [makeStmtList:](#makeStmtList)
* [ast: makeStmtList(n: PNode): PNode](ast#makeStmtList%2CPNode)
 [makeTypeDesc:](#makeTypeDesc)
* [semdata: makeTypeDesc(c: PContext; typ: PType): PType](semdata#makeTypeDesc%2CPContext%2CPType)
 [makeTypeFromExpr:](#makeTypeFromExpr)
* [semdata: makeTypeFromExpr(c: PContext; n: PNode): PType](semdata#makeTypeFromExpr%2CPContext%2CPNode)
 [makeTypeSymNode:](#makeTypeSymNode)
* [semdata: makeTypeSymNode(c: PContext; typ: PType; info: TLineInfo): PNode](semdata#makeTypeSymNode%2CPContext%2CPType%2CTLineInfo)
 [makeTypeWithModifier:](#makeTypeWithModifier)
* [semdata: makeTypeWithModifier(c: PContext; modifier: TTypeKind; baseType: PType): PType](semdata#makeTypeWithModifier%2CPContext%2CTTypeKind%2CPType)
 [makeVarType:](#makeVarType)
* [semdata: makeVarType(c: PContext; baseType: PType; kind = tyVar): PType](semdata#makeVarType%2CPContext%2CPType)
* [semdata: makeVarType(owner: PSym; baseType: PType; kind = tyVar): PType](semdata#makeVarType%2CPSym%2CPType)
 [makeYamlString:](#makeYamlString)
* [astalgo: makeYamlString(s: string): Rope](astalgo#makeYamlString%2Cstring)
 [mAlignOf:](#mAlignOf)
* [TMagic.mAlignOf](ast#mAlignOf)
 [mAnd:](#mAnd)
* [TMagic.mAnd](ast#mAnd)
 [mangle:](#mangle)
* [ccgutils: mangle(name: string): string](ccgutils#mangle%2Cstring)
 [mAppendSeqElem:](#mAppendSeqElem)
* [TMagic.mAppendSeqElem](ast#mAppendSeqElem)
 [mAppendStrCh:](#mAppendStrCh)
* [TMagic.mAppendStrCh](ast#mAppendStrCh)
 [mAppendStrStr:](#mAppendStrStr)
* [TMagic.mAppendStrStr](ast#mAppendStrStr)
 [Mapping:](#Mapping)
* [sourcemap: Mapping](sourcemap#Mapping)
 [mAppType:](#mAppType)
* [TMagic.mAppType](ast#mAppType)
 [markClientsDirty:](#markClientsDirty)
* [modulegraphs: markClientsDirty(g: ModuleGraph; fileIdx: FileIndex)](modulegraphs#markClientsDirty%2CModuleGraph%2CFileIndex)
 [markDirty:](#markDirty)
* [modulegraphs: markDirty(g: ModuleGraph; fileIdx: FileIndex)](modulegraphs#markDirty%2CModuleGraph%2CFileIndex)
 [markIndirect:](#markIndirect)
* [semdata: markIndirect(c: PContext; s: PSym)](semdata#markIndirect%2CPContext%2CPSym)
 [markOwnerModuleAsUsed:](#markOwnerModuleAsUsed)
* [sigmatch: markOwnerModuleAsUsed(c: PContext; s: PSym)](sigmatch#markOwnerModuleAsUsed%2CPContext%2CPSym)
 [markUsed:](#markUsed)
* [sigmatch: markUsed(c: PContext; info: TLineInfo; s: PSym)](sigmatch#markUsed%2CPContext%2CTLineInfo%2CPSym)
 [mArray:](#mArray)
* [TMagic.mArray](ast#mArray)
 [mArrGet:](#mArrGet)
* [TMagic.mArrGet](ast#mArrGet)
 [mArrPut:](#mArrPut)
* [TMagic.mArrPut](ast#mArrPut)
 [mArrToSeq:](#mArrToSeq)
* [TMagic.mArrToSeq](ast#mArrToSeq)
 [mAsgn:](#mAsgn)
* [TMagic.mAsgn](ast#mAsgn)
 [mAshrI:](#mAshrI)
* [TMagic.mAshrI](ast#mAshrI)
 [maskBytes:](#maskBytes)
* [int128: maskBytes(arg: Int128; numbytes: int): Int128](int128#maskBytes%2CInt128%2Cint)
 [maskUInt16:](#maskUInt16)
* [int128: maskUInt16(arg: Int128): Int128](int128#maskUInt16%2CInt128)
 [maskUInt32:](#maskUInt32)
* [int128: maskUInt32(arg: Int128): Int128](int128#maskUInt32%2CInt128)
 [maskUInt64:](#maskUInt64)
* [int128: maskUInt64(arg: Int128): Int128](int128#maskUInt64%2CInt128)
 [maskUInt8:](#maskUInt8)
* [int128: maskUInt8(arg: Int128): Int128](int128#maskUInt8%2CInt128)
 [mAstToStr:](#mAstToStr)
* [TMagic.mAstToStr](ast#mAstToStr)
 [matches:](#matches)
* [sigmatch: matches(c: PContext; n, nOrig: PNode; m: var TCandidate)](sigmatch#matches%2CPContext%2CPNode%2CPNode%2CTCandidate)
 [matchNodeKinds:](#matchNodeKinds)
* [parampatterns: matchNodeKinds(p, n: PNode): bool](parampatterns#matchNodeKinds%2CPNode%2CPNode)
 [matchType:](#matchType)
* [types: matchType(a: PType; pattern: openArray[tuple[k: TTypeKind, i: int]]; last: TTypeKind): bool](types#matchType%2CPType%2CopenArray%5Btuple%5BTTypeKind%2Cint%5D%5D%2CTTypeKind)
 [matchUserTypeClass:](#matchUserTypeClass)
* [sigmatch: matchUserTypeClass(m: var TCandidate; ff, a: PType): PType](sigmatch#matchUserTypeClass%2CTCandidate%2CPType%2CPType)
 [MaxLineLength:](#MaxLineLength)
* [lexer: MaxLineLength](lexer#MaxLineLength)
 [MaxLockLevel:](#MaxLockLevel)
* [ast: MaxLockLevel](ast#MaxLockLevel)
 [MaxSetElements:](#MaxSetElements)
* [nversion: MaxSetElements](nversion#MaxSetElements)
 [MaxStackSize:](#MaxStackSize)
* [parampatterns: MaxStackSize](parampatterns#MaxStackSize)
 [mBitandI:](#mBitandI)
* [TMagic.mBitandI](ast#mBitandI)
 [mBitnotI:](#mBitnotI)
* [TMagic.mBitnotI](ast#mBitnotI)
 [mBitorI:](#mBitorI)
* [TMagic.mBitorI](ast#mBitorI)
 [mBitxorI:](#mBitxorI)
* [TMagic.mBitxorI](ast#mBitxorI)
 [mBool:](#mBool)
* [TMagic.mBool](ast#mBool)
 [mBoolDefine:](#mBoolDefine)
* [TMagic.mBoolDefine](ast#mBoolDefine)
 [mBoolToStr:](#mBoolToStr)
* [TMagic.mBoolToStr](ast#mBoolToStr)
 [mBuildCPU:](#mBuildCPU)
* [TMagic.mBuildCPU](ast#mBuildCPU)
 [mBuildOS:](#mBuildOS)
* [TMagic.mBuildOS](ast#mBuildOS)
 [mBuiltinType:](#mBuiltinType)
* [TMagic.mBuiltinType](ast#mBuiltinType)
 [mCard:](#mCard)
* [TMagic.mCard](ast#mCard)
 [mChar:](#mChar)
* [TMagic.mChar](ast#mChar)
 [mCharToStr:](#mCharToStr)
* [TMagic.mCharToStr](ast#mCharToStr)
 [mChr:](#mChr)
* [TMagic.mChr](ast#mChr)
 [mCompileDate:](#mCompileDate)
* [TMagic.mCompileDate](ast#mCompileDate)
 [mCompileOption:](#mCompileOption)
* [TMagic.mCompileOption](ast#mCompileOption)
 [mCompileOptionArg:](#mCompileOptionArg)
* [TMagic.mCompileOptionArg](ast#mCompileOptionArg)
 [mCompiles:](#mCompiles)
* [TMagic.mCompiles](ast#mCompiles)
 [mCompileTime:](#mCompileTime)
* [TMagic.mCompileTime](ast#mCompileTime)
 [mConStrStr:](#mConStrStr)
* [TMagic.mConStrStr](ast#mConStrStr)
 [mCpuEndian:](#mCpuEndian)
* [TMagic.mCpuEndian](ast#mCpuEndian)
 [mCstring:](#mCstring)
* [TMagic.mCstring](ast#mCstring)
 [mCStrToStr:](#mCStrToStr)
* [TMagic.mCStrToStr](ast#mCStrToStr)
 [mdbg:](#mdbg)
* [astalgo: mdbg(): bool](astalgo#mdbg.t)
 [mDec:](#mDec)
* [TMagic.mDec](ast#mDec)
 [mDeclared:](#mDeclared)
* [TMagic.mDeclared](ast#mDeclared)
 [mDeclaredInScope:](#mDeclaredInScope)
* [TMagic.mDeclaredInScope](ast#mDeclaredInScope)
 [mDeepCopy:](#mDeepCopy)
* [TMagic.mDeepCopy](ast#mDeepCopy)
 [mDefault:](#mDefault)
* [TMagic.mDefault](ast#mDefault)
 [mDefined:](#mDefined)
* [TMagic.mDefined](ast#mDefined)
 [mDestroy:](#mDestroy)
* [TMagic.mDestroy](ast#mDestroy)
 [mDistinct:](#mDistinct)
* [TMagic.mDistinct](ast#mDistinct)
 [mDivF64:](#mDivF64)
* [TMagic.mDivF64](ast#mDivF64)
 [mDivI:](#mDivI)
* [TMagic.mDivI](ast#mDivI)
 [mDivU:](#mDivU)
* [TMagic.mDivU](ast#mDivU)
 [mDotDot:](#mDotDot)
* [TMagic.mDotDot](ast#mDotDot)
 [mEcho:](#mEcho)
* [TMagic.mEcho](ast#mEcho)
 [mEnumToStr:](#mEnumToStr)
* [TMagic.mEnumToStr](ast#mEnumToStr)
 [mEqB:](#mEqB)
* [TMagic.mEqB](ast#mEqB)
 [mEqCh:](#mEqCh)
* [TMagic.mEqCh](ast#mEqCh)
 [mEqCString:](#mEqCString)
* [TMagic.mEqCString](ast#mEqCString)
 [mEqEnum:](#mEqEnum)
* [TMagic.mEqEnum](ast#mEqEnum)
 [mEqF64:](#mEqF64)
* [TMagic.mEqF64](ast#mEqF64)
 [mEqI:](#mEqI)
* [TMagic.mEqI](ast#mEqI)
 [mEqIdent:](#mEqIdent)
* [TMagic.mEqIdent](ast#mEqIdent)
 [mEqNimrodNode:](#mEqNimrodNode)
* [TMagic.mEqNimrodNode](ast#mEqNimrodNode)
 [mEqProc:](#mEqProc)
* [TMagic.mEqProc](ast#mEqProc)
 [mEqRef:](#mEqRef)
* [TMagic.mEqRef](ast#mEqRef)
 [mEqSet:](#mEqSet)
* [TMagic.mEqSet](ast#mEqSet)
 [mEqStr:](#mEqStr)
* [TMagic.mEqStr](ast#mEqStr)
 [mergeFiles:](#mergeFiles)
* [ccgmerge: mergeFiles(cfilename: AbsoluteFile; m: BModule)](ccgmerge#mergeFiles%2CAbsoluteFile%2CBModule)
 [mergeRequired:](#mergeRequired)
* [ccgmerge: mergeRequired(m: BModule): bool](ccgmerge#mergeRequired%2CBModule)
 [mergeShadowScope:](#mergeShadowScope)
* [lookups: mergeShadowScope(c: PContext)](lookups#mergeShadowScope%2CPContext)
 [message:](#message)
* [msgs: message(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")](msgs#message.t%2CConfigRef%2CTLineInfo%2CTMsgKind%2Cstring)
 [methodCall:](#methodCall)
* [cgmeth: methodCall(n: PNode; conf: ConfigRef): PNode](cgmeth#methodCall%2CPNode%2CConfigRef)
 [methodDef:](#methodDef)
* [cgmeth: methodDef(g: ModuleGraph; s: PSym; fromCache: bool)](cgmeth#methodDef%2CModuleGraph%2CPSym%2Cbool)
 [methodPragmas:](#methodPragmas)
* [pragmas: methodPragmas](pragmas#methodPragmas)
 [mException:](#mException)
* [TMagic.mException](ast#mException)
 [mExcl:](#mExcl)
* [TMagic.mExcl](ast#mExcl)
 [mExists:](#mExists)
* [TMagic.mExists](ast#mExists)
 [mExit:](#mExit)
* [TMagic.mExit](ast#mExit)
 [mExpandToAst:](#mExpandToAst)
* [TMagic.mExpandToAst](ast#mExpandToAst)
 [mExpr:](#mExpr)
* [TMagic.mExpr](ast#mExpr)
 [mFieldPairs:](#mFieldPairs)
* [TMagic.mFieldPairs](ast#mFieldPairs)
 [mFields:](#mFields)
* [TMagic.mFields](ast#mFields)
 [mFloat:](#mFloat)
* [TMagic.mFloat](ast#mFloat)
 [mFloat128:](#mFloat128)
* [TMagic.mFloat128](ast#mFloat128)
 [mFloat32:](#mFloat32)
* [TMagic.mFloat32](ast#mFloat32)
 [mFloat64:](#mFloat64)
* [TMagic.mFloat64](ast#mFloat64)
 [mFloatToStr:](#mFloatToStr)
* [TMagic.mFloatToStr](ast#mFloatToStr)
 [mForall:](#mForall)
* [TMagic.mForall](ast#mForall)
 [mGCref:](#mGCref)
* [TMagic.mGCref](ast#mGCref)
 [mGCunref:](#mGCunref)
* [TMagic.mGCunref](ast#mGCunref)
 [mGetImpl:](#mGetImpl)
* [TMagic.mGetImpl](ast#mGetImpl)
 [mGetImplTransf:](#mGetImplTransf)
* [TMagic.mGetImplTransf](ast#mGetImplTransf)
 [mGetTypeInfo:](#mGetTypeInfo)
* [TMagic.mGetTypeInfo](ast#mGetTypeInfo)
 [mGetTypeInfoV2:](#mGetTypeInfoV2)
* [TMagic.mGetTypeInfoV2](ast#mGetTypeInfoV2)
 [mHigh:](#mHigh)
* [TMagic.mHigh](ast#mHigh)
 [mHostCPU:](#mHostCPU)
* [TMagic.mHostCPU](ast#mHostCPU)
 [mHostOS:](#mHostOS)
* [TMagic.mHostOS](ast#mHostOS)
 [mIff:](#mIff)
* [TMagic.mIff](ast#mIff)
 [mImplies:](#mImplies)
* [TMagic.mImplies](ast#mImplies)
 [mInc:](#mInc)
* [TMagic.mInc](ast#mInc)
 [mIncl:](#mIncl)
* [TMagic.mIncl](ast#mIncl)
 [mInSet:](#mInSet)
* [TMagic.mInSet](ast#mInSet)
 [mInstantiationInfo:](#mInstantiationInfo)
* [TMagic.mInstantiationInfo](ast#mInstantiationInfo)
 [mInt:](#mInt)
* [TMagic.mInt](ast#mInt)
 [mInt16:](#mInt16)
* [TMagic.mInt16](ast#mInt16)
 [mInt32:](#mInt32)
* [TMagic.mInt32](ast#mInt32)
 [mInt64:](#mInt64)
* [TMagic.mInt64](ast#mInt64)
 [mInt64ToStr:](#mInt64ToStr)
* [TMagic.mInt64ToStr](ast#mInt64ToStr)
 [mInt8:](#mInt8)
* [TMagic.mInt8](ast#mInt8)
 [mIntDefine:](#mIntDefine)
* [TMagic.mIntDefine](ast#mIntDefine)
 [mIntToStr:](#mIntToStr)
* [TMagic.mIntToStr](ast#mIntToStr)
 [mIs:](#mIs)
* [TMagic.mIs](ast#mIs)
 [miscPos:](#miscPos)
* [ast: miscPos](ast#miscPos)
 [mIsMainModule:](#mIsMainModule)
* [TMagic.mIsMainModule](ast#mIsMainModule)
 [MismatchInfo:](#MismatchInfo)
* [sigmatch: MismatchInfo](sigmatch#MismatchInfo)
 [MismatchKind:](#MismatchKind)
* [sigmatch: MismatchKind](sigmatch#MismatchKind)
 [mIsNil:](#mIsNil)
* [TMagic.mIsNil](ast#mIsNil)
 [mIsolate:](#mIsolate)
* [TMagic.mIsolate](ast#mIsolate)
 [mIsPartOf:](#mIsPartOf)
* [TMagic.mIsPartOf](ast#mIsPartOf)
 [mLeB:](#mLeB)
* [TMagic.mLeB](ast#mLeB)
 [mLeCh:](#mLeCh)
* [TMagic.mLeCh](ast#mLeCh)
 [mLeEnum:](#mLeEnum)
* [TMagic.mLeEnum](ast#mLeEnum)
 [mLeF64:](#mLeF64)
* [TMagic.mLeF64](ast#mLeF64)
 [mLeI:](#mLeI)
* [TMagic.mLeI](ast#mLeI)
 [mLengthArray:](#mLengthArray)
* [TMagic.mLengthArray](ast#mLengthArray)
 [mLengthOpenArray:](#mLengthOpenArray)
* [TMagic.mLengthOpenArray](ast#mLengthOpenArray)
 [mLengthSeq:](#mLengthSeq)
* [TMagic.mLengthSeq](ast#mLengthSeq)
 [mLengthStr:](#mLengthStr)
* [TMagic.mLengthStr](ast#mLengthStr)
 [mLePtr:](#mLePtr)
* [TMagic.mLePtr](ast#mLePtr)
 [mLeSet:](#mLeSet)
* [TMagic.mLeSet](ast#mLeSet)
 [mLeStr:](#mLeStr)
* [TMagic.mLeStr](ast#mLeStr)
 [mLeU:](#mLeU)
* [TMagic.mLeU](ast#mLeU)
 [mLow:](#mLow)
* [TMagic.mLow](ast#mLow)
 [mLtB:](#mLtB)
* [TMagic.mLtB](ast#mLtB)
 [mLtCh:](#mLtCh)
* [TMagic.mLtCh](ast#mLtCh)
 [mLtEnum:](#mLtEnum)
* [TMagic.mLtEnum](ast#mLtEnum)
 [mLtF64:](#mLtF64)
* [TMagic.mLtF64](ast#mLtF64)
 [mLtI:](#mLtI)
* [TMagic.mLtI](ast#mLtI)
 [mLtPtr:](#mLtPtr)
* [TMagic.mLtPtr](ast#mLtPtr)
 [mLtSet:](#mLtSet)
* [TMagic.mLtSet](ast#mLtSet)
 [mLtStr:](#mLtStr)
* [TMagic.mLtStr](ast#mLtStr)
 [mLtU:](#mLtU)
* [TMagic.mLtU](ast#mLtU)
 [mMaxI:](#mMaxI)
* [TMagic.mMaxI](ast#mMaxI)
 [mMinI:](#mMinI)
* [TMagic.mMinI](ast#mMinI)
 [mMinusSet:](#mMinusSet)
* [TMagic.mMinusSet](ast#mMinusSet)
 [mModI:](#mModI)
* [TMagic.mModI](ast#mModI)
 [mModU:](#mModU)
* [TMagic.mModU](ast#mModU)
 [mMove:](#mMove)
* [TMagic.mMove](ast#mMove)
 [mMulF64:](#mMulF64)
* [TMagic.mMulF64](ast#mMulF64)
 [mMulI:](#mMulI)
* [TMagic.mMulI](ast#mMulI)
 [mMulSet:](#mMulSet)
* [TMagic.mMulSet](ast#mMulSet)
 [mMulU:](#mMulU)
* [TMagic.mMulU](ast#mMulU)
 [mNAdd:](#mNAdd)
* [TMagic.mNAdd](ast#mNAdd)
 [mNAddMultiple:](#mNAddMultiple)
* [TMagic.mNAddMultiple](ast#mNAddMultiple)
 [mNBindSym:](#mNBindSym)
* [TMagic.mNBindSym](ast#mNBindSym)
 [mNCallSite:](#mNCallSite)
* [TMagic.mNCallSite](ast#mNCallSite)
 [mNccInc:](#mNccInc)
* [TMagic.mNccInc](ast#mNccInc)
 [mNccValue:](#mNccValue)
* [TMagic.mNccValue](ast#mNccValue)
 [mNChild:](#mNChild)
* [TMagic.mNChild](ast#mNChild)
 [mNCopyNimNode:](#mNCopyNimNode)
* [TMagic.mNCopyNimNode](ast#mNCopyNimNode)
 [mNCopyNimTree:](#mNCopyNimTree)
* [TMagic.mNCopyNimTree](ast#mNCopyNimTree)
 [mNcsAdd:](#mNcsAdd)
* [TMagic.mNcsAdd](ast#mNcsAdd)
 [mNcsAt:](#mNcsAt)
* [TMagic.mNcsAt](ast#mNcsAt)
 [mNcsIncl:](#mNcsIncl)
* [TMagic.mNcsIncl](ast#mNcsIncl)
 [mNcsLen:](#mNcsLen)
* [TMagic.mNcsLen](ast#mNcsLen)
 [mNctGet:](#mNctGet)
* [TMagic.mNctGet](ast#mNctGet)
 [mNctHasNext:](#mNctHasNext)
* [TMagic.mNctHasNext](ast#mNctHasNext)
 [mNctLen:](#mNctLen)
* [TMagic.mNctLen](ast#mNctLen)
 [mNctNext:](#mNctNext)
* [TMagic.mNctNext](ast#mNctNext)
 [mNctPut:](#mNctPut)
* [TMagic.mNctPut](ast#mNctPut)
 [mNDel:](#mNDel)
* [TMagic.mNDel](ast#mNDel)
 [mNError:](#mNError)
* [TMagic.mNError](ast#mNError)
 [mNew:](#mNew)
* [TMagic.mNew](ast#mNew)
 [mNewFinalize:](#mNewFinalize)
* [TMagic.mNewFinalize](ast#mNewFinalize)
 [mNewSeq:](#mNewSeq)
* [TMagic.mNewSeq](ast#mNewSeq)
 [mNewSeqOfCap:](#mNewSeqOfCap)
* [TMagic.mNewSeqOfCap](ast#mNewSeqOfCap)
 [mNewString:](#mNewString)
* [TMagic.mNewString](ast#mNewString)
 [mNewStringOfCap:](#mNewStringOfCap)
* [TMagic.mNewStringOfCap](ast#mNewStringOfCap)
 [mNFloatVal:](#mNFloatVal)
* [TMagic.mNFloatVal](ast#mNFloatVal)
 [mNGenSym:](#mNGenSym)
* [TMagic.mNGenSym](ast#mNGenSym)
 [mNGetType:](#mNGetType)
* [TMagic.mNGetType](ast#mNGetType)
 [mNHint:](#mNHint)
* [TMagic.mNHint](ast#mNHint)
 [mNIdent:](#mNIdent)
* [TMagic.mNIdent](ast#mNIdent)
 [mNil:](#mNil)
* [TMagic.mNil](ast#mNil)
 [mNimvm:](#mNimvm)
* [TMagic.mNimvm](ast#mNimvm)
 [mNIntVal:](#mNIntVal)
* [TMagic.mNIntVal](ast#mNIntVal)
 [mNKind:](#mNKind)
* [TMagic.mNKind](ast#mNKind)
 [mNLen:](#mNLen)
* [TMagic.mNLen](ast#mNLen)
 [mNLineInfo:](#mNLineInfo)
* [TMagic.mNLineInfo](ast#mNLineInfo)
 [mNNewNimNode:](#mNNewNimNode)
* [TMagic.mNNewNimNode](ast#mNNewNimNode)
 [mNodeId:](#mNodeId)
* [TMagic.mNodeId](ast#mNodeId)
 [mNone:](#mNone)
* [TMagic.mNone](ast#mNone)
 [mNot:](#mNot)
* [TMagic.mNot](ast#mNot)
 [mNSetChild:](#mNSetChild)
* [TMagic.mNSetChild](ast#mNSetChild)
 [mNSetFloatVal:](#mNSetFloatVal)
* [TMagic.mNSetFloatVal](ast#mNSetFloatVal)
 [mNSetIdent:](#mNSetIdent)
* [TMagic.mNSetIdent](ast#mNSetIdent)
 [mNSetIntVal:](#mNSetIntVal)
* [TMagic.mNSetIntVal](ast#mNSetIntVal)
 [mNSetStrVal:](#mNSetStrVal)
* [TMagic.mNSetStrVal](ast#mNSetStrVal)
 [mNSetSymbol:](#mNSetSymbol)
* [TMagic.mNSetSymbol](ast#mNSetSymbol)
 [mNSetType:](#mNSetType)
* [TMagic.mNSetType](ast#mNSetType)
 [mNSigHash:](#mNSigHash)
* [TMagic.mNSigHash](ast#mNSigHash)
 [mNSizeOf:](#mNSizeOf)
* [TMagic.mNSizeOf](ast#mNSizeOf)
 [mNStrVal:](#mNStrVal)
* [TMagic.mNStrVal](ast#mNStrVal)
 [mNSymbol:](#mNSymbol)
* [TMagic.mNSymbol](ast#mNSymbol)
 [mNSymKind:](#mNSymKind)
* [TMagic.mNSymKind](ast#mNSymKind)
 [mNWarning:](#mNWarning)
* [TMagic.mNWarning](ast#mNWarning)
 [ModuleGraph:](#ModuleGraph)
* [modulegraphs: ModuleGraph](modulegraphs#ModuleGraph)
 [moduleHasChanged:](#moduleHasChanged)
* [passes: moduleHasChanged(graph: ModuleGraph; module: PSym): bool](passes#moduleHasChanged%2CModuleGraph%2CPSym)
 [mOf:](#mOf)
* [TMagic.mOf](ast#mOf)
 [mOffsetOf:](#mOffsetOf)
* [TMagic.mOffsetOf](ast#mOffsetOf)
 [mOld:](#mOld)
* [TMagic.mOld](ast#mOld)
 [mOmpParFor:](#mOmpParFor)
* [TMagic.mOmpParFor](ast#mOmpParFor)
 [mOpenArray:](#mOpenArray)
* [TMagic.mOpenArray](ast#mOpenArray)
 [mOr:](#mOr)
* [TMagic.mOr](ast#mOr)
 [mOrd:](#mOrd)
* [TMagic.mOrd](ast#mOrd)
 [mOrdinal:](#mOrdinal)
* [TMagic.mOrdinal](ast#mOrdinal)
 [mParallel:](#mParallel)
* [TMagic.mParallel](ast#mParallel)
 [mParseBiggestFloat:](#mParseBiggestFloat)
* [TMagic.mParseBiggestFloat](ast#mParseBiggestFloat)
 [mParseExprToAst:](#mParseExprToAst)
* [TMagic.mParseExprToAst](ast#mParseExprToAst)
 [mParseStmtToAst:](#mParseStmtToAst)
* [TMagic.mParseStmtToAst](ast#mParseStmtToAst)
 [mPlugin:](#mPlugin)
* [TMagic.mPlugin](ast#mPlugin)
 [mPlusSet:](#mPlusSet)
* [TMagic.mPlusSet](ast#mPlusSet)
 [mPNimrodNode:](#mPNimrodNode)
* [TMagic.mPNimrodNode](ast#mPNimrodNode)
 [mPointer:](#mPointer)
* [TMagic.mPointer](ast#mPointer)
 [mPred:](#mPred)
* [TMagic.mPred](ast#mPred)
 [mProcCall:](#mProcCall)
* [TMagic.mProcCall](ast#mProcCall)
 [mPtr:](#mPtr)
* [TMagic.mPtr](ast#mPtr)
 [mQuoteAst:](#mQuoteAst)
* [TMagic.mQuoteAst](ast#mQuoteAst)
 [mRange:](#mRange)
* [TMagic.mRange](ast#mRange)
 [mRef:](#mRef)
* [TMagic.mRef](ast#mRef)
 [mRepr:](#mRepr)
* [TMagic.mRepr](ast#mRepr)
 [mReset:](#mReset)
* [TMagic.mReset](ast#mReset)
 [mRunnableExamples:](#mRunnableExamples)
* [TMagic.mRunnableExamples](ast#mRunnableExamples)
 [mSameNodeType:](#mSameNodeType)
* [TMagic.mSameNodeType](ast#mSameNodeType)
 [mSeq:](#mSeq)
* [TMagic.mSeq](ast#mSeq)
 [mSet:](#mSet)
* [TMagic.mSet](ast#mSet)
 [mSetLengthSeq:](#mSetLengthSeq)
* [TMagic.mSetLengthSeq](ast#mSetLengthSeq)
 [mSetLengthStr:](#mSetLengthStr)
* [TMagic.mSetLengthStr](ast#mSetLengthStr)
 [MsgConfig:](#MsgConfig)
* [lineinfos: MsgConfig](lineinfos#MsgConfig)
 [MsgFlag:](#MsgFlag)
* [msgs: MsgFlag](msgs#MsgFlag)
 [MsgFlags:](#MsgFlags)
* [msgs: MsgFlags](msgs#MsgFlags)
 [MsgKindToStr:](#MsgKindToStr)
* [lineinfos: MsgKindToStr](lineinfos#MsgKindToStr)
 [msgKindToString:](#msgKindToString)
* [msgs: msgKindToString(kind: TMsgKind): string](msgs#msgKindToString%2CTMsgKind)
 [msgQuit:](#msgQuit)
* [msgs: msgQuit(x: int8)](msgs#msgQuit%2Cint8)
* [msgs: msgQuit(x: string)](msgs#msgQuit%2Cstring)
 [msgSkipHook:](#msgSkipHook)
* [MsgFlag.msgSkipHook](msgs#msgSkipHook)
 [msgStdout:](#msgStdout)
* [MsgFlag.msgStdout](msgs#msgStdout)
 [msgWriteln:](#msgWriteln)
* [msgs: msgWriteln(conf: ConfigRef; s: string; flags: MsgFlags = {})](msgs#msgWriteln%2CConfigRef%2Cstring%2CMsgFlags)
 [mShallowCopy:](#mShallowCopy)
* [TMagic.mShallowCopy](ast#mShallowCopy)
 [mShlI:](#mShlI)
* [TMagic.mShlI](ast#mShlI)
 [mShrI:](#mShrI)
* [TMagic.mShrI](ast#mShrI)
 [mSizeOf:](#mSizeOf)
* [TMagic.mSizeOf](ast#mSizeOf)
 [mSlice:](#mSlice)
* [TMagic.mSlice](ast#mSlice)
 [mSlurp:](#mSlurp)
* [TMagic.mSlurp](ast#mSlurp)
 [mSpawn:](#mSpawn)
* [TMagic.mSpawn](ast#mSpawn)
 [mStatic:](#mStatic)
* [TMagic.mStatic](ast#mStatic)
 [mStaticExec:](#mStaticExec)
* [TMagic.mStaticExec](ast#mStaticExec)
 [mStmt:](#mStmt)
* [TMagic.mStmt](ast#mStmt)
 [mStrDefine:](#mStrDefine)
* [TMagic.mStrDefine](ast#mStrDefine)
 [mString:](#mString)
* [TMagic.mString](ast#mString)
 [mStrToIdent:](#mStrToIdent)
* [TMagic.mStrToIdent](ast#mStrToIdent)
 [mStrToStr:](#mStrToStr)
* [TMagic.mStrToStr](ast#mStrToStr)
 [mSubF64:](#mSubF64)
* [TMagic.mSubF64](ast#mSubF64)
 [mSubI:](#mSubI)
* [TMagic.mSubI](ast#mSubI)
 [mSubU:](#mSubU)
* [TMagic.mSubU](ast#mSubU)
 [mSucc:](#mSucc)
* [TMagic.mSucc](ast#mSucc)
 [mSwap:](#mSwap)
* [TMagic.mSwap](ast#mSwap)
 [mSymIsInstantiationOf:](#mSymIsInstantiationOf)
* [TMagic.mSymIsInstantiationOf](ast#mSymIsInstantiationOf)
 [mSymOwner:](#mSymOwner)
* [TMagic.mSymOwner](ast#mSymOwner)
 [mTuple:](#mTuple)
* [TMagic.mTuple](ast#mTuple)
 [mType:](#mType)
* [TMagic.mType](ast#mType)
 [mTypeDesc:](#mTypeDesc)
* [TMagic.mTypeDesc](ast#mTypeDesc)
 [mTypeOf:](#mTypeOf)
* [TMagic.mTypeOf](ast#mTypeOf)
 [mTypeTrait:](#mTypeTrait)
* [TMagic.mTypeTrait](ast#mTypeTrait)
 [mUInt:](#mUInt)
* [TMagic.mUInt](ast#mUInt)
 [mUInt16:](#mUInt16)
* [TMagic.mUInt16](ast#mUInt16)
 [mUInt32:](#mUInt32)
* [TMagic.mUInt32](ast#mUInt32)
 [mUInt64:](#mUInt64)
* [TMagic.mUInt64](ast#mUInt64)
 [mUInt8:](#mUInt8)
* [TMagic.mUInt8](ast#mUInt8)
 [mUnaryMinusF64:](#mUnaryMinusF64)
* [TMagic.mUnaryMinusF64](ast#mUnaryMinusF64)
 [mUnaryMinusI:](#mUnaryMinusI)
* [TMagic.mUnaryMinusI](ast#mUnaryMinusI)
 [mUnaryMinusI64:](#mUnaryMinusI64)
* [TMagic.mUnaryMinusI64](ast#mUnaryMinusI64)
 [mUnaryPlusF64:](#mUnaryPlusF64)
* [TMagic.mUnaryPlusF64](ast#mUnaryPlusF64)
 [mUnaryPlusI:](#mUnaryPlusI)
* [TMagic.mUnaryPlusI](ast#mUnaryPlusI)
 [mUncheckedArray:](#mUncheckedArray)
* [TMagic.mUncheckedArray](ast#mUncheckedArray)
 [mUnown:](#mUnown)
* [TMagic.mUnown](ast#mUnown)
 [mustRehash:](#mustRehash)
* [astalgo: mustRehash(length, counter: int): bool](astalgo#mustRehash%2Cint%2Cint)
 [mutableView:](#mutableView)
* [ViewTypeKind.mutableView](typeallowed#mutableView)
 [mutateType:](#mutateType)
* [types: mutateType(t: PType; iter: TTypeMutator; closure: RootRef): PType](types#mutateType%2CPType%2CTTypeMutator%2CRootRef)
 [MutationInfo:](#MutationInfo)
* [varpartitions: MutationInfo](varpartitions#MutationInfo)
 [mVar:](#mVar)
* [TMagic.mVar](ast#mVar)
 [mVarargs:](#mVarargs)
* [TMagic.mVarargs](ast#mVarargs)
 [mVoid:](#mVoid)
* [TMagic.mVoid](ast#mVoid)
 [mVoidType:](#mVoidType)
* [TMagic.mVoidType](ast#mVoidType)
 [mWasMoved:](#mWasMoved)
* [TMagic.mWasMoved](ast#mWasMoved)
 [mXor:](#mXor)
* [TMagic.mXor](ast#mXor)
 [namePos:](#namePos)
* [ast: namePos](ast#namePos)
 [nameToCC:](#nameToCC)
* [extccomp: nameToCC(name: string): TSystemCC](extccomp#nameToCC%2Cstring)
 [nameToCPU:](#nameToCPU)
* [platform: nameToCPU(name: string): TSystemCPU](platform#nameToCPU%2Cstring)
 [nameToOS:](#nameToOS)
* [platform: nameToOS(name: string): TSystemOS](platform#nameToOS%2Cstring)
 [NdiFile:](#NdiFile)
* [ndi: NdiFile](ndi#NdiFile)
 [NegOne:](#NegOne)
* [int128: NegOne](int128#NegOne)
 [newAsgnStmt:](#newAsgnStmt)
* [lowerings: newAsgnStmt(le, ri: PNode): PNode](lowerings#newAsgnStmt%2CPNode%2CPNode)
 [newCandidate:](#newCandidate)
* [sigmatch: newCandidate(ctx: PContext; callee: PSym; binding: PNode; calleeScope = -1): TCandidate](sigmatch#newCandidate%2CPContext%2CPSym%2CPNode)
* [sigmatch: newCandidate(ctx: PContext; callee: PType): TCandidate](sigmatch#newCandidate%2CPContext%2CPType)
 [newConfigRef:](#newConfigRef)
* [options: newConfigRef(): ConfigRef](options#newConfigRef)
 [newContext:](#newContext)
* [semdata: newContext(graph: ModuleGraph; module: PSym): PContext](semdata#newContext%2CModuleGraph%2CPSym)
 [newCtx:](#newCtx)
* [vmdef: newCtx(module: PSym; cache: IdentCache; g: ModuleGraph): PCtx](vmdef#newCtx%2CPSym%2CIdentCache%2CModuleGraph)
 [newDeref:](#newDeref)
* [lowerings: newDeref(n: PNode): PNode](lowerings#newDeref%2CPNode)
 [newDocumentor:](#newDocumentor)
* [docgen: newDocumentor(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef; outExt: string = HtmlExt; module: PSym = nil): PDoc](docgen#newDocumentor%2CAbsoluteFile%2CIdentCache%2CConfigRef%2Cstring%2CPSym)
 [newDotExpr:](#newDotExpr)
* [lowerings: newDotExpr(obj, b: PSym): PNode](lowerings#newDotExpr%2CPSym%2CPSym)
 [newFastAsgnStmt:](#newFastAsgnStmt)
* [lowerings: newFastAsgnStmt(le, ri: PNode): PNode](lowerings#newFastAsgnStmt%2CPNode%2CPNode)
 [newFastMoveStmt:](#newFastMoveStmt)
* [lowerings: newFastMoveStmt(g: ModuleGraph; le, ri: PNode): PNode](lowerings#newFastMoveStmt%2CModuleGraph%2CPNode%2CPNode)
 [newFloatNode:](#newFloatNode)
* [ast: newFloatNode(kind: TNodeKind; floatVal: BiggestFloat): PNode](ast#newFloatNode%2CTNodeKind%2CBiggestFloat)
 [newFloatNodeP:](#newFloatNodeP)
* [parser: newFloatNodeP(kind: TNodeKind; floatVal: BiggestFloat; p: Parser): PNode](parser#newFloatNodeP%2CTNodeKind%2CBiggestFloat%2CParser)
 [newFloatNodeT:](#newFloatNodeT)
* [semfold: newFloatNodeT(floatVal: BiggestFloat; n: PNode; g: ModuleGraph): PNode](semfold#newFloatNodeT%2CBiggestFloat%2CPNode%2CModuleGraph)
 [newIdentCache:](#newIdentCache)
* [idents: newIdentCache(): IdentCache](idents#newIdentCache)
 [newIdentNode:](#newIdentNode)
* [ast: newIdentNode(ident: PIdent; info: TLineInfo): PNode](ast#newIdentNode%2CPIdent%2CTLineInfo)
 [newIdentNodeP:](#newIdentNodeP)
* [parser: newIdentNodeP(ident: PIdent; p: Parser): PNode](parser#newIdentNodeP%2CPIdent%2CParser)
 [newIdTable:](#newIdTable)
* [ast: newIdTable(): TIdTable](ast#newIdTable)
 [newIntLit:](#newIntLit)
* [lowerings: newIntLit(g: ModuleGraph; info: TLineInfo; value: BiggestInt): PNode](lowerings#newIntLit%2CModuleGraph%2CTLineInfo%2CBiggestInt)
 [newIntNode:](#newIntNode)
* [ast: newIntNode(kind: TNodeKind; intVal: BiggestInt): PNode](ast#newIntNode%2CTNodeKind%2CBiggestInt)
* [ast: newIntNode(kind: TNodeKind; intVal: Int128): PNode](ast#newIntNode%2CTNodeKind%2CInt128)
 [newIntNodeP:](#newIntNodeP)
* [parser: newIntNodeP(kind: TNodeKind; intVal: BiggestInt; p: Parser): PNode](parser#newIntNodeP%2CTNodeKind%2CBiggestInt%2CParser)
 [newIntNodeT:](#newIntNodeT)
* [semfold: newIntNodeT(intVal: Int128; n: PNode; g: ModuleGraph): PNode](semfold#newIntNodeT%2CInt128%2CPNode%2CModuleGraph)
 [newIntTypeNode:](#newIntTypeNode)
* [ast: newIntTypeNode(intVal: BiggestInt; typ: PType): PNode](ast#newIntTypeNode%2CBiggestInt%2CPType)
* [ast: newIntTypeNode(intVal: Int128; typ: PType): PNode](ast#newIntTypeNode%2CInt128%2CPType)
 [newLib:](#newLib)
* [semdata: newLib(kind: TLibKind): PLib](semdata#newLib%2CTLibKind)
 [newlineFollows:](#newlineFollows)
* [lexer: newlineFollows(L: Lexer): bool](lexer#newlineFollows%2CLexer)
 [newLineInfo:](#newLineInfo)
* [msgs: newLineInfo(conf: ConfigRef; filename: AbsoluteFile; line, col: int): TLineInfo](msgs#newLineInfo%2CConfigRef%2CAbsoluteFile%2Cint%2Cint)
* [msgs: newLineInfo(fileInfoIdx: FileIndex; line, col: int): TLineInfo](msgs#newLineInfo%2CFileIndex%2Cint%2Cint)
 [NewLines:](#NewLines)
* [nimlexbase: NewLines](nimlexbase#NewLines)
 [newModuleGraph:](#newModuleGraph)
* [modulegraphs: newModuleGraph(cache: IdentCache; config: ConfigRef): ModuleGraph](modulegraphs#newModuleGraph%2CIdentCache%2CConfigRef)
 [newModuleList:](#newModuleList)
* [cgendata: newModuleList(g: ModuleGraph): BModuleList](cgendata#newModuleList%2CModuleGraph)
 [newNode:](#newNode)
* [ast: newNode(kind: TNodeKind): PNode](ast#newNode%2CTNodeKind)
 [newNodeI:](#newNodeI)
* [ast: newNodeI(kind: TNodeKind; info: TLineInfo): PNode](ast#newNodeI%2CTNodeKind%2CTLineInfo)
* [ast: newNodeI(kind: TNodeKind; info: TLineInfo; children: int): PNode](ast#newNodeI%2CTNodeKind%2CTLineInfo%2Cint)
 [newNodeIT:](#newNodeIT)
* [ast: newNodeIT(kind: TNodeKind; info: TLineInfo; typ: PType): PNode](ast#newNodeIT%2CTNodeKind%2CTLineInfo%2CPType)
 [newNodeP:](#newNodeP)
* [parser: newNodeP(kind: TNodeKind; p: Parser): PNode](parser#newNodeP%2CTNodeKind%2CParser)
 [newOptionEntry:](#newOptionEntry)
* [semdata: newOptionEntry(conf: ConfigRef): POptionEntry](semdata#newOptionEntry%2CConfigRef)
 [newPackageCache:](#newPackageCache)
* [options: newPackageCache(): untyped](options#newPackageCache.t)
 [newPartialConfigRef:](#newPartialConfigRef)
* [options: newPartialConfigRef(): ConfigRef](options#newPartialConfigRef)
 [newProc:](#newProc)
* [cgendata: newProc(prc: PSym; module: BModule): BProc](cgendata#newProc%2CPSym%2CBModule)
 [newProcNode:](#newProcNode)
* [ast: newProcNode(kind: TNodeKind; info: TLineInfo; body: PNode; params, name, pattern, genericParams, pragmas, exceptions: PNode): PNode](ast#newProcNode%2CTNodeKind%2CTLineInfo%2CPNode%2CPNode%2CPNode%2CPNode%2CPNode%2CPNode%2CPNode)
 [newProcType:](#newProcType)
* [ast: newProcType(info: TLineInfo; owner: PSym): PType](ast#newProcType%2CTLineInfo%2CPSym)
 [newSons:](#newSons)
* [ast: newSons(father: Indexable; length: int)](ast#newSons%2CIndexable%2Cint)
 [newStrNode:](#newStrNode)
* [ast: newStrNode(strVal: string; info: TLineInfo): PNode](ast#newStrNode%2Cstring%2CTLineInfo)
* [ast: newStrNode(kind: TNodeKind; strVal: string): PNode](ast#newStrNode%2CTNodeKind%2Cstring)
 [newStrNodeP:](#newStrNodeP)
* [parser: newStrNodeP(kind: TNodeKind; strVal: string; p: Parser): PNode](parser#newStrNodeP%2CTNodeKind%2Cstring%2CParser)
 [newStrNodeT:](#newStrNodeT)
* [semfold: newStrNodeT(strVal: string; n: PNode; g: ModuleGraph): PNode](semfold#newStrNodeT%2Cstring%2CPNode%2CModuleGraph)
 [newStrTable:](#newStrTable)
* [ast: newStrTable(): TStrTable](ast#newStrTable)
 [newSym:](#newSym)
* [ast: newSym(symKind: TSymKind; name: PIdent; owner: PSym; info: TLineInfo; options: TOptions = {}): PSym](ast#newSym%2CTSymKind%2CPIdent%2CPSym%2CTLineInfo%2CTOptions)
 [newSymG:](#newSymG)
* [sem: newSymG(kind: TSymKind; n: PNode; c: PContext): PSym](sem#newSymG%2CTSymKind%2CPNode%2CPContext)
 [newSymNode:](#newSymNode)
* [ast: newSymNode(sym: PSym): PNode](ast#newSymNode%2CPSym)
* [ast: newSymNode(sym: PSym; info: TLineInfo): PNode](ast#newSymNode%2CPSym%2CTLineInfo)
 [newSymNodeTypeDesc:](#newSymNodeTypeDesc)
* [semfold: newSymNodeTypeDesc(s: PSym; info: TLineInfo): PNode](semfold#newSymNodeTypeDesc%2CPSym%2CTLineInfo)
 [newTree:](#newTree)
* [ast: newTree(kind: TNodeKind; children: varargs[PNode]): PNode](ast#newTree%2CTNodeKind%2Cvarargs%5BPNode%5D)
 [newTreeI:](#newTreeI)
* [ast: newTreeI(kind: TNodeKind; info: TLineInfo; children: varargs[PNode]): PNode](ast#newTreeI%2CTNodeKind%2CTLineInfo%2Cvarargs%5BPNode%5D)
 [newTreeIT:](#newTreeIT)
* [ast: newTreeIT(kind: TNodeKind; info: TLineInfo; typ: PType; children: varargs[PNode]): PNode](ast#newTreeIT%2CTNodeKind%2CTLineInfo%2CPType%2Cvarargs%5BPNode%5D)
 [newTryFinally:](#newTryFinally)
* [lowerings: newTryFinally(body, final: PNode): PNode](lowerings#newTryFinally%2CPNode%2CPNode)
 [newTupleAccess:](#newTupleAccess)
* [lowerings: newTupleAccess(g: ModuleGraph; tup: PNode; i: int): PNode](lowerings#newTupleAccess%2CModuleGraph%2CPNode%2Cint)
 [newTupleAccessRaw:](#newTupleAccessRaw)
* [lowerings: newTupleAccessRaw(tup: PNode; i: int): PNode](lowerings#newTupleAccessRaw%2CPNode%2Cint)
 [newType:](#newType)
* [ast: newType(kind: TTypeKind; owner: PSym): PType](ast#newType%2CTTypeKind%2CPSym)
 [newTypeMapLayer:](#newTypeMapLayer)
* [semtypinst: newTypeMapLayer(cl: var TReplTypeVars): LayeredIdTable](semtypinst#newTypeMapLayer%2CTReplTypeVars)
 [newTypeS:](#newTypeS)
* [semdata: newTypeS(kind: TTypeKind; c: PContext): PType](semdata#newTypeS%2CTTypeKind%2CPContext)
 [newTypeWithSons:](#newTypeWithSons)
* [semdata: newTypeWithSons(c: PContext; kind: TTypeKind; sons: seq[PType]): PType](semdata#newTypeWithSons%2CPContext%2CTTypeKind%2Cseq%5BPType%5D)
* [semdata: newTypeWithSons(owner: PSym; kind: TTypeKind; sons: seq[PType]): PType](semdata#newTypeWithSons%2CPSym%2CTTypeKind%2Cseq%5BPType%5D)
 [newVersion:](#newVersion)
* [nimblecmd: newVersion(ver: string): Version](nimblecmd#newVersion%2Cstring)
 [next:](#next)
* [btrees: next[Key, Val](b: BTree[Key, Val]; index: int): (Key, Val, int)](btrees#next%2CBTree%5BKey%2CVal%5D%2Cint)
 [nextIdentExcluding:](#nextIdentExcluding)
* [astalgo: nextIdentExcluding(ti: var TIdentIter; tab: TStrTable; excluding: IntSet): PSym](astalgo#nextIdentExcluding%2CTIdentIter%2CTStrTable%2CIntSet)
 [nextIdentIter:](#nextIdentIter)
* [astalgo: nextIdentIter(ti: var TIdentIter; tab: TStrTable): PSym](astalgo#nextIdentIter%2CTIdentIter%2CTStrTable)
 [nextIter:](#nextIter)
* [astalgo: nextIter(ti: var TTabIter; tab: TStrTable): PSym](astalgo#nextIter%2CTTabIter%2CTStrTable)
 [nextOverloadIter:](#nextOverloadIter)
* [lookups: nextOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym](lookups#nextOverloadIter%2CTOverloadIter%2CPContext%2CPNode)
 [nextTry:](#nextTry)
* [astalgo: nextTry(h, maxHash: Hash): Hash](astalgo#nextTry%2CHash%2CHash)
 [nfAllConst:](#nfAllConst)
* [TNodeFlag.nfAllConst](ast#nfAllConst)
 [nfAllFieldsSet:](#nfAllFieldsSet)
* [ast: nfAllFieldsSet](ast#nfAllFieldsSet)
 [nfBase16:](#nfBase16)
* [TNodeFlag.nfBase16](ast#nfBase16)
 [nfBase2:](#nfBase2)
* [TNodeFlag.nfBase2](ast#nfBase2)
 [nfBase8:](#nfBase8)
* [TNodeFlag.nfBase8](ast#nfBase8)
 [nfBlockArg:](#nfBlockArg)
* [TNodeFlag.nfBlockArg](ast#nfBlockArg)
 [nfDefaultParam:](#nfDefaultParam)
* [TNodeFlag.nfDefaultParam](ast#nfDefaultParam)
 [nfDefaultRefsParam:](#nfDefaultRefsParam)
* [TNodeFlag.nfDefaultRefsParam](ast#nfDefaultRefsParam)
 [nfDotField:](#nfDotField)
* [TNodeFlag.nfDotField](ast#nfDotField)
 [nfDotSetter:](#nfDotSetter)
* [TNodeFlag.nfDotSetter](ast#nfDotSetter)
 [nfExecuteOnReload:](#nfExecuteOnReload)
* [TNodeFlag.nfExecuteOnReload](ast#nfExecuteOnReload)
 [nfExplicitCall:](#nfExplicitCall)
* [TNodeFlag.nfExplicitCall](ast#nfExplicitCall)
 [nfExprCall:](#nfExprCall)
* [TNodeFlag.nfExprCall](ast#nfExprCall)
 [nfFromTemplate:](#nfFromTemplate)
* [TNodeFlag.nfFromTemplate](ast#nfFromTemplate)
 [nfIsPtr:](#nfIsPtr)
* [TNodeFlag.nfIsPtr](ast#nfIsPtr)
 [nfIsRef:](#nfIsRef)
* [TNodeFlag.nfIsRef](ast#nfIsRef)
 [nfLL:](#nfLL)
* [TNodeFlag.nfLL](ast#nfLL)
 [nfNone:](#nfNone)
* [TNodeFlag.nfNone](ast#nfNone)
 [nfNoRewrite:](#nfNoRewrite)
* [TNodeFlag.nfNoRewrite](ast#nfNoRewrite)
 [nfPreventCg:](#nfPreventCg)
* [TNodeFlag.nfPreventCg](ast#nfPreventCg)
 [nfSem:](#nfSem)
* [TNodeFlag.nfSem](ast#nfSem)
 [nfTransf:](#nfTransf)
* [TNodeFlag.nfTransf](ast#nfTransf)
 [NilableTypes:](#NilableTypes)
* [ast: NilableTypes](ast#NilableTypes)
 [nilOrSysInt:](#nilOrSysInt)
* [magicsys: nilOrSysInt(g: ModuleGraph): PType](magicsys#nilOrSysInt%2CModuleGraph)
 [nimblePath:](#nimblePath)
* [nimblecmd: nimblePath(conf: ConfigRef; path: AbsoluteDir; info: TLineInfo)](nimblecmd#nimblePath%2CConfigRef%2CAbsoluteDir%2CTLineInfo)
 [nimbleSubs:](#nimbleSubs)
* [options: nimbleSubs(conf: ConfigRef; p: string): string](options#nimbleSubs.i%2CConfigRef%2Cstring)
 [NimCompilerApiVersion:](#NimCompilerApiVersion)
* [nversion: NimCompilerApiVersion](nversion#NimCompilerApiVersion)
 [nimdocOutCss:](#nimdocOutCss)
* [nimpaths: nimdocOutCss](nimpaths#nimdocOutCss)
 [nimErrorFlagAccessed:](#nimErrorFlagAccessed)
* [TCProcFlag.nimErrorFlagAccessed](cgendata#nimErrorFlagAccessed)
 [nimErrorFlagDeclared:](#nimErrorFlagDeclared)
* [TCProcFlag.nimErrorFlagDeclared](cgendata#nimErrorFlagDeclared)
 [nimErrorFlagDisabled:](#nimErrorFlagDisabled)
* [TCProcFlag.nimErrorFlagDisabled](cgendata#nimErrorFlagDisabled)
 [NimExt:](#NimExt)
* [options: NimExt](options#NimExt)
 [nimIncremental:](#nimIncremental)
* [incremental: nimIncremental](incremental#nimIncremental)
 [nimKeywordsHigh:](#nimKeywordsHigh)
* [wordrecg: nimKeywordsHigh](wordrecg#nimKeywordsHigh)
 [nimKeywordsLow:](#nimKeywordsLow)
* [wordrecg: nimKeywordsLow](wordrecg#nimKeywordsLow)
 [nimNodeFlag:](#nimNodeFlag)
* [vmdef: nimNodeFlag](vmdef#nimNodeFlag)
 [NimProg:](#NimProg)
* [cmdlinehelper: NimProg](cmdlinehelper#NimProg)
 [nkAccQuoted:](#nkAccQuoted)
* [TNodeKind.nkAccQuoted](ast#nkAccQuoted)
 [nkAddr:](#nkAddr)
* [TNodeKind.nkAddr](ast#nkAddr)
 [nkArgList:](#nkArgList)
* [TNodeKind.nkArgList](ast#nkArgList)
 [nkAsgn:](#nkAsgn)
* [TNodeKind.nkAsgn](ast#nkAsgn)
 [nkAsmStmt:](#nkAsmStmt)
* [TNodeKind.nkAsmStmt](ast#nkAsmStmt)
 [nkBind:](#nkBind)
* [TNodeKind.nkBind](ast#nkBind)
 [nkBindStmt:](#nkBindStmt)
* [TNodeKind.nkBindStmt](ast#nkBindStmt)
 [nkBlockExpr:](#nkBlockExpr)
* [TNodeKind.nkBlockExpr](ast#nkBlockExpr)
 [nkBlockStmt:](#nkBlockStmt)
* [TNodeKind.nkBlockStmt](ast#nkBlockStmt)
 [nkBlockType:](#nkBlockType)
* [TNodeKind.nkBlockType](ast#nkBlockType)
 [nkBracket:](#nkBracket)
* [TNodeKind.nkBracket](ast#nkBracket)
 [nkBracketExpr:](#nkBracketExpr)
* [TNodeKind.nkBracketExpr](ast#nkBracketExpr)
 [nkBreakState:](#nkBreakState)
* [TNodeKind.nkBreakState](ast#nkBreakState)
 [nkBreakStmt:](#nkBreakStmt)
* [TNodeKind.nkBreakStmt](ast#nkBreakStmt)
 [nkCall:](#nkCall)
* [TNodeKind.nkCall](ast#nkCall)
 [nkCallKinds:](#nkCallKinds)
* [ast: nkCallKinds](ast#nkCallKinds)
 [nkCallStrLit:](#nkCallStrLit)
* [TNodeKind.nkCallStrLit](ast#nkCallStrLit)
 [nkCaseStmt:](#nkCaseStmt)
* [TNodeKind.nkCaseStmt](ast#nkCaseStmt)
 [nkCast:](#nkCast)
* [TNodeKind.nkCast](ast#nkCast)
 [nkCharLit:](#nkCharLit)
* [TNodeKind.nkCharLit](ast#nkCharLit)
 [nkChckRange:](#nkChckRange)
* [TNodeKind.nkChckRange](ast#nkChckRange)
 [nkChckRange64:](#nkChckRange64)
* [TNodeKind.nkChckRange64](ast#nkChckRange64)
 [nkChckRangeF:](#nkChckRangeF)
* [TNodeKind.nkChckRangeF](ast#nkChckRangeF)
 [nkCheckedFieldExpr:](#nkCheckedFieldExpr)
* [TNodeKind.nkCheckedFieldExpr](ast#nkCheckedFieldExpr)
 [nkClosedSymChoice:](#nkClosedSymChoice)
* [TNodeKind.nkClosedSymChoice](ast#nkClosedSymChoice)
 [nkClosure:](#nkClosure)
* [TNodeKind.nkClosure](ast#nkClosure)
 [nkComesFrom:](#nkComesFrom)
* [TNodeKind.nkComesFrom](ast#nkComesFrom)
 [nkCommand:](#nkCommand)
* [TNodeKind.nkCommand](ast#nkCommand)
 [nkCommentStmt:](#nkCommentStmt)
* [TNodeKind.nkCommentStmt](ast#nkCommentStmt)
 [nkConstDef:](#nkConstDef)
* [TNodeKind.nkConstDef](ast#nkConstDef)
 [nkConstSection:](#nkConstSection)
* [TNodeKind.nkConstSection](ast#nkConstSection)
 [nkConstTy:](#nkConstTy)
* [TNodeKind.nkConstTy](ast#nkConstTy)
 [nkContinueStmt:](#nkContinueStmt)
* [TNodeKind.nkContinueStmt](ast#nkContinueStmt)
 [nkConv:](#nkConv)
* [TNodeKind.nkConv](ast#nkConv)
 [nkConverterDef:](#nkConverterDef)
* [TNodeKind.nkConverterDef](ast#nkConverterDef)
 [nkCStringToString:](#nkCStringToString)
* [TNodeKind.nkCStringToString](ast#nkCStringToString)
 [nkCurly:](#nkCurly)
* [TNodeKind.nkCurly](ast#nkCurly)
 [nkCurlyExpr:](#nkCurlyExpr)
* [TNodeKind.nkCurlyExpr](ast#nkCurlyExpr)
 [nkDefer:](#nkDefer)
* [TNodeKind.nkDefer](ast#nkDefer)
 [nkDerefExpr:](#nkDerefExpr)
* [TNodeKind.nkDerefExpr](ast#nkDerefExpr)
 [nkDiscardStmt:](#nkDiscardStmt)
* [TNodeKind.nkDiscardStmt](ast#nkDiscardStmt)
 [nkDistinctTy:](#nkDistinctTy)
* [TNodeKind.nkDistinctTy](ast#nkDistinctTy)
 [nkDo:](#nkDo)
* [TNodeKind.nkDo](ast#nkDo)
 [nkDotCall:](#nkDotCall)
* [TNodeKind.nkDotCall](ast#nkDotCall)
 [nkDotExpr:](#nkDotExpr)
* [TNodeKind.nkDotExpr](ast#nkDotExpr)
 [nkEffectList:](#nkEffectList)
* [ast: nkEffectList](ast#nkEffectList)
 [nkElifBranch:](#nkElifBranch)
* [TNodeKind.nkElifBranch](ast#nkElifBranch)
 [nkElifExpr:](#nkElifExpr)
* [TNodeKind.nkElifExpr](ast#nkElifExpr)
 [nkElse:](#nkElse)
* [TNodeKind.nkElse](ast#nkElse)
 [nkElseExpr:](#nkElseExpr)
* [TNodeKind.nkElseExpr](ast#nkElseExpr)
 [nkEmpty:](#nkEmpty)
* [TNodeKind.nkEmpty](ast#nkEmpty)
 [nkEnumFieldDef:](#nkEnumFieldDef)
* [TNodeKind.nkEnumFieldDef](ast#nkEnumFieldDef)
 [nkEnumTy:](#nkEnumTy)
* [TNodeKind.nkEnumTy](ast#nkEnumTy)
 [nkExceptBranch:](#nkExceptBranch)
* [TNodeKind.nkExceptBranch](ast#nkExceptBranch)
 [nkExportExceptStmt:](#nkExportExceptStmt)
* [TNodeKind.nkExportExceptStmt](ast#nkExportExceptStmt)
 [nkExportStmt:](#nkExportStmt)
* [TNodeKind.nkExportStmt](ast#nkExportStmt)
 [nkExprColonExpr:](#nkExprColonExpr)
* [TNodeKind.nkExprColonExpr](ast#nkExprColonExpr)
 [nkExprEqExpr:](#nkExprEqExpr)
* [TNodeKind.nkExprEqExpr](ast#nkExprEqExpr)
 [nkFastAsgn:](#nkFastAsgn)
* [TNodeKind.nkFastAsgn](ast#nkFastAsgn)
 [nkFinally:](#nkFinally)
* [TNodeKind.nkFinally](ast#nkFinally)
 [nkFloat128Lit:](#nkFloat128Lit)
* [TNodeKind.nkFloat128Lit](ast#nkFloat128Lit)
 [nkFloat32Lit:](#nkFloat32Lit)
* [TNodeKind.nkFloat32Lit](ast#nkFloat32Lit)
 [nkFloat64Lit:](#nkFloat64Lit)
* [TNodeKind.nkFloat64Lit](ast#nkFloat64Lit)
 [nkFloatLit:](#nkFloatLit)
* [TNodeKind.nkFloatLit](ast#nkFloatLit)
 [nkFloatLiterals:](#nkFloatLiterals)
* [ast: nkFloatLiterals](ast#nkFloatLiterals)
 [nkFormalParams:](#nkFormalParams)
* [TNodeKind.nkFormalParams](ast#nkFormalParams)
 [nkForStmt:](#nkForStmt)
* [TNodeKind.nkForStmt](ast#nkForStmt)
 [nkFromStmt:](#nkFromStmt)
* [TNodeKind.nkFromStmt](ast#nkFromStmt)
 [nkFuncDef:](#nkFuncDef)
* [TNodeKind.nkFuncDef](ast#nkFuncDef)
 [nkGenericParams:](#nkGenericParams)
* [TNodeKind.nkGenericParams](ast#nkGenericParams)
 [nkGotoState:](#nkGotoState)
* [TNodeKind.nkGotoState](ast#nkGotoState)
 [nkHiddenAddr:](#nkHiddenAddr)
* [TNodeKind.nkHiddenAddr](ast#nkHiddenAddr)
 [nkHiddenCallConv:](#nkHiddenCallConv)
* [TNodeKind.nkHiddenCallConv](ast#nkHiddenCallConv)
 [nkHiddenDeref:](#nkHiddenDeref)
* [TNodeKind.nkHiddenDeref](ast#nkHiddenDeref)
 [nkHiddenStdConv:](#nkHiddenStdConv)
* [TNodeKind.nkHiddenStdConv](ast#nkHiddenStdConv)
 [nkHiddenSubConv:](#nkHiddenSubConv)
* [TNodeKind.nkHiddenSubConv](ast#nkHiddenSubConv)
 [nkHiddenTryStmt:](#nkHiddenTryStmt)
* [TNodeKind.nkHiddenTryStmt](ast#nkHiddenTryStmt)
 [nkIdent:](#nkIdent)
* [TNodeKind.nkIdent](ast#nkIdent)
 [nkIdentDefs:](#nkIdentDefs)
* [TNodeKind.nkIdentDefs](ast#nkIdentDefs)
 [nkIdentKinds:](#nkIdentKinds)
* [ast: nkIdentKinds](ast#nkIdentKinds)
 [nkIfExpr:](#nkIfExpr)
* [TNodeKind.nkIfExpr](ast#nkIfExpr)
 [nkIfStmt:](#nkIfStmt)
* [TNodeKind.nkIfStmt](ast#nkIfStmt)
 [nkImportAs:](#nkImportAs)
* [TNodeKind.nkImportAs](ast#nkImportAs)
 [nkImportExceptStmt:](#nkImportExceptStmt)
* [TNodeKind.nkImportExceptStmt](ast#nkImportExceptStmt)
 [nkImportStmt:](#nkImportStmt)
* [TNodeKind.nkImportStmt](ast#nkImportStmt)
 [nkIncludeStmt:](#nkIncludeStmt)
* [TNodeKind.nkIncludeStmt](ast#nkIncludeStmt)
 [nkInfix:](#nkInfix)
* [TNodeKind.nkInfix](ast#nkInfix)
 [nkInt16Lit:](#nkInt16Lit)
* [TNodeKind.nkInt16Lit](ast#nkInt16Lit)
 [nkInt32Lit:](#nkInt32Lit)
* [TNodeKind.nkInt32Lit](ast#nkInt32Lit)
 [nkInt64Lit:](#nkInt64Lit)
* [TNodeKind.nkInt64Lit](ast#nkInt64Lit)
 [nkInt8Lit:](#nkInt8Lit)
* [TNodeKind.nkInt8Lit](ast#nkInt8Lit)
 [nkIntLit:](#nkIntLit)
* [TNodeKind.nkIntLit](ast#nkIntLit)
 [nkIteratorDef:](#nkIteratorDef)
* [TNodeKind.nkIteratorDef](ast#nkIteratorDef)
 [nkIteratorTy:](#nkIteratorTy)
* [TNodeKind.nkIteratorTy](ast#nkIteratorTy)
 [nkLambda:](#nkLambda)
* [TNodeKind.nkLambda](ast#nkLambda)
 [nkLambdaKinds:](#nkLambdaKinds)
* [ast: nkLambdaKinds](ast#nkLambdaKinds)
 [nkLastBlockStmts:](#nkLastBlockStmts)
* [ast: nkLastBlockStmts](ast#nkLastBlockStmts)
 [nkLetSection:](#nkLetSection)
* [TNodeKind.nkLetSection](ast#nkLetSection)
 [nkLiterals:](#nkLiterals)
* [ast: nkLiterals](ast#nkLiterals)
 [nkMacroDef:](#nkMacroDef)
* [TNodeKind.nkMacroDef](ast#nkMacroDef)
 [nkMethodDef:](#nkMethodDef)
* [TNodeKind.nkMethodDef](ast#nkMethodDef)
 [nkMixinStmt:](#nkMixinStmt)
* [TNodeKind.nkMixinStmt](ast#nkMixinStmt)
 [nkMutableTy:](#nkMutableTy)
* [TNodeKind.nkMutableTy](ast#nkMutableTy)
 [nkNilLit:](#nkNilLit)
* [TNodeKind.nkNilLit](ast#nkNilLit)
 [nkNone:](#nkNone)
* [TNodeKind.nkNone](ast#nkNone)
 [nkObjConstr:](#nkObjConstr)
* [TNodeKind.nkObjConstr](ast#nkObjConstr)
 [nkObjDownConv:](#nkObjDownConv)
* [TNodeKind.nkObjDownConv](ast#nkObjDownConv)
 [nkObjectTy:](#nkObjectTy)
* [TNodeKind.nkObjectTy](ast#nkObjectTy)
 [nkObjUpConv:](#nkObjUpConv)
* [TNodeKind.nkObjUpConv](ast#nkObjUpConv)
 [nkOfBranch:](#nkOfBranch)
* [TNodeKind.nkOfBranch](ast#nkOfBranch)
 [nkOfInherit:](#nkOfInherit)
* [TNodeKind.nkOfInherit](ast#nkOfInherit)
 [nkOpenSymChoice:](#nkOpenSymChoice)
* [TNodeKind.nkOpenSymChoice](ast#nkOpenSymChoice)
 [nkPar:](#nkPar)
* [TNodeKind.nkPar](ast#nkPar)
 [nkParForStmt:](#nkParForStmt)
* [TNodeKind.nkParForStmt](ast#nkParForStmt)
 [nkPattern:](#nkPattern)
* [TNodeKind.nkPattern](ast#nkPattern)
 [nkPostfix:](#nkPostfix)
* [TNodeKind.nkPostfix](ast#nkPostfix)
 [nkPragma:](#nkPragma)
* [TNodeKind.nkPragma](ast#nkPragma)
 [nkPragmaBlock:](#nkPragmaBlock)
* [TNodeKind.nkPragmaBlock](ast#nkPragmaBlock)
 [nkPragmaCallKinds:](#nkPragmaCallKinds)
* [ast: nkPragmaCallKinds](ast#nkPragmaCallKinds)
 [nkPragmaExpr:](#nkPragmaExpr)
* [TNodeKind.nkPragmaExpr](ast#nkPragmaExpr)
 [nkPrefix:](#nkPrefix)
* [TNodeKind.nkPrefix](ast#nkPrefix)
 [nkProcDef:](#nkProcDef)
* [TNodeKind.nkProcDef](ast#nkProcDef)
 [nkProcTy:](#nkProcTy)
* [TNodeKind.nkProcTy](ast#nkProcTy)
 [nkPtrTy:](#nkPtrTy)
* [TNodeKind.nkPtrTy](ast#nkPtrTy)
 [nkRaiseStmt:](#nkRaiseStmt)
* [TNodeKind.nkRaiseStmt](ast#nkRaiseStmt)
 [nkRange:](#nkRange)
* [TNodeKind.nkRange](ast#nkRange)
 [nkRecCase:](#nkRecCase)
* [TNodeKind.nkRecCase](ast#nkRecCase)
 [nkRecList:](#nkRecList)
* [TNodeKind.nkRecList](ast#nkRecList)
 [nkRecWhen:](#nkRecWhen)
* [TNodeKind.nkRecWhen](ast#nkRecWhen)
 [nkRefTy:](#nkRefTy)
* [TNodeKind.nkRefTy](ast#nkRefTy)
 [nkReturnStmt:](#nkReturnStmt)
* [TNodeKind.nkReturnStmt](ast#nkReturnStmt)
 [nkRStrLit:](#nkRStrLit)
* [TNodeKind.nkRStrLit](ast#nkRStrLit)
 [nkSharedTy:](#nkSharedTy)
* [TNodeKind.nkSharedTy](ast#nkSharedTy)
 [nkState:](#nkState)
* [TNodeKind.nkState](ast#nkState)
 [nkStaticExpr:](#nkStaticExpr)
* [TNodeKind.nkStaticExpr](ast#nkStaticExpr)
 [nkStaticStmt:](#nkStaticStmt)
* [TNodeKind.nkStaticStmt](ast#nkStaticStmt)
 [nkStaticTy:](#nkStaticTy)
* [TNodeKind.nkStaticTy](ast#nkStaticTy)
 [nkStmtList:](#nkStmtList)
* [TNodeKind.nkStmtList](ast#nkStmtList)
 [nkStmtListExpr:](#nkStmtListExpr)
* [TNodeKind.nkStmtListExpr](ast#nkStmtListExpr)
 [nkStmtListType:](#nkStmtListType)
* [TNodeKind.nkStmtListType](ast#nkStmtListType)
 [nkStringToCString:](#nkStringToCString)
* [TNodeKind.nkStringToCString](ast#nkStringToCString)
 [nkStrKinds:](#nkStrKinds)
* [ast: nkStrKinds](ast#nkStrKinds)
 [nkStrLit:](#nkStrLit)
* [TNodeKind.nkStrLit](ast#nkStrLit)
 [nkSym:](#nkSym)
* [TNodeKind.nkSym](ast#nkSym)
 [nkSymChoices:](#nkSymChoices)
* [ast: nkSymChoices](ast#nkSymChoices)
 [nkTableConstr:](#nkTableConstr)
* [TNodeKind.nkTableConstr](ast#nkTableConstr)
 [nkTemplateDef:](#nkTemplateDef)
* [TNodeKind.nkTemplateDef](ast#nkTemplateDef)
 [nkTripleStrLit:](#nkTripleStrLit)
* [TNodeKind.nkTripleStrLit](ast#nkTripleStrLit)
 [nkTryStmt:](#nkTryStmt)
* [TNodeKind.nkTryStmt](ast#nkTryStmt)
 [nkTupleClassTy:](#nkTupleClassTy)
* [TNodeKind.nkTupleClassTy](ast#nkTupleClassTy)
 [nkTupleConstr:](#nkTupleConstr)
* [TNodeKind.nkTupleConstr](ast#nkTupleConstr)
 [nkTupleTy:](#nkTupleTy)
* [TNodeKind.nkTupleTy](ast#nkTupleTy)
 [nkType:](#nkType)
* [TNodeKind.nkType](ast#nkType)
 [nkTypeClassTy:](#nkTypeClassTy)
* [TNodeKind.nkTypeClassTy](ast#nkTypeClassTy)
 [nkTypeDef:](#nkTypeDef)
* [TNodeKind.nkTypeDef](ast#nkTypeDef)
 [nkTypeOfExpr:](#nkTypeOfExpr)
* [TNodeKind.nkTypeOfExpr](ast#nkTypeOfExpr)
 [nkTypeSection:](#nkTypeSection)
* [TNodeKind.nkTypeSection](ast#nkTypeSection)
 [nkUInt16Lit:](#nkUInt16Lit)
* [TNodeKind.nkUInt16Lit](ast#nkUInt16Lit)
 [nkUInt32Lit:](#nkUInt32Lit)
* [TNodeKind.nkUInt32Lit](ast#nkUInt32Lit)
 [nkUInt64Lit:](#nkUInt64Lit)
* [TNodeKind.nkUInt64Lit](ast#nkUInt64Lit)
 [nkUInt8Lit:](#nkUInt8Lit)
* [TNodeKind.nkUInt8Lit](ast#nkUInt8Lit)
 [nkUIntLit:](#nkUIntLit)
* [TNodeKind.nkUIntLit](ast#nkUIntLit)
 [nkUsingStmt:](#nkUsingStmt)
* [TNodeKind.nkUsingStmt](ast#nkUsingStmt)
 [nkVarSection:](#nkVarSection)
* [TNodeKind.nkVarSection](ast#nkVarSection)
 [nkVarTuple:](#nkVarTuple)
* [TNodeKind.nkVarTuple](ast#nkVarTuple)
 [nkVarTy:](#nkVarTy)
* [TNodeKind.nkVarTy](ast#nkVarTy)
 [nkWhen:](#nkWhen)
* [ast: nkWhen](ast#nkWhen)
 [nkWhenExpr:](#nkWhenExpr)
* [ast: nkWhenExpr](ast#nkWhenExpr)
 [nkWhenStmt:](#nkWhenStmt)
* [TNodeKind.nkWhenStmt](ast#nkWhenStmt)
 [nkWhileStmt:](#nkWhileStmt)
* [TNodeKind.nkWhileStmt](ast#nkWhileStmt)
 [nkWith:](#nkWith)
* [TNodeKind.nkWith](ast#nkWith)
 [nkWithout:](#nkWithout)
* [TNodeKind.nkWithout](ast#nkWithout)
 [nkYieldStmt:](#nkYieldStmt)
* [TNodeKind.nkYieldStmt](ast#nkYieldStmt)
 [nodeTableGet:](#nodeTableGet)
* [treetab: nodeTableGet(t: TNodeTable; key: PNode): int](treetab#nodeTableGet%2CTNodeTable%2CPNode)
 [nodeTablePut:](#nodeTablePut)
* [treetab: nodeTablePut(t: var TNodeTable; key: PNode; val: int)](treetab#nodeTablePut%2CTNodeTable%2CPNode%2Cint)
 [nodeTableTestOrSet:](#nodeTableTestOrSet)
* [treetab: nodeTableTestOrSet(t: var TNodeTable; key: PNode; val: int): int](treetab#nodeTableTestOrSet%2CTNodeTable%2CPNode%2Cint)
 [None:](#None)
* [InstrTargetKind.None](dfa#None)
 [NoneLike:](#NoneLike)
* [OrdinalType.NoneLike](types#NoneLike)
 [noSafePoints:](#noSafePoints)
* [TCProcFlag.noSafePoints](cgendata#noSafePoints)
 [NotesVerbosity:](#NotesVerbosity)
* [lineinfos: NotesVerbosity](lineinfos#NotesVerbosity)
 [notFoundError:](#notFoundError)
* [sem: notFoundError(c: PContext; n: PNode; errors: CandidateErrors)](sem#notFoundError%2CPContext%2CPNode%2CCandidateErrors)
 [notnil:](#notnil)
* [Feature.notnil](options#notnil)
 [noView:](#noView)
* [ViewTypeKind.noView](typeallowed#noView)
 [numChars:](#numChars)
* [lexer: numChars](lexer#numChars)
 [NumericalBase:](#NumericalBase)
* [lexer: NumericalBase](lexer#NumericalBase)
 [numLines:](#numLines)
* [msgs: numLines(conf: ConfigRef; fileIdx: FileIndex): int](msgs#numLines%2CConfigRef%2CFileIndex)
 [objectSetContains:](#objectSetContains)
* [astalgo: objectSetContains(t: TObjectSet; obj: RootRef): bool](astalgo#objectSetContains%2CTObjectSet%2CRootRef)
 [objectSetContainsOrIncl:](#objectSetContainsOrIncl)
* [astalgo: objectSetContainsOrIncl(t: var TObjectSet; obj: RootRef): bool](astalgo#objectSetContainsOrIncl%2CTObjectSet%2CRootRef)
 [objectSetIncl:](#objectSetIncl)
* [astalgo: objectSetIncl(t: var TObjectSet; obj: RootRef)](astalgo#objectSetIncl%2CTObjectSet%2CRootRef)
 [objHasKidsValid:](#objHasKidsValid)
* [CodegenFlag.objHasKidsValid](cgendata#objHasKidsValid)
 [oimDone:](#oimDone)
* [TOverloadIterMode.oimDone](lookups#oimDone)
 [oimNoQualifier:](#oimNoQualifier)
* [TOverloadIterMode.oimNoQualifier](lookups#oimNoQualifier)
 [oimOtherModule:](#oimOtherModule)
* [TOverloadIterMode.oimOtherModule](lookups#oimOtherModule)
 [oimSelfModule:](#oimSelfModule)
* [TOverloadIterMode.oimSelfModule](lookups#oimSelfModule)
 [oimSymChoice:](#oimSymChoice)
* [TOverloadIterMode.oimSymChoice](lookups#oimSymChoice)
 [oimSymChoiceLocalLookup:](#oimSymChoiceLocalLookup)
* [TOverloadIterMode.oimSymChoiceLocalLookup](lookups#oimSymChoiceLocalLookup)
 [oKeepVariableNames:](#oKeepVariableNames)
* [options: oKeepVariableNames](options#oKeepVariableNames)
 [oldExperimentalFeatures:](#oldExperimentalFeatures)
* [options: oldExperimentalFeatures](options#oldExperimentalFeatures)
 [onDef:](#onDef)
* [modulegraphs: onDef(info: TLineInfo; s: PSym)](modulegraphs#onDef.t%2CTLineInfo%2CPSym)
 [onDefResolveForward:](#onDefResolveForward)
* [modulegraphs: onDefResolveForward(info: TLineInfo; s: PSym)](modulegraphs#onDefResolveForward.t%2CTLineInfo%2CPSym)
 [One:](#One)
* [int128: One](int128#One)
 [OnHeap:](#OnHeap)
* [TStorageLoc.OnHeap](ast#OnHeap)
 [OnStack:](#OnStack)
* [TStorageLoc.OnStack](ast#OnStack)
 [OnStatic:](#OnStatic)
* [TStorageLoc.OnStatic](ast#OnStatic)
 [OnUnknown:](#OnUnknown)
* [TStorageLoc.OnUnknown](ast#OnUnknown)
 [onUse:](#onUse)
* [modulegraphs: onUse(info: TLineInfo; s: PSym)](modulegraphs#onUse.t%2CTLineInfo%2CPSym)
 [opcAddFloat:](#opcAddFloat)
* [TOpcode.opcAddFloat](vmdef#opcAddFloat)
 [opcAddImmInt:](#opcAddImmInt)
* [TOpcode.opcAddImmInt](vmdef#opcAddImmInt)
 [opcAddInt:](#opcAddInt)
* [TOpcode.opcAddInt](vmdef#opcAddInt)
 [opcAddrNode:](#opcAddrNode)
* [TOpcode.opcAddrNode](vmdef#opcAddrNode)
 [opcAddrReg:](#opcAddrReg)
* [TOpcode.opcAddrReg](vmdef#opcAddrReg)
 [opcAddSeqElem:](#opcAddSeqElem)
* [TOpcode.opcAddSeqElem](vmdef#opcAddSeqElem)
 [opcAddStrCh:](#opcAddStrCh)
* [TOpcode.opcAddStrCh](vmdef#opcAddStrCh)
 [opcAddStrStr:](#opcAddStrStr)
* [TOpcode.opcAddStrStr](vmdef#opcAddStrStr)
 [opcAddu:](#opcAddu)
* [TOpcode.opcAddu](vmdef#opcAddu)
 [opcAsgnComplex:](#opcAsgnComplex)
* [TOpcode.opcAsgnComplex](vmdef#opcAsgnComplex)
 [opcAsgnConst:](#opcAsgnConst)
* [TOpcode.opcAsgnConst](vmdef#opcAsgnConst)
 [opcAsgnFloat:](#opcAsgnFloat)
* [TOpcode.opcAsgnFloat](vmdef#opcAsgnFloat)
 [opcAsgnInt:](#opcAsgnInt)
* [TOpcode.opcAsgnInt](vmdef#opcAsgnInt)
 [opcAsgnRef:](#opcAsgnRef)
* [TOpcode.opcAsgnRef](vmdef#opcAsgnRef)
 [opcAshrInt:](#opcAshrInt)
* [TOpcode.opcAshrInt](vmdef#opcAshrInt)
 [opcBitandInt:](#opcBitandInt)
* [TOpcode.opcBitandInt](vmdef#opcBitandInt)
 [opcBitnotInt:](#opcBitnotInt)
* [TOpcode.opcBitnotInt](vmdef#opcBitnotInt)
 [opcBitorInt:](#opcBitorInt)
* [TOpcode.opcBitorInt](vmdef#opcBitorInt)
 [opcBitxorInt:](#opcBitxorInt)
* [TOpcode.opcBitxorInt](vmdef#opcBitxorInt)
 [opcBranch:](#opcBranch)
* [TOpcode.opcBranch](vmdef#opcBranch)
 [opcCallSite:](#opcCallSite)
* [TOpcode.opcCallSite](vmdef#opcCallSite)
 [opcCard:](#opcCard)
* [TOpcode.opcCard](vmdef#opcCard)
 [opcCast:](#opcCast)
* [TOpcode.opcCast](vmdef#opcCast)
 [opcCastFloatToInt32:](#opcCastFloatToInt32)
* [TOpcode.opcCastFloatToInt32](vmdef#opcCastFloatToInt32)
 [opcCastFloatToInt64:](#opcCastFloatToInt64)
* [TOpcode.opcCastFloatToInt64](vmdef#opcCastFloatToInt64)
 [opcCastIntToFloat32:](#opcCastIntToFloat32)
* [TOpcode.opcCastIntToFloat32](vmdef#opcCastIntToFloat32)
 [opcCastIntToFloat64:](#opcCastIntToFloat64)
* [TOpcode.opcCastIntToFloat64](vmdef#opcCastIntToFloat64)
 [opcCastIntToPtr:](#opcCastIntToPtr)
* [TOpcode.opcCastIntToPtr](vmdef#opcCastIntToPtr)
 [opcCastPtrToInt:](#opcCastPtrToInt)
* [TOpcode.opcCastPtrToInt](vmdef#opcCastPtrToInt)
 [opcConcatStr:](#opcConcatStr)
* [TOpcode.opcConcatStr](vmdef#opcConcatStr)
 [opcContainsSet:](#opcContainsSet)
* [TOpcode.opcContainsSet](vmdef#opcContainsSet)
 [opcConv:](#opcConv)
* [TOpcode.opcConv](vmdef#opcConv)
 [opcDivFloat:](#opcDivFloat)
* [TOpcode.opcDivFloat](vmdef#opcDivFloat)
 [opcDivInt:](#opcDivInt)
* [TOpcode.opcDivInt](vmdef#opcDivInt)
 [opcDivu:](#opcDivu)
* [TOpcode.opcDivu](vmdef#opcDivu)
 [opcEcho:](#opcEcho)
* [TOpcode.opcEcho](vmdef#opcEcho)
 [opcEof:](#opcEof)
* [TOpcode.opcEof](vmdef#opcEof)
 [opcEqFloat:](#opcEqFloat)
* [TOpcode.opcEqFloat](vmdef#opcEqFloat)
 [opcEqIdent:](#opcEqIdent)
* [TOpcode.opcEqIdent](vmdef#opcEqIdent)
 [opcEqInt:](#opcEqInt)
* [TOpcode.opcEqInt](vmdef#opcEqInt)
 [opcEqNimNode:](#opcEqNimNode)
* [TOpcode.opcEqNimNode](vmdef#opcEqNimNode)
 [opcEqRef:](#opcEqRef)
* [TOpcode.opcEqRef](vmdef#opcEqRef)
 [opcEqSet:](#opcEqSet)
* [TOpcode.opcEqSet](vmdef#opcEqSet)
 [opcEqStr:](#opcEqStr)
* [TOpcode.opcEqStr](vmdef#opcEqStr)
 [opcExcept:](#opcExcept)
* [TOpcode.opcExcept](vmdef#opcExcept)
 [opcExcl:](#opcExcl)
* [TOpcode.opcExcl](vmdef#opcExcl)
 [opcFastAsgnComplex:](#opcFastAsgnComplex)
* [TOpcode.opcFastAsgnComplex](vmdef#opcFastAsgnComplex)
 [opcFinally:](#opcFinally)
* [TOpcode.opcFinally](vmdef#opcFinally)
 [opcFinallyEnd:](#opcFinallyEnd)
* [TOpcode.opcFinallyEnd](vmdef#opcFinallyEnd)
 [opcFJmp:](#opcFJmp)
* [TOpcode.opcFJmp](vmdef#opcFJmp)
 [opcGenSym:](#opcGenSym)
* [TOpcode.opcGenSym](vmdef#opcGenSym)
 [opcGetImpl:](#opcGetImpl)
* [TOpcode.opcGetImpl](vmdef#opcGetImpl)
 [opcGetImplTransf:](#opcGetImplTransf)
* [TOpcode.opcGetImplTransf](vmdef#opcGetImplTransf)
 [opcGorge:](#opcGorge)
* [TOpcode.opcGorge](vmdef#opcGorge)
 [OpChars:](#OpChars)
* [lexer: OpChars](lexer#OpChars)
 [opcIncl:](#opcIncl)
* [TOpcode.opcIncl](vmdef#opcIncl)
 [opcInclRange:](#opcInclRange)
* [TOpcode.opcInclRange](vmdef#opcInclRange)
 [opcIndCall:](#opcIndCall)
* [TOpcode.opcIndCall](vmdef#opcIndCall)
 [opcIndCallAsgn:](#opcIndCallAsgn)
* [TOpcode.opcIndCallAsgn](vmdef#opcIndCallAsgn)
 [opcInvalidField:](#opcInvalidField)
* [TOpcode.opcInvalidField](vmdef#opcInvalidField)
 [opcIs:](#opcIs)
* [TOpcode.opcIs](vmdef#opcIs)
 [opcIsNil:](#opcIsNil)
* [TOpcode.opcIsNil](vmdef#opcIsNil)
 [opcJmp:](#opcJmp)
* [TOpcode.opcJmp](vmdef#opcJmp)
 [opcJmpBack:](#opcJmpBack)
* [TOpcode.opcJmpBack](vmdef#opcJmpBack)
 [opcLdArr:](#opcLdArr)
* [TOpcode.opcLdArr](vmdef#opcLdArr)
 [opcLdArrAddr:](#opcLdArrAddr)
* [TOpcode.opcLdArrAddr](vmdef#opcLdArrAddr)
 [opcLdConst:](#opcLdConst)
* [TOpcode.opcLdConst](vmdef#opcLdConst)
 [opcLdDeref:](#opcLdDeref)
* [TOpcode.opcLdDeref](vmdef#opcLdDeref)
 [opcLdGlobal:](#opcLdGlobal)
* [TOpcode.opcLdGlobal](vmdef#opcLdGlobal)
 [opcLdGlobalAddr:](#opcLdGlobalAddr)
* [TOpcode.opcLdGlobalAddr](vmdef#opcLdGlobalAddr)
 [opcLdGlobalAddrDerefFFI:](#opcLdGlobalAddrDerefFFI)
* [TOpcode.opcLdGlobalAddrDerefFFI](vmdef#opcLdGlobalAddrDerefFFI)
 [opcLdGlobalDerefFFI:](#opcLdGlobalDerefFFI)
* [TOpcode.opcLdGlobalDerefFFI](vmdef#opcLdGlobalDerefFFI)
 [opcLdImmInt:](#opcLdImmInt)
* [TOpcode.opcLdImmInt](vmdef#opcLdImmInt)
 [opcLdNull:](#opcLdNull)
* [TOpcode.opcLdNull](vmdef#opcLdNull)
 [opcLdNullReg:](#opcLdNullReg)
* [TOpcode.opcLdNullReg](vmdef#opcLdNullReg)
 [opcLdObj:](#opcLdObj)
* [TOpcode.opcLdObj](vmdef#opcLdObj)
 [opcLdObjAddr:](#opcLdObjAddr)
* [TOpcode.opcLdObjAddr](vmdef#opcLdObjAddr)
 [opcLdStrIdx:](#opcLdStrIdx)
* [TOpcode.opcLdStrIdx](vmdef#opcLdStrIdx)
 [opcLeFloat:](#opcLeFloat)
* [TOpcode.opcLeFloat](vmdef#opcLeFloat)
 [opcLeInt:](#opcLeInt)
* [TOpcode.opcLeInt](vmdef#opcLeInt)
 [opcLenSeq:](#opcLenSeq)
* [TOpcode.opcLenSeq](vmdef#opcLenSeq)
 [opcLenStr:](#opcLenStr)
* [TOpcode.opcLenStr](vmdef#opcLenStr)
 [opcLeSet:](#opcLeSet)
* [TOpcode.opcLeSet](vmdef#opcLeSet)
 [opcLeStr:](#opcLeStr)
* [TOpcode.opcLeStr](vmdef#opcLeStr)
 [opcLeu:](#opcLeu)
* [TOpcode.opcLeu](vmdef#opcLeu)
 [opcLtFloat:](#opcLtFloat)
* [TOpcode.opcLtFloat](vmdef#opcLtFloat)
 [opcLtInt:](#opcLtInt)
* [TOpcode.opcLtInt](vmdef#opcLtInt)
 [opcLtSet:](#opcLtSet)
* [TOpcode.opcLtSet](vmdef#opcLtSet)
 [opcLtStr:](#opcLtStr)
* [TOpcode.opcLtStr](vmdef#opcLtStr)
 [opcLtu:](#opcLtu)
* [TOpcode.opcLtu](vmdef#opcLtu)
 [opcMarshalLoad:](#opcMarshalLoad)
* [TOpcode.opcMarshalLoad](vmdef#opcMarshalLoad)
 [opcMarshalStore:](#opcMarshalStore)
* [TOpcode.opcMarshalStore](vmdef#opcMarshalStore)
 [opcMinusSet:](#opcMinusSet)
* [TOpcode.opcMinusSet](vmdef#opcMinusSet)
 [opcModInt:](#opcModInt)
* [TOpcode.opcModInt](vmdef#opcModInt)
 [opcModu:](#opcModu)
* [TOpcode.opcModu](vmdef#opcModu)
 [opcMulFloat:](#opcMulFloat)
* [TOpcode.opcMulFloat](vmdef#opcMulFloat)
 [opcMulInt:](#opcMulInt)
* [TOpcode.opcMulInt](vmdef#opcMulInt)
 [opcMulSet:](#opcMulSet)
* [TOpcode.opcMulSet](vmdef#opcMulSet)
 [opcMulu:](#opcMulu)
* [TOpcode.opcMulu](vmdef#opcMulu)
 [opcNAdd:](#opcNAdd)
* [TOpcode.opcNAdd](vmdef#opcNAdd)
 [opcNAddMultiple:](#opcNAddMultiple)
* [TOpcode.opcNAddMultiple](vmdef#opcNAddMultiple)
 [opcNarrowS:](#opcNarrowS)
* [TOpcode.opcNarrowS](vmdef#opcNarrowS)
 [opcNarrowU:](#opcNarrowU)
* [TOpcode.opcNarrowU](vmdef#opcNarrowU)
 [opcNBindSym:](#opcNBindSym)
* [TOpcode.opcNBindSym](vmdef#opcNBindSym)
 [opcNccInc:](#opcNccInc)
* [TOpcode.opcNccInc](vmdef#opcNccInc)
 [opcNccValue:](#opcNccValue)
* [TOpcode.opcNccValue](vmdef#opcNccValue)
 [opcNChild:](#opcNChild)
* [TOpcode.opcNChild](vmdef#opcNChild)
 [opcNCopyNimNode:](#opcNCopyNimNode)
* [TOpcode.opcNCopyNimNode](vmdef#opcNCopyNimNode)
 [opcNCopyNimTree:](#opcNCopyNimTree)
* [TOpcode.opcNCopyNimTree](vmdef#opcNCopyNimTree)
 [opcNcsAdd:](#opcNcsAdd)
* [TOpcode.opcNcsAdd](vmdef#opcNcsAdd)
 [opcNcsAt:](#opcNcsAt)
* [TOpcode.opcNcsAt](vmdef#opcNcsAt)
 [opcNcsIncl:](#opcNcsIncl)
* [TOpcode.opcNcsIncl](vmdef#opcNcsIncl)
 [opcNcsLen:](#opcNcsLen)
* [TOpcode.opcNcsLen](vmdef#opcNcsLen)
 [opcNctGet:](#opcNctGet)
* [TOpcode.opcNctGet](vmdef#opcNctGet)
 [opcNctHasNext:](#opcNctHasNext)
* [TOpcode.opcNctHasNext](vmdef#opcNctHasNext)
 [opcNctLen:](#opcNctLen)
* [TOpcode.opcNctLen](vmdef#opcNctLen)
 [opcNctNext:](#opcNctNext)
* [TOpcode.opcNctNext](vmdef#opcNctNext)
 [opcNctPut:](#opcNctPut)
* [TOpcode.opcNctPut](vmdef#opcNctPut)
 [opcNDel:](#opcNDel)
* [TOpcode.opcNDel](vmdef#opcNDel)
 [opcNDynBindSym:](#opcNDynBindSym)
* [TOpcode.opcNDynBindSym](vmdef#opcNDynBindSym)
 [opcNError:](#opcNError)
* [TOpcode.opcNError](vmdef#opcNError)
 [opcNew:](#opcNew)
* [TOpcode.opcNew](vmdef#opcNew)
 [opcNewSeq:](#opcNewSeq)
* [TOpcode.opcNewSeq](vmdef#opcNewSeq)
 [opcNewStr:](#opcNewStr)
* [TOpcode.opcNewStr](vmdef#opcNewStr)
 [opcNFloatVal:](#opcNFloatVal)
* [TOpcode.opcNFloatVal](vmdef#opcNFloatVal)
 [opcNGetLineInfo:](#opcNGetLineInfo)
* [TOpcode.opcNGetLineInfo](vmdef#opcNGetLineInfo)
 [opcNGetSize:](#opcNGetSize)
* [TOpcode.opcNGetSize](vmdef#opcNGetSize)
 [opcNGetType:](#opcNGetType)
* [TOpcode.opcNGetType](vmdef#opcNGetType)
 [opcNHint:](#opcNHint)
* [TOpcode.opcNHint](vmdef#opcNHint)
 [opcNIdent:](#opcNIdent)
* [TOpcode.opcNIdent](vmdef#opcNIdent)
 [opcNIntVal:](#opcNIntVal)
* [TOpcode.opcNIntVal](vmdef#opcNIntVal)
 [opcNKind:](#opcNKind)
* [TOpcode.opcNKind](vmdef#opcNKind)
 [opcNNewNimNode:](#opcNNewNimNode)
* [TOpcode.opcNNewNimNode](vmdef#opcNNewNimNode)
 [opcNodeId:](#opcNodeId)
* [TOpcode.opcNodeId](vmdef#opcNodeId)
 [opcNodeToReg:](#opcNodeToReg)
* [TOpcode.opcNodeToReg](vmdef#opcNodeToReg)
 [opcNot:](#opcNot)
* [TOpcode.opcNot](vmdef#opcNot)
 [opcNSetChild:](#opcNSetChild)
* [TOpcode.opcNSetChild](vmdef#opcNSetChild)
 [opcNSetFloatVal:](#opcNSetFloatVal)
* [TOpcode.opcNSetFloatVal](vmdef#opcNSetFloatVal)
 [opcNSetIdent:](#opcNSetIdent)
* [TOpcode.opcNSetIdent](vmdef#opcNSetIdent)
 [opcNSetIntVal:](#opcNSetIntVal)
* [TOpcode.opcNSetIntVal](vmdef#opcNSetIntVal)
 [opcNSetLineInfo:](#opcNSetLineInfo)
* [TOpcode.opcNSetLineInfo](vmdef#opcNSetLineInfo)
 [opcNSetStrVal:](#opcNSetStrVal)
* [TOpcode.opcNSetStrVal](vmdef#opcNSetStrVal)
 [opcNSetSymbol:](#opcNSetSymbol)
* [TOpcode.opcNSetSymbol](vmdef#opcNSetSymbol)
 [opcNSetType:](#opcNSetType)
* [TOpcode.opcNSetType](vmdef#opcNSetType)
 [opcNSigHash:](#opcNSigHash)
* [TOpcode.opcNSigHash](vmdef#opcNSigHash)
 [opcNStrVal:](#opcNStrVal)
* [TOpcode.opcNStrVal](vmdef#opcNStrVal)
 [opcNSymbol:](#opcNSymbol)
* [TOpcode.opcNSymbol](vmdef#opcNSymbol)
 [opcNSymKind:](#opcNSymKind)
* [TOpcode.opcNSymKind](vmdef#opcNSymKind)
 [opcNWarning:](#opcNWarning)
* [TOpcode.opcNWarning](vmdef#opcNWarning)
 [opcode:](#opcode)
* [vmdef: opcode(x: TInstr): TOpcode](vmdef#opcode.t%2CTInstr)
 [opcOf:](#opcOf)
* [TOpcode.opcOf](vmdef#opcOf)
 [opcParseExprToAst:](#opcParseExprToAst)
* [TOpcode.opcParseExprToAst](vmdef#opcParseExprToAst)
 [opcParseFloat:](#opcParseFloat)
* [TOpcode.opcParseFloat](vmdef#opcParseFloat)
 [opcParseStmtToAst:](#opcParseStmtToAst)
* [TOpcode.opcParseStmtToAst](vmdef#opcParseStmtToAst)
 [opcPlusSet:](#opcPlusSet)
* [TOpcode.opcPlusSet](vmdef#opcPlusSet)
 [opcQueryErrorFlag:](#opcQueryErrorFlag)
* [TOpcode.opcQueryErrorFlag](vmdef#opcQueryErrorFlag)
 [opcQuit:](#opcQuit)
* [TOpcode.opcQuit](vmdef#opcQuit)
 [opcRaise:](#opcRaise)
* [TOpcode.opcRaise](vmdef#opcRaise)
 [opcRangeChck:](#opcRangeChck)
* [TOpcode.opcRangeChck](vmdef#opcRangeChck)
 [opcRepr:](#opcRepr)
* [TOpcode.opcRepr](vmdef#opcRepr)
 [opcRet:](#opcRet)
* [TOpcode.opcRet](vmdef#opcRet)
 [opcSameNodeType:](#opcSameNodeType)
* [TOpcode.opcSameNodeType](vmdef#opcSameNodeType)
 [opcSetLenSeq:](#opcSetLenSeq)
* [TOpcode.opcSetLenSeq](vmdef#opcSetLenSeq)
 [opcSetLenStr:](#opcSetLenStr)
* [TOpcode.opcSetLenStr](vmdef#opcSetLenStr)
 [opcSetType:](#opcSetType)
* [TOpcode.opcSetType](vmdef#opcSetType)
 [opcShlInt:](#opcShlInt)
* [TOpcode.opcShlInt](vmdef#opcShlInt)
 [opcShrInt:](#opcShrInt)
* [TOpcode.opcShrInt](vmdef#opcShrInt)
 [opcSignExtend:](#opcSignExtend)
* [TOpcode.opcSignExtend](vmdef#opcSignExtend)
 [opcSlurp:](#opcSlurp)
* [TOpcode.opcSlurp](vmdef#opcSlurp)
 [opcStrToIdent:](#opcStrToIdent)
* [TOpcode.opcStrToIdent](vmdef#opcStrToIdent)
 [opcSubFloat:](#opcSubFloat)
* [TOpcode.opcSubFloat](vmdef#opcSubFloat)
 [opcSubImmInt:](#opcSubImmInt)
* [TOpcode.opcSubImmInt](vmdef#opcSubImmInt)
 [opcSubInt:](#opcSubInt)
* [TOpcode.opcSubInt](vmdef#opcSubInt)
 [opcSubStr:](#opcSubStr)
* [TOpcode.opcSubStr](vmdef#opcSubStr)
 [opcSubu:](#opcSubu)
* [TOpcode.opcSubu](vmdef#opcSubu)
 [opcSymIsInstantiationOf:](#opcSymIsInstantiationOf)
* [TOpcode.opcSymIsInstantiationOf](vmdef#opcSymIsInstantiationOf)
 [opcSymOwner:](#opcSymOwner)
* [TOpcode.opcSymOwner](vmdef#opcSymOwner)
 [opcTJmp:](#opcTJmp)
* [TOpcode.opcTJmp](vmdef#opcTJmp)
 [opcTry:](#opcTry)
* [TOpcode.opcTry](vmdef#opcTry)
 [opcTypeTrait:](#opcTypeTrait)
* [TOpcode.opcTypeTrait](vmdef#opcTypeTrait)
 [opcUnaryMinusFloat:](#opcUnaryMinusFloat)
* [TOpcode.opcUnaryMinusFloat](vmdef#opcUnaryMinusFloat)
 [opcUnaryMinusInt:](#opcUnaryMinusInt)
* [TOpcode.opcUnaryMinusInt](vmdef#opcUnaryMinusInt)
 [opcWrArr:](#opcWrArr)
* [TOpcode.opcWrArr](vmdef#opcWrArr)
 [opcWrDeref:](#opcWrDeref)
* [TOpcode.opcWrDeref](vmdef#opcWrDeref)
 [opcWrObj:](#opcWrObj)
* [TOpcode.opcWrObj](vmdef#opcWrObj)
 [opcWrStrIdx:](#opcWrStrIdx)
* [TOpcode.opcWrStrIdx](vmdef#opcWrStrIdx)
 [opcXor:](#opcXor)
* [TOpcode.opcXor](vmdef#opcXor)
 [opcYldVal:](#opcYldVal)
* [TOpcode.opcYldVal](vmdef#opcYldVal)
 [opcYldYoid:](#opcYldYoid)
* [TOpcode.opcYldYoid](vmdef#opcYldYoid)
 [open:](#open)
* [ndi: open(f: var NdiFile; filename: AbsoluteFile; conf: ConfigRef)](ndi#open%2CNdiFile%2CAbsoluteFile%2CConfigRef)
 [openBaseLexer:](#openBaseLexer)
* [nimlexbase: openBaseLexer(L: var TBaseLexer; inputstream: PLLStream; bufLen: int = 8192)](nimlexbase#openBaseLexer%2CTBaseLexer%2CPLLStream%2Cint)
 [openLexer:](#openLexer)
* [lexer: openLexer(lex: var Lexer; filename: AbsoluteFile; inputstream: PLLStream; cache: IdentCache; config: ConfigRef)](lexer#openLexer%2CLexer%2CAbsoluteFile%2CPLLStream%2CIdentCache%2CConfigRef)
* [lexer: openLexer(lex: var Lexer; fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache; config: ConfigRef)](lexer#openLexer%2CLexer%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef)
 [openParser:](#openParser)
* [parser: openParser(p: var Parser; filename: AbsoluteFile; inputStream: PLLStream; cache: IdentCache; config: ConfigRef)](parser#openParser%2CParser%2CAbsoluteFile%2CPLLStream%2CIdentCache%2CConfigRef)
* [parser: openParser(p: var Parser; fileIdx: FileIndex; inputStream: PLLStream; cache: IdentCache; config: ConfigRef)](parser#openParser%2CParser%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef)
* [syntaxes: openParser(p: var Parser; fileIdx: FileIndex; inputstream: PLLStream; cache: IdentCache; config: ConfigRef)](syntaxes#openParser%2CParser%2CFileIndex%2CPLLStream%2CIdentCache%2CConfigRef)
 [openScope:](#openScope)
* [lookups: openScope(c: PContext): PScope](lookups#openScope%2CPContext)
 [openShadowScope:](#openShadowScope)
* [lookups: openShadowScope(c: PContext)](lookups#openShadowScope%2CPContext)
 [Operators:](#Operators)
* [guards: Operators](guards#Operators)
 [opGorge:](#opGorge)
* [gorgeimpl: opGorge(cmd, input, cache: string; info: TLineInfo; conf: ConfigRef): (string, int)](gorgeimpl#opGorge%2Cstring%2Cstring%2Cstring%2CTLineInfo%2CConfigRef)
 [opMapTypeImplToAst:](#opMapTypeImplToAst)
* [vmdeps: opMapTypeImplToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode](vmdeps#opMapTypeImplToAst%2CIdentCache%2CPType%2CTLineInfo)
 [opMapTypeInstToAst:](#opMapTypeInstToAst)
* [vmdeps: opMapTypeInstToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode](vmdeps#opMapTypeInstToAst%2CIdentCache%2CPType%2CTLineInfo)
 [opMapTypeToAst:](#opMapTypeToAst)
* [vmdeps: opMapTypeToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode](vmdeps#opMapTypeToAst%2CIdentCache%2CPType%2CTLineInfo)
 [oprHigh:](#oprHigh)
* [wordrecg: oprHigh](wordrecg#oprHigh)
 [oprLow:](#oprLow)
* [wordrecg: oprLow](wordrecg#oprLow)
 [opSlurp:](#opSlurp)
* [vmdeps: opSlurp(file: string; info: TLineInfo; module: PSym; conf: ConfigRef): string](vmdeps#opSlurp%2Cstring%2CTLineInfo%2CPSym%2CConfigRef)
 [optAssert:](#optAssert)
* [TOption.optAssert](options#optAssert)
 [optBenchmarkVM:](#optBenchmarkVM)
* [TGlobalOption.optBenchmarkVM](options#optBenchmarkVM)
 [optBoundsCheck:](#optBoundsCheck)
* [TOption.optBoundsCheck](options#optBoundsCheck)
 [optByRef:](#optByRef)
* [TOption.optByRef](options#optByRef)
 [optCDebug:](#optCDebug)
* [TGlobalOption.optCDebug](options#optCDebug)
 [optCompileOnly:](#optCompileOnly)
* [TGlobalOption.optCompileOnly](options#optCompileOnly)
 [optCursorInference:](#optCursorInference)
* [TOption.optCursorInference](options#optCursorInference)
 [optDocInternal:](#optDocInternal)
* [TGlobalOption.optDocInternal](options#optDocInternal)
 [optDynlibOverrideAll:](#optDynlibOverrideAll)
* [TGlobalOption.optDynlibOverrideAll](options#optDynlibOverrideAll)
 [optEmbedOrigSrc:](#optEmbedOrigSrc)
* [TGlobalOption.optEmbedOrigSrc](options#optEmbedOrigSrc)
 [optEnableDeepCopy:](#optEnableDeepCopy)
* [TGlobalOption.optEnableDeepCopy](options#optEnableDeepCopy)
 [optExcessiveStackTrace:](#optExcessiveStackTrace)
* [TGlobalOption.optExcessiveStackTrace](options#optExcessiveStackTrace)
 [optFieldCheck:](#optFieldCheck)
* [TOption.optFieldCheck](options#optFieldCheck)
 [optForceFullMake:](#optForceFullMake)
* [TGlobalOption.optForceFullMake](options#optForceFullMake)
 [optGenDynLib:](#optGenDynLib)
* [TGlobalOption.optGenDynLib](options#optGenDynLib)
 [optGenGuiApp:](#optGenGuiApp)
* [TGlobalOption.optGenGuiApp](options#optGenGuiApp)
 [optGenIndex:](#optGenIndex)
* [TGlobalOption.optGenIndex](options#optGenIndex)
 [optGenMapping:](#optGenMapping)
* [TGlobalOption.optGenMapping](options#optGenMapping)
 [optGenScript:](#optGenScript)
* [TGlobalOption.optGenScript](options#optGenScript)
 [optGenStaticLib:](#optGenStaticLib)
* [TGlobalOption.optGenStaticLib](options#optGenStaticLib)
 [optHints:](#optHints)
* [TOption.optHints](options#optHints)
 [optHotCodeReloading:](#optHotCodeReloading)
* [TGlobalOption.optHotCodeReloading](options#optHotCodeReloading)
 [optIdeDebug:](#optIdeDebug)
* [TGlobalOption.optIdeDebug](options#optIdeDebug)
 [optIdeTerse:](#optIdeTerse)
* [TGlobalOption.optIdeTerse](options#optIdeTerse)
 [optimize:](#optimize)
* [optimizer: optimize(n: PNode): PNode](optimizer#optimize%2CPNode)
 [optImplicitStatic:](#optImplicitStatic)
* [TOption.optImplicitStatic](options#optImplicitStatic)
 [optInd:](#optInd)
* [parser: optInd(p: var Parser; n: PNode)](parser#optInd%2CParser%2CPNode)
 [optInfCheck:](#optInfCheck)
* [TOption.optInfCheck](options#optInfCheck)
 [optLineDir:](#optLineDir)
* [TOption.optLineDir](options#optLineDir)
 [optLineTrace:](#optLineTrace)
* [TOption.optLineTrace](options#optLineTrace)
 [optListCmd:](#optListCmd)
* [TGlobalOption.optListCmd](options#optListCmd)
 [optListFullPaths:](#optListFullPaths)
* [TGlobalOption.optListFullPaths](options#optListFullPaths)
 [optMemTracker:](#optMemTracker)
* [TOption.optMemTracker](options#optMemTracker)
 [optMixedMode:](#optMixedMode)
* [TGlobalOption.optMixedMode](options#optMixedMode)
 [optMultiMethods:](#optMultiMethods)
* [TGlobalOption.optMultiMethods](options#optMultiMethods)
 [optNaNCheck:](#optNaNCheck)
* [TOption.optNaNCheck](options#optNaNCheck)
 [optNilSeqs:](#optNilSeqs)
* [TOption.optNilSeqs](options#optNilSeqs)
 [optNimV12Emulation:](#optNimV12Emulation)
* [TGlobalOption.optNimV12Emulation](options#optNimV12Emulation)
 [optNimV1Emulation:](#optNimV1Emulation)
* [TGlobalOption.optNimV1Emulation](options#optNimV1Emulation)
 [optNoLinking:](#optNoLinking)
* [TGlobalOption.optNoLinking](options#optNoLinking)
 [optNoMain:](#optNoMain)
* [TGlobalOption.optNoMain](options#optNoMain)
 [optNone:](#optNone)
* [TOption.optNone](options#optNone)
 [optNoNimblePath:](#optNoNimblePath)
* [TGlobalOption.optNoNimblePath](options#optNoNimblePath)
 [optObjCheck:](#optObjCheck)
* [TOption.optObjCheck](options#optObjCheck)
 [optOptimizeSize:](#optOptimizeSize)
* [TOption.optOptimizeSize](options#optOptimizeSize)
 [optOptimizeSpeed:](#optOptimizeSpeed)
* [TOption.optOptimizeSpeed](options#optOptimizeSpeed)
 [optOverflowCheck:](#optOverflowCheck)
* [TOption.optOverflowCheck](options#optOverflowCheck)
 [optOwnedRefs:](#optOwnedRefs)
* [TGlobalOption.optOwnedRefs](options#optOwnedRefs)
 [optPanics:](#optPanics)
* [TGlobalOption.optPanics](options#optPanics)
 [optPar:](#optPar)
* [parser: optPar(p: var Parser)](parser#optPar%2CParser)
 [optPreserveOrigSource:](#optPreserveOrigSource)
* [options: optPreserveOrigSource(conf: ConfigRef): untyped](options#optPreserveOrigSource.t%2CConfigRef)
 [optProduceAsm:](#optProduceAsm)
* [TGlobalOption.optProduceAsm](options#optProduceAsm)
 [optProfiler:](#optProfiler)
* [TOption.optProfiler](options#optProfiler)
 [optProfileVM:](#optProfileVM)
* [TGlobalOption.optProfileVM](options#optProfileVM)
 [optRangeCheck:](#optRangeCheck)
* [TOption.optRangeCheck](options#optRangeCheck)
 [optRefCheck:](#optRefCheck)
* [TOption.optRefCheck](options#optRefCheck)
 [optRun:](#optRun)
* [TGlobalOption.optRun](options#optRun)
 [optSeqDestructors:](#optSeqDestructors)
* [TGlobalOption.optSeqDestructors](options#optSeqDestructors)
 [optShowAllMismatches:](#optShowAllMismatches)
* [TGlobalOption.optShowAllMismatches](options#optShowAllMismatches)
 [optSinkInference:](#optSinkInference)
* [TOption.optSinkInference](options#optSinkInference)
 [optSkipParentConfigFiles:](#optSkipParentConfigFiles)
* [TGlobalOption.optSkipParentConfigFiles](options#optSkipParentConfigFiles)
 [optSkipProjConfigFile:](#optSkipProjConfigFile)
* [TGlobalOption.optSkipProjConfigFile](options#optSkipProjConfigFile)
 [optSkipSystemConfigFile:](#optSkipSystemConfigFile)
* [TGlobalOption.optSkipSystemConfigFile](options#optSkipSystemConfigFile)
 [optSkipUserConfigFile:](#optSkipUserConfigFile)
* [TGlobalOption.optSkipUserConfigFile](options#optSkipUserConfigFile)
 [optSourcemap:](#optSourcemap)
* [TGlobalOption.optSourcemap](options#optSourcemap)
 [optStackTrace:](#optStackTrace)
* [TOption.optStackTrace](options#optStackTrace)
 [optStackTraceMsgs:](#optStackTraceMsgs)
* [TOption.optStackTraceMsgs](options#optStackTraceMsgs)
 [optStaticBoundsCheck:](#optStaticBoundsCheck)
* [TOption.optStaticBoundsCheck](options#optStaticBoundsCheck)
 [optStdout:](#optStdout)
* [TGlobalOption.optStdout](options#optStdout)
 [optStyleCheck:](#optStyleCheck)
* [TOption.optStyleCheck](options#optStyleCheck)
 [optStyleError:](#optStyleError)
* [TGlobalOption.optStyleError](options#optStyleError)
 [optStyleHint:](#optStyleHint)
* [TGlobalOption.optStyleHint](options#optStyleHint)
 [optStyleUsages:](#optStyleUsages)
* [TGlobalOption.optStyleUsages](options#optStyleUsages)
 [optTaintMode:](#optTaintMode)
* [TGlobalOption.optTaintMode](options#optTaintMode)
 [optThreadAnalysis:](#optThreadAnalysis)
* [TGlobalOption.optThreadAnalysis](options#optThreadAnalysis)
 [optThreads:](#optThreads)
* [TGlobalOption.optThreads](options#optThreads)
 [optTinyRtti:](#optTinyRtti)
* [TGlobalOption.optTinyRtti](options#optTinyRtti)
 [optTlsEmulation:](#optTlsEmulation)
* [TGlobalOption.optTlsEmulation](options#optTlsEmulation)
 [optTrMacros:](#optTrMacros)
* [TOption.optTrMacros](options#optTrMacros)
 [optUseColors:](#optUseColors)
* [TGlobalOption.optUseColors](options#optUseColors)
 [optUseNimcache:](#optUseNimcache)
* [TGlobalOption.optUseNimcache](options#optUseNimcache)
 [optWarns:](#optWarns)
* [TOption.optWarns](options#optWarns)
 [optWasNimscript:](#optWasNimscript)
* [TGlobalOption.optWasNimscript](options#optWasNimscript)
 [optWholeProject:](#optWholeProject)
* [TGlobalOption.optWholeProject](options#optWholeProject)
 [OrdinalType:](#OrdinalType)
* [types: OrdinalType](types#OrdinalType)
 [ordinalValToString:](#ordinalValToString)
* [semfold: ordinalValToString(a: PNode; g: ModuleGraph): string](semfold#ordinalValToString%2CPNode%2CModuleGraph)
 [originatingModule:](#originatingModule)
* [ast: originatingModule(s: PSym): PSym](ast#originatingModule%2CPSym)
 [OS:](#OS)
* [platform: OS](platform#OS)
 [osAix:](#osAix)
* [TSystemOS.osAix](platform#osAix)
 [osAmiga:](#osAmiga)
* [TSystemOS.osAmiga](platform#osAmiga)
 [osAndroid:](#osAndroid)
* [TSystemOS.osAndroid](platform#osAndroid)
 [osAny:](#osAny)
* [TSystemOS.osAny](platform#osAny)
 [osAtari:](#osAtari)
* [TSystemOS.osAtari](platform#osAtari)
 [osDos:](#osDos)
* [TSystemOS.osDos](platform#osDos)
 [osDragonfly:](#osDragonfly)
* [TSystemOS.osDragonfly](platform#osDragonfly)
 [osFreebsd:](#osFreebsd)
* [TSystemOS.osFreebsd](platform#osFreebsd)
 [osFreeRTOS:](#osFreeRTOS)
* [TSystemOS.osFreeRTOS](platform#osFreeRTOS)
 [osGenode:](#osGenode)
* [TSystemOS.osGenode](platform#osGenode)
 [osHaiku:](#osHaiku)
* [TSystemOS.osHaiku](platform#osHaiku)
 [osIos:](#osIos)
* [TSystemOS.osIos](platform#osIos)
 [osIrix:](#osIrix)
* [TSystemOS.osIrix](platform#osIrix)
 [osJS:](#osJS)
* [TSystemOS.osJS](platform#osJS)
 [osLinux:](#osLinux)
* [TSystemOS.osLinux](platform#osLinux)
 [osMacos:](#osMacos)
* [TSystemOS.osMacos](platform#osMacos)
 [osMacosx:](#osMacosx)
* [TSystemOS.osMacosx](platform#osMacosx)
 [osMorphos:](#osMorphos)
* [TSystemOS.osMorphos](platform#osMorphos)
 [osNetbsd:](#osNetbsd)
* [TSystemOS.osNetbsd](platform#osNetbsd)
 [osNetware:](#osNetware)
* [TSystemOS.osNetware](platform#osNetware)
 [osNimVM:](#osNimVM)
* [TSystemOS.osNimVM](platform#osNimVM)
 [osNintendoSwitch:](#osNintendoSwitch)
* [TSystemOS.osNintendoSwitch](platform#osNintendoSwitch)
 [osNone:](#osNone)
* [TSystemOS.osNone](platform#osNone)
 [osOpenbsd:](#osOpenbsd)
* [TSystemOS.osOpenbsd](platform#osOpenbsd)
 [osOs2:](#osOs2)
* [TSystemOS.osOs2](platform#osOs2)
 [osPalmos:](#osPalmos)
* [TSystemOS.osPalmos](platform#osPalmos)
 [ospCaseInsensitive:](#ospCaseInsensitive)
* [TInfoOSProp.ospCaseInsensitive](platform#ospCaseInsensitive)
 [ospLacksThreadVars:](#ospLacksThreadVars)
* [TInfoOSProp.ospLacksThreadVars](platform#ospLacksThreadVars)
 [ospNeedsPIC:](#ospNeedsPIC)
* [TInfoOSProp.ospNeedsPIC](platform#ospNeedsPIC)
 [ospPosix:](#ospPosix)
* [TInfoOSProp.ospPosix](platform#ospPosix)
 [osQnx:](#osQnx)
* [TSystemOS.osQnx](platform#osQnx)
 [osSkyos:](#osSkyos)
* [TSystemOS.osSkyos](platform#osSkyos)
 [osSolaris:](#osSolaris)
* [TSystemOS.osSolaris](platform#osSolaris)
 [osStandalone:](#osStandalone)
* [TSystemOS.osStandalone](platform#osStandalone)
 [osVxWorks:](#osVxWorks)
* [TSystemOS.osVxWorks](platform#osVxWorks)
 [osWindows:](#osWindows)
* [TSystemOS.osWindows](platform#osWindows)
 [overlap:](#overlap)
* [nimsets: overlap(a, b: PNode): bool](nimsets#overlap%2CPNode%2CPNode)
 [OverloadableSyms:](#OverloadableSyms)
* [ast: OverloadableSyms](ast#OverloadableSyms)
 [pairs:](#pairs)
* [ast: pairs(n: PNode): tuple[i: int, n: PNode]](ast#pairs.i%2CPNode)
* [astalgo: pairs(t: TIdNodeTable): tuple[key: PIdObj, val: PNode]](astalgo#pairs.i%2CTIdNodeTable)
* [astalgo: pairs(t: TIdTable): tuple[key: int, value: RootRef]](astalgo#pairs.i%2CTIdTable)
* [btrees: pairs[Key, Val](b: BTree[Key, Val]): (Key, Val)](btrees#pairs.i%2CBTree%5BKey%2CVal%5D)
 [parallel:](#parallel)
* [Feature.parallel](options#parallel)
 [paramName:](#paramName)
* [lambdalifting: paramName](lambdalifting#paramName)
 [paramPragmas:](#paramPragmas)
* [pragmas: paramPragmas](pragmas#paramPragmas)
 [paramsEqual:](#paramsEqual)
* [TParamsEquality.paramsEqual](types#paramsEqual)
 [paramsIncompatible:](#paramsIncompatible)
* [TParamsEquality.paramsIncompatible](types#paramsIncompatible)
 [paramsNotEqual:](#paramsNotEqual)
* [TParamsEquality.paramsNotEqual](types#paramsNotEqual)
 [paramsPos:](#paramsPos)
* [ast: paramsPos](ast#paramsPos)
 [paramTypesMatch:](#paramTypesMatch)
* [sigmatch: paramTypesMatch(m: var TCandidate; f, a: PType; arg, argOrig: PNode): PNode](sigmatch#paramTypesMatch%2CTCandidate%2CPType%2CPType%2CPNode%2CPNode)
 [parentModule:](#parentModule)
* [modulegraphs: parentModule(g: ModuleGraph; fileIdx: FileIndex): FileIndex](modulegraphs#parentModule%2CModuleGraph%2CFileIndex)
 [parLineInfo:](#parLineInfo)
* [parser: parLineInfo(p: Parser): TLineInfo](parser#parLineInfo%2CParser)
 [parMessage:](#parMessage)
* [parser: parMessage(p: Parser; msg: TMsgKind; arg: string = "")](parser#parMessage%2CParser%2CTMsgKind%2Cstring)
 [parse:](#parse)
* [sourcemap: parse(source: string; path: string): SourceNode](sourcemap#parse%2Cstring%2Cstring)
 [parseAll:](#parseAll)
* [parser: parseAll(p: var Parser): PNode](parser#parseAll%2CParser)
 [parseDecimalInt128:](#parseDecimalInt128)
* [int128: parseDecimalInt128(arg: string; pos: int = 0): Int128](int128#parseDecimalInt128%2Cstring%2Cint)
 [parseFile:](#parseFile)
* [syntaxes: parseFile(fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): PNode](syntaxes#parseFile%2CFileIndex%2CIdentCache%2CConfigRef)
 [parseIdeCmd:](#parseIdeCmd)
* [options: parseIdeCmd(s: string): IdeCmd](options#parseIdeCmd%2Cstring)
 [Parser:](#Parser)
* [parser: Parser](parser#Parser)
 [parseString:](#parseString)
* [parser: parseString(s: string; cache: IdentCache; config: ConfigRef; filename: string = ""; line: int = 0; errorHandler: ErrorHandler = nil): PNode](parser#parseString%2Cstring%2CIdentCache%2CConfigRef%2Cstring%2Cint%2CErrorHandler)
 [parseSymbol:](#parseSymbol)
* [parser: parseSymbol(p: var Parser; mode = smNormal): PNode](parser#parseSymbol%2CParser)
 [parseTableCells:](#parseTableCells)
* [asciitables: parseTableCells(s: string; delim = ' '): Cell](asciitables#parseTableCells.i%2Cstring%2Cchar)
 [parseTopLevelStmt:](#parseTopLevelStmt)
* [parser: parseTopLevelStmt(p: var Parser): PNode](parser#parseTopLevelStmt%2CParser)
 [Partial:](#Partial)
* [InstrTargetKind.Partial](dfa#Partial)
 [partialMatch:](#partialMatch)
* [sigmatch: partialMatch(c: PContext; n, nOrig: PNode; m: var TCandidate)](sigmatch#partialMatch%2CPContext%2CPNode%2CPNode%2CTCandidate)
 [Partitions:](#Partitions)
* [varpartitions: Partitions](varpartitions#Partitions)
 [passCmd1:](#passCmd1)
* [TCmdLinePass.passCmd1](commands#passCmd1)
 [passCmd2:](#passCmd2)
* [TCmdLinePass.passCmd2](commands#passCmd2)
 [passPP:](#passPP)
* [TCmdLinePass.passPP](commands#passPP)
 [pathSubs:](#pathSubs)
* [options: pathSubs(conf: ConfigRef; p, config: string): string](options#pathSubs%2CConfigRef%2Cstring%2Cstring)
 [patternPos:](#patternPos)
* [ast: patternPos](ast#patternPos)
 [PContext:](#PContext)
* [semdata: PContext](semdata#PContext)
 [PCtx:](#PCtx)
* [vmdef: PCtx](vmdef#PCtx)
 [PDoc:](#PDoc)
* [docgen: PDoc](docgen#PDoc)
 [PersistentNodeFlags:](#PersistentNodeFlags)
* [ast: PersistentNodeFlags](ast#PersistentNodeFlags)
 [PEvalContext:](#PEvalContext)
* [vmdef: PEvalContext](vmdef#PEvalContext)
 [pickSym:](#pickSym)
* [lookups: pickSym(c: PContext; n: PNode; kinds: set[TSymKind]; flags: TSymFlags = {}): PSym](lookups#pickSym%2CPContext%2CPNode%2Cset%5BTSymKind%5D%2CTSymFlags)
 [PIdent:](#PIdent)
* [idents: PIdent](idents#PIdent)
 [PIdObj:](#PIdObj)
* [idents: PIdObj](idents#PIdObj)
 [PInstantiation:](#PInstantiation)
* [ast: PInstantiation](ast#PInstantiation)
 [PLib:](#PLib)
* [ast: PLib](ast#PLib)
 [PLLStream:](#PLLStream)
* [llstream: PLLStream](llstream#PLLStream)
 [Plugin:](#Plugin)
* [pluginsupport: Plugin](pluginsupport#Plugin)
 [pluginMatches:](#pluginMatches)
* [pluginsupport: pluginMatches(ic: IdentCache; p: Plugin; s: PSym): bool](pluginsupport#pluginMatches%2CIdentCache%2CPlugin%2CPSym)
 [PNode:](#PNode)
* [ast: PNode](ast#PNode)
 [popCaseContext:](#popCaseContext)
* [semdata: popCaseContext(c: PContext)](semdata#popCaseContext%2CPContext)
 [popInfoContext:](#popInfoContext)
* [msgs: popInfoContext(conf: ConfigRef)](msgs#popInfoContext%2CConfigRef)
 [popOptionEntry:](#popOptionEntry)
* [semdata: popOptionEntry(c: PContext)](semdata#popOptionEntry%2CPContext)
 [popOwner:](#popOwner)
* [semdata: popOwner(c: PContext)](semdata#popOwner%2CPContext)
 [popProcCon:](#popProcCon)
* [semdata: popProcCon(c: PContext)](semdata#popProcCon%2CPContext)
 [POptionEntry:](#POptionEntry)
* [semdata: POptionEntry](semdata#POptionEntry)
 [PPassContext:](#PPassContext)
* [modulegraphs: PPassContext](modulegraphs#PPassContext)
 [PProc:](#PProc)
* [vmdef: PProc](vmdef#PProc)
 [PProcCon:](#PProcCon)
* [semdata: PProcCon](semdata#PProcCon)
 [pragma:](#pragma)
* [pragmas: pragma(c: PContext; sym: PSym; n: PNode; validPragmas: TSpecialWords; isStatement: bool = false)](pragmas#pragma%2CPContext%2CPSym%2CPNode%2CTSpecialWords%2Cbool)
 [pragmaAsm:](#pragmaAsm)
* [pragmas: pragmaAsm(c: PContext; n: PNode): char](pragmas#pragmaAsm%2CPContext%2CPNode)
 [pragmasEffects:](#pragmasEffects)
* [ast: pragmasEffects](ast#pragmasEffects)
 [pragmasPos:](#pragmasPos)
* [ast: pragmasPos](ast#pragmasPos)
 [preferDesc:](#preferDesc)
* [TPreferedDesc.preferDesc](types#preferDesc)
 [preferExported:](#preferExported)
* [TPreferedDesc.preferExported](types#preferExported)
 [preferGenericArg:](#preferGenericArg)
* [TPreferedDesc.preferGenericArg](types#preferGenericArg)
 [preferMixed:](#preferMixed)
* [TPreferedDesc.preferMixed](types#preferMixed)
 [preferModuleInfo:](#preferModuleInfo)
* [TPreferedDesc.preferModuleInfo](types#preferModuleInfo)
 [preferName:](#preferName)
* [TPreferedDesc.preferName](types#preferName)
 [preferResolved:](#preferResolved)
* [TPreferedDesc.preferResolved](types#preferResolved)
 [preferTypeName:](#preferTypeName)
* [TPreferedDesc.preferTypeName](types#preferTypeName)
 [PrefixMatch:](#PrefixMatch)
* [prefixmatches: PrefixMatch](prefixmatches#PrefixMatch)
 [prefixMatch:](#prefixMatch)
* [prefixmatches: prefixMatch(p, s: string): PrefixMatch](prefixmatches#prefixMatch%2Cstring%2Cstring)
 [prepareMetatypeForSigmatch:](#prepareMetatypeForSigmatch)
* [semtypinst: prepareMetatypeForSigmatch(p: PContext; pt: TIdTable; info: TLineInfo; t: PType): PType](semtypinst#prepareMetatypeForSigmatch%2CPContext%2CTIdTable%2CTLineInfo%2CPType)
 [prepareToWriteOutput:](#prepareToWriteOutput)
* [options: prepareToWriteOutput(conf: ConfigRef): AbsoluteFile](options#prepareToWriteOutput%2CConfigRef)
 [prepend:](#prepend)
* [ropes: prepend(a: var Rope; b: Rope)](ropes#prepend%2CRope%2CRope)
* [ropes: prepend(a: var Rope; b: string)](ropes#prepend%2CRope%2Cstring)
 [prependCurDir:](#prependCurDir)
* [cmdlinehelper: prependCurDir(f: AbsoluteFile): AbsoluteFile](cmdlinehelper#prependCurDir%2CAbsoluteFile)
 [presentationPath:](#presentationPath)
* [docgen: presentationPath(conf: ConfigRef; file: AbsoluteFile; isTitle = false): RelativeFile](docgen#presentationPath%2CConfigRef%2CAbsoluteFile)
 [prettyTok:](#prettyTok)
* [lexer: prettyTok(tok: Token): string](lexer#prettyTok%2CToken)
 [preventStackTrace:](#preventStackTrace)
* [CodegenFlag.preventStackTrace](cgendata#preventStackTrace)
 [previouslyInferred:](#previouslyInferred)
* [ast: previouslyInferred(t: PType): PType](ast#previouslyInferred.t%2CPType)
 [printTok:](#printTok)
* [lexer: printTok(conf: ConfigRef; tok: Token)](lexer#printTok%2CConfigRef%2CToken)
 [procDefs:](#procDefs)
* [ast: procDefs](ast#procDefs)
 [processArgument:](#processArgument)
* [commands: processArgument(pass: TCmdLinePass; p: OptParser; argsCount: var int; config: ConfigRef): bool](commands#processArgument%2CTCmdLinePass%2COptParser%2Cint%2CConfigRef)
 [processCmdLineAndProjectPath:](#processCmdLineAndProjectPath)
* [cmdlinehelper: processCmdLineAndProjectPath(self: NimProg; conf: ConfigRef)](cmdlinehelper#processCmdLineAndProjectPath%2CNimProg%2CConfigRef)
 [processCommand:](#processCommand)
* [commands: processCommand(switch: string; pass: TCmdLinePass; config: ConfigRef)](commands#processCommand%2Cstring%2CTCmdLinePass%2CConfigRef)
 [processModule:](#processModule)
* [passes: processModule(graph: ModuleGraph; module: PSym; stream: PLLStream): bool](passes#processModule%2CModuleGraph%2CPSym%2CPLLStream)
 [processSpecificNote:](#processSpecificNote)
* [commands: processSpecificNote(arg: string; state: TSpecialWord; pass: TCmdLinePass; info: TLineInfo; orig: string; conf: ConfigRef)](commands#processSpecificNote%2Cstring%2CTSpecialWord%2CTCmdLinePass%2CTLineInfo%2Cstring%2CConfigRef)
 [processSwitch:](#processSwitch)
* [commands: processSwitch(switch, arg: string; pass: TCmdLinePass; info: TLineInfo; conf: ConfigRef)](commands#processSwitch%2Cstring%2Cstring%2CTCmdLinePass%2CTLineInfo%2CConfigRef)
* [commands: processSwitch(pass: TCmdLinePass; p: OptParser; config: ConfigRef)](commands#processSwitch%2CTCmdLinePass%2COptParser%2CConfigRef)
 [procPragmas:](#procPragmas)
* [pragmas: procPragmas](pragmas#procPragmas)
 [procSec:](#procSec)
* [cgendata: procSec(p: BProc; s: TCProcSection): var Rope](cgendata#procSec%2CBProc%2CTCProcSection)
 [procTypePragmas:](#procTypePragmas)
* [pragmas: procTypePragmas](pragmas#procTypePragmas)
 [produceDestructorForDiscriminator:](#produceDestructorForDiscriminator)
* [liftdestructors: produceDestructorForDiscriminator(g: ModuleGraph; typ: PType; field: PSym; info: TLineInfo): PSym](liftdestructors#produceDestructorForDiscriminator%2CModuleGraph%2CPType%2CPSym%2CTLineInfo)
 [ProfileData:](#ProfileData)
* [options: ProfileData](options#ProfileData)
 [ProfileInfo:](#ProfileInfo)
* [options: ProfileInfo](options#ProfileInfo)
 [Profiler:](#Profiler)
* [vmdef: Profiler](vmdef#Profiler)
 [propagateToOwner:](#propagateToOwner)
* [ast: propagateToOwner(owner, elem: PType; propagateHasAsgn = true)](ast#propagateToOwner%2CPType%2CPType)
 [propSpec:](#propSpec)
* [trees: propSpec(n: PNode; effectType: TSpecialWord): PNode](trees#propSpec%2CPNode%2CTSpecialWord)
 [proveLe:](#proveLe)
* [guards: proveLe(m: TModel; a, b: PNode): TImplication](guards#proveLe%2CTModel%2CPNode%2CPNode)
 [PScope:](#PScope)
* [ast: PScope](ast#PScope)
 [PStackFrame:](#PStackFrame)
* [vmdef: PStackFrame](vmdef#PStackFrame)
 [PSym:](#PSym)
* [ast: PSym](ast#PSym)
 [PtrLikeKinds:](#PtrLikeKinds)
* [ast: PtrLikeKinds](ast#PtrLikeKinds)
 [PType:](#PType)
* [ast: PType](ast#PType)
 [pushCaseContext:](#pushCaseContext)
* [semdata: pushCaseContext(c: PContext; caseNode: PNode)](semdata#pushCaseContext%2CPContext%2CPNode)
 [pushInfoContext:](#pushInfoContext)
* [msgs: pushInfoContext(conf: ConfigRef; info: TLineInfo; detail: string = "")](msgs#pushInfoContext%2CConfigRef%2CTLineInfo%2Cstring)
 [pushOptionEntry:](#pushOptionEntry)
* [semdata: pushOptionEntry(c: PContext): POptionEntry](semdata#pushOptionEntry%2CPContext)
 [pushOwner:](#pushOwner)
* [semdata: pushOwner(c: PContext; owner: PSym)](semdata#pushOwner%2CPContext%2CPSym)
 [pushProcCon:](#pushProcCon)
* [sem: pushProcCon(c: PContext; owner: PSym)](sem#pushProcCon%2CPContext%2CPSym)
 [put:](#put)
* [semdata: put(p: PProcCon; key, val: PSym)](semdata#put%2CPProcCon%2CPSym%2CPSym)
 [qualifiedLookUp:](#qualifiedLookUp)
* [lookups: qualifiedLookUp(c: PContext; n: PNode; flags: set[TLookupFlag]): PSym](lookups#qualifiedLookUp%2CPContext%2CPNode%2Cset%5BTLookupFlag%5D)
 [quotedFilename:](#quotedFilename)
* [msgs: quotedFilename(conf: ConfigRef; i: TLineInfo): Rope](msgs#quotedFilename%2CConfigRef%2CTLineInfo)
 [quoteExpr:](#quoteExpr)
* [renderer: quoteExpr(a: string): string](renderer#quoteExpr%2Cstring)
 [quoteShell:](#quoteShell)
* [pathutils: quoteShell(x: AbsoluteDir): string](pathutils#quoteShell%2CAbsoluteDir)
* [pathutils: quoteShell(x: AbsoluteFile): string](pathutils#quoteShell%2CAbsoluteFile)
 [raiseRecoverableError:](#raiseRecoverableError)
* [lineinfos: raiseRecoverableError(msg: string)](lineinfos#raiseRecoverableError%2Cstring)
 [rangeHasUnresolvedStatic:](#rangeHasUnresolvedStatic)
* [semdata: rangeHasUnresolvedStatic(t: PType): bool](semdata#rangeHasUnresolvedStatic.t%2CPType)
 [rawAddField:](#rawAddField)
* [lowerings: rawAddField(obj: PType; field: PSym)](lowerings#rawAddField%2CPType%2CPSym)
 [rawAddSon:](#rawAddSon)
* [ast: rawAddSon(father, son: PType; propagateHasAsgn = true)](ast#rawAddSon%2CPType%2CPType)
 [rawAddSonNoPropagationOfTypeFlags:](#rawAddSonNoPropagationOfTypeFlags)
* [ast: rawAddSonNoPropagationOfTypeFlags(father, son: PType)](ast#rawAddSonNoPropagationOfTypeFlags%2CPType%2CPType)
 [rawCloseScope:](#rawCloseScope)
* [lookups: rawCloseScope(c: PContext)](lookups#rawCloseScope%2CPContext)
 [rawDirectAccess:](#rawDirectAccess)
* [lowerings: rawDirectAccess(obj, field: PSym): PNode](lowerings#rawDirectAccess%2CPSym%2CPSym)
 [rawGetTok:](#rawGetTok)
* [lexer: rawGetTok(L: var Lexer; tok: var Token)](lexer#rawGetTok%2CLexer%2CToken)
 [rawIndirectAccess:](#rawIndirectAccess)
* [lowerings: rawIndirectAccess(a: PNode; field: PSym; info: TLineInfo): PNode](lowerings#rawIndirectAccess%2CPNode%2CPSym%2CTLineInfo)
 [rawMessage:](#rawMessage)
* [msgs: rawMessage(conf: ConfigRef; msg: TMsgKind; args: openArray[string])](msgs#rawMessage.t%2CConfigRef%2CTMsgKind%2CopenArray%5Bstring%5D)
* [msgs: rawMessage(conf: ConfigRef; msg: TMsgKind; arg: string)](msgs#rawMessage.t%2CConfigRef%2CTMsgKind%2Cstring)
 [readConfigFile:](#readConfigFile)
* [nimconf: readConfigFile(filename: AbsoluteFile; cache: IdentCache; config: ConfigRef): bool](nimconf#readConfigFile%2CAbsoluteFile%2CIdentCache%2CConfigRef)
 [readExceptSet:](#readExceptSet)
* [importer: readExceptSet(c: PContext; n: PNode): IntSet](importer#readExceptSet%2CPContext%2CPNode)
 [readMergeInfo:](#readMergeInfo)
* [ccgmerge: readMergeInfo(cfilename: AbsoluteFile; m: BModule)](ccgmerge#readMergeInfo%2CAbsoluteFile%2CBModule)
 [readOnlySf:](#readOnlySf)
* [SymbolFilesOption.readOnlySf](options#readOnlySf)
 [recomputeFieldPositions:](#recomputeFieldPositions)
* [semtypinst: recomputeFieldPositions(t: PType; obj: PNode; currPosition: var int)](semtypinst#recomputeFieldPositions%2CPType%2CPNode%2Cint)
 [recordAdd:](#recordAdd)
* [macrocacheimpl: recordAdd(c: PCtx; info: TLineInfo; key: string; val: PNode)](macrocacheimpl#recordAdd%2CPCtx%2CTLineInfo%2Cstring%2CPNode)
 [recordInc:](#recordInc)
* [macrocacheimpl: recordInc(c: PCtx; info: TLineInfo; key: string; by: BiggestInt)](macrocacheimpl#recordInc%2CPCtx%2CTLineInfo%2Cstring%2CBiggestInt)
 [recordIncl:](#recordIncl)
* [macrocacheimpl: recordIncl(c: PCtx; info: TLineInfo; key: string; val: PNode)](macrocacheimpl#recordIncl%2CPCtx%2CTLineInfo%2Cstring%2CPNode)
 [recordPut:](#recordPut)
* [macrocacheimpl: recordPut(c: PCtx; info: TLineInfo; key: string; k: string; val: PNode)](macrocacheimpl#recordPut%2CPCtx%2CTLineInfo%2Cstring%2Cstring%2CPNode)
 [refresh:](#refresh)
* [vmdef: refresh(c: PCtx; module: PSym)](vmdef#refresh%2CPCtx%2CPSym)
 [regA:](#regA)
* [vmdef: regA(x: TInstr): TRegister](vmdef#regA.t%2CTInstr)
 [regAMask:](#regAMask)
* [vmdef: regAMask](vmdef#regAMask)
 [regAShift:](#regAShift)
* [vmdef: regAShift](vmdef#regAShift)
 [regB:](#regB)
* [vmdef: regB(x: TInstr): TRegister](vmdef#regB.t%2CTInstr)
 [regBMask:](#regBMask)
* [vmdef: regBMask](vmdef#regBMask)
 [regBShift:](#regBShift)
* [vmdef: regBShift](vmdef#regBShift)
 [regBx:](#regBx)
* [vmdef: regBx(x: TInstr): int](vmdef#regBx.t%2CTInstr)
 [regBxMask:](#regBxMask)
* [vmdef: regBxMask](vmdef#regBxMask)
 [regBxMax:](#regBxMax)
* [vmdef: regBxMax](vmdef#regBxMax)
 [regBxMin:](#regBxMin)
* [vmdef: regBxMin](vmdef#regBxMin)
 [regBxShift:](#regBxShift)
* [vmdef: regBxShift](vmdef#regBxShift)
 [regC:](#regC)
* [vmdef: regC(x: TInstr): TRegister](vmdef#regC.t%2CTInstr)
 [regCMask:](#regCMask)
* [vmdef: regCMask](vmdef#regCMask)
 [regCShift:](#regCShift)
* [vmdef: regCShift](vmdef#regCShift)
 [registerAdditionalOps:](#registerAdditionalOps)
* [vm: registerAdditionalOps(c: PCtx)](vm#registerAdditionalOps%2CPCtx)
 [registerCallback:](#registerCallback)
* [vmdef: registerCallback(c: PCtx; name: string; callback: VmCallback): int](vmdef#registerCallback%2CPCtx%2Cstring%2CVmCallback)
 [registerCompilerProc:](#registerCompilerProc)
* [magicsys: registerCompilerProc(g: ModuleGraph; s: PSym)](magicsys#registerCompilerProc%2CModuleGraph%2CPSym)
 [registerID:](#registerID)
* [idgen: registerID(id: PIdObj)](idgen#registerID%2CPIdObj)
 [registerModule:](#registerModule)
* [rod: registerModule(g: ModuleGraph; module: PSym)](rod#registerModule.t%2CModuleGraph%2CPSym)
 [registerNimScriptSymbol:](#registerNimScriptSymbol)
* [magicsys: registerNimScriptSymbol(g: ModuleGraph; s: PSym)](magicsys#registerNimScriptSymbol%2CModuleGraph%2CPSym)
 [registerPass:](#registerPass)
* [passes: registerPass(g: ModuleGraph; p: TPass)](passes#registerPass%2CModuleGraph%2CTPass)
 [registerSysType:](#registerSysType)
* [magicsys: registerSysType(g: ModuleGraph; t: PType)](magicsys#registerSysType%2CModuleGraph%2CPType)
 [regOMask:](#regOMask)
* [vmdef: regOMask](vmdef#regOMask)
 [regOShift:](#regOShift)
* [vmdef: regOShift](vmdef#regOShift)
 [RelativeDir:](#RelativeDir)
* [pathutils: RelativeDir](pathutils#RelativeDir)
 [RelativeFile:](#RelativeFile)
* [pathutils: RelativeFile](pathutils#RelativeFile)
 [relativeJumps:](#relativeJumps)
* [vmdef: relativeJumps](vmdef#relativeJumps)
 [relativeTo:](#relativeTo)
* [pathutils: relativeTo(fullPath: AbsoluteFile; baseFilename: AbsoluteDir; sep = DirSep): RelativeFile](pathutils#relativeTo%2CAbsoluteFile%2CAbsoluteDir)
 [removeFile:](#removeFile)
* [pathutils: removeFile(x: AbsoluteFile)](pathutils#removeFile%2CAbsoluteFile)
 [removeTrailingDirSep:](#removeTrailingDirSep)
* [options: removeTrailingDirSep(path: string): string](options#removeTrailingDirSep%2Cstring)
 [renderDefinitionName:](#renderDefinitionName)
* [renderer: renderDefinitionName(s: PSym; noQuotes = false): string](renderer#renderDefinitionName%2CPSym)
 [renderDocComments:](#renderDocComments)
* [TRenderFlag.renderDocComments](renderer#renderDocComments)
 [renderIds:](#renderIds)
* [TRenderFlag.renderIds](renderer#renderIds)
 [renderIr:](#renderIr)
* [TRenderFlag.renderIr](renderer#renderIr)
 [renderModule:](#renderModule)
* [renderer: renderModule(n: PNode; infile, outfile: string; renderFlags: TRenderFlags = {}; fid = FileIndex(-1); conf: ConfigRef = nil)](renderer#renderModule%2CPNode%2Cstring%2Cstring%2CTRenderFlags%2CConfigRef)
 [renderNimCode:](#renderNimCode)
* [renderverbatim: renderNimCode(result: var string; code: string; isLatex = false)](renderverbatim#renderNimCode%2Cstring%2Cstring)
 [renderNoBody:](#renderNoBody)
* [TRenderFlag.renderNoBody](renderer#renderNoBody)
 [renderNoComments:](#renderNoComments)
* [TRenderFlag.renderNoComments](renderer#renderNoComments)
 [renderNone:](#renderNone)
* [TRenderFlag.renderNone](renderer#renderNone)
 [renderNoPragmas:](#renderNoPragmas)
* [TRenderFlag.renderNoPragmas](renderer#renderNoPragmas)
 [renderNoProcDefs:](#renderNoProcDefs)
* [TRenderFlag.renderNoProcDefs](renderer#renderNoProcDefs)
 [renderParamTypes:](#renderParamTypes)
* [typesrenderer: renderParamTypes(n: PNode; sep = defaultParamSeparator): string](typesrenderer#renderParamTypes%2CPNode)
 [renderPlainSymbolName:](#renderPlainSymbolName)
* [typesrenderer: renderPlainSymbolName(n: PNode): string](typesrenderer#renderPlainSymbolName%2CPNode)
 [renderRunnableExamples:](#renderRunnableExamples)
* [TRenderFlag.renderRunnableExamples](renderer#renderRunnableExamples)
 [renderSyms:](#renderSyms)
* [TRenderFlag.renderSyms](renderer#renderSyms)
 [renderTree:](#renderTree)
* [renderer: renderTree(n: PNode; renderFlags: TRenderFlags = {}): string](renderer#renderTree%2CPNode%2CTRenderFlags)
 [reorder:](#reorder)
* [reorder: reorder(graph: ModuleGraph; n: PNode; module: PSym): PNode](reorder#reorder%2CModuleGraph%2CPNode%2CPSym)
 [replaceComment:](#replaceComment)
* [prettybase: replaceComment(conf: ConfigRef; info: TLineInfo)](nimfix/prettybase#replaceComment%2CConfigRef%2CTLineInfo)
 [replaceDeprecated:](#replaceDeprecated)
* [prettybase: replaceDeprecated(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PIdent)](nimfix/prettybase#replaceDeprecated%2CConfigRef%2CTLineInfo%2CPIdent%2CPIdent)
* [prettybase: replaceDeprecated(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PSym)](nimfix/prettybase#replaceDeprecated%2CConfigRef%2CTLineInfo%2CPSym%2CPSym)
 [replaceTypesInBody:](#replaceTypesInBody)
* [semtypinst: replaceTypesInBody(p: PContext; pt: TIdTable; n: PNode; owner: PSym; allowMetaTypes = false): PNode](semtypinst#replaceTypesInBody%2CPContext%2CTIdTable%2CPNode%2CPSym)
 [replaceTypeVarsN:](#replaceTypeVarsN)
* [semtypinst: replaceTypeVarsN(cl: var TReplTypeVars; n: PNode; start = 0): PNode](semtypinst#replaceTypeVarsN%2CTReplTypeVars%2CPNode%2Cint)
 [replaceTypeVarsT:](#replaceTypeVarsT)
* [semtypinst: replaceTypeVarsT(cl: var TReplTypeVars; t: PType): PType](semtypinst#replaceTypeVarsT%2CTReplTypeVars%2CPType)
 [requiredParams:](#requiredParams)
* [ast: requiredParams(s: PSym): int](ast#requiredParams%2CPSym)
 [requiresEffects:](#requiresEffects)
* [ast: requiresEffects](ast#requiresEffects)
 [requiresInit:](#requiresInit)
* [typeallowed: requiresInit(t: PType): bool](typeallowed#requiresInit%2CPType)
 [resetAllModules:](#resetAllModules)
* [modulegraphs: resetAllModules(g: ModuleGraph)](modulegraphs#resetAllModules%2CModuleGraph)
 [resetCompilationLists:](#resetCompilationLists)
* [extccomp: resetCompilationLists(conf: ConfigRef)](extccomp#resetCompilationLists%2CConfigRef)
 [resetIdentCache:](#resetIdentCache)
* [idents: resetIdentCache()](idents#resetIdentCache)
 [resetIdTable:](#resetIdTable)
* [ast: resetIdTable(x: var TIdTable)](ast#resetIdTable%2CTIdTable)
 [resetNimScriptSymbols:](#resetNimScriptSymbols)
* [magicsys: resetNimScriptSymbols(g: ModuleGraph)](magicsys#resetNimScriptSymbols%2CModuleGraph)
 [resetRopeCache:](#resetRopeCache)
* [ropes: resetRopeCache()](ropes#resetRopeCache)
 [resetSystemArtifacts:](#resetSystemArtifacts)
* [modules: resetSystemArtifacts(g: ModuleGraph)](modules#resetSystemArtifacts%2CModuleGraph)
 [resetSysTypes:](#resetSysTypes)
* [magicsys: resetSysTypes(g: ModuleGraph)](magicsys#resetSysTypes%2CModuleGraph)
 [resultPos:](#resultPos)
* [ast: resultPos](ast#resultPos)
 [rkFloat:](#rkFloat)
* [TRegisterKind.rkFloat](vmdef#rkFloat)
 [rkInt:](#rkInt)
* [TRegisterKind.rkInt](vmdef#rkInt)
 [rkNode:](#rkNode)
* [TRegisterKind.rkNode](vmdef#rkNode)
 [rkNodeAddr:](#rkNodeAddr)
* [TRegisterKind.rkNodeAddr](vmdef#rkNodeAddr)
 [rkNone:](#rkNone)
* [TRegisterKind.rkNone](vmdef#rkNone)
 [rkRegisterAddr:](#rkRegisterAddr)
* [TRegisterKind.rkRegisterAddr](vmdef#rkRegisterAddr)
 [RodExt:](#RodExt)
* [options: RodExt](options#RodExt)
 [RodFileVersion:](#RodFileVersion)
* [nversion: RodFileVersion](nversion#RodFileVersion)
 [Rope:](#Rope)
* [ropes: Rope](ropes#Rope)
 [rope:](#rope)
* [ropes: rope(f: BiggestFloat): Rope](ropes#rope%2CBiggestFloat)
* [ropes: rope(i: BiggestInt): Rope](ropes#rope%2CBiggestInt)
* [ropes: rope(s: string): Rope](ropes#rope%2Cstring)
 [ropeConcat:](#ropeConcat)
* [ropes: ropeConcat(a: varargs[Rope]): Rope](ropes#ropeConcat%2Cvarargs%5BRope%5D)
 [RopeObj:](#RopeObj)
* [ropes: RopeObj](ropes#RopeObj)
 [routineDefs:](#routineDefs)
* [ast: routineDefs](ast#routineDefs)
 [routineKinds:](#routineKinds)
* [ast: routineKinds](ast#routineKinds)
 [runJsonBuildInstructions:](#runJsonBuildInstructions)
* [extccomp: runJsonBuildInstructions(conf: ConfigRef; projectfile: AbsoluteFile)](extccomp#runJsonBuildInstructions%2CConfigRef%2CAbsoluteFile)
 [runNimScript:](#runNimScript)
* [scriptconfig: runNimScript(cache: IdentCache; scriptName: AbsoluteFile; freshDefines = true; conf: ConfigRef)](scriptconfig#runNimScript%2CIdentCache%2CAbsoluteFile%2CConfigRef)
 [runtimeFormat:](#runtimeFormat)
* [ropes: runtimeFormat(frmt: FormatStr; args: openArray[Rope]): Rope](ropes#runtimeFormat%2CFormatStr%2CopenArray%5BRope%5D)
 [s:](#s)
* [cgendata: s(p: BProc; s: TCProcSection): var Rope](cgendata#s%2CBProc%2CTCProcSection)
 [safeArrLen:](#safeArrLen)
* [ast: safeArrLen(n: PNode): int](ast#safeArrLen%2CPNode)
 [safeInheritanceDiff:](#safeInheritanceDiff)
* [types: safeInheritanceDiff(a, b: PType): int](types#safeInheritanceDiff%2CPType%2CPType)
 [safeLen:](#safeLen)
* [ast: safeLen(n: PNode): int](ast#safeLen%2CPNode)
 [safeSemExpr:](#safeSemExpr)
* [sigmatch: safeSemExpr(c: PContext; n: PNode): PNode](sigmatch#safeSemExpr%2CPContext%2CPNode)
 [safeSkipTypes:](#safeSkipTypes)
* [types: safeSkipTypes(t: PType; kinds: TTypeKinds): PType](types#safeSkipTypes%2CPType%2CTTypeKinds)
 [sameBackendType:](#sameBackendType)
* [types: sameBackendType(x, y: PType): bool](types#sameBackendType%2CPType%2CPType)
 [sameConstant:](#sameConstant)
* [vmgen: sameConstant(a, b: PNode): bool](vmgen#sameConstant%2CPNode%2CPNode)
 [sameDistinctTypes:](#sameDistinctTypes)
* [types: sameDistinctTypes(a, b: PType): bool](types#sameDistinctTypes%2CPType%2CPType)
 [sameEnumTypes:](#sameEnumTypes)
* [types: sameEnumTypes(a, b: PType): bool](types#sameEnumTypes%2CPType%2CPType)
 [sameFlags:](#sameFlags)
* [types: sameFlags(a, b: PType): bool](types#sameFlags%2CPType%2CPType)
 [sameObjectTypes:](#sameObjectTypes)
* [types: sameObjectTypes(a, b: PType): bool](types#sameObjectTypes%2CPType%2CPType)
 [sameSubexprs:](#sameSubexprs)
* [guards: sameSubexprs(m: TModel; a, b: PNode): bool](guards#sameSubexprs%2CTModel%2CPNode%2CPNode)
 [sameTree:](#sameTree)
* [guards: sameTree(a, b: PNode): bool](guards#sameTree%2CPNode%2CPNode)
* [trees: sameTree(a, b: PNode): bool](trees#sameTree%2CPNode%2CPNode)
 [sameTrees:](#sameTrees)
* [patterns: sameTrees(a, b: PNode): bool](patterns#sameTrees%2CPNode%2CPNode)
 [sameType:](#sameType)
* [types: sameType(a, b: PType; flags: TTypeCmpFlags = {}): bool](types#sameType%2CPType%2CPType%2CTTypeCmpFlags)
 [sameTypeOrNil:](#sameTypeOrNil)
* [types: sameTypeOrNil(a, b: PType; flags: TTypeCmpFlags = {}): bool](types#sameTypeOrNil%2CPType%2CPType%2CTTypeCmpFlags)
 [sameValue:](#sameValue)
* [astalgo: sameValue(a, b: PNode): bool](astalgo#sameValue%2CPNode%2CPNode)
 [saveMaxIds:](#saveMaxIds)
* [idgen: saveMaxIds(conf: ConfigRef; project: AbsoluteFile)](idgen#saveMaxIds%2CConfigRef%2CAbsoluteFile)
 [scopeDepth:](#scopeDepth)
* [semdata: scopeDepth(c: PContext): int](semdata#scopeDepth%2CPContext)
 [searchForProc:](#searchForProc)
* [procfind: searchForProc(c: PContext; scope: PScope; fn: PSym): tuple[proto: PSym, comesFromShadowScope: bool]](procfind#searchForProc%2CPContext%2CPScope%2CPSym)
 [searchInScopes:](#searchInScopes)
* [lookups: searchInScopes(c: PContext; s: PIdent): PSym](lookups#searchInScopes%2CPContext%2CPIdent)
* [lookups: searchInScopes(c: PContext; s: PIdent; filter: TSymKinds): PSym](lookups#searchInScopes%2CPContext%2CPIdent%2CTSymKinds)
 [searchInstTypes:](#searchInstTypes)
* [semtypinst: searchInstTypes(key: PType): PType](semtypinst#searchInstTypes%2CPType)
 [searchTypeFor:](#searchTypeFor)
* [types: searchTypeFor(t: PType; predicate: TTypePredicate): bool](types#searchTypeFor%2CPType%2CTTypePredicate)
 [semAsmOrEmit:](#semAsmOrEmit)
* [pragmas: semAsmOrEmit(con: PContext; n: PNode; marker: char): PNode](pragmas#semAsmOrEmit%2CPContext%2CPNode%2Cchar)
 [semCaptureSym:](#semCaptureSym)
* [lambdalifting: semCaptureSym(s, owner: PSym)](lambdalifting#semCaptureSym%2CPSym%2CPSym)
 [semFinishOperands:](#semFinishOperands)
* [sigmatch: semFinishOperands(c: PContext; n: PNode)](sigmatch#semFinishOperands%2CPContext%2CPNode)
 [semLocals:](#semLocals)
* [locals: semLocals(c: PContext; n: PNode): PNode](plugins/locals#semLocals%2CPContext%2CPNode)
 [semNodeKindConstraints:](#semNodeKindConstraints)
* [parampatterns: semNodeKindConstraints(n: PNode; conf: ConfigRef; start: Natural): PNode](parampatterns#semNodeKindConstraints%2CPNode%2CConfigRef%2CNatural)
 [semPass:](#semPass)
* [sem: semPass](sem#semPass)
 [seNoSideEffect:](#seNoSideEffect)
* [TSideEffectAnalysis.seNoSideEffect](parampatterns#seNoSideEffect)
 [seSideEffect:](#seSideEffect)
* [TSideEffectAnalysis.seSideEffect](parampatterns#seSideEffect)
 [setBaseFlags:](#setBaseFlags)
* [parser: setBaseFlags(n: PNode; base: NumericalBase)](parser#setBaseFlags%2CPNode%2CNumericalBase)
 [setCaseContextIdx:](#setCaseContextIdx)
* [semdata: setCaseContextIdx(c: PContext; idx: int)](semdata#setCaseContextIdx%2CPContext%2Cint)
 [setCC:](#setCC)
* [extccomp: setCC(conf: ConfigRef; ccname: string; info: TLineInfo)](extccomp#setCC%2CConfigRef%2Cstring%2CTLineInfo)
 [setConfigVar:](#setConfigVar)
* [options: setConfigVar(conf: ConfigRef; key, val: string)](options#setConfigVar%2CConfigRef%2Cstring%2Cstring)
 [setDefaultLibpath:](#setDefaultLibpath)
* [options: setDefaultLibpath(conf: ConfigRef)](options#setDefaultLibpath%2CConfigRef)
 [setDirtyFile:](#setDirtyFile)
* [msgs: setDirtyFile(conf: ConfigRef; fileIdx: FileIndex; filename: AbsoluteFile)](msgs#setDirtyFile%2CConfigRef%2CFileIndex%2CAbsoluteFile)
 [setEffectsForProcType:](#setEffectsForProcType)
* [sempass2: setEffectsForProcType(g: ModuleGraph; t: PType; n: PNode)](sempass2#setEffectsForProcType%2CModuleGraph%2CPType%2CPNode)
 [setErrorMaxHighMaybe:](#setErrorMaxHighMaybe)
* [options: setErrorMaxHighMaybe(conf: ConfigRef)](options#setErrorMaxHighMaybe.t%2CConfigRef)
 [setHash:](#setHash)
* [msgs: setHash(conf: ConfigRef; fileIdx: FileIndex; hash: string)](msgs#setHash%2CConfigRef%2CFileIndex%2Cstring)
 [setHasRange:](#setHasRange)
* [nimsets: setHasRange(s: PNode): bool](nimsets#setHasRange%2CPNode)
 [setId:](#setId)
* [idgen: setId(id: int)](idgen#setId%2Cint)
 [setInfoContextLen:](#setInfoContextLen)
* [msgs: setInfoContextLen(conf: ConfigRef; L: int)](msgs#setInfoContextLen%2CConfigRef%2Cint)
 [setIntLitType:](#setIntLitType)
* [magicsys: setIntLitType(g: ModuleGraph; result: PNode)](magicsys#setIntLitType%2CModuleGraph%2CPNode)
 [setLen:](#setLen)
* [strutils2: setLen(result: var string; n: int; isInit: bool)](strutils2#setLen%2Cstring%2Cint%2Cbool)
 [setNote:](#setNote)
* [options: setNote(conf: ConfigRef; note: TNoteKind; enabled = true)](options#setNote%2CConfigRef%2CTNoteKind)
 [setNoteDefaults:](#setNoteDefaults)
* [options: setNoteDefaults(conf: ConfigRef; note: TNoteKind; enabled = true)](options#setNoteDefaults%2CConfigRef%2CTNoteKind)
 [setOutFile:](#setOutFile)
* [options: setOutFile(conf: ConfigRef)](options#setOutFile%2CConfigRef)
 [setResult:](#setResult)
* [vm: setResult(a: VmArgs; v: AbsoluteDir)](vm#setResult%2CVmArgs%2CAbsoluteDir)
* [vm: setResult(a: VmArgs; v: BiggestFloat)](vm#setResult%2CVmArgs%2CBiggestFloat)
* [vm: setResult(a: VmArgs; v: BiggestInt)](vm#setResult%2CVmArgs%2CBiggestInt)
* [vm: setResult(a: VmArgs; v: bool)](vm#setResult%2CVmArgs%2Cbool)
* [vm: setResult(a: VmArgs; n: PNode)](vm#setResult%2CVmArgs%2CPNode)
* [vm: setResult(a: VmArgs; v: seq[string])](vm#setResult%2CVmArgs%2Cseq%5Bstring%5D)
* [vm: setResult(a: VmArgs; v: string)](vm#setResult%2CVmArgs%2Cstring)
 [setTarget:](#setTarget)
* [platform: setTarget(t: var Target; o: TSystemOS; c: TSystemCPU)](platform#setTarget%2CTarget%2CTSystemOS%2CTSystemCPU)
 [setTargetFromSystem:](#setTargetFromSystem)
* [platform: setTargetFromSystem(t: var Target)](platform#setTargetFromSystem%2CTarget)
 [setupCompileTimeVar:](#setupCompileTimeVar)
* [vm: setupCompileTimeVar(module: PSym; g: ModuleGraph; n: PNode)](vm#setupCompileTimeVar%2CPSym%2CModuleGraph%2CPNode)
 [setupGlobalCtx:](#setupGlobalCtx)
* [vm: setupGlobalCtx(module: PSym; graph: ModuleGraph)](vm#setupGlobalCtx%2CPSym%2CModuleGraph)
 [setupModuleCache:](#setupModuleCache)
* [rod: setupModuleCache(g: ModuleGraph)](rod#setupModuleCache.t%2CModuleGraph)
 [setupParser:](#setupParser)
* [syntaxes: setupParser(p: var Parser; fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): bool](syntaxes#setupParser%2CParser%2CFileIndex%2CIdentCache%2CConfigRef)
 [setupVM:](#setupVM)
* [scriptconfig: setupVM(module: PSym; cache: IdentCache; scriptName: string; graph: ModuleGraph): PEvalContext](scriptconfig#setupVM%2CPSym%2CIdentCache%2Cstring%2CModuleGraph)
 [seUnknown:](#seUnknown)
* [TSideEffectAnalysis.seUnknown](parampatterns#seUnknown)
 [Severity:](#Severity)
* [lineinfos: Severity](lineinfos#Severity)
 [sfAddrTaken:](#sfAddrTaken)
* [TSymFlag.sfAddrTaken](ast#sfAddrTaken)
 [sfAllUntyped:](#sfAllUntyped)
* [ast: sfAllUntyped](ast#sfAllUntyped)
 [sfAnon:](#sfAnon)
* [ast: sfAnon](ast#sfAnon)
 [sfBase:](#sfBase)
* [ast: sfBase](ast#sfBase)
 [sfBorrow:](#sfBorrow)
* [TSymFlag.sfBorrow](ast#sfBorrow)
 [sfCallsite:](#sfCallsite)
* [TSymFlag.sfCallsite](ast#sfCallsite)
 [sfCompilerProc:](#sfCompilerProc)
* [TSymFlag.sfCompilerProc](ast#sfCompilerProc)
 [sfCompileTime:](#sfCompileTime)
* [TSymFlag.sfCompileTime](ast#sfCompileTime)
 [sfCompileToCpp:](#sfCompileToCpp)
* [ast: sfCompileToCpp](ast#sfCompileToCpp)
 [sfCompileToObjc:](#sfCompileToObjc)
* [ast: sfCompileToObjc](ast#sfCompileToObjc)
 [sfConstructor:](#sfConstructor)
* [TSymFlag.sfConstructor](ast#sfConstructor)
 [sfCursor:](#sfCursor)
* [TSymFlag.sfCursor](ast#sfCursor)
 [sfCustomPragma:](#sfCustomPragma)
* [ast: sfCustomPragma](ast#sfCustomPragma)
 [sfDeprecated:](#sfDeprecated)
* [TSymFlag.sfDeprecated](ast#sfDeprecated)
 [sfDirty:](#sfDirty)
* [ast: sfDirty](ast#sfDirty)
 [sfDiscardable:](#sfDiscardable)
* [TSymFlag.sfDiscardable](ast#sfDiscardable)
 [sfDiscriminant:](#sfDiscriminant)
* [TSymFlag.sfDiscriminant](ast#sfDiscriminant)
 [sfDispatcher:](#sfDispatcher)
* [TSymFlag.sfDispatcher](ast#sfDispatcher)
 [sfError:](#sfError)
* [TSymFlag.sfError](ast#sfError)
 [sfEscapes:](#sfEscapes)
* [ast: sfEscapes](ast#sfEscapes)
 [sfExperimental:](#sfExperimental)
* [ast: sfExperimental](ast#sfExperimental)
 [sfExplain:](#sfExplain)
* [TSymFlag.sfExplain](ast#sfExplain)
 [sfExportc:](#sfExportc)
* [TSymFlag.sfExportc](ast#sfExportc)
 [sfExported:](#sfExported)
* [TSymFlag.sfExported](ast#sfExported)
 [sfForward:](#sfForward)
* [TSymFlag.sfForward](ast#sfForward)
 [sfFromGeneric:](#sfFromGeneric)
* [TSymFlag.sfFromGeneric](ast#sfFromGeneric)
 [sfGeneratedOp:](#sfGeneratedOp)
* [TSymFlag.sfGeneratedOp](ast#sfGeneratedOp)
 [sfGenSym:](#sfGenSym)
* [TSymFlag.sfGenSym](ast#sfGenSym)
 [sfGlobal:](#sfGlobal)
* [TSymFlag.sfGlobal](ast#sfGlobal)
 [sfGoto:](#sfGoto)
* [ast: sfGoto](ast#sfGoto)
 [sfImportc:](#sfImportc)
* [TSymFlag.sfImportc](ast#sfImportc)
 [sfInfixCall:](#sfInfixCall)
* [TSymFlag.sfInfixCall](ast#sfInfixCall)
 [sfInjectDestructors:](#sfInjectDestructors)
* [TSymFlag.sfInjectDestructors](ast#sfInjectDestructors)
 [sfIsSelf:](#sfIsSelf)
* [ast: sfIsSelf](ast#sfIsSelf)
 [sfMainModule:](#sfMainModule)
* [TSymFlag.sfMainModule](ast#sfMainModule)
 [sfMangleCpp:](#sfMangleCpp)
* [TSymFlag.sfMangleCpp](ast#sfMangleCpp)
 [sfNamedParamCall:](#sfNamedParamCall)
* [TSymFlag.sfNamedParamCall](ast#sfNamedParamCall)
 [sfNeverRaises:](#sfNeverRaises)
* [TSymFlag.sfNeverRaises](ast#sfNeverRaises)
 [sfNoalias:](#sfNoalias)
* [TSymFlag.sfNoalias](ast#sfNoalias)
 [sfNoForward:](#sfNoForward)
* [ast: sfNoForward](ast#sfNoForward)
 [sfNoInit:](#sfNoInit)
* [ast: sfNoInit](ast#sfNoInit)
 [sfNonReloadable:](#sfNonReloadable)
* [TSymFlag.sfNonReloadable](ast#sfNonReloadable)
 [sfNoReturn:](#sfNoReturn)
* [TSymFlag.sfNoReturn](ast#sfNoReturn)
 [sfNoSideEffect:](#sfNoSideEffect)
* [TSymFlag.sfNoSideEffect](ast#sfNoSideEffect)
 [sfOverriden:](#sfOverriden)
* [TSymFlag.sfOverriden](ast#sfOverriden)
 [sfProcvar:](#sfProcvar)
* [TSymFlag.sfProcvar](ast#sfProcvar)
 [sfPure:](#sfPure)
* [TSymFlag.sfPure](ast#sfPure)
 [sfRegister:](#sfRegister)
* [TSymFlag.sfRegister](ast#sfRegister)
 [sfReorder:](#sfReorder)
* [ast: sfReorder](ast#sfReorder)
 [sfRequiresInit:](#sfRequiresInit)
* [TSymFlag.sfRequiresInit](ast#sfRequiresInit)
 [sfShadowed:](#sfShadowed)
* [TSymFlag.sfShadowed](ast#sfShadowed)
 [sfSideEffect:](#sfSideEffect)
* [TSymFlag.sfSideEffect](ast#sfSideEffect)
 [sfSingleUsedTemp:](#sfSingleUsedTemp)
* [TSymFlag.sfSingleUsedTemp](ast#sfSingleUsedTemp)
 [sfSystemModule:](#sfSystemModule)
* [TSymFlag.sfSystemModule](ast#sfSystemModule)
 [sfTemplateParam:](#sfTemplateParam)
* [TSymFlag.sfTemplateParam](ast#sfTemplateParam)
 [sfThread:](#sfThread)
* [TSymFlag.sfThread](ast#sfThread)
 [sfUsed:](#sfUsed)
* [TSymFlag.sfUsed](ast#sfUsed)
 [sfUsedInFinallyOrExcept:](#sfUsedInFinallyOrExcept)
* [TSymFlag.sfUsedInFinallyOrExcept](ast#sfUsedInFinallyOrExcept)
 [sfVolatile:](#sfVolatile)
* [TSymFlag.sfVolatile](ast#sfVolatile)
 [sfWasForwarded:](#sfWasForwarded)
* [TSymFlag.sfWasForwarded](ast#sfWasForwarded)
 [sfWrittenTo:](#sfWrittenTo)
* [ast: sfWrittenTo](ast#sfWrittenTo)
 [shallowCopy:](#shallowCopy)
* [ast: shallowCopy(src: PNode): PNode](ast#shallowCopy%2CPNode)
 [SigHash:](#SigHash)
* [modulegraphs: SigHash](modulegraphs#SigHash)
 [sigHash:](#sigHash)
* [sighashes: sigHash(s: PSym): SigHash](sighashes#sigHash%2CPSym)
 [simpleSlice:](#simpleSlice)
* [guards: simpleSlice(a, b: PNode): BiggestInt](guards#simpleSlice%2CPNode%2CPNode)
 [skAlias:](#skAlias)
* [TSymKind.skAlias](ast#skAlias)
 [skConditional:](#skConditional)
* [TSymKind.skConditional](ast#skConditional)
 [skConst:](#skConst)
* [TSymKind.skConst](ast#skConst)
 [skConverter:](#skConverter)
* [TSymKind.skConverter](ast#skConverter)
 [skDynLib:](#skDynLib)
* [TSymKind.skDynLib](ast#skDynLib)
 [skEnumField:](#skEnumField)
* [TSymKind.skEnumField](ast#skEnumField)
 [skError:](#skError)
* [ast: skError](ast#skError)
 [skField:](#skField)
* [TSymKind.skField](ast#skField)
 [skForVar:](#skForVar)
* [TSymKind.skForVar](ast#skForVar)
 [skFunc:](#skFunc)
* [TSymKind.skFunc](ast#skFunc)
 [skGenericParam:](#skGenericParam)
* [TSymKind.skGenericParam](ast#skGenericParam)
 [skipAddr:](#skipAddr)
* [ast: skipAddr(n: PNode): PNode](ast#skipAddr%2CPNode)
 [skipAlias:](#skipAlias)
* [lookups: skipAlias(s: PSym; n: PNode; conf: ConfigRef): PSym](lookups#skipAlias%2CPSym%2CPNode%2CConfigRef)
 [skipCodegen:](#skipCodegen)
* [passes: skipCodegen(config: ConfigRef; n: PNode): bool](passes#skipCodegen%2CConfigRef%2CPNode)
 [skipColon:](#skipColon)
* [ast: skipColon(n: PNode): PNode](ast#skipColon%2CPNode)
 [skipComment:](#skipComment)
* [parser: skipComment(p: var Parser; node: PNode)](parser#skipComment%2CParser%2CPNode)
 [skipConv:](#skipConv)
* [types: skipConv(n: PNode): PNode](types#skipConv%2CPNode)
 [skipConvCastAndClosure:](#skipConvCastAndClosure)
* [astalgo: skipConvCastAndClosure(n: PNode): PNode](astalgo#skipConvCastAndClosure%2CPNode)
 [skipConvDfa:](#skipConvDfa)
* [dfa: skipConvDfa(n: PNode): PNode](dfa#skipConvDfa%2CPNode)
 [skipConvTakeType:](#skipConvTakeType)
* [types: skipConvTakeType(n: PNode): PNode](types#skipConvTakeType%2CPNode)
 [skipGenericAlias:](#skipGenericAlias)
* [types: skipGenericAlias(t: PType): PType](types#skipGenericAlias%2CPType)
 [skipGenericOwner:](#skipGenericOwner)
* [ast: skipGenericOwner(s: PSym): PSym](ast#skipGenericOwner%2CPSym)
 [skipHidden:](#skipHidden)
* [types: skipHidden(n: PNode): PNode](types#skipHidden%2CPNode)
 [skipHiddenSubConv:](#skipHiddenSubConv)
* [types: skipHiddenSubConv(n: PNode): PNode](types#skipHiddenSubConv%2CPNode)
 [skipInd:](#skipInd)
* [parser: skipInd(p: var Parser)](parser#skipInd%2CParser)
 [skipIntLit:](#skipIntLit)
* [magicsys: skipIntLit(t: PType): PType](magicsys#skipIntLit%2CPType)
 [skipIntLiteralParams:](#skipIntLiteralParams)
* [semtypinst: skipIntLiteralParams(t: PType)](semtypinst#skipIntLiteralParams%2CPType)
 [skipPtrs:](#skipPtrs)
* [types: skipPtrs](types#skipPtrs)
 [skipStmtList:](#skipStmtList)
* [ast: skipStmtList(n: PNode): PNode](ast#skipStmtList%2CPNode)
 [skipTypes:](#skipTypes)
* [ast: skipTypes(t: PType; kinds: TTypeKinds): PType](ast#skipTypes%2CPType%2CTTypeKinds)
* [ast: skipTypes(t: PType; kinds: TTypeKinds; maxIters: int): PType](ast#skipTypes%2CPType%2CTTypeKinds%2Cint)
 [skipTypesOrNil:](#skipTypesOrNil)
* [ast: skipTypesOrNil(t: PType; kinds: TTypeKinds): PType](ast#skipTypesOrNil%2CPType%2CTTypeKinds)
 [skIterator:](#skIterator)
* [TSymKind.skIterator](ast#skIterator)
 [skLabel:](#skLabel)
* [TSymKind.skLabel](ast#skLabel)
 [skLet:](#skLet)
* [TSymKind.skLet](ast#skLet)
 [skLocalVars:](#skLocalVars)
* [ast: skLocalVars](ast#skLocalVars)
 [skMacro:](#skMacro)
* [TSymKind.skMacro](ast#skMacro)
 [skMethod:](#skMethod)
* [TSymKind.skMethod](ast#skMethod)
 [skModule:](#skModule)
* [TSymKind.skModule](ast#skModule)
 [skPackage:](#skPackage)
* [TSymKind.skPackage](ast#skPackage)
 [skParam:](#skParam)
* [TSymKind.skParam](ast#skParam)
 [skProc:](#skProc)
* [TSymKind.skProc](ast#skProc)
 [skProcKinds:](#skProcKinds)
* [ast: skProcKinds](ast#skProcKinds)
 [skResult:](#skResult)
* [TSymKind.skResult](ast#skResult)
 [skStub:](#skStub)
* [TSymKind.skStub](ast#skStub)
 [skTemp:](#skTemp)
* [TSymKind.skTemp](ast#skTemp)
 [skTemplate:](#skTemplate)
* [TSymKind.skTemplate](ast#skTemplate)
 [skType:](#skType)
* [TSymKind.skType](ast#skType)
 [skUnknown:](#skUnknown)
* [TSymKind.skUnknown](ast#skUnknown)
 [skVar:](#skVar)
* [TSymKind.skVar](ast#skVar)
 [slotEmpty:](#slotEmpty)
* [TSlotKind.slotEmpty](vmdef#slotEmpty)
 [slotFixedLet:](#slotFixedLet)
* [TSlotKind.slotFixedLet](vmdef#slotFixedLet)
 [slotFixedVar:](#slotFixedVar)
* [TSlotKind.slotFixedVar](vmdef#slotFixedVar)
 [slotSomeTemp:](#slotSomeTemp)
* [vmdef: slotSomeTemp](vmdef#slotSomeTemp)
 [slotTempComplex:](#slotTempComplex)
* [TSlotKind.slotTempComplex](vmdef#slotTempComplex)
 [slotTempFloat:](#slotTempFloat)
* [TSlotKind.slotTempFloat](vmdef#slotTempFloat)
 [slotTempInt:](#slotTempInt)
* [TSlotKind.slotTempInt](vmdef#slotTempInt)
 [slotTempPerm:](#slotTempPerm)
* [TSlotKind.slotTempPerm](vmdef#slotTempPerm)
 [slotTempStr:](#slotTempStr)
* [TSlotKind.slotTempStr](vmdef#slotTempStr)
 [slotTempUnknown:](#slotTempUnknown)
* [TSlotKind.slotTempUnknown](vmdef#slotTempUnknown)
 [someInSet:](#someInSet)
* [nimsets: someInSet(s: PNode; a, b: PNode): bool](nimsets#someInSet%2CPNode%2CPNode%2CPNode)
 [sourceLine:](#sourceLine)
* [msgs: sourceLine(conf: ConfigRef; i: TLineInfo): string](msgs#sourceLine%2CConfigRef%2CTLineInfo)
 [SourceMap:](#SourceMap)
* [sourcemap: SourceMap](sourcemap#SourceMap)
 [SourceNode:](#SourceNode)
* [sourcemap: SourceNode](sourcemap#SourceNode)
 [spawnResult:](#spawnResult)
* [spawn: spawnResult(t: PType; inParallel: bool): TSpawnResult](spawn#spawnResult%2CPType%2Cbool)
 [splitFile:](#splitFile)
* [pathutils: splitFile(x: AbsoluteFile): tuple[dir: AbsoluteDir, name, ext: string]](pathutils#splitFile%2CAbsoluteFile)
 [srByVar:](#srByVar)
* [TSpawnResult.srByVar](spawn#srByVar)
 [srFlowVar:](#srFlowVar)
* [TSpawnResult.srFlowVar](spawn#srFlowVar)
 [srVoid:](#srVoid)
* [TSpawnResult.srVoid](spawn#srVoid)
 [StartSize:](#StartSize)
* [ast: StartSize](ast#StartSize)
 [stmtPragmas:](#stmtPragmas)
* [pragmas: stmtPragmas](pragmas#stmtPragmas)
 [stmtsContainPragma:](#stmtsContainPragma)
* [ccgutils: stmtsContainPragma(n: PNode; w: TSpecialWord): bool](ccgutils#stmtsContainPragma%2CPNode%2CTSpecialWord)
 [stopCompile:](#stopCompile)
* [modulegraphs: stopCompile(g: ModuleGraph): bool](modulegraphs#stopCompile%2CModuleGraph)
 [storeAny:](#storeAny)
* [vmmarshal: storeAny(s: var string; t: PType; a: PNode; conf: ConfigRef)](vmmarshal#storeAny%2Cstring%2CPType%2CPNode%2CConfigRef)
 [storeNode:](#storeNode)
* [rod: storeNode(g: ModuleGraph; module: PSym; n: PNode)](rod#storeNode.t%2CModuleGraph%2CPSym%2CPNode)
 [storeRemaining:](#storeRemaining)
* [rod: storeRemaining(g: ModuleGraph; module: PSym)](rod#storeRemaining.t%2CModuleGraph%2CPSym)
 [strArg:](#strArg)
* [filters: strArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: string): string](filters#strArg%2CConfigRef%2CPNode%2Cstring%2Cint%2Cstring)
 [strictFuncs:](#strictFuncs)
* [Feature.strictFuncs](options#strictFuncs)
 [strTableAdd:](#strTableAdd)
* [astalgo: strTableAdd(t: var TStrTable; n: PSym)](astalgo#strTableAdd%2CTStrTable%2CPSym)
 [strTableContains:](#strTableContains)
* [astalgo: strTableContains(t: TStrTable; n: PSym): bool](astalgo#strTableContains%2CTStrTable%2CPSym)
 [strTableGet:](#strTableGet)
* [astalgo: strTableGet(t: TStrTable; name: PIdent): PSym](astalgo#strTableGet%2CTStrTable%2CPIdent)
 [strTableIncl:](#strTableIncl)
* [astalgo: strTableIncl(t: var TStrTable; n: PSym; onConflictKeepOld = false): bool](astalgo#strTableIncl%2CTStrTable%2CPSym)
 [strTableInclReportConflict:](#strTableInclReportConflict)
* [astalgo: strTableInclReportConflict(t: var TStrTable; n: PSym; onConflictKeepOld = false): PSym](astalgo#strTableInclReportConflict%2CTStrTable%2CPSym)
 [StructuralEquivTypes:](#StructuralEquivTypes)
* [ast: StructuralEquivTypes](ast#StructuralEquivTypes)
 [stupidStmtListExpr:](#stupidStmtListExpr)
* [trees: stupidStmtListExpr(n: PNode): bool](trees#stupidStmtListExpr%2CPNode)
 [styleCheckDef:](#styleCheckDef)
* [linter: styleCheckDef(conf: ConfigRef; s: PSym)](linter#styleCheckDef.t%2CConfigRef%2CPSym)
* [linter: styleCheckDef(conf: ConfigRef; info: TLineInfo; s: PSym)](linter#styleCheckDef.t%2CConfigRef%2CTLineInfo%2CPSym)
* [linter: styleCheckDef(conf: ConfigRef; info: TLineInfo; s: PSym; k: TSymKind)](linter#styleCheckDef.t%2CConfigRef%2CTLineInfo%2CPSym%2CTSymKind)
 [styleCheckUse:](#styleCheckUse)
* [linter: styleCheckUse(conf: ConfigRef; info: TLineInfo; s: PSym)](linter#styleCheckUse%2CConfigRef%2CTLineInfo%2CPSym)
 [styledMsgWriteln:](#styledMsgWriteln)
* [msgs: styledMsgWriteln(args: varargs[typed])](msgs#styledMsgWriteln.t%2Cvarargs%5Btyped%5D)
 [Suggest:](#Suggest)
* [options: Suggest](options#Suggest)
 [suggestDecl:](#suggestDecl)
* [sigmatch: suggestDecl(c: PContext; n: PNode; s: PSym)](sigmatch#suggestDecl%2CPContext%2CPNode%2CPSym)
 [suggestEnum:](#suggestEnum)
* [sigmatch: suggestEnum(c: PContext; n: PNode; t: PType)](sigmatch#suggestEnum%2CPContext%2CPNode%2CPType)
 [suggestExpr:](#suggestExpr)
* [sigmatch: suggestExpr(c: PContext; n: PNode)](sigmatch#suggestExpr%2CPContext%2CPNode)
 [suggestExprNoCheck:](#suggestExprNoCheck)
* [sigmatch: suggestExprNoCheck(c: PContext; n: PNode)](sigmatch#suggestExprNoCheck%2CPContext%2CPNode)
 [Suggestions:](#Suggestions)
* [options: Suggestions](options#Suggestions)
 [suggestQuit:](#suggestQuit)
* [msgs: suggestQuit()](msgs#suggestQuit)
 [suggestSentinel:](#suggestSentinel)
* [sigmatch: suggestSentinel(c: PContext)](sigmatch#suggestSentinel%2CPContext)
 [suggestStmt:](#suggestStmt)
* [sigmatch: suggestStmt(c: PContext; n: PNode)](sigmatch#suggestStmt%2CPContext%2CPNode)
 [suggestSym:](#suggestSym)
* [sigmatch: suggestSym(conf: ConfigRef; info: TLineInfo; s: PSym; usageSym: var PSym; isDecl = true)](sigmatch#suggestSym%2CConfigRef%2CTLineInfo%2CPSym%2CPSym)
 [suggestWriteln:](#suggestWriteln)
* [msgs: suggestWriteln(conf: ConfigRef; s: string)](msgs#suggestWriteln%2CConfigRef%2Cstring)
 [symBodyDigest:](#symBodyDigest)
* [sighashes: symBodyDigest(graph: ModuleGraph; sym: PSym): SigHash](sighashes#symBodyDigest%2CModuleGraph%2CPSym)
 [SymbolFilesOption:](#SymbolFilesOption)
* [options: SymbolFilesOption](options#SymbolFilesOption)
 [SymChars:](#SymChars)
* [lexer: SymChars](lexer#SymChars)
 [symdiffSets:](#symdiffSets)
* [nimsets: symdiffSets(conf: ConfigRef; a, b: PNode): PNode](nimsets#symdiffSets%2CConfigRef%2CPNode%2CPNode)
 [SymStartChars:](#SymStartChars)
* [lexer: SymStartChars](lexer#SymStartChars)
 [symTabReplace:](#symTabReplace)
* [astalgo: symTabReplace(t: var TStrTable; prevSym: PSym; newSym: PSym)](astalgo#symTabReplace%2CTStrTable%2CPSym%2CPSym)
 [symToYaml:](#symToYaml)
* [astalgo: symToYaml(conf: ConfigRef; n: PSym; indent: int = 0; maxRecDepth: int = -1): Rope](astalgo#symToYaml%2CConfigRef%2CPSym%2Cint%2Cint)
 [sysTypeFromName:](#sysTypeFromName)
* [magicsys: sysTypeFromName(g: ModuleGraph; info: TLineInfo; name: string): PType](magicsys#sysTypeFromName%2CModuleGraph%2CTLineInfo%2Cstring)
 [szIllegalRecursion:](#szIllegalRecursion)
* [types: szIllegalRecursion](types#szIllegalRecursion)
 [szTooBigSize:](#szTooBigSize)
* [types: szTooBigSize](types#szTooBigSize)
 [szUncomputedSize:](#szUncomputedSize)
* [types: szUncomputedSize](types#szUncomputedSize)
 [szUnknownSize:](#szUnknownSize)
* [types: szUnknownSize](types#szUnknownSize)
 [Tabulator:](#Tabulator)
* [nimlexbase: Tabulator](nimlexbase#Tabulator)
 [taConcept:](#taConcept)
* [TTypeAllowedFlag.taConcept](typeallowed#taConcept)
 [taField:](#taField)
* [TTypeAllowedFlag.taField](typeallowed#taField)
 [tagEffects:](#tagEffects)
* [ast: tagEffects](ast#tagEffects)
 [TagsExt:](#TagsExt)
* [options: TagsExt](options#TagsExt)
 [taHeap:](#taHeap)
* [TTypeAllowedFlag.taHeap](typeallowed#taHeap)
 [taIsOpenArray:](#taIsOpenArray)
* [TTypeAllowedFlag.taIsOpenArray](typeallowed#taIsOpenArray)
 [taIsTemplateOrMacro:](#taIsTemplateOrMacro)
* [TTypeAllowedFlag.taIsTemplateOrMacro](typeallowed#taIsTemplateOrMacro)
 [takeType:](#takeType)
* [types: takeType(formal, arg: PType): PType](types#takeType%2CPType%2CPType)
 [TAliasRequest:](#TAliasRequest)
* [parampatterns: TAliasRequest](parampatterns#TAliasRequest)
 [TAnalysisResult:](#TAnalysisResult)
* [aliases: TAnalysisResult](aliases#TAnalysisResult)
 [taNoUntyped:](#taNoUntyped)
* [TTypeAllowedFlag.taNoUntyped](typeallowed#taNoUntyped)
 [taProcContextIsNotMacro:](#taProcContextIsNotMacro)
* [TTypeAllowedFlag.taProcContextIsNotMacro](typeallowed#taProcContextIsNotMacro)
 [Target:](#Target)
* [platform: Target](platform#Target)
 [TAssignableResult:](#TAssignableResult)
* [parampatterns: TAssignableResult](parampatterns#TAssignableResult)
 [TBackend:](#TBackend)
* [options: TBackend](options#TBackend)
 [TBaseLexer:](#TBaseLexer)
* [nimlexbase: TBaseLexer](nimlexbase#TBaseLexer)
 [TBitSet:](#TBitSet)
* [bitsets: TBitSet](bitsets#TBitSet)
 [TBlock:](#TBlock)
* [cgendata: TBlock](cgendata#TBlock)
* [vmdef: TBlock](vmdef#TBlock)
 [TCallingConvention:](#TCallingConvention)
* [ast: TCallingConvention](ast#TCallingConvention)
 [TCandidate:](#TCandidate)
* [sigmatch: TCandidate](sigmatch#TCandidate)
 [TCandidateState:](#TCandidateState)
* [sigmatch: TCandidateState](sigmatch#TCandidateState)
 [TCFileSection:](#TCFileSection)
* [cgendata: TCFileSection](cgendata#TCFileSection)
 [TCFileSections:](#TCFileSections)
* [cgendata: TCFileSections](cgendata#TCFileSections)
 [TCheckPointResult:](#TCheckPointResult)
* [sigmatch: TCheckPointResult](sigmatch#TCheckPointResult)
 [TCmdLinePass:](#TCmdLinePass)
* [commands: TCmdLinePass](commands#TCmdLinePass)
 [TCommands:](#TCommands)
* [options: TCommands](options#TCommands)
 [TContext:](#TContext)
* [semdata: TContext](semdata#TContext)
 [TCProcFlag:](#TCProcFlag)
* [cgendata: TCProcFlag](cgendata#TCProcFlag)
 [TCProcSection:](#TCProcSection)
* [cgendata: TCProcSection](cgendata#TCProcSection)
 [TCProcSections:](#TCProcSections)
* [cgendata: TCProcSections](cgendata#TCProcSections)
 [TCtx:](#TCtx)
* [vmdef: TCtx](vmdef#TCtx)
 [TCTypeKind:](#TCTypeKind)
* [cgendata: TCTypeKind](cgendata#TCTypeKind)
 [TDest:](#TDest)
* [vmdef: TDest](vmdef#TDest)
 [TDistinctCompare:](#TDistinctCompare)
* [types: TDistinctCompare](types#TDistinctCompare)
 [templatePragmas:](#templatePragmas)
* [pragmas: templatePragmas](pragmas#templatePragmas)
 [Ten:](#Ten)
* [int128: Ten](int128#Ten)
 [TEndian:](#TEndian)
* [platform: TEndian](platform#TEndian)
 [TErrorHandling:](#TErrorHandling)
* [msgs: TErrorHandling](msgs#TErrorHandling)
 [TErrorOutput:](#TErrorOutput)
* [lineinfos: TErrorOutput](lineinfos#TErrorOutput)
 [TErrorOutputs:](#TErrorOutputs)
* [lineinfos: TErrorOutputs](lineinfos#TErrorOutputs)
 [testCompileOption:](#testCompileOption)
* [commands: testCompileOption(conf: ConfigRef; switch: string; info: TLineInfo): bool](commands#testCompileOption%2CConfigRef%2Cstring%2CTLineInfo)
 [testCompileOptionArg:](#testCompileOptionArg)
* [commands: testCompileOptionArg(conf: ConfigRef; switch, arg: string; info: TLineInfo): bool](commands#testCompileOptionArg%2CConfigRef%2Cstring%2Cstring%2CTLineInfo)
 [TEvalMode:](#TEvalMode)
* [vmdef: TEvalMode](vmdef#TEvalMode)
 [TexExt:](#TexExt)
* [options: TexExt](options#TexExt)
 [TExprFlag:](#TExprFlag)
* [semdata: TExprFlag](semdata#TExprFlag)
 [TExprFlags:](#TExprFlags)
* [semdata: TExprFlags](semdata#TExprFlags)
 [text:](#text)
* [sourcemap: text(sourceNode: SourceNode; depth: int): string](sourcemap#text%2CSourceNode%2Cint)
 [tfAcyclic:](#tfAcyclic)
* [TTypeFlag.tfAcyclic](ast#tfAcyclic)
 [tfBorrowDot:](#tfBorrowDot)
* [TTypeFlag.tfBorrowDot](ast#tfBorrowDot)
 [tfByCopy:](#tfByCopy)
* [TTypeFlag.tfByCopy](ast#tfByCopy)
 [tfByRef:](#tfByRef)
* [TTypeFlag.tfByRef](ast#tfByRef)
 [tfCapturesEnv:](#tfCapturesEnv)
* [TTypeFlag.tfCapturesEnv](ast#tfCapturesEnv)
 [tfCheckedForDestructor:](#tfCheckedForDestructor)
* [TTypeFlag.tfCheckedForDestructor](ast#tfCheckedForDestructor)
 [tfCompleteStruct:](#tfCompleteStruct)
* [TTypeFlag.tfCompleteStruct](ast#tfCompleteStruct)
 [tfConceptMatchedTypeSym:](#tfConceptMatchedTypeSym)
* [TTypeFlag.tfConceptMatchedTypeSym](ast#tfConceptMatchedTypeSym)
 [tfContravariant:](#tfContravariant)
* [TTypeFlag.tfContravariant](ast#tfContravariant)
 [tfCovariant:](#tfCovariant)
* [TTypeFlag.tfCovariant](ast#tfCovariant)
 [tfEnumHasHoles:](#tfEnumHasHoles)
* [TTypeFlag.tfEnumHasHoles](ast#tfEnumHasHoles)
 [tfExplicit:](#tfExplicit)
* [TTypeFlag.tfExplicit](ast#tfExplicit)
 [tfExplicitCallConv:](#tfExplicitCallConv)
* [TTypeFlag.tfExplicitCallConv](ast#tfExplicitCallConv)
 [tfFinal:](#tfFinal)
* [TTypeFlag.tfFinal](ast#tfFinal)
 [tfFromGeneric:](#tfFromGeneric)
* [TTypeFlag.tfFromGeneric](ast#tfFromGeneric)
 [tfGcSafe:](#tfGcSafe)
* [ast: tfGcSafe](ast#tfGcSafe)
 [tfGenericTypeParam:](#tfGenericTypeParam)
* [TTypeFlag.tfGenericTypeParam](ast#tfGenericTypeParam)
 [tfHasAsgn:](#tfHasAsgn)
* [TTypeFlag.tfHasAsgn](ast#tfHasAsgn)
 [tfHasGCedMem:](#tfHasGCedMem)
* [TTypeFlag.tfHasGCedMem](ast#tfHasGCedMem)
 [tfHasMeta:](#tfHasMeta)
* [TTypeFlag.tfHasMeta](ast#tfHasMeta)
 [tfHasOwned:](#tfHasOwned)
* [TTypeFlag.tfHasOwned](ast#tfHasOwned)
 [tfHasStatic:](#tfHasStatic)
* [TTypeFlag.tfHasStatic](ast#tfHasStatic)
 [TFileInfo:](#TFileInfo)
* [lineinfos: TFileInfo](lineinfos#TFileInfo)
 [tfImplicitTypeParam:](#tfImplicitTypeParam)
* [TTypeFlag.tfImplicitTypeParam](ast#tfImplicitTypeParam)
 [tfIncompleteStruct:](#tfIncompleteStruct)
* [TTypeFlag.tfIncompleteStruct](ast#tfIncompleteStruct)
 [tfInferrableStatic:](#tfInferrableStatic)
* [TTypeFlag.tfInferrableStatic](ast#tfInferrableStatic)
 [tfInheritable:](#tfInheritable)
* [TTypeFlag.tfInheritable](ast#tfInheritable)
 [tfIterator:](#tfIterator)
* [TTypeFlag.tfIterator](ast#tfIterator)
 [tfNeedsFullInit:](#tfNeedsFullInit)
* [TTypeFlag.tfNeedsFullInit](ast#tfNeedsFullInit)
 [tfNoSideEffect:](#tfNoSideEffect)
* [TTypeFlag.tfNoSideEffect](ast#tfNoSideEffect)
 [tfNotNil:](#tfNotNil)
* [TTypeFlag.tfNotNil](ast#tfNotNil)
 [tfObjHasKids:](#tfObjHasKids)
* [ast: tfObjHasKids](ast#tfObjHasKids)
 [tfPacked:](#tfPacked)
* [TTypeFlag.tfPacked](ast#tfPacked)
 [tfPartial:](#tfPartial)
* [TTypeFlag.tfPartial](ast#tfPartial)
 [tfRefsAnonObj:](#tfRefsAnonObj)
* [TTypeFlag.tfRefsAnonObj](ast#tfRefsAnonObj)
 [tfRequiresInit:](#tfRequiresInit)
* [TTypeFlag.tfRequiresInit](ast#tfRequiresInit)
 [tfResolved:](#tfResolved)
* [TTypeFlag.tfResolved](ast#tfResolved)
 [tfRetType:](#tfRetType)
* [TTypeFlag.tfRetType](ast#tfRetType)
 [tfReturnsNew:](#tfReturnsNew)
* [ast: tfReturnsNew](ast#tfReturnsNew)
 [tfShallow:](#tfShallow)
* [TTypeFlag.tfShallow](ast#tfShallow)
 [tfThread:](#tfThread)
* [TTypeFlag.tfThread](ast#tfThread)
 [tfTriggersCompileTime:](#tfTriggersCompileTime)
* [TTypeFlag.tfTriggersCompileTime](ast#tfTriggersCompileTime)
 [TFullReg:](#TFullReg)
* [vmdef: TFullReg](vmdef#TFullReg)
 [tfUnion:](#tfUnion)
* [ast: tfUnion](ast#tfUnion)
 [tfUnresolved:](#tfUnresolved)
* [TTypeFlag.tfUnresolved](ast#tfUnresolved)
 [tfVarargs:](#tfVarargs)
* [TTypeFlag.tfVarargs](ast#tfVarargs)
 [tfVarIsPtr:](#tfVarIsPtr)
* [TTypeFlag.tfVarIsPtr](ast#tfVarIsPtr)
 [tfWeakCovariant:](#tfWeakCovariant)
* [TTypeFlag.tfWeakCovariant](ast#tfWeakCovariant)
 [tfWildcard:](#tfWildcard)
* [TTypeFlag.tfWildcard](ast#tfWildcard)
 [TGCMode:](#TGCMode)
* [options: TGCMode](options#TGCMode)
 [TGlobalOption:](#TGlobalOption)
* [options: TGlobalOption](options#TGlobalOption)
 [TGlobalOptions:](#TGlobalOptions)
* [options: TGlobalOptions](options#TGlobalOptions)
 [theindexFname:](#theindexFname)
* [nimpaths: theindexFname](nimpaths#theindexFname)
 [threadVarAccessed:](#threadVarAccessed)
* [TCProcFlag.threadVarAccessed](cgendata#threadVarAccessed)
 [TIdent:](#TIdent)
* [idents: TIdent](idents#TIdent)
 [TIdentIter:](#TIdentIter)
* [astalgo: TIdentIter](astalgo#TIdentIter)
 [TIdNodePair:](#TIdNodePair)
* [ast: TIdNodePair](ast#TIdNodePair)
 [TIdNodePairSeq:](#TIdNodePairSeq)
* [ast: TIdNodePairSeq](ast#TIdNodePairSeq)
 [TIdNodeTable:](#TIdNodeTable)
* [ast: TIdNodeTable](ast#TIdNodeTable)
 [TIdObj:](#TIdObj)
* [idents: TIdObj](idents#TIdObj)
 [TIdPair:](#TIdPair)
* [ast: TIdPair](ast#TIdPair)
 [TIdPairSeq:](#TIdPairSeq)
* [ast: TIdPairSeq](ast#TIdPairSeq)
 [TIdTable:](#TIdTable)
* [ast: TIdTable](ast#TIdTable)
 [TIIPair:](#TIIPair)
* [astalgo: TIIPair](astalgo#TIIPair)
 [TIIPairSeq:](#TIIPairSeq)
* [astalgo: TIIPairSeq](astalgo#TIIPairSeq)
 [TIITable:](#TIITable)
* [astalgo: TIITable](astalgo#TIITable)
 [TImplication:](#TImplication)
* [ast: TImplication](ast#TImplication)
 [TInfoCC:](#TInfoCC)
* [extccomp: TInfoCC](extccomp#TInfoCC)
 [TInfoCCProp:](#TInfoCCProp)
* [extccomp: TInfoCCProp](extccomp#TInfoCCProp)
 [TInfoCCProps:](#TInfoCCProps)
* [extccomp: TInfoCCProps](extccomp#TInfoCCProps)
 [TInfoCPU:](#TInfoCPU)
* [platform: TInfoCPU](platform#TInfoCPU)
 [TInfoOS:](#TInfoOS)
* [platform: TInfoOS](platform#TInfoOS)
 [TInfoOSProp:](#TInfoOSProp)
* [platform: TInfoOSProp](platform#TInfoOSProp)
 [TInfoOSProps:](#TInfoOSProps)
* [platform: TInfoOSProps](platform#TInfoOSProps)
 [TInstantiation:](#TInstantiation)
* [ast: TInstantiation](ast#TInstantiation)
 [TInstantiationPair:](#TInstantiationPair)
* [semdata: TInstantiationPair](semdata#TInstantiationPair)
 [TInstr:](#TInstr)
* [vmdef: TInstr](vmdef#TInstr)
 [TInstrType:](#TInstrType)
* [vmdef: TInstrType](vmdef#TInstrType)
 [tkAccent:](#tkAccent)
* [TokType.tkAccent](lexer#tkAccent)
 [tkAddr:](#tkAddr)
* [TokType.tkAddr](lexer#tkAddr)
 [tkAnd:](#tkAnd)
* [TokType.tkAnd](lexer#tkAnd)
 [tkAs:](#tkAs)
* [TokType.tkAs](lexer#tkAs)
 [tkAsm:](#tkAsm)
* [TokType.tkAsm](lexer#tkAsm)
 [tkBind:](#tkBind)
* [TokType.tkBind](lexer#tkBind)
 [tkBlock:](#tkBlock)
* [TokType.tkBlock](lexer#tkBlock)
 [tkBracketDotLe:](#tkBracketDotLe)
* [TokType.tkBracketDotLe](lexer#tkBracketDotLe)
 [tkBracketDotRi:](#tkBracketDotRi)
* [TokType.tkBracketDotRi](lexer#tkBracketDotRi)
 [tkBracketLe:](#tkBracketLe)
* [TokType.tkBracketLe](lexer#tkBracketLe)
 [tkBracketLeColon:](#tkBracketLeColon)
* [TokType.tkBracketLeColon](lexer#tkBracketLeColon)
 [tkBracketRi:](#tkBracketRi)
* [TokType.tkBracketRi](lexer#tkBracketRi)
 [tkBreak:](#tkBreak)
* [TokType.tkBreak](lexer#tkBreak)
 [tkCase:](#tkCase)
* [TokType.tkCase](lexer#tkCase)
 [tkCast:](#tkCast)
* [TokType.tkCast](lexer#tkCast)
 [tkCharLit:](#tkCharLit)
* [TokType.tkCharLit](lexer#tkCharLit)
 [tkColon:](#tkColon)
* [TokType.tkColon](lexer#tkColon)
 [tkColonColon:](#tkColonColon)
* [TokType.tkColonColon](lexer#tkColonColon)
 [tkComma:](#tkComma)
* [TokType.tkComma](lexer#tkComma)
 [tkComment:](#tkComment)
* [TokType.tkComment](lexer#tkComment)
 [tkConcept:](#tkConcept)
* [TokType.tkConcept](lexer#tkConcept)
 [tkConst:](#tkConst)
* [TokType.tkConst](lexer#tkConst)
 [tkContinue:](#tkContinue)
* [TokType.tkContinue](lexer#tkContinue)
 [tkConverter:](#tkConverter)
* [TokType.tkConverter](lexer#tkConverter)
 [tkCurlyDotLe:](#tkCurlyDotLe)
* [TokType.tkCurlyDotLe](lexer#tkCurlyDotLe)
 [tkCurlyDotRi:](#tkCurlyDotRi)
* [TokType.tkCurlyDotRi](lexer#tkCurlyDotRi)
 [tkCurlyLe:](#tkCurlyLe)
* [TokType.tkCurlyLe](lexer#tkCurlyLe)
 [tkCurlyRi:](#tkCurlyRi)
* [TokType.tkCurlyRi](lexer#tkCurlyRi)
 [tkDefer:](#tkDefer)
* [TokType.tkDefer](lexer#tkDefer)
 [tkDiscard:](#tkDiscard)
* [TokType.tkDiscard](lexer#tkDiscard)
 [tkDistinct:](#tkDistinct)
* [TokType.tkDistinct](lexer#tkDistinct)
 [tkDiv:](#tkDiv)
* [TokType.tkDiv](lexer#tkDiv)
 [tkDo:](#tkDo)
* [TokType.tkDo](lexer#tkDo)
 [tkDot:](#tkDot)
* [TokType.tkDot](lexer#tkDot)
 [tkDotDot:](#tkDotDot)
* [TokType.tkDotDot](lexer#tkDotDot)
 [tkElif:](#tkElif)
* [TokType.tkElif](lexer#tkElif)
 [tkElse:](#tkElse)
* [TokType.tkElse](lexer#tkElse)
 [tkEnd:](#tkEnd)
* [TokType.tkEnd](lexer#tkEnd)
 [tkEnum:](#tkEnum)
* [TokType.tkEnum](lexer#tkEnum)
 [tkEof:](#tkEof)
* [TokType.tkEof](lexer#tkEof)
 [tkEquals:](#tkEquals)
* [TokType.tkEquals](lexer#tkEquals)
 [tkExcept:](#tkExcept)
* [TokType.tkExcept](lexer#tkExcept)
 [tkExport:](#tkExport)
* [TokType.tkExport](lexer#tkExport)
 [tkFinally:](#tkFinally)
* [TokType.tkFinally](lexer#tkFinally)
 [tkFloat128Lit:](#tkFloat128Lit)
* [TokType.tkFloat128Lit](lexer#tkFloat128Lit)
 [tkFloat32Lit:](#tkFloat32Lit)
* [TokType.tkFloat32Lit](lexer#tkFloat32Lit)
 [tkFloat64Lit:](#tkFloat64Lit)
* [TokType.tkFloat64Lit](lexer#tkFloat64Lit)
 [tkFloatLit:](#tkFloatLit)
* [TokType.tkFloatLit](lexer#tkFloatLit)
 [tkFor:](#tkFor)
* [TokType.tkFor](lexer#tkFor)
 [tkFrom:](#tkFrom)
* [TokType.tkFrom](lexer#tkFrom)
 [tkFunc:](#tkFunc)
* [TokType.tkFunc](lexer#tkFunc)
 [tkGStrLit:](#tkGStrLit)
* [TokType.tkGStrLit](lexer#tkGStrLit)
 [tkGTripleStrLit:](#tkGTripleStrLit)
* [TokType.tkGTripleStrLit](lexer#tkGTripleStrLit)
 [tkIf:](#tkIf)
* [TokType.tkIf](lexer#tkIf)
 [tkImport:](#tkImport)
* [TokType.tkImport](lexer#tkImport)
 [tkIn:](#tkIn)
* [TokType.tkIn](lexer#tkIn)
 [tkInclude:](#tkInclude)
* [TokType.tkInclude](lexer#tkInclude)
 [tkInfixOpr:](#tkInfixOpr)
* [TokType.tkInfixOpr](lexer#tkInfixOpr)
 [tkInt16Lit:](#tkInt16Lit)
* [TokType.tkInt16Lit](lexer#tkInt16Lit)
 [tkInt32Lit:](#tkInt32Lit)
* [TokType.tkInt32Lit](lexer#tkInt32Lit)
 [tkInt64Lit:](#tkInt64Lit)
* [TokType.tkInt64Lit](lexer#tkInt64Lit)
 [tkInt8Lit:](#tkInt8Lit)
* [TokType.tkInt8Lit](lexer#tkInt8Lit)
 [tkInterface:](#tkInterface)
* [TokType.tkInterface](lexer#tkInterface)
 [tkIntLit:](#tkIntLit)
* [TokType.tkIntLit](lexer#tkIntLit)
 [tkInvalid:](#tkInvalid)
* [TokType.tkInvalid](lexer#tkInvalid)
 [tkIs:](#tkIs)
* [TokType.tkIs](lexer#tkIs)
 [tkIsnot:](#tkIsnot)
* [TokType.tkIsnot](lexer#tkIsnot)
 [tkIterator:](#tkIterator)
* [TokType.tkIterator](lexer#tkIterator)
 [tkLet:](#tkLet)
* [TokType.tkLet](lexer#tkLet)
 [tkMacro:](#tkMacro)
* [TokType.tkMacro](lexer#tkMacro)
 [tkMethod:](#tkMethod)
* [TokType.tkMethod](lexer#tkMethod)
 [tkMixin:](#tkMixin)
* [TokType.tkMixin](lexer#tkMixin)
 [tkMod:](#tkMod)
* [TokType.tkMod](lexer#tkMod)
 [tkNil:](#tkNil)
* [TokType.tkNil](lexer#tkNil)
 [tkNot:](#tkNot)
* [TokType.tkNot](lexer#tkNot)
 [tkNotin:](#tkNotin)
* [TokType.tkNotin](lexer#tkNotin)
 [tkObject:](#tkObject)
* [TokType.tkObject](lexer#tkObject)
 [tkOf:](#tkOf)
* [TokType.tkOf](lexer#tkOf)
 [tkOpr:](#tkOpr)
* [TokType.tkOpr](lexer#tkOpr)
 [tkOr:](#tkOr)
* [TokType.tkOr](lexer#tkOr)
 [tkOut:](#tkOut)
* [TokType.tkOut](lexer#tkOut)
 [tkParDotLe:](#tkParDotLe)
* [TokType.tkParDotLe](lexer#tkParDotLe)
 [tkParDotRi:](#tkParDotRi)
* [TokType.tkParDotRi](lexer#tkParDotRi)
 [tkParLe:](#tkParLe)
* [TokType.tkParLe](lexer#tkParLe)
 [tkParRi:](#tkParRi)
* [TokType.tkParRi](lexer#tkParRi)
 [tkPostfixOpr:](#tkPostfixOpr)
* [TokType.tkPostfixOpr](lexer#tkPostfixOpr)
 [tkPrefixOpr:](#tkPrefixOpr)
* [TokType.tkPrefixOpr](lexer#tkPrefixOpr)
 [tkProc:](#tkProc)
* [TokType.tkProc](lexer#tkProc)
 [tkPtr:](#tkPtr)
* [TokType.tkPtr](lexer#tkPtr)
 [tkRaise:](#tkRaise)
* [TokType.tkRaise](lexer#tkRaise)
 [tkRef:](#tkRef)
* [TokType.tkRef](lexer#tkRef)
 [tkReturn:](#tkReturn)
* [TokType.tkReturn](lexer#tkReturn)
 [tkRStrLit:](#tkRStrLit)
* [TokType.tkRStrLit](lexer#tkRStrLit)
 [tkSemiColon:](#tkSemiColon)
* [TokType.tkSemiColon](lexer#tkSemiColon)
 [tkShl:](#tkShl)
* [TokType.tkShl](lexer#tkShl)
 [tkShr:](#tkShr)
* [TokType.tkShr](lexer#tkShr)
 [tkSpaces:](#tkSpaces)
* [TokType.tkSpaces](lexer#tkSpaces)
 [tkStatic:](#tkStatic)
* [TokType.tkStatic](lexer#tkStatic)
 [tkStrLit:](#tkStrLit)
* [TokType.tkStrLit](lexer#tkStrLit)
 [tkSymbol:](#tkSymbol)
* [TokType.tkSymbol](lexer#tkSymbol)
 [tkTemplate:](#tkTemplate)
* [TokType.tkTemplate](lexer#tkTemplate)
 [tkTripleStrLit:](#tkTripleStrLit)
* [TokType.tkTripleStrLit](lexer#tkTripleStrLit)
 [tkTry:](#tkTry)
* [TokType.tkTry](lexer#tkTry)
 [tkTuple:](#tkTuple)
* [TokType.tkTuple](lexer#tkTuple)
 [tkType:](#tkType)
* [TokType.tkType](lexer#tkType)
 [tkUInt16Lit:](#tkUInt16Lit)
* [TokType.tkUInt16Lit](lexer#tkUInt16Lit)
 [tkUInt32Lit:](#tkUInt32Lit)
* [TokType.tkUInt32Lit](lexer#tkUInt32Lit)
 [tkUInt64Lit:](#tkUInt64Lit)
* [TokType.tkUInt64Lit](lexer#tkUInt64Lit)
 [tkUInt8Lit:](#tkUInt8Lit)
* [TokType.tkUInt8Lit](lexer#tkUInt8Lit)
 [tkUIntLit:](#tkUIntLit)
* [TokType.tkUIntLit](lexer#tkUIntLit)
 [tkUsing:](#tkUsing)
* [TokType.tkUsing](lexer#tkUsing)
 [tkVar:](#tkVar)
* [TokType.tkVar](lexer#tkVar)
 [tkWhen:](#tkWhen)
* [TokType.tkWhen](lexer#tkWhen)
 [tkWhile:](#tkWhile)
* [TokType.tkWhile](lexer#tkWhile)
 [tkXor:](#tkXor)
* [TokType.tkXor](lexer#tkXor)
 [tkYield:](#tkYield)
* [TokType.tkYield](lexer#tkYield)
 [TLabel:](#TLabel)
* [cgendata: TLabel](cgendata#TLabel)
 [TLib:](#TLib)
* [ast: TLib](ast#TLib)
 [TLibKind:](#TLibKind)
* [ast: TLibKind](ast#TLibKind)
 [TLineInfo:](#TLineInfo)
* [lineinfos: TLineInfo](lineinfos#TLineInfo)
 [TLLRepl:](#TLLRepl)
* [llstream: TLLRepl](llstream#TLLRepl)
 [TLLStream:](#TLLStream)
* [llstream: TLLStream](llstream#TLLStream)
 [TLLStreamKind:](#TLLStreamKind)
* [llstream: TLLStreamKind](llstream#TLLStreamKind)
 [TLoc:](#TLoc)
* [ast: TLoc](ast#TLoc)
 [TLocFlag:](#TLocFlag)
* [ast: TLocFlag](ast#TLocFlag)
 [TLocFlags:](#TLocFlags)
* [ast: TLocFlags](ast#TLocFlags)
 [TLocKind:](#TLocKind)
* [ast: TLocKind](ast#TLocKind)
 [TLockLevel:](#TLockLevel)
* [ast: TLockLevel](ast#TLockLevel)
 [TLookupFlag:](#TLookupFlag)
* [lookups: TLookupFlag](lookups#TLookupFlag)
 [TMagic:](#TMagic)
* [ast: TMagic](ast#TMagic)
 [TMatchedConcept:](#TMatchedConcept)
* [semdata: TMatchedConcept](semdata#TMatchedConcept)
 [TModel:](#TModel)
* [guards: TModel](guards#TModel)
 [TMsgKind:](#TMsgKind)
* [lineinfos: TMsgKind](lineinfos#TMsgKind)
 [TNode:](#TNode)
* [ast: TNode](ast#TNode)
 [TNodeFlag:](#TNodeFlag)
* [ast: TNodeFlag](ast#TNodeFlag)
 [TNodeFlags:](#TNodeFlags)
* [ast: TNodeFlags](ast#TNodeFlags)
 [TNodeKind:](#TNodeKind)
* [ast: TNodeKind](ast#TNodeKind)
 [TNodeKinds:](#TNodeKinds)
* [ast: TNodeKinds](ast#TNodeKinds)
 [TNodePair:](#TNodePair)
* [ast: TNodePair](ast#TNodePair)
 [TNodePairSeq:](#TNodePairSeq)
* [ast: TNodePairSeq](ast#TNodePairSeq)
 [TNodeSeq:](#TNodeSeq)
* [ast: TNodeSeq](ast#TNodeSeq)
 [TNodeTable:](#TNodeTable)
* [ast: TNodeTable](ast#TNodeTable)
 [TNoteKind:](#TNoteKind)
* [lineinfos: TNoteKind](lineinfos#TNoteKind)
 [TNoteKinds:](#TNoteKinds)
* [lineinfos: TNoteKinds](lineinfos#TNoteKinds)
 [toAbsolute:](#toAbsolute)
* [pathutils: toAbsolute(file: string; base: AbsoluteDir): AbsoluteFile](pathutils#toAbsolute%2Cstring%2CAbsoluteDir)
 [toAbsoluteDir:](#toAbsoluteDir)
* [pathutils: toAbsoluteDir(path: string): AbsoluteDir](pathutils#toAbsoluteDir%2Cstring)
 [toBitSet:](#toBitSet)
* [nimsets: toBitSet(conf: ConfigRef; s: PNode): TBitSet](nimsets#toBitSet%2CConfigRef%2CPNode)
 [TObjectSeq:](#TObjectSeq)
* [ast: TObjectSeq](ast#TObjectSeq)
 [TObjectSet:](#TObjectSet)
* [ast: TObjectSet](ast#TObjectSet)
 [toCChar:](#toCChar)
* [msgs: toCChar(c: char; result: var string)](msgs#toCChar%2Cchar%2Cstring)
 [toColumn:](#toColumn)
* [msgs: toColumn(info: TLineInfo): int](msgs#toColumn%2CTLineInfo)
 [toFileLineCol:](#toFileLineCol)
* [msgs: toFileLineCol(conf: ConfigRef; info: TLineInfo): string](msgs#toFileLineCol%2CConfigRef%2CTLineInfo)
 [toFilename:](#toFilename)
* [msgs: toFilename(conf: ConfigRef; fileIdx: FileIndex): string](msgs#toFilename.t%2CConfigRef%2CFileIndex)
* [msgs: toFilename(conf: ConfigRef; info: TLineInfo): string](msgs#toFilename.t%2CConfigRef%2CTLineInfo)
 [toFilenameOption:](#toFilenameOption)
* [msgs: toFilenameOption(conf: ConfigRef; fileIdx: FileIndex; opt: FilenameOption): string](msgs#toFilenameOption%2CConfigRef%2CFileIndex%2CFilenameOption)
 [toFloat64:](#toFloat64)
* [int128: toFloat64(arg: Int128): float64](int128#toFloat64%2CInt128)
 [toFullPath:](#toFullPath)
* [msgs: toFullPath(conf: ConfigRef; fileIdx: FileIndex): string](msgs#toFullPath%2CConfigRef%2CFileIndex)
* [msgs: toFullPath(conf: ConfigRef; info: TLineInfo): string](msgs#toFullPath.t%2CConfigRef%2CTLineInfo)
 [toFullPathConsiderDirty:](#toFullPathConsiderDirty)
* [msgs: toFullPathConsiderDirty(conf: ConfigRef; fileIdx: FileIndex): AbsoluteFile](msgs#toFullPathConsiderDirty%2CConfigRef%2CFileIndex)
* [msgs: toFullPathConsiderDirty(conf: ConfigRef; info: TLineInfo): string](msgs#toFullPathConsiderDirty.t%2CConfigRef%2CTLineInfo)
 [toGeneratedFile:](#toGeneratedFile)
* [options: toGeneratedFile(conf: ConfigRef; path: AbsoluteFile; ext: string): AbsoluteFile](options#toGeneratedFile%2CConfigRef%2CAbsoluteFile%2Cstring)
 [toHex:](#toHex)
* [int128: toHex(arg: Int128): string](int128#toHex%2CInt128)
 [toHumanStr:](#toHumanStr)
* [ast: toHumanStr(kind: TSymKind): string](ast#toHumanStr%2CTSymKind)
* [ast: toHumanStr(kind: TTypeKind): string](ast#toHumanStr%2CTTypeKind)
 [toInt:](#toInt)
* [int128: toInt(arg: Int128): int](int128#toInt%2CInt128)
 [toInt128:](#toInt128)
* [int128: toInt128(arg: float64): Int128](int128#toInt128%2Cfloat64)
* [int128: toInt128[T: SomeInteger | bool](arg: T): Int128](int128#toInt128%2CT)
 [toInt16:](#toInt16)
* [int128: toInt16(arg: Int128): int16](int128#toInt16%2CInt128)
 [toInt32:](#toInt32)
* [int128: toInt32(arg: Int128): int32](int128#toInt32%2CInt128)
 [toInt64:](#toInt64)
* [int128: toInt64(arg: Int128): int64](int128#toInt64%2CInt128)
 [toInt64Checked:](#toInt64Checked)
* [int128: toInt64Checked(arg: Int128; onError: int64): int64](int128#toInt64Checked%2CInt128%2Cint64)
 [toInt8:](#toInt8)
* [int128: toInt8(arg: Int128): int8](int128#toInt8%2CInt128)
 [Token:](#Token)
* [lexer: Token](lexer#Token)
 [tokenize:](#tokenize)
* [sourcemap: tokenize(line: string): (bool, string)](sourcemap#tokenize.i%2Cstring)
 [tokKeywordHigh:](#tokKeywordHigh)
* [lexer: tokKeywordHigh](lexer#tokKeywordHigh)
 [tokKeywordLow:](#tokKeywordLow)
* [lexer: tokKeywordLow](lexer#tokKeywordLow)
 [TokType:](#TokType)
* [lexer: TokType](lexer#TokType)
 [TokTypes:](#TokTypes)
* [lexer: TokTypes](lexer#TokTypes)
 [toLinenumber:](#toLinenumber)
* [msgs: toLinenumber(info: TLineInfo): int](msgs#toLinenumber%2CTLineInfo)
 [toLit:](#toLit)
* [vmconv: toLit[T](a: T): PNode](vmconv#toLit%2CT)
 [toLowerAscii:](#toLowerAscii)
* [strutils2: toLowerAscii(a: var string)](strutils2#toLowerAscii%2Cstring)
 [toMsgFilename:](#toMsgFilename)
* [msgs: toMsgFilename(conf: ConfigRef; info: FileIndex): string](msgs#toMsgFilename%2CConfigRef%2CFileIndex)
* [msgs: toMsgFilename(conf: ConfigRef; info: TLineInfo): string](msgs#toMsgFilename.t%2CConfigRef%2CTLineInfo)
 [toObject:](#toObject)
* [ast: toObject(typ: PType): PType](ast#toObject%2CPType)
 [toObjFile:](#toObjFile)
* [extccomp: toObjFile(conf: ConfigRef; filename: AbsoluteFile): AbsoluteFile](extccomp#toObjFile%2CConfigRef%2CAbsoluteFile)
 [TOpcode:](#TOpcode)
* [vmdef: TOpcode](vmdef#TOpcode)
 [toProjPath:](#toProjPath)
* [msgs: toProjPath(conf: ConfigRef; fileIdx: FileIndex): string](msgs#toProjPath%2CConfigRef%2CFileIndex)
* [msgs: toProjPath(conf: ConfigRef; info: TLineInfo): string](msgs#toProjPath.t%2CConfigRef%2CTLineInfo)
 [TOption:](#TOption)
* [options: TOption](options#TOption)
 [TOptionEntry:](#TOptionEntry)
* [semdata: TOptionEntry](semdata#TOptionEntry)
 [TOptions:](#TOptions)
* [options: TOptions](options#TOptions)
 [toRef:](#toRef)
* [ast: toRef(typ: PType): PType](ast#toRef%2CPType)
 [toSourceMap:](#toSourceMap)
* [sourcemap: toSourceMap(node: SourceNode; file: string): SourceMapGenerator](sourcemap#toSourceMap%2CSourceNode%2Cstring)
 [toStrMaxPrecision:](#toStrMaxPrecision)
* [rodutils: toStrMaxPrecision(f: BiggestFloat; literalPostfix = ""): string](rodutils#toStrMaxPrecision%2CBiggestFloat%2Cstring)
 [toTreeSet:](#toTreeSet)
* [nimsets: toTreeSet(conf: ConfigRef; s: TBitSet; settype: PType; info: TLineInfo): PNode](nimsets#toTreeSet%2CConfigRef%2CTBitSet%2CPType%2CTLineInfo)
 [toUInt:](#toUInt)
* [int128: toUInt(arg: Int128): uint](int128#toUInt%2CInt128)
 [toUInt16:](#toUInt16)
* [int128: toUInt16(arg: Int128): uint16](int128#toUInt16%2CInt128)
 [toUInt32:](#toUInt32)
* [int128: toUInt32(arg: Int128): uint32](int128#toUInt32%2CInt128)
 [toUInt64:](#toUInt64)
* [int128: toUInt64(arg: Int128): uint64](int128#toUInt64%2CInt128)
 [toUInt8:](#toUInt8)
* [int128: toUInt8(arg: Int128): uint8](int128#toUInt8%2CInt128)
 [toVar:](#toVar)
* [ast: toVar(typ: PType; kind: TTypeKind): PType](ast#toVar%2CPType%2CTTypeKind)
 [TOverloadIter:](#TOverloadIter)
* [lookups: TOverloadIter](lookups#TOverloadIter)
 [TOverloadIterMode:](#TOverloadIterMode)
* [lookups: TOverloadIterMode](lookups#TOverloadIterMode)
 [TPair:](#TPair)
* [ast: TPair](ast#TPair)
 [TPairSeq:](#TPairSeq)
* [ast: TPairSeq](ast#TPairSeq)
 [TParamsEquality:](#TParamsEquality)
* [types: TParamsEquality](types#TParamsEquality)
 [TPass:](#TPass)
* [modulegraphs: TPass](modulegraphs#TPass)
 [TPassClose:](#TPassClose)
* [modulegraphs: TPassClose](modulegraphs#TPassClose)
 [TPassContext:](#TPassContext)
* [modulegraphs: TPassContext](modulegraphs#TPassContext)
 [TPassData:](#TPassData)
* [passes: TPassData](passes#TPassData)
 [TPassOpen:](#TPassOpen)
* [modulegraphs: TPassOpen](modulegraphs#TPassOpen)
 [TPassProcess:](#TPassProcess)
* [modulegraphs: TPassProcess](modulegraphs#TPassProcess)
 [TPosition:](#TPosition)
* [vmdef: TPosition](vmdef#TPosition)
 [TPreferedDesc:](#TPreferedDesc)
* [types: TPreferedDesc](types#TPreferedDesc)
 [TProcCon:](#TProcCon)
* [semdata: TProcCon](semdata#TProcCon)
 [trackPosInvalidFileIdx:](#trackPosInvalidFileIdx)
* [lineinfos: trackPosInvalidFileIdx](lineinfos#trackPosInvalidFileIdx)
 [trackProc:](#trackProc)
* [sempass2: trackProc(c: PContext; s: PSym; body: PNode)](sempass2#trackProc%2CPContext%2CPSym%2CPNode)
 [trackStmt:](#trackStmt)
* [sempass2: trackStmt(c: PContext; module: PSym; n: PNode; isTopLevel: bool)](sempass2#trackStmt%2CPContext%2CPSym%2CPNode%2Cbool)
 [Transformation:](#Transformation)
* [pluginsupport: Transformation](pluginsupport#Transformation)
 [transformBody:](#transformBody)
* [transf: transformBody(g: ModuleGraph; prc: PSym; cache: bool): PNode](transf#transformBody%2CModuleGraph%2CPSym%2Cbool)
 [transformClosureIterator:](#transformClosureIterator)
* [closureiters: transformClosureIterator(g: ModuleGraph; fn: PSym; n: PNode): PNode](closureiters#transformClosureIterator%2CModuleGraph%2CPSym%2CPNode)
 [transformExpr:](#transformExpr)
* [transf: transformExpr(g: ModuleGraph; module: PSym; n: PNode): PNode](transf#transformExpr%2CModuleGraph%2CPSym%2CPNode)
 [transformStmt:](#transformStmt)
* [transf: transformStmt(g: ModuleGraph; module: PSym; n: PNode): PNode](transf#transformStmt%2CModuleGraph%2CPSym%2CPNode)
 [transitionGenericParamToType:](#transitionGenericParamToType)
* [ast: transitionGenericParamToType(s: PSym)](ast#transitionGenericParamToType%2CPSym)
 [transitionIntKind:](#transitionIntKind)
* [ast: transitionIntKind(n: PNode; kind: range[nkCharLit .. nkUInt64Lit])](ast#transitionIntKind%2CPNode%2Crange%5B%5D)
 [transitionNoneToSym:](#transitionNoneToSym)
* [ast: transitionNoneToSym(n: PNode)](ast#transitionNoneToSym%2CPNode)
 [transitionRoutineSymKind:](#transitionRoutineSymKind)
* [ast: transitionRoutineSymKind(s: PSym; kind: range[skProc .. skTemplate])](ast#transitionRoutineSymKind%2CPSym%2Crange%5B%5D)
 [transitionSonsKind:](#transitionSonsKind)
* [ast: transitionSonsKind(n: PNode; kind: range[nkComesFrom .. nkTupleConstr])](ast#transitionSonsKind%2CPNode%2Crange%5B%5D)
 [transitionSymKindCommon:](#transitionSymKindCommon)
* [ast: transitionSymKindCommon(k: TSymKind)](ast#transitionSymKindCommon.t%2CTSymKind)
 [transitionToLet:](#transitionToLet)
* [ast: transitionToLet(s: PSym)](ast#transitionToLet%2CPSym)
 [trBindGenericParam:](#trBindGenericParam)
* [TTypeRelFlag.trBindGenericParam](sigmatch#trBindGenericParam)
 [trDontBind:](#trDontBind)
* [TTypeRelFlag.trDontBind](sigmatch#trDontBind)
 [treeToYaml:](#treeToYaml)
* [astalgo: treeToYaml(conf: ConfigRef; n: PNode; indent: int = 0; maxRecDepth: int = -1): Rope](astalgo#treeToYaml%2CConfigRef%2CPNode%2Cint%2Cint)
 [TRegister:](#TRegister)
* [vmdef: TRegister](vmdef#TRegister)
 [TRegisterKind:](#TRegisterKind)
* [vmdef: TRegisterKind](vmdef#TRegisterKind)
 [TRenderFlag:](#TRenderFlag)
* [renderer: TRenderFlag](renderer#TRenderFlag)
 [TRenderFlags:](#TRenderFlags)
* [renderer: TRenderFlags](renderer#TRenderFlags)
 [TRenderTok:](#TRenderTok)
* [renderer: TRenderTok](renderer#TRenderTok)
 [TRenderTokSeq:](#TRenderTokSeq)
* [renderer: TRenderTokSeq](renderer#TRenderTokSeq)
 [TReplTypeVars:](#TReplTypeVars)
* [semtypinst: TReplTypeVars](semtypinst#TReplTypeVars)
 [trNoCovariance:](#trNoCovariance)
* [TTypeRelFlag.trNoCovariance](sigmatch#trNoCovariance)
 [TSandboxFlag:](#TSandboxFlag)
* [vmdef: TSandboxFlag](vmdef#TSandboxFlag)
 [TSandboxFlags:](#TSandboxFlags)
* [vmdef: TSandboxFlags](vmdef#TSandboxFlags)
 [TScope:](#TScope)
* [ast: TScope](ast#TScope)
 [TSideEffectAnalysis:](#TSideEffectAnalysis)
* [parampatterns: TSideEffectAnalysis](parampatterns#TSideEffectAnalysis)
 [TSlotKind:](#TSlotKind)
* [vmdef: TSlotKind](vmdef#TSlotKind)
 [TSpawnResult:](#TSpawnResult)
* [spawn: TSpawnResult](spawn#TSpawnResult)
 [TSpecialWord:](#TSpecialWord)
* [wordrecg: TSpecialWord](wordrecg#TSpecialWord)
 [TSpecialWords:](#TSpecialWords)
* [wordrecg: TSpecialWords](wordrecg#TSpecialWords)
 [TSrcGen:](#TSrcGen)
* [renderer: TSrcGen](renderer#TSrcGen)
 [TStackFrame:](#TStackFrame)
* [vmdef: TStackFrame](vmdef#TStackFrame)
 [TStorageLoc:](#TStorageLoc)
* [ast: TStorageLoc](ast#TStorageLoc)
 [TStringSeq:](#TStringSeq)
* [options: TStringSeq](options#TStringSeq)
 [TStrTable:](#TStrTable)
* [ast: TStrTable](ast#TStrTable)
 [TSym:](#TSym)
* [ast: TSym](ast#TSym)
 [TSymFlag:](#TSymFlag)
* [ast: TSymFlag](ast#TSymFlag)
 [TSymFlags:](#TSymFlags)
* [ast: TSymFlags](ast#TSymFlags)
 [TSymKind:](#TSymKind)
* [ast: TSymKind](ast#TSymKind)
 [TSymKinds:](#TSymKinds)
* [ast: TSymKinds](ast#TSymKinds)
 [TSystemCC:](#TSystemCC)
* [options: TSystemCC](options#TSystemCC)
 [TSystemCPU:](#TSystemCPU)
* [platform: TSystemCPU](platform#TSystemCPU)
 [TSystemOS:](#TSystemOS)
* [platform: TSystemOS](platform#TSystemOS)
 [TTabIter:](#TTabIter)
* [astalgo: TTabIter](astalgo#TTabIter)
 [TType:](#TType)
* [ast: TType](ast#TType)
 [TTypeAllowedFlag:](#TTypeAllowedFlag)
* [typeallowed: TTypeAllowedFlag](typeallowed#TTypeAllowedFlag)
 [TTypeAllowedFlags:](#TTypeAllowedFlags)
* [typeallowed: TTypeAllowedFlags](typeallowed#TTypeAllowedFlags)
 [TTypeAttachedOp:](#TTypeAttachedOp)
* [ast: TTypeAttachedOp](ast#TTypeAttachedOp)
 [TTypeCmpFlag:](#TTypeCmpFlag)
* [types: TTypeCmpFlag](types#TTypeCmpFlag)
 [TTypeCmpFlags:](#TTypeCmpFlags)
* [types: TTypeCmpFlags](types#TTypeCmpFlags)
 [TTypeFieldResult:](#TTypeFieldResult)
* [types: TTypeFieldResult](types#TTypeFieldResult)
 [TTypeFlag:](#TTypeFlag)
* [ast: TTypeFlag](ast#TTypeFlag)
 [TTypeFlags:](#TTypeFlags)
* [ast: TTypeFlags](ast#TTypeFlags)
 [TTypeIter:](#TTypeIter)
* [types: TTypeIter](types#TTypeIter)
 [TTypeKind:](#TTypeKind)
* [ast: TTypeKind](ast#TTypeKind)
 [TTypeKinds:](#TTypeKinds)
* [ast: TTypeKinds](ast#TTypeKinds)
 [TTypeMutator:](#TTypeMutator)
* [types: TTypeMutator](types#TTypeMutator)
 [TTypePredicate:](#TTypePredicate)
* [types: TTypePredicate](types#TTypePredicate)
 [TTypeRelation:](#TTypeRelation)
* [sigmatch: TTypeRelation](sigmatch#TTypeRelation)
 [TTypeRelFlag:](#TTypeRelFlag)
* [sigmatch: TTypeRelFlag](sigmatch#TTypeRelFlag)
 [TTypeRelFlags:](#TTypeRelFlags)
* [sigmatch: TTypeRelFlags](sigmatch#TTypeRelFlags)
 [TTypeSeq:](#TTypeSeq)
* [ast: TTypeSeq](ast#TTypeSeq)
* [cgendata: TTypeSeq](cgendata#TTypeSeq)
 [tyAlias:](#tyAlias)
* [TTypeKind.tyAlias](ast#tyAlias)
 [tyAnd:](#tyAnd)
* [TTypeKind.tyAnd](ast#tyAnd)
 [tyAnything:](#tyAnything)
* [TTypeKind.tyAnything](ast#tyAnything)
 [tyArray:](#tyArray)
* [TTypeKind.tyArray](ast#tyArray)
 [tyBool:](#tyBool)
* [TTypeKind.tyBool](ast#tyBool)
 [tyBuiltInTypeClass:](#tyBuiltInTypeClass)
* [TTypeKind.tyBuiltInTypeClass](ast#tyBuiltInTypeClass)
 [tyChar:](#tyChar)
* [TTypeKind.tyChar](ast#tyChar)
 [tyCompositeTypeClass:](#tyCompositeTypeClass)
* [TTypeKind.tyCompositeTypeClass](ast#tyCompositeTypeClass)
 [tyCString:](#tyCString)
* [TTypeKind.tyCString](ast#tyCString)
 [tyDistinct:](#tyDistinct)
* [TTypeKind.tyDistinct](ast#tyDistinct)
 [tyEmpty:](#tyEmpty)
* [TTypeKind.tyEmpty](ast#tyEmpty)
 [tyEnum:](#tyEnum)
* [TTypeKind.tyEnum](ast#tyEnum)
 [tyError:](#tyError)
* [ast: tyError](ast#tyError)
 [tyFloat:](#tyFloat)
* [TTypeKind.tyFloat](ast#tyFloat)
 [tyFloat128:](#tyFloat128)
* [TTypeKind.tyFloat128](ast#tyFloat128)
 [tyFloat32:](#tyFloat32)
* [TTypeKind.tyFloat32](ast#tyFloat32)
 [tyFloat64:](#tyFloat64)
* [TTypeKind.tyFloat64](ast#tyFloat64)
 [tyForward:](#tyForward)
* [TTypeKind.tyForward](ast#tyForward)
 [tyFromExpr:](#tyFromExpr)
* [TTypeKind.tyFromExpr](ast#tyFromExpr)
 [tyGenericBody:](#tyGenericBody)
* [TTypeKind.tyGenericBody](ast#tyGenericBody)
 [tyGenericInst:](#tyGenericInst)
* [TTypeKind.tyGenericInst](ast#tyGenericInst)
 [tyGenericInvocation:](#tyGenericInvocation)
* [TTypeKind.tyGenericInvocation](ast#tyGenericInvocation)
 [tyGenericLike:](#tyGenericLike)
* [sem: tyGenericLike](sem#tyGenericLike)
 [tyGenericParam:](#tyGenericParam)
* [TTypeKind.tyGenericParam](ast#tyGenericParam)
 [tyInferred:](#tyInferred)
* [TTypeKind.tyInferred](ast#tyInferred)
 [tyInt:](#tyInt)
* [TTypeKind.tyInt](ast#tyInt)
 [tyInt16:](#tyInt16)
* [TTypeKind.tyInt16](ast#tyInt16)
 [tyInt32:](#tyInt32)
* [TTypeKind.tyInt32](ast#tyInt32)
 [tyInt64:](#tyInt64)
* [TTypeKind.tyInt64](ast#tyInt64)
 [tyInt8:](#tyInt8)
* [TTypeKind.tyInt8](ast#tyInt8)
 [tyLent:](#tyLent)
* [TTypeKind.tyLent](ast#tyLent)
 [tyMagicGenerics:](#tyMagicGenerics)
* [sem: tyMagicGenerics](sem#tyMagicGenerics)
 [tyMetaTypes:](#tyMetaTypes)
* [ast: tyMetaTypes](ast#tyMetaTypes)
 [tyNil:](#tyNil)
* [TTypeKind.tyNil](ast#tyNil)
 [tyNone:](#tyNone)
* [TTypeKind.tyNone](ast#tyNone)
 [tyNot:](#tyNot)
* [TTypeKind.tyNot](ast#tyNot)
 [tyObject:](#tyObject)
* [TTypeKind.tyObject](ast#tyObject)
 [tyOpenArray:](#tyOpenArray)
* [TTypeKind.tyOpenArray](ast#tyOpenArray)
 [tyOptDeprecated:](#tyOptDeprecated)
* [TTypeKind.tyOptDeprecated](ast#tyOptDeprecated)
 [tyOr:](#tyOr)
* [TTypeKind.tyOr](ast#tyOr)
 [tyOrdinal:](#tyOrdinal)
* [TTypeKind.tyOrdinal](ast#tyOrdinal)
 [tyOwned:](#tyOwned)
* [TTypeKind.tyOwned](ast#tyOwned)
 [typeAllowed:](#typeAllowed)
* [typeallowed: typeAllowed(t: PType; kind: TSymKind; c: PContext; flags: TTypeAllowedFlags = {}): PType](typeallowed#typeAllowed%2CPType%2CTSymKind%2CPContext%2CTTypeAllowedFlags)
 [TypeCache:](#TypeCache)
* [cgendata: TypeCache](cgendata#TypeCache)
 [TypeCacheWithOwner:](#TypeCacheWithOwner)
* [cgendata: TypeCacheWithOwner](cgendata#TypeCacheWithOwner)
 [typeCompleted:](#typeCompleted)
* [ast: typeCompleted(s: PSym)](ast#typeCompleted.t%2CPSym)
 [typedescInst:](#typedescInst)
* [types: typedescInst](types#typedescInst)
 [typedescPtrs:](#typedescPtrs)
* [types: typedescPtrs](types#typedescPtrs)
 [typekinds:](#typekinds)
* [astalgo: typekinds(t: PType)](astalgo#typekinds%2CPType)
 [typeMismatch:](#typeMismatch)
* [types: typeMismatch(conf: ConfigRef; info: TLineInfo; formal, actual: PType)](types#typeMismatch%2CConfigRef%2CTLineInfo%2CPType%2CPType)
 [typePragmas:](#typePragmas)
* [pragmas: typePragmas](pragmas#typePragmas)
 [typeRel:](#typeRel)
* [sigmatch: typeRel(c: var TCandidate; f, aOrig: PType; flags: TTypeRelFlags = {}): TTypeRelation](sigmatch#typeRel%2CTCandidate%2CPType%2CPType%2CTTypeRelFlags)
 [typeToString:](#typeToString)
* [types: typeToString(typ: PType; prefer: TPreferedDesc = preferName): string](types#typeToString%2CPType%2CTPreferedDesc)
 [typeToYaml:](#typeToYaml)
* [astalgo: typeToYaml(conf: ConfigRef; n: PType; indent: int = 0; maxRecDepth: int = -1): Rope](astalgo#typeToYaml%2CConfigRef%2CPType%2Cint%2Cint)
 [tyPointer:](#tyPointer)
* [TTypeKind.tyPointer](ast#tyPointer)
 [tyProc:](#tyProc)
* [TTypeKind.tyProc](ast#tyProc)
 [tyProxy:](#tyProxy)
* [TTypeKind.tyProxy](ast#tyProxy)
 [tyPtr:](#tyPtr)
* [TTypeKind.tyPtr](ast#tyPtr)
 [tyPureObject:](#tyPureObject)
* [ast: tyPureObject](ast#tyPureObject)
 [tyRange:](#tyRange)
* [TTypeKind.tyRange](ast#tyRange)
 [tyRef:](#tyRef)
* [TTypeKind.tyRef](ast#tyRef)
 [tySequence:](#tySequence)
* [TTypeKind.tySequence](ast#tySequence)
 [tySet:](#tySet)
* [TTypeKind.tySet](ast#tySet)
 [tySink:](#tySink)
* [TTypeKind.tySink](ast#tySink)
 [tyStatic:](#tyStatic)
* [TTypeKind.tyStatic](ast#tyStatic)
 [tyString:](#tyString)
* [TTypeKind.tyString](ast#tyString)
 [tyTuple:](#tyTuple)
* [TTypeKind.tyTuple](ast#tyTuple)
 [tyTypeClasses:](#tyTypeClasses)
* [ast: tyTypeClasses](ast#tyTypeClasses)
 [tyTyped:](#tyTyped)
* [TTypeKind.tyTyped](ast#tyTyped)
 [tyTypeDesc:](#tyTypeDesc)
* [TTypeKind.tyTypeDesc](ast#tyTypeDesc)
 [tyUInt:](#tyUInt)
* [TTypeKind.tyUInt](ast#tyUInt)
 [tyUInt16:](#tyUInt16)
* [TTypeKind.tyUInt16](ast#tyUInt16)
 [tyUInt32:](#tyUInt32)
* [TTypeKind.tyUInt32](ast#tyUInt32)
 [tyUInt64:](#tyUInt64)
* [TTypeKind.tyUInt64](ast#tyUInt64)
 [tyUInt8:](#tyUInt8)
* [TTypeKind.tyUInt8](ast#tyUInt8)
 [tyUncheckedArray:](#tyUncheckedArray)
* [TTypeKind.tyUncheckedArray](ast#tyUncheckedArray)
 [tyUnknown:](#tyUnknown)
* [ast: tyUnknown](ast#tyUnknown)
 [tyUnknownTypes:](#tyUnknownTypes)
* [ast: tyUnknownTypes](ast#tyUnknownTypes)
 [tyUntyped:](#tyUntyped)
* [TTypeKind.tyUntyped](ast#tyUntyped)
 [tyUserDefinedGenerics:](#tyUserDefinedGenerics)
* [sem: tyUserDefinedGenerics](sem#tyUserDefinedGenerics)
 [tyUserTypeClass:](#tyUserTypeClass)
* [TTypeKind.tyUserTypeClass](ast#tyUserTypeClass)
 [tyUserTypeClasses:](#tyUserTypeClasses)
* [ast: tyUserTypeClasses](ast#tyUserTypeClasses)
 [tyUserTypeClassInst:](#tyUserTypeClassInst)
* [TTypeKind.tyUserTypeClassInst](ast#tyUserTypeClassInst)
 [tyVar:](#tyVar)
* [TTypeKind.tyVar](ast#tyVar)
 [tyVarargs:](#tyVarargs)
* [TTypeKind.tyVarargs](ast#tyVarargs)
 [tyVoid:](#tyVoid)
* [TTypeKind.tyVoid](ast#tyVoid)
 [undefSymbol:](#undefSymbol)
* [condsyms: undefSymbol(symbols: StringTableRef; symbol: string)](condsyms#undefSymbol%2CStringTableRef%2Cstring)
 [unionSets:](#unionSets)
* [nimsets: unionSets(conf: ConfigRef; a, b: PNode): PNode](nimsets#unionSets%2CConfigRef%2CPNode%2CPNode)
 [unknownLineInfo:](#unknownLineInfo)
* [lineinfos: unknownLineInfo](lineinfos#unknownLineInfo)
 [UnknownLockLevel:](#UnknownLockLevel)
* [ast: UnknownLockLevel](ast#UnknownLockLevel)
 [UnspecifiedLockLevel:](#UnspecifiedLockLevel)
* [ast: UnspecifiedLockLevel](ast#UnspecifiedLockLevel)
 [upName:](#upName)
* [lambdalifting: upName](lambdalifting#upName)
 [use:](#use)
* [InstrKind.use](dfa#use)
 [useEffectSystem:](#useEffectSystem)
* [options: useEffectSystem](options#useEffectSystem)
 [usesThreadVars:](#usesThreadVars)
* [CodegenFlag.usesThreadVars](cgendata#usesThreadVars)
 [usesWriteBarrier:](#usesWriteBarrier)
* [options: usesWriteBarrier(conf: ConfigRef): bool](options#usesWriteBarrier%2CConfigRef)
 [useWriteTracking:](#useWriteTracking)
* [options: useWriteTracking](options#useWriteTracking)
 [v2Sf:](#v2Sf)
* [SymbolFilesOption.v2Sf](options#v2Sf)
 [varPragmas:](#varPragmas)
* [pragmas: varPragmas](pragmas#varPragmas)
 [verbosePass:](#verbosePass)
* [passaux: verbosePass](passaux#verbosePass)
 [Version:](#Version)
* [nimblecmd: Version](nimblecmd#Version)
 [VersionAsString:](#VersionAsString)
* [nversion: VersionAsString](nversion#VersionAsString)
 [views:](#views)
* [Feature.views](options#views)
 [ViewTypeKind:](#ViewTypeKind)
* [typeallowed: ViewTypeKind](typeallowed#ViewTypeKind)
 [VmArgs:](#VmArgs)
* [vmdef: VmArgs](vmdef#VmArgs)
 [VmCallback:](#VmCallback)
* [vmdef: VmCallback](vmdef#VmCallback)
 [vmopsDanger:](#vmopsDanger)
* [Feature.vmopsDanger](options#vmopsDanger)
 [VT:](#VT)
* [nimlexbase: VT](nimlexbase#VT)
 [wAcyclic:](#wAcyclic)
* [TSpecialWord.wAcyclic](wordrecg#wAcyclic)
 [wAddr:](#wAddr)
* [TSpecialWord.wAddr](wordrecg#wAddr)
 [wAlign:](#wAlign)
* [TSpecialWord.wAlign](wordrecg#wAlign)
 [wAlignas:](#wAlignas)
* [TSpecialWord.wAlignas](wordrecg#wAlignas)
 [wAlignof:](#wAlignof)
* [TSpecialWord.wAlignof](wordrecg#wAlignof)
 [walk:](#walk)
* [sourcemap: walk(node: SourceNode; fn: proc (line: string; original: SourceNode))](sourcemap#walk%2CSourceNode%2Cproc%28string%2CSourceNode%29)
 [walkScopes:](#walkScopes)
* [lookups: walkScopes(scope: PScope): PScope](lookups#walkScopes.i%2CPScope)
 [wAnd:](#wAnd)
* [TSpecialWord.wAnd](wordrecg#wAnd)
 [wantMainModule:](#wantMainModule)
* [modules: wantMainModule(conf: ConfigRef)](modules#wantMainModule%2CConfigRef)
 [warnCannotOpenFile:](#warnCannotOpenFile)
* [TMsgKind.warnCannotOpenFile](lineinfos#warnCannotOpenFile)
 [warnCaseTransition:](#warnCaseTransition)
* [TMsgKind.warnCaseTransition](lineinfos#warnCaseTransition)
 [warnCommentXIgnored:](#warnCommentXIgnored)
* [TMsgKind.warnCommentXIgnored](lineinfos#warnCommentXIgnored)
 [warnConfigDeprecated:](#warnConfigDeprecated)
* [TMsgKind.warnConfigDeprecated](lineinfos#warnConfigDeprecated)
 [warnCycleCreated:](#warnCycleCreated)
* [TMsgKind.warnCycleCreated](lineinfos#warnCycleCreated)
 [warnDeprecated:](#warnDeprecated)
* [TMsgKind.warnDeprecated](lineinfos#warnDeprecated)
 [warnDestructor:](#warnDestructor)
* [TMsgKind.warnDestructor](lineinfos#warnDestructor)
 [warnEachIdentIsTuple:](#warnEachIdentIsTuple)
* [TMsgKind.warnEachIdentIsTuple](lineinfos#warnEachIdentIsTuple)
 [warnFieldXNotSupported:](#warnFieldXNotSupported)
* [TMsgKind.warnFieldXNotSupported](lineinfos#warnFieldXNotSupported)
 [warnGcMem:](#warnGcMem)
* [TMsgKind.warnGcMem](lineinfos#warnGcMem)
 [warnGcUnsafe:](#warnGcUnsafe)
* [TMsgKind.warnGcUnsafe](lineinfos#warnGcUnsafe)
 [warnGcUnsafe2:](#warnGcUnsafe2)
* [TMsgKind.warnGcUnsafe2](lineinfos#warnGcUnsafe2)
 [warnInconsistentSpacing:](#warnInconsistentSpacing)
* [TMsgKind.warnInconsistentSpacing](lineinfos#warnInconsistentSpacing)
 [warnInheritFromException:](#warnInheritFromException)
* [TMsgKind.warnInheritFromException](lineinfos#warnInheritFromException)
 [warnLanguageXNotSupported:](#warnLanguageXNotSupported)
* [TMsgKind.warnLanguageXNotSupported](lineinfos#warnLanguageXNotSupported)
 [warnLockLevel:](#warnLockLevel)
* [TMsgKind.warnLockLevel](lineinfos#warnLockLevel)
 [warnMax:](#warnMax)
* [lineinfos: warnMax](lineinfos#warnMax)
 [warnMin:](#warnMin)
* [lineinfos: warnMin](lineinfos#warnMin)
 [warnObservableStores:](#warnObservableStores)
* [TMsgKind.warnObservableStores](lineinfos#warnObservableStores)
 [warnOctalEscape:](#warnOctalEscape)
* [TMsgKind.warnOctalEscape](lineinfos#warnOctalEscape)
 [warnProveField:](#warnProveField)
* [TMsgKind.warnProveField](lineinfos#warnProveField)
 [warnProveIndex:](#warnProveIndex)
* [TMsgKind.warnProveIndex](lineinfos#warnProveIndex)
 [warnProveInit:](#warnProveInit)
* [TMsgKind.warnProveInit](lineinfos#warnProveInit)
 [warnRedefinitionOfLabel:](#warnRedefinitionOfLabel)
* [TMsgKind.warnRedefinitionOfLabel](lineinfos#warnRedefinitionOfLabel)
 [warnResultShadowed:](#warnResultShadowed)
* [TMsgKind.warnResultShadowed](lineinfos#warnResultShadowed)
 [warnResultUsed:](#warnResultUsed)
* [TMsgKind.warnResultUsed](lineinfos#warnResultUsed)
 [warnSmallLshouldNotBeUsed:](#warnSmallLshouldNotBeUsed)
* [TMsgKind.warnSmallLshouldNotBeUsed](lineinfos#warnSmallLshouldNotBeUsed)
 [warnStaticIndexCheck:](#warnStaticIndexCheck)
* [TMsgKind.warnStaticIndexCheck](lineinfos#warnStaticIndexCheck)
 [warnTypelessParam:](#warnTypelessParam)
* [TMsgKind.warnTypelessParam](lineinfos#warnTypelessParam)
 [warnUninit:](#warnUninit)
* [TMsgKind.warnUninit](lineinfos#warnUninit)
 [warnUnknownMagic:](#warnUnknownMagic)
* [TMsgKind.warnUnknownMagic](lineinfos#warnUnknownMagic)
 [warnUnknownSubstitutionX:](#warnUnknownSubstitutionX)
* [TMsgKind.warnUnknownSubstitutionX](lineinfos#warnUnknownSubstitutionX)
 [warnUnreachableCode:](#warnUnreachableCode)
* [TMsgKind.warnUnreachableCode](lineinfos#warnUnreachableCode)
 [warnUnreachableElse:](#warnUnreachableElse)
* [TMsgKind.warnUnreachableElse](lineinfos#warnUnreachableElse)
 [warnUnsafeCode:](#warnUnsafeCode)
* [TMsgKind.warnUnsafeCode](lineinfos#warnUnsafeCode)
 [warnUnsafeDefault:](#warnUnsafeDefault)
* [TMsgKind.warnUnsafeDefault](lineinfos#warnUnsafeDefault)
 [warnUnsafeSetLen:](#warnUnsafeSetLen)
* [TMsgKind.warnUnsafeSetLen](lineinfos#warnUnsafeSetLen)
 [warnUnusedImportX:](#warnUnusedImportX)
* [TMsgKind.warnUnusedImportX](lineinfos#warnUnusedImportX)
 [warnUseBase:](#warnUseBase)
* [TMsgKind.warnUseBase](lineinfos#warnUseBase)
 [warnUser:](#warnUser)
* [TMsgKind.warnUser](lineinfos#warnUser)
 [warnWriteToForeignHeap:](#warnWriteToForeignHeap)
* [TMsgKind.warnWriteToForeignHeap](lineinfos#warnWriteToForeignHeap)
 [warnXIsNeverRead:](#warnXIsNeverRead)
* [TMsgKind.warnXIsNeverRead](lineinfos#warnXIsNeverRead)
 [warnXmightNotBeenInit:](#warnXmightNotBeenInit)
* [TMsgKind.warnXmightNotBeenInit](lineinfos#warnXmightNotBeenInit)
 [wAs:](#wAs)
* [TSpecialWord.wAs](wordrecg#wAs)
 [wAsm:](#wAsm)
* [TSpecialWord.wAsm](wordrecg#wAsm)
 [wAsmNoStackFrame:](#wAsmNoStackFrame)
* [TSpecialWord.wAsmNoStackFrame](wordrecg#wAsmNoStackFrame)
 [wAssert:](#wAssert)
* [TSpecialWord.wAssert](wordrecg#wAssert)
 [wAssertions:](#wAssertions)
* [TSpecialWord.wAssertions](wordrecg#wAssertions)
 [wAssume:](#wAssume)
* [TSpecialWord.wAssume](wordrecg#wAssume)
 [wAuto:](#wAuto)
* [TSpecialWord.wAuto](wordrecg#wAuto)
 [wBase:](#wBase)
* [TSpecialWord.wBase](wordrecg#wBase)
 [wBind:](#wBind)
* [TSpecialWord.wBind](wordrecg#wBind)
 [wBitsize:](#wBitsize)
* [TSpecialWord.wBitsize](wordrecg#wBitsize)
 [wBlock:](#wBlock)
* [TSpecialWord.wBlock](wordrecg#wBlock)
 [wBool:](#wBool)
* [TSpecialWord.wBool](wordrecg#wBool)
 [wBoolDefine:](#wBoolDefine)
* [TSpecialWord.wBoolDefine](wordrecg#wBoolDefine)
 [wBorrow:](#wBorrow)
* [TSpecialWord.wBorrow](wordrecg#wBorrow)
 [wBoundChecks:](#wBoundChecks)
* [TSpecialWord.wBoundChecks](wordrecg#wBoundChecks)
 [wBreak:](#wBreak)
* [TSpecialWord.wBreak](wordrecg#wBreak)
 [wByCopy:](#wByCopy)
* [TSpecialWord.wByCopy](wordrecg#wByCopy)
 [wByRef:](#wByRef)
* [TSpecialWord.wByRef](wordrecg#wByRef)
 [wCallconv:](#wCallconv)
* [TSpecialWord.wCallconv](wordrecg#wCallconv)
 [wCase:](#wCase)
* [TSpecialWord.wCase](wordrecg#wCase)
 [wCast:](#wCast)
* [TSpecialWord.wCast](wordrecg#wCast)
 [wCatch:](#wCatch)
* [TSpecialWord.wCatch](wordrecg#wCatch)
 [wCdecl:](#wCdecl)
* [TSpecialWord.wCdecl](wordrecg#wCdecl)
 [wChar:](#wChar)
* [TSpecialWord.wChar](wordrecg#wChar)
 [wChar16\_t:](#wChar16_t)
* [TSpecialWord.wChar16\_t](wordrecg#wChar16_t)
 [wChar32\_t:](#wChar32_t)
* [TSpecialWord.wChar32\_t](wordrecg#wChar32_t)
 [wChecks:](#wChecks)
* [TSpecialWord.wChecks](wordrecg#wChecks)
 [wClass:](#wClass)
* [TSpecialWord.wClass](wordrecg#wClass)
 [wClosure:](#wClosure)
* [TSpecialWord.wClosure](wordrecg#wClosure)
 [wCodegenDecl:](#wCodegenDecl)
* [TSpecialWord.wCodegenDecl](wordrecg#wCodegenDecl)
 [wColon:](#wColon)
* [TSpecialWord.wColon](wordrecg#wColon)
 [wColonColon:](#wColonColon)
* [TSpecialWord.wColonColon](wordrecg#wColonColon)
 [wCompile:](#wCompile)
* [TSpecialWord.wCompile](wordrecg#wCompile)
 [wCompilerProc:](#wCompilerProc)
* [TSpecialWord.wCompilerProc](wordrecg#wCompilerProc)
 [wCompileTime:](#wCompileTime)
* [TSpecialWord.wCompileTime](wordrecg#wCompileTime)
 [wCompl:](#wCompl)
* [TSpecialWord.wCompl](wordrecg#wCompl)
 [wCompleteStruct:](#wCompleteStruct)
* [TSpecialWord.wCompleteStruct](wordrecg#wCompleteStruct)
 [wComputedGoto:](#wComputedGoto)
* [TSpecialWord.wComputedGoto](wordrecg#wComputedGoto)
 [wConcept:](#wConcept)
* [TSpecialWord.wConcept](wordrecg#wConcept)
 [wConst:](#wConst)
* [TSpecialWord.wConst](wordrecg#wConst)
 [wConst\_cast:](#wConst_cast)
* [TSpecialWord.wConst\_cast](wordrecg#wConst_cast)
 [wConstexpr:](#wConstexpr)
* [TSpecialWord.wConstexpr](wordrecg#wConstexpr)
 [wConstructor:](#wConstructor)
* [TSpecialWord.wConstructor](wordrecg#wConstructor)
 [wContinue:](#wContinue)
* [TSpecialWord.wContinue](wordrecg#wContinue)
 [wConverter:](#wConverter)
* [TSpecialWord.wConverter](wordrecg#wConverter)
 [wCore:](#wCore)
* [TSpecialWord.wCore](wordrecg#wCore)
 [wCursor:](#wCursor)
* [TSpecialWord.wCursor](wordrecg#wCursor)
 [wDeadCodeElimUnused:](#wDeadCodeElimUnused)
* [TSpecialWord.wDeadCodeElimUnused](wordrecg#wDeadCodeElimUnused)
 [wDebugger:](#wDebugger)
* [TSpecialWord.wDebugger](wordrecg#wDebugger)
 [wDecltype:](#wDecltype)
* [TSpecialWord.wDecltype](wordrecg#wDecltype)
 [wDefault:](#wDefault)
* [TSpecialWord.wDefault](wordrecg#wDefault)
 [wDefer:](#wDefer)
* [TSpecialWord.wDefer](wordrecg#wDefer)
 [wDefine:](#wDefine)
* [TSpecialWord.wDefine](wordrecg#wDefine)
 [wDelegator:](#wDelegator)
* [TSpecialWord.wDelegator](wordrecg#wDelegator)
 [wDelete:](#wDelete)
* [TSpecialWord.wDelete](wordrecg#wDelete)
 [wDeprecated:](#wDeprecated)
* [TSpecialWord.wDeprecated](wordrecg#wDeprecated)
 [wDestructor:](#wDestructor)
* [TSpecialWord.wDestructor](wordrecg#wDestructor)
 [wDirty:](#wDirty)
* [TSpecialWord.wDirty](wordrecg#wDirty)
 [wDiscard:](#wDiscard)
* [TSpecialWord.wDiscard](wordrecg#wDiscard)
 [wDiscardable:](#wDiscardable)
* [TSpecialWord.wDiscardable](wordrecg#wDiscardable)
 [wDistinct:](#wDistinct)
* [TSpecialWord.wDistinct](wordrecg#wDistinct)
 [wDiv:](#wDiv)
* [TSpecialWord.wDiv](wordrecg#wDiv)
 [wDo:](#wDo)
* [TSpecialWord.wDo](wordrecg#wDo)
 [wDot:](#wDot)
* [TSpecialWord.wDot](wordrecg#wDot)
 [wDotDot:](#wDotDot)
* [TSpecialWord.wDotDot](wordrecg#wDotDot)
 [wDouble:](#wDouble)
* [TSpecialWord.wDouble](wordrecg#wDouble)
 [wDynamic\_cast:](#wDynamic_cast)
* [TSpecialWord.wDynamic\_cast](wordrecg#wDynamic_cast)
 [wDynlib:](#wDynlib)
* [TSpecialWord.wDynlib](wordrecg#wDynlib)
 [weakLeValue:](#weakLeValue)
* [astalgo: weakLeValue(a, b: PNode): TImplication](astalgo#weakLeValue%2CPNode%2CPNode)
 [wEffects:](#wEffects)
* [TSpecialWord.wEffects](wordrecg#wEffects)
 [wElif:](#wElif)
* [TSpecialWord.wElif](wordrecg#wElif)
 [wElse:](#wElse)
* [TSpecialWord.wElse](wordrecg#wElse)
 [wEmit:](#wEmit)
* [TSpecialWord.wEmit](wordrecg#wEmit)
 [wEnd:](#wEnd)
* [TSpecialWord.wEnd](wordrecg#wEnd)
 [wEnsures:](#wEnsures)
* [TSpecialWord.wEnsures](wordrecg#wEnsures)
 [wEnum:](#wEnum)
* [TSpecialWord.wEnum](wordrecg#wEnum)
 [wEquals:](#wEquals)
* [TSpecialWord.wEquals](wordrecg#wEquals)
 [wError:](#wError)
* [TSpecialWord.wError](wordrecg#wError)
 [wExcept:](#wExcept)
* [TSpecialWord.wExcept](wordrecg#wExcept)
 [wExecuteOnReload:](#wExecuteOnReload)
* [TSpecialWord.wExecuteOnReload](wordrecg#wExecuteOnReload)
 [wExperimental:](#wExperimental)
* [TSpecialWord.wExperimental](wordrecg#wExperimental)
 [wExplain:](#wExplain)
* [TSpecialWord.wExplain](wordrecg#wExplain)
 [wExplicit:](#wExplicit)
* [TSpecialWord.wExplicit](wordrecg#wExplicit)
 [wExport:](#wExport)
* [TSpecialWord.wExport](wordrecg#wExport)
 [wExportc:](#wExportc)
* [TSpecialWord.wExportc](wordrecg#wExportc)
 [wExportCpp:](#wExportCpp)
* [TSpecialWord.wExportCpp](wordrecg#wExportCpp)
 [wExportNims:](#wExportNims)
* [TSpecialWord.wExportNims](wordrecg#wExportNims)
 [wExtern:](#wExtern)
* [TSpecialWord.wExtern](wordrecg#wExtern)
 [wFalse:](#wFalse)
* [TSpecialWord.wFalse](wordrecg#wFalse)
 [wFastcall:](#wFastcall)
* [TSpecialWord.wFastcall](wordrecg#wFastcall)
 [wFatal:](#wFatal)
* [TSpecialWord.wFatal](wordrecg#wFatal)
 [wFieldChecks:](#wFieldChecks)
* [TSpecialWord.wFieldChecks](wordrecg#wFieldChecks)
 [wFinal:](#wFinal)
* [TSpecialWord.wFinal](wordrecg#wFinal)
 [wFinally:](#wFinally)
* [TSpecialWord.wFinally](wordrecg#wFinally)
 [wFloat:](#wFloat)
* [TSpecialWord.wFloat](wordrecg#wFloat)
 [wFloatChecks:](#wFloatChecks)
* [TSpecialWord.wFloatChecks](wordrecg#wFloatChecks)
 [wFor:](#wFor)
* [TSpecialWord.wFor](wordrecg#wFor)
 [wFriend:](#wFriend)
* [TSpecialWord.wFriend](wordrecg#wFriend)
 [wFrom:](#wFrom)
* [TSpecialWord.wFrom](wordrecg#wFrom)
 [wFunc:](#wFunc)
* [TSpecialWord.wFunc](wordrecg#wFunc)
 [wGcSafe:](#wGcSafe)
* [TSpecialWord.wGcSafe](wordrecg#wGcSafe)
 [wGensym:](#wGensym)
* [TSpecialWord.wGensym](wordrecg#wGensym)
 [wGlobal:](#wGlobal)
* [TSpecialWord.wGlobal](wordrecg#wGlobal)
 [wGoto:](#wGoto)
* [TSpecialWord.wGoto](wordrecg#wGoto)
 [wGuard:](#wGuard)
* [TSpecialWord.wGuard](wordrecg#wGuard)
 [wHeader:](#wHeader)
* [TSpecialWord.wHeader](wordrecg#wHeader)
 [whichAlias:](#whichAlias)
* [parampatterns: whichAlias(p: PSym): TAliasRequest](parampatterns#whichAlias%2CPSym)
 [whichKeyword:](#whichKeyword)
* [idents: whichKeyword(id: PIdent): TSpecialWord](idents#whichKeyword%2CPIdent)
 [whichPragma:](#whichPragma)
* [trees: whichPragma(n: PNode): TSpecialWord](trees#whichPragma%2CPNode)
 [wHint:](#wHint)
* [TSpecialWord.wHint](wordrecg#wHint)
 [wHints:](#wHints)
* [TSpecialWord.wHints](wordrecg#wHints)
 [wIf:](#wIf)
* [TSpecialWord.wIf](wordrecg#wIf)
 [wImmediate:](#wImmediate)
* [TSpecialWord.wImmediate](wordrecg#wImmediate)
 [wImplicitStatic:](#wImplicitStatic)
* [TSpecialWord.wImplicitStatic](wordrecg#wImplicitStatic)
 [wImport:](#wImport)
* [TSpecialWord.wImport](wordrecg#wImport)
 [wImportc:](#wImportc)
* [TSpecialWord.wImportc](wordrecg#wImportc)
 [wImportCompilerProc:](#wImportCompilerProc)
* [TSpecialWord.wImportCompilerProc](wordrecg#wImportCompilerProc)
 [wImportCpp:](#wImportCpp)
* [TSpecialWord.wImportCpp](wordrecg#wImportCpp)
 [wImportJs:](#wImportJs)
* [TSpecialWord.wImportJs](wordrecg#wImportJs)
 [wImportObjC:](#wImportObjC)
* [TSpecialWord.wImportObjC](wordrecg#wImportObjC)
 [wIn:](#wIn)
* [TSpecialWord.wIn](wordrecg#wIn)
 [wInclude:](#wInclude)
* [TSpecialWord.wInclude](wordrecg#wInclude)
 [wIncompleteStruct:](#wIncompleteStruct)
* [TSpecialWord.wIncompleteStruct](wordrecg#wIncompleteStruct)
 [wInfChecks:](#wInfChecks)
* [TSpecialWord.wInfChecks](wordrecg#wInfChecks)
 [wInheritable:](#wInheritable)
* [TSpecialWord.wInheritable](wordrecg#wInheritable)
 [wInject:](#wInject)
* [TSpecialWord.wInject](wordrecg#wInject)
 [wInjectStmt:](#wInjectStmt)
* [TSpecialWord.wInjectStmt](wordrecg#wInjectStmt)
 [wInline:](#wInline)
* [TSpecialWord.wInline](wordrecg#wInline)
 [wInOut:](#wInOut)
* [TSpecialWord.wInOut](wordrecg#wInOut)
 [wInt:](#wInt)
* [TSpecialWord.wInt](wordrecg#wInt)
 [wIntDefine:](#wIntDefine)
* [TSpecialWord.wIntDefine](wordrecg#wIntDefine)
 [wInterface:](#wInterface)
* [TSpecialWord.wInterface](wordrecg#wInterface)
 [wInvalid:](#wInvalid)
* [TSpecialWord.wInvalid](wordrecg#wInvalid)
 [wInvariant:](#wInvariant)
* [TSpecialWord.wInvariant](wordrecg#wInvariant)
 [wIs:](#wIs)
* [TSpecialWord.wIs](wordrecg#wIs)
 [wIsnot:](#wIsnot)
* [TSpecialWord.wIsnot](wordrecg#wIsnot)
 [wIterator:](#wIterator)
* [TSpecialWord.wIterator](wordrecg#wIterator)
 [withInfo:](#withInfo)
* [ast: withInfo(n: PNode; info: TLineInfo): PNode](ast#withInfo%2CPNode%2CTLineInfo)
 [withPackageName:](#withPackageName)
* [options: withPackageName(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile](options#withPackageName%2CConfigRef%2CAbsoluteFile)
 [wLet:](#wLet)
* [TSpecialWord.wLet](wordrecg#wLet)
 [wLib:](#wLib)
* [TSpecialWord.wLib](wordrecg#wLib)
 [wLiftLocals:](#wLiftLocals)
* [TSpecialWord.wLiftLocals](wordrecg#wLiftLocals)
 [wLine:](#wLine)
* [TSpecialWord.wLine](wordrecg#wLine)
 [wLinearScanEnd:](#wLinearScanEnd)
* [TSpecialWord.wLinearScanEnd](wordrecg#wLinearScanEnd)
 [wLineDir:](#wLineDir)
* [TSpecialWord.wLineDir](wordrecg#wLineDir)
 [wLineTrace:](#wLineTrace)
* [TSpecialWord.wLineTrace](wordrecg#wLineTrace)
 [wLink:](#wLink)
* [TSpecialWord.wLink](wordrecg#wLink)
 [wLinksys:](#wLinksys)
* [TSpecialWord.wLinksys](wordrecg#wLinksys)
 [wLocalPassc:](#wLocalPassc)
* [TSpecialWord.wLocalPassc](wordrecg#wLocalPassc)
 [wLocks:](#wLocks)
* [TSpecialWord.wLocks](wordrecg#wLocks)
 [wLong:](#wLong)
* [TSpecialWord.wLong](wordrecg#wLong)
 [wMacro:](#wMacro)
* [TSpecialWord.wMacro](wordrecg#wMacro)
 [wMagic:](#wMagic)
* [TSpecialWord.wMagic](wordrecg#wMagic)
 [wMemTracker:](#wMemTracker)
* [TSpecialWord.wMemTracker](wordrecg#wMemTracker)
 [wMerge:](#wMerge)
* [TSpecialWord.wMerge](wordrecg#wMerge)
 [wMethod:](#wMethod)
* [TSpecialWord.wMethod](wordrecg#wMethod)
 [wMinus:](#wMinus)
* [TSpecialWord.wMinus](wordrecg#wMinus)
 [wMixin:](#wMixin)
* [TSpecialWord.wMixin](wordrecg#wMixin)
 [wMod:](#wMod)
* [TSpecialWord.wMod](wordrecg#wMod)
 [wMutable:](#wMutable)
* [TSpecialWord.wMutable](wordrecg#wMutable)
 [wNamespace:](#wNamespace)
* [TSpecialWord.wNamespace](wordrecg#wNamespace)
 [wNanChecks:](#wNanChecks)
* [TSpecialWord.wNanChecks](wordrecg#wNanChecks)
 [wNew:](#wNew)
* [TSpecialWord.wNew](wordrecg#wNew)
 [wNil:](#wNil)
* [TSpecialWord.wNil](wordrecg#wNil)
 [wNilChecks:](#wNilChecks)
* [TSpecialWord.wNilChecks](wordrecg#wNilChecks)
 [wNimcall:](#wNimcall)
* [TSpecialWord.wNimcall](wordrecg#wNimcall)
 [wNoalias:](#wNoalias)
* [TSpecialWord.wNoalias](wordrecg#wNoalias)
 [wNoconv:](#wNoconv)
* [TSpecialWord.wNoconv](wordrecg#wNoconv)
 [wNodecl:](#wNodecl)
* [TSpecialWord.wNodecl](wordrecg#wNodecl)
 [wNoDestroy:](#wNoDestroy)
* [TSpecialWord.wNoDestroy](wordrecg#wNoDestroy)
 [wNoexcept:](#wNoexcept)
* [TSpecialWord.wNoexcept](wordrecg#wNoexcept)
 [wNoForward:](#wNoForward)
* [TSpecialWord.wNoForward](wordrecg#wNoForward)
 [wNoInit:](#wNoInit)
* [TSpecialWord.wNoInit](wordrecg#wNoInit)
 [wNoInline:](#wNoInline)
* [TSpecialWord.wNoInline](wordrecg#wNoInline)
 [wNonReloadable:](#wNonReloadable)
* [TSpecialWord.wNonReloadable](wordrecg#wNonReloadable)
 [wNoreturn:](#wNoreturn)
* [TSpecialWord.wNoreturn](wordrecg#wNoreturn)
 [wNoRewrite:](#wNoRewrite)
* [TSpecialWord.wNoRewrite](wordrecg#wNoRewrite)
 [wNoSideEffect:](#wNoSideEffect)
* [TSpecialWord.wNoSideEffect](wordrecg#wNoSideEffect)
 [wNosinks:](#wNosinks)
* [TSpecialWord.wNosinks](wordrecg#wNosinks)
 [wNot:](#wNot)
* [TSpecialWord.wNot](wordrecg#wNot)
 [wNotin:](#wNotin)
* [TSpecialWord.wNotin](wordrecg#wNotin)
 [wNullptr:](#wNullptr)
* [TSpecialWord.wNullptr](wordrecg#wNullptr)
 [wObjChecks:](#wObjChecks)
* [TSpecialWord.wObjChecks](wordrecg#wObjChecks)
 [wObject:](#wObject)
* [TSpecialWord.wObject](wordrecg#wObject)
 [wOf:](#wOf)
* [TSpecialWord.wOf](wordrecg#wOf)
 [wOff:](#wOff)
* [TSpecialWord.wOff](wordrecg#wOff)
 [wOn:](#wOn)
* [TSpecialWord.wOn](wordrecg#wOn)
 [wOneWay:](#wOneWay)
* [TSpecialWord.wOneWay](wordrecg#wOneWay)
 [wOperator:](#wOperator)
* [TSpecialWord.wOperator](wordrecg#wOperator)
 [wOptimization:](#wOptimization)
* [TSpecialWord.wOptimization](wordrecg#wOptimization)
 [wOr:](#wOr)
* [TSpecialWord.wOr](wordrecg#wOr)
 [wordExcess:](#wordExcess)
* [vmdef: wordExcess](vmdef#wordExcess)
 [wOut:](#wOut)
* [TSpecialWord.wOut](wordrecg#wOut)
 [wOverflowChecks:](#wOverflowChecks)
* [TSpecialWord.wOverflowChecks](wordrecg#wOverflowChecks)
 [wOverride:](#wOverride)
* [TSpecialWord.wOverride](wordrecg#wOverride)
 [wPackage:](#wPackage)
* [TSpecialWord.wPackage](wordrecg#wPackage)
 [wPacked:](#wPacked)
* [TSpecialWord.wPacked](wordrecg#wPacked)
 [wPartial:](#wPartial)
* [TSpecialWord.wPartial](wordrecg#wPartial)
 [wPassc:](#wPassc)
* [TSpecialWord.wPassc](wordrecg#wPassc)
 [wPassl:](#wPassl)
* [TSpecialWord.wPassl](wordrecg#wPassl)
 [wPatterns:](#wPatterns)
* [TSpecialWord.wPatterns](wordrecg#wPatterns)
 [wPop:](#wPop)
* [TSpecialWord.wPop](wordrecg#wPop)
 [wPragma:](#wPragma)
* [TSpecialWord.wPragma](wordrecg#wPragma)
 [wPrivate:](#wPrivate)
* [TSpecialWord.wPrivate](wordrecg#wPrivate)
 [wProc:](#wProc)
* [TSpecialWord.wProc](wordrecg#wProc)
 [wProcVar:](#wProcVar)
* [TSpecialWord.wProcVar](wordrecg#wProcVar)
 [wProfiler:](#wProfiler)
* [TSpecialWord.wProfiler](wordrecg#wProfiler)
 [wProtected:](#wProtected)
* [TSpecialWord.wProtected](wordrecg#wProtected)
 [wPtr:](#wPtr)
* [TSpecialWord.wPtr](wordrecg#wPtr)
 [wPublic:](#wPublic)
* [TSpecialWord.wPublic](wordrecg#wPublic)
 [wPure:](#wPure)
* [TSpecialWord.wPure](wordrecg#wPure)
 [wPush:](#wPush)
* [TSpecialWord.wPush](wordrecg#wPush)
 [wRaise:](#wRaise)
* [TSpecialWord.wRaise](wordrecg#wRaise)
 [wRaises:](#wRaises)
* [TSpecialWord.wRaises](wordrecg#wRaises)
 [wRangeChecks:](#wRangeChecks)
* [TSpecialWord.wRangeChecks](wordrecg#wRangeChecks)
 [wrapInComesFrom:](#wrapInComesFrom)
* [evaltempl: wrapInComesFrom(info: TLineInfo; sym: PSym; res: PNode): PNode](evaltempl#wrapInComesFrom%2CTLineInfo%2CPSym%2CPNode)
 [wrapProcForSpawn:](#wrapProcForSpawn)
* [spawn: wrapProcForSpawn(g: ModuleGraph; owner: PSym; spawnExpr: PNode; retType: PType; barrier, dest: PNode = nil): PNode](spawn#wrapProcForSpawn%2CModuleGraph%2CPSym%2CPNode%2CPType%2CPNode%2CPNode)
 [wReads:](#wReads)
* [TSpecialWord.wReads](wordrecg#wReads)
 [wRef:](#wRef)
* [TSpecialWord.wRef](wordrecg#wRef)
 [wRegister:](#wRegister)
* [TSpecialWord.wRegister](wordrecg#wRegister)
 [wReinterpret\_cast:](#wReinterpret_cast)
* [TSpecialWord.wReinterpret\_cast](wordrecg#wReinterpret_cast)
 [wReorder:](#wReorder)
* [TSpecialWord.wReorder](wordrecg#wReorder)
 [wRequires:](#wRequires)
* [TSpecialWord.wRequires](wordrecg#wRequires)
 [wRequiresInit:](#wRequiresInit)
* [TSpecialWord.wRequiresInit](wordrecg#wRequiresInit)
 [wRestrict:](#wRestrict)
* [TSpecialWord.wRestrict](wordrecg#wRestrict)
 [wReturn:](#wReturn)
* [TSpecialWord.wReturn](wordrecg#wReturn)
 [writeCommandLineUsage:](#writeCommandLineUsage)
* [commands: writeCommandLineUsage(conf: ConfigRef)](commands#writeCommandLineUsage%2CConfigRef)
 [writeFile:](#writeFile)
* [pathutils: writeFile(x: AbsoluteFile; content: string)](pathutils#writeFile%2CAbsoluteFile%2Cstring)
 [writeJsonBuildInstructions:](#writeJsonBuildInstructions)
* [extccomp: writeJsonBuildInstructions(conf: ConfigRef)](extccomp#writeJsonBuildInstructions%2CConfigRef)
 [writeMangledName:](#writeMangledName)
* [ndi: writeMangledName(f: NdiFile; s: PSym; conf: ConfigRef)](ndi#writeMangledName.t%2CNdiFile%2CPSym%2CConfigRef)
 [writeMapping:](#writeMapping)
* [extccomp: writeMapping(conf: ConfigRef; symbolMapping: Rope)](extccomp#writeMapping%2CConfigRef%2CRope)
 [writeMatches:](#writeMatches)
* [sigmatch: writeMatches(c: TCandidate)](sigmatch#writeMatches%2CTCandidate)
 [writeOnlySf:](#writeOnlySf)
* [SymbolFilesOption.writeOnlySf](options#writeOnlySf)
 [writeOutput:](#writeOutput)
* [docgen: writeOutput(d: PDoc; useWarning = false; groupedToc = false)](docgen#writeOutput%2CPDoc)
 [writeOutputJson:](#writeOutputJson)
* [docgen: writeOutputJson(d: PDoc; useWarning = false)](docgen#writeOutputJson%2CPDoc)
 [writeRope:](#writeRope)
* [ropes: writeRope(f: File; r: Rope)](ropes#writeRope%2CFile%2CRope)
* [ropes: writeRope(head: Rope; filename: AbsoluteFile): bool](ropes#writeRope%2CRope%2CAbsoluteFile)
 [writeRopeIfNotEqual:](#writeRopeIfNotEqual)
* [ropes: writeRopeIfNotEqual(r: Rope; filename: AbsoluteFile): bool](ropes#writeRopeIfNotEqual%2CRope%2CAbsoluteFile)
 [wrongRedefinition:](#wrongRedefinition)
* [lookups: wrongRedefinition(c: PContext; info: TLineInfo; s: string; conflictsWith: TLineInfo)](lookups#wrongRedefinition%2CPContext%2CTLineInfo%2Cstring%2CTLineInfo)
 [wSafecall:](#wSafecall)
* [TSpecialWord.wSafecall](wordrecg#wSafecall)
 [wSafecode:](#wSafecode)
* [TSpecialWord.wSafecode](wordrecg#wSafecode)
 [wShallow:](#wShallow)
* [TSpecialWord.wShallow](wordrecg#wShallow)
 [wShl:](#wShl)
* [TSpecialWord.wShl](wordrecg#wShl)
 [wShort:](#wShort)
* [TSpecialWord.wShort](wordrecg#wShort)
 [wShr:](#wShr)
* [TSpecialWord.wShr](wordrecg#wShr)
 [wSideEffect:](#wSideEffect)
* [TSpecialWord.wSideEffect](wordrecg#wSideEffect)
 [wSigned:](#wSigned)
* [TSpecialWord.wSigned](wordrecg#wSigned)
 [wSinkInference:](#wSinkInference)
* [TSpecialWord.wSinkInference](wordrecg#wSinkInference)
 [wSize:](#wSize)
* [TSpecialWord.wSize](wordrecg#wSize)
 [wSizeof:](#wSizeof)
* [TSpecialWord.wSizeof](wordrecg#wSizeof)
 [wStackTrace:](#wStackTrace)
* [TSpecialWord.wStackTrace](wordrecg#wStackTrace)
 [wStar:](#wStar)
* [TSpecialWord.wStar](wordrecg#wStar)
 [wStatic:](#wStatic)
* [TSpecialWord.wStatic](wordrecg#wStatic)
 [wStatic\_assert:](#wStatic_assert)
* [TSpecialWord.wStatic\_assert](wordrecg#wStatic_assert)
 [wStaticBoundchecks:](#wStaticBoundchecks)
* [TSpecialWord.wStaticBoundchecks](wordrecg#wStaticBoundchecks)
 [wStatic\_cast:](#wStatic_cast)
* [TSpecialWord.wStatic\_cast](wordrecg#wStatic_cast)
 [wStdcall:](#wStdcall)
* [TSpecialWord.wStdcall](wordrecg#wStdcall)
 [wStdErr:](#wStdErr)
* [TSpecialWord.wStdErr](wordrecg#wStdErr)
 [wStdIn:](#wStdIn)
* [TSpecialWord.wStdIn](wordrecg#wStdIn)
 [wStdOut:](#wStdOut)
* [TSpecialWord.wStdOut](wordrecg#wStdOut)
 [wStrDefine:](#wStrDefine)
* [TSpecialWord.wStrDefine](wordrecg#wStrDefine)
 [wStruct:](#wStruct)
* [TSpecialWord.wStruct](wordrecg#wStruct)
 [wStyleChecks:](#wStyleChecks)
* [TSpecialWord.wStyleChecks](wordrecg#wStyleChecks)
 [wSubsChar:](#wSubsChar)
* [TSpecialWord.wSubsChar](wordrecg#wSubsChar)
 [wSwitch:](#wSwitch)
* [TSpecialWord.wSwitch](wordrecg#wSwitch)
 [wSyscall:](#wSyscall)
* [TSpecialWord.wSyscall](wordrecg#wSyscall)
 [wTags:](#wTags)
* [TSpecialWord.wTags](wordrecg#wTags)
 [wTemplate:](#wTemplate)
* [TSpecialWord.wTemplate](wordrecg#wTemplate)
 [wThis:](#wThis)
* [TSpecialWord.wThis](wordrecg#wThis)
 [wThiscall:](#wThiscall)
* [TSpecialWord.wThiscall](wordrecg#wThiscall)
 [wThread:](#wThread)
* [TSpecialWord.wThread](wordrecg#wThread)
 [wThread\_local:](#wThread_local)
* [TSpecialWord.wThread\_local](wordrecg#wThread_local)
 [wThreadVar:](#wThreadVar)
* [TSpecialWord.wThreadVar](wordrecg#wThreadVar)
 [wThrow:](#wThrow)
* [TSpecialWord.wThrow](wordrecg#wThrow)
 [wTrMacros:](#wTrMacros)
* [TSpecialWord.wTrMacros](wordrecg#wTrMacros)
 [wTrue:](#wTrue)
* [TSpecialWord.wTrue](wordrecg#wTrue)
 [wTry:](#wTry)
* [TSpecialWord.wTry](wordrecg#wTry)
 [wTuple:](#wTuple)
* [TSpecialWord.wTuple](wordrecg#wTuple)
 [wType:](#wType)
* [TSpecialWord.wType](wordrecg#wType)
 [wTypedef:](#wTypedef)
* [TSpecialWord.wTypedef](wordrecg#wTypedef)
 [wTypeid:](#wTypeid)
* [TSpecialWord.wTypeid](wordrecg#wTypeid)
 [wTypename:](#wTypename)
* [TSpecialWord.wTypename](wordrecg#wTypename)
 [wTypeof:](#wTypeof)
* [TSpecialWord.wTypeof](wordrecg#wTypeof)
 [wUnchecked:](#wUnchecked)
* [TSpecialWord.wUnchecked](wordrecg#wUnchecked)
 [wUndef:](#wUndef)
* [TSpecialWord.wUndef](wordrecg#wUndef)
 [wUnion:](#wUnion)
* [TSpecialWord.wUnion](wordrecg#wUnion)
 [wUnroll:](#wUnroll)
* [TSpecialWord.wUnroll](wordrecg#wUnroll)
 [wUnsigned:](#wUnsigned)
* [TSpecialWord.wUnsigned](wordrecg#wUnsigned)
 [wUsed:](#wUsed)
* [TSpecialWord.wUsed](wordrecg#wUsed)
 [wUsing:](#wUsing)
* [TSpecialWord.wUsing](wordrecg#wUsing)
 [wVar:](#wVar)
* [TSpecialWord.wVar](wordrecg#wVar)
 [wVarargs:](#wVarargs)
* [TSpecialWord.wVarargs](wordrecg#wVarargs)
 [wVirtual:](#wVirtual)
* [TSpecialWord.wVirtual](wordrecg#wVirtual)
 [wVoid:](#wVoid)
* [TSpecialWord.wVoid](wordrecg#wVoid)
 [wVolatile:](#wVolatile)
* [TSpecialWord.wVolatile](wordrecg#wVolatile)
 [wWarning:](#wWarning)
* [TSpecialWord.wWarning](wordrecg#wWarning)
 [wWarningAsError:](#wWarningAsError)
* [TSpecialWord.wWarningAsError](wordrecg#wWarningAsError)
 [wWarnings:](#wWarnings)
* [TSpecialWord.wWarnings](wordrecg#wWarnings)
 [wWchar\_t:](#wWchar_t)
* [TSpecialWord.wWchar\_t](wordrecg#wWchar_t)
 [wWhen:](#wWhen)
* [TSpecialWord.wWhen](wordrecg#wWhen)
 [wWhile:](#wWhile)
* [TSpecialWord.wWhile](wordrecg#wWhile)
 [wWrite:](#wWrite)
* [TSpecialWord.wWrite](wordrecg#wWrite)
 [wWrites:](#wWrites)
* [TSpecialWord.wWrites](wordrecg#wWrites)
 [wXor:](#wXor)
* [TSpecialWord.wXor](wordrecg#wXor)
 [wYield:](#wYield)
* [TSpecialWord.wYield](wordrecg#wYield)
 [Zero:](#Zero)
* [int128: Zero](int128#Zero)
  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/theindex.html>

API naming design
=================

 The API is designed to be **easy to use** and consistent. Ease of use is measured by the number of calls to achieve a concrete high-level action.

 Naming scheme
-------------


The library uses a simple naming scheme that makes use of common abbreviations to keep the names short but meaningful. Since version 0.8.2 many symbols have been renamed to fit this scheme. The ultimate goal is that the programmer can *guess* a name.

 

| English word | To use | Notes |
| --- | --- | --- |
| initialize | initT  | `init` is used to create a value type `T` |
| new | newP  | `new` is used to create a reference type `P` |
| find | find | should return the position where something was found; for a bool result use `contains` |
| contains | contains | often short for `find() >= 0` |
| append | add | use `add` instead of `append` |
| compare | cmp | should return an int with the `< 0` `== 0` or `> 0` semantics; for a bool result use `sameXYZ` |
| put | put, `[]=` | consider overloading `[]=` for put |
| get | get, `[]` | consider overloading `[]` for get; consider to not use `get` as a prefix: `len` instead of `getLen` |
| length | len | also used for *number of elements* |
| size | size, len | size should refer to a byte size |
| capacity | cap |  |
| memory | mem | implies a low-level operation |
| items | items | default iterator over a collection |
| pairs | pairs | iterator over (key, value) pairs |
| delete | delete, del | del is supposed to be faster than delete, because it does not keep the order; delete keeps the order |
| remove | delete, del | inconsistent right now |
| remove-and-return | pop | `Table`/`TableRef` alias to `take` |
| include | incl |  |
| exclude | excl |  |
| command | cmd |  |
| execute | exec |  |
| environment | env |  |
| variable | var |  |
| value | value, val  | val is preferred, inconsistent right now |
| executable | exe |  |
| directory | dir |  |
| path | path | path is the string "/usr/bin" (for example), dir is the content of "/usr/bin"; inconsistent right now |
| extension | ext |  |
| separator | sep |  |
| column | col, column  | col is preferred, inconsistent right now |
| application | app |  |
| configuration | cfg |  |
| message | msg |  |
| argument | arg |  |
| object | obj |  |
| parameter | param |  |
| operator | opr |  |
| procedure | proc |  |
| function | func |  |
| coordinate | coord |  |
| rectangle | rect |  |
| point | point |  |
| symbol | sym |  |
| literal | lit |  |
| string | str |  |
| identifier | ident |  |
| indentation | indent |  |

 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/apis.html>

threads
=======


Thread support for Nim.

 **Note**: This is part of the system module. Do not import it directly. To activate thread support you need to compile with the `--threads:on` command line switch.

 Nim's memory model for threads is quite different from other common programming languages (C, Pascal): Each thread has its own (garbage collected) heap and sharing of memory is restricted. This helps to prevent race conditions and improves efficiency. See [the manual for details of this memory model](manual#threads).

 Examples
--------



```
import locks

var
  thr: array[0..4, Thread[tuple[a,b: int]]]
  L: Lock

proc threadFunc(interval: tuple[a,b: int]) {.thread.} =
  for i in interval.a..interval.b:
    acquire(L) # lock stdout
    echo i
    release(L)

initLock(L)

for i in 0..high(thr):
  createThread(thr[i], threadFunc, (i*10, i*10+5))
joinThreads(thr)

deinitLock(L)
```
 Types
-----

  
```
Thread*[TArg] = object
  core: PGcThread
  sys: SysThread
  when TArg is void:
      dataFn: proc () {...}{.nimcall, gcsafe.}

  else:
      dataFn: proc (m: TArg) {...}{.nimcall, gcsafe.}
      data: TArg
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L84)   Procs
-----

  
```
proc onThreadDestruction*(handler: proc () {...}{.closure, gcsafe, raises: [].})
```
  Registers a *thread local* handler that is called at the thread's destruction.

 A thread is destructed when the `.thread` proc returns normally or when it raises an exception. Note that unhandled exceptions in a thread nevertheless cause the whole process to die.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L96)  
```
proc running*[TArg](t: Thread[TArg]): bool {...}{.inline.}
```
  Returns true if `t` is running. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L198)  
```
proc handle*[TArg](t: Thread[TArg]): SysThread {...}{.inline.}
```
  Returns the thread handle of `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L202)  
```
proc joinThread*[TArg](t: Thread[TArg]) {...}{.inline.}
```
  Waits for the thread `t` to finish. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L209)  
```
proc joinThreads*[TArg](t: varargs[Thread[TArg]])
```
  Waits for every thread in `t` to finish. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L213)  
```
proc createThread*[TArg](t: var Thread[TArg];
                         tp: proc (arg: TArg) {...}{.thread, nimcall.}; param: TArg)
```
  Creates a new thread `t` and starts its execution.

 Entry point is the proc `tp`. `param` is passed to `tp`. `TArg` can be `void` if you don't need to pass any data to the thread.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L258)  
```
proc pinToCpu*[Arg](t: var Thread[Arg]; cpu: Natural)
```
  Pins a thread to a CPU.

 In other words sets a thread's affinity. If you don't know what this means, you shouldn't use this proc.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L277)  
```
proc createThread*(t: var Thread[void]; tp: proc () {...}{.thread, nimcall.})
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L341)  
```
proc getThreadId*(): int
```
  Gets the ID of the currently running thread. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/threads.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/threads.nim#L348)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/threads.html>

channels
========


Channel support for threads.

 **Note**: This is part of the system module. Do not import it directly. To activate thread support compile with the `--threads:on` command line switch.

 **Note:** Channels are designed for the `Thread` type. They are unstable when used with `spawn`

 **Note:** The current implementation of message passing does not work with cyclic data structures.

 **Note:** Channels cannot be passed between threads. Use globals or pass them by `ptr`.

 Example
-------


The following is a simple example of two different ways to use channels: blocking and non-blocking.

 
```
# Be sure to compile with --threads:on.
# The channels and threads modules are part of system and should not be
# imported.
import os

# Channels can either be:
#  - declared at the module level, or
#  - passed to procedures by ptr (raw pointer) -- see note on safety.
#
# For simplicity, in this example a channel is declared at module scope.
# Channels are generic, and they include support for passing objects between
# threads.
# Note that objects passed through channels will be deeply copied.
var chan: Channel[string]

# This proc will be run in another thread using the threads module.
proc firstWorker() =
  chan.send("Hello World!")

# This is another proc to run in a background thread. This proc takes a while
# to send the message since it sleeps for 2 seconds (or 2000 milliseconds).
proc secondWorker() =
  sleep(2000)
  chan.send("Another message")

# Initialize the channel.
chan.open()

# Launch the worker.
var worker1: Thread[void]
createThread(worker1, firstWorker)

# Block until the message arrives, then print it out.
echo chan.recv() # "Hello World!"

# Wait for the thread to exit before moving on to the next example.
worker1.joinThread()

# Launch the other worker.
var worker2: Thread[void]
createThread(worker2, secondWorker)
# This time, use a non-blocking approach with tryRecv.
# Since the main thread is not blocked, it could be used to perform other
# useful work while it waits for data to arrive on the channel.
while true:
  let tried = chan.tryRecv()
  if tried.dataAvailable:
    echo tried.msg # "Another message"
    break
  
  echo "Pretend I'm doing useful work..."
  # For this example, sleep in order not to flood stdout with the above
  # message.
  sleep(400)

# Wait for the second thread to exit before cleaning up the channel.
worker2.joinThread()

# Clean up the channel.
chan.close()
```
 ### Sample output


The program should output something similar to this, but keep in mind that exact results may vary in the real world:



```
Hello World!
Pretend I'm doing useful work...
Pretend I'm doing useful work...
Pretend I'm doing useful work...
Pretend I'm doing useful work...
Pretend I'm doing useful work...
Another message
```
 ### Passing Channels Safely


Note that when passing objects to procedures on another thread by pointer (for example through a thread's argument), objects created using the default allocator will use thread-local, GC-managed memory. Thus it is generally safer to store channel objects in global variables (as in the above example), in which case they will use a process-wide (thread-safe) shared heap.

 However, it is possible to manually allocate shared memory for channels using e.g. `system.allocShared0` and pass these pointers through thread arguments:

 
```
proc worker(channel: ptr Channel[string]) =
  let greeting = channel[].recv()
  echo greeting

proc localChannelExample() =
  # Use allocShared0 to allocate some shared-heap memory and zero it.
  # The usual warnings about dealing with raw pointers apply. Exercise caution.
  var channel = cast[ptr Channel[string]](
    allocShared0(sizeof(Channel[string]))
  )
  channel[].open()
  # Create a thread which will receive the channel as an argument.
  var thread: Thread[ptr Channel[string]]
  createThread(thread, worker, channel)
  channel[].send("Hello from the main thread!")
  # Clean up resources.
  thread.joinThread()
  channel[].close()
  deallocShared(channel)

localChannelExample() # "Hello from the main thread!"
```
 Types
-----

  
```
Channel*[TMsg] {...}{.gcsafe.} = RawChannel
```
  a channel for thread communication [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L154)   Procs
-----

  
```
proc send*[TMsg](c: var Channel[TMsg]; msg: sink TMsg) {...}{.inline.}
```
  Sends a message to a thread. `msg` is deeply copied. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L367) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L367)  
```
proc trySend*[TMsg](c: var Channel[TMsg]; msg: sink TMsg): bool {...}{.inline.}
```
  Tries to send a message to a thread.

 `msg` is deeply copied. Doesn't block.

 Returns `false` if the message was not sent because number of pending items in the channel exceeded `maxItems`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L373)  
```
proc recv*[TMsg](c: var Channel[TMsg]): TMsg
```
  Receives a message from the channel `c`.

 This blocks until a message has arrived! You may use [peek proc](#peek,Channel%5BTMsg%5D) to avoid the blocking.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L398)  
```
proc tryRecv*[TMsg](c: var Channel[TMsg]): tuple[dataAvailable: bool, msg: TMsg]
```
  Tries to receive a message from the channel `c`, but this can fail for all sort of reasons, including contention.

 If it fails, it returns `(false, default(msg))` otherwise it returns `(true, msg)`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L408)  
```
proc peek*[TMsg](c: var Channel[TMsg]): int
```
  Returns the current number of messages in the channel `c`.

 Returns -1 if the channel has been closed.

 **Note**: This is dangerous to use as it encourages races. It's much better to use [tryRecv proc](#tryRecv,Channel%5BTMsg%5D) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L423)  
```
proc open*[TMsg](c: var Channel[TMsg]; maxItems: int = 0)
```
  Opens a channel `c` for inter thread communication.

 The `send` operation will block until number of unprocessed items is less than `maxItems`.

 For unlimited queue set `maxItems` to 0.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L437)  
```
proc close*[TMsg](c: var Channel[TMsg])
```
  Closes a channel `c` and frees its associated resources. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L446)  
```
proc ready*[TMsg](c: var Channel[TMsg]): bool
```
  Returns true if some thread is waiting on the channel `c` for new messages. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/channels.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/channels.nim#L450)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/channels.html>

bitops
======

 This module implements a series of low level methods for bit manipulation.


By default, this module use compiler intrinsics where possible to improve performance on supported compilers: `GCC`, `LLVM_GCC`, `CLANG`, `VCC`, `ICC`.

 The module will fallback to pure nim procs incase the backend is not supported. You can also use the flag `noIntrinsicsBitOpts` to disable compiler intrinsics.

 This module is also compatible with other backends: `Javascript`, `Nimscript` as well as the `compiletime VM`.

 As a result of using optimized function/intrinsics some functions can return undefined results if the input is invalid. You can use the flag `noUndefinedBitOpts` to force predictable behaviour for all input, causing a small performance hit.

 At this time only `fastLog2`, `firstSetBit, `countLeadingZeroBits`, `countTrailingZeroBits` may return undefined and/or platform dependent value if given invalid input.

 Imports
-------

  <macros>, <since>  Types
-----

  
```
BitsRange[T] = range[0 .. sizeof(T) * 8 - 1]
```
  A range with all bit positions for type `T` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L88)   Procs
-----

  
```
proc bitnot[T: SomeInteger](x: T): T {...}{.magic: "BitnotI", noSideEffect.}
```
  Computes the `bitwise complement` of the integer `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L31)  
```
proc bitslice[T: SomeInteger](v: var T; slice: Slice[int]) {...}{.inline.}
```
  Mutates `v` into an extracted (and shifted) slice of bits from `v`. **Example:**

 
```
var x = 0b101110
x.bitslice(2 .. 4)
doAssert x == 0b011
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L103)  
```
proc masked[T: SomeInteger](v, mask: T): T {...}{.inline.}
```
  Returns `v`, with only the `1` bits from `mask` matching those of `v` set to 1.

 Effectively maps to a `bitand` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.masked(0b0000_1010'u8) == 0b0000_0010'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L129)  
```
proc mask[T: SomeInteger](v: var T; mask: T) {...}{.inline.}
```
  Mutates `v`, with only the `1` bits from `mask` matching those of `v` set to 1.

 Effectively maps to a `bitand` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
v.mask(0b0000_1010'u8)
doAssert v == 0b0000_0010'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L151)  
```
proc mask[T: SomeInteger](v: var T; slice: Slice[int]) {...}{.inline.}
```
  Mutates `v`, with only the `1` bits in the range of `slice` matching those of `v` set to 1.

 Effectively maps to a `bitand` operation.

 **Example:**

 
```
var v = 0b0000_1011'u8
v.mask(1 .. 3)
doAssert v == 0b0000_1010'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L163)  
```
proc setMask[T: SomeInteger](v: var T; mask: T) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits from `mask` set to 1.

 Effectively maps to a `bitor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
v.setMask(0b0000_1010'u8)
doAssert v == 0b0000_1011'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L195)  
```
proc setMask[T: SomeInteger](v: var T; slice: Slice[int]) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits in the range of `slice` set to 1.

 Effectively maps to a `bitor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
v.setMask(2 .. 3)
doAssert v == 0b0000_1111'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L206)  
```
proc clearMask[T: SomeInteger](v: var T; mask: T) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits from `mask` set to 0.

 Effectively maps to a `bitand` operation with an *inverted mask.*

 **Example:**

 
```
var v = 0b0000_0011'u8
v.clearMask(0b0000_1010'u8)
doAssert v == 0b0000_0001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L237)  
```
proc clearMask[T: SomeInteger](v: var T; slice: Slice[int]) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits in the range of `slice` set to 0.

 Effectively maps to a `bitand` operation with an *inverted mask.*

 **Example:**

 
```
var v = 0b0000_0011'u8
v.clearMask(1 .. 3)
doAssert v == 0b0000_0001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L248)  
```
proc flipMask[T: SomeInteger](v: var T; mask: T) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits from `mask` flipped.

 Effectively maps to a `bitxor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
v.flipMask(0b0000_1010'u8)
doAssert v == 0b0000_1001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L279)  
```
proc flipMask[T: SomeInteger](v: var T; slice: Slice[int]) {...}{.inline.}
```
  Mutates `v`, with all the `1` bits in the range of `slice` flipped.

 Effectively maps to a `bitxor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
v.flipMask(1 .. 3)
doAssert v == 0b0000_1101'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L290)  
```
proc setBit[T: SomeInteger](v: var T; bit: BitsRange[T]) {...}{.inline.}
```
  Mutates `v`, with the bit at position `bit` set to 1 **Example:**

 
```
var v = 0b0000_0011'u8
v.setBit(5'u8)
doAssert v == 0b0010_0011'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L301)  
```
proc clearBit[T: SomeInteger](v: var T; bit: BitsRange[T]) {...}{.inline.}
```
  Mutates `v`, with the bit at position `bit` set to 0 **Example:**

 
```
var v = 0b0000_0011'u8
v.clearBit(1'u8)
doAssert v == 0b0000_0001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L310)  
```
proc flipBit[T: SomeInteger](v: var T; bit: BitsRange[T]) {...}{.inline.}
```
  Mutates `v`, with the bit at position `bit` flipped **Example:**

 
```
var v = 0b0000_0011'u8
v.flipBit(1'u8)
doAssert v == 0b0000_0001'u8

v = 0b0000_0011'u8
v.flipBit(2'u8)
doAssert v == 0b0000_0111'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L319)  
```
proc testBit[T: SomeInteger](v: T; bit: BitsRange[T]): bool {...}{.inline.}
```
  Returns true if the bit in `v` at positions `bit` is set to 1 **Example:**

 
```
var v = 0b0000_1111'u8
doAssert v.testBit(0)
doAssert not v.testBit(7)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L369)  
```
proc countSetBits(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Counts the set bits in integer. (also called Hamming weight.) **Example:**

 
```
doAssert countSetBits(0b0000_0011'u8) == 2
doAssert countSetBits(0b1010_1010'u8) == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L531)  
```
proc popcount(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Alias for for [countSetBits](#countSetBits,SomeInteger). (Hamming weight.) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L562)  
```
proc parityBits(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Calculate the bit parity in integer. If number of 1-bit is odd parity is 1, otherwise 0. **Example:**

 
```
doAssert parityBits(0b0000_0000'u8) == 0
doAssert parityBits(0b0101_0001'u8) == 1
doAssert parityBits(0b0110_1001'u8) == 0
doAssert parityBits(0b0111_1111'u8) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L566)  
```
proc firstSetBit(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Returns the 1-based index of the least significant set bit of x. If `x` is zero, when `noUndefinedBitOpts` is set, result is 0, otherwise result is undefined. **Example:**

 
```
doAssert firstSetBit(0b0000_0001'u8) == 1
doAssert firstSetBit(0b0000_0010'u8) == 2
doAssert firstSetBit(0b0000_0100'u8) == 3
doAssert firstSetBit(0b0000_1000'u8) == 4
doAssert firstSetBit(0b0000_1111'u8) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L589)  
```
proc fastLog2(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Quickly find the log base 2 of an integer. If `x` is zero, when `noUndefinedBitOpts` is set, result is -1, otherwise result is undefined. **Example:**

 
```
doAssert fastLog2(0b0000_0001'u8) == 0
doAssert fastLog2(0b0000_0010'u8) == 1
doAssert fastLog2(0b0000_0100'u8) == 2
doAssert fastLog2(0b0000_1000'u8) == 3
doAssert fastLog2(0b0000_1111'u8) == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L633)  
```
proc countLeadingZeroBits(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Returns the number of leading zero bits in integer. If `x` is zero, when `noUndefinedBitOpts` is set, result is 0, otherwise result is undefined.

 See also:

 * [countTrailingZeroBits proc](#countTrailingZeroBits,SomeInteger)

 **Example:**

 
```
doAssert countLeadingZeroBits(0b0000_0001'u8) == 7
doAssert countLeadingZeroBits(0b0000_0010'u8) == 6
doAssert countLeadingZeroBits(0b0000_0100'u8) == 5
doAssert countLeadingZeroBits(0b0000_1000'u8) == 4
doAssert countLeadingZeroBits(0b0000_1111'u8) == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L673)  
```
proc countTrailingZeroBits(x: SomeInteger): int {...}{.inline, noSideEffect.}
```
  Returns the number of trailing zeros in integer. If `x` is zero, when `noUndefinedBitOpts` is set, result is 0, otherwise result is undefined.

 See also:

 * [countLeadingZeroBits proc](#countLeadingZeroBits,SomeInteger)

 **Example:**

 
```
doAssert countTrailingZeroBits(0b0000_0001'u8) == 0
doAssert countTrailingZeroBits(0b0000_0010'u8) == 1
doAssert countTrailingZeroBits(0b0000_0100'u8) == 2
doAssert countTrailingZeroBits(0b0000_1000'u8) == 3
doAssert countTrailingZeroBits(0b0000_1111'u8) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L702)  
```
proc rotateLeftBits(value: uint8; amount: range[0 .. 8]): uint8 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Left-rotate bits in a 8-bits value. **Example:**

 
```
doAssert rotateLeftBits(0b0000_0001'u8, 1) == 0b0000_0010'u8
doAssert rotateLeftBits(0b0000_0001'u8, 2) == 0b0000_0100'u8
doAssert rotateLeftBits(0b0100_0001'u8, 1) == 0b1000_0010'u8
doAssert rotateLeftBits(0b0100_0001'u8, 2) == 0b0000_0101'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L731)  
```
proc rotateLeftBits(value: uint16; amount: range[0 .. 16]): uint16 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Left-rotate bits in a 16-bits value.

 See also:

 * [rotateLeftBits proc](#rotateLeftBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L747)  
```
proc rotateLeftBits(value: uint32; amount: range[0 .. 32]): uint32 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Left-rotate bits in a 32-bits value.

 See also:

 * [rotateLeftBits proc](#rotateLeftBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L756) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L756)  
```
proc rotateLeftBits(value: uint64; amount: range[0 .. 64]): uint64 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Left-rotate bits in a 64-bits value.

 See also:

 * [rotateLeftBits proc](#rotateLeftBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L765) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L765)  
```
proc rotateRightBits(value: uint8; amount: range[0 .. 8]): uint8 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Right-rotate bits in a 8-bits value. **Example:**

 
```
doAssert rotateRightBits(0b0000_0001'u8, 1) == 0b1000_0000'u8
doAssert rotateRightBits(0b0000_0001'u8, 2) == 0b0100_0000'u8
doAssert rotateRightBits(0b0100_0001'u8, 1) == 0b1010_0000'u8
doAssert rotateRightBits(0b0100_0001'u8, 2) == 0b0101_0000'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L775) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L775)  
```
proc rotateRightBits(value: uint16; amount: range[0 .. 16]): uint16 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Right-rotate bits in a 16-bits value.

 See also:

 * [rotateRightBits proc](#rotateRightBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L787) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L787)  
```
proc rotateRightBits(value: uint32; amount: range[0 .. 32]): uint32 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Right-rotate bits in a 32-bits value.

 See also:

 * [rotateRightBits proc](#rotateRightBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L796)  
```
proc rotateRightBits(value: uint64; amount: range[0 .. 64]): uint64 {...}{.inline,
    noSideEffect, raises: [], tags: [].}
```
  Right-rotate bits in a 64-bits value.

 See also:

 * [rotateRightBits proc](#rotateRightBits,uint8,range%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L805) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L805)  
```
proc reverseBits[T: SomeUnsignedInt](x: T): T {...}{.noSideEffect.}
```
  Return the bit reversal of x. **Example:**

 
```
doAssert reverseBits(0b10100100'u8) == 0b00100101'u8
doAssert reverseBits(0xdd'u8) == 0xbb'u8
doAssert reverseBits(0xddbb'u16) == 0xddbb'u16
doAssert reverseBits(0xdeadbeef'u32) == 0xf77db57b'u32
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L822)   Funcs
-----

  
```
func bitsliced[T: SomeInteger](v: T; slice: Slice[int]): T {...}{.inline.}
```
  Returns an extracted (and shifted) slice of bits from `v`. **Example:**

 
```
doAssert 0b10111.bitsliced(2 .. 4) == 0b101
doAssert 0b11100.bitsliced(0 .. 2) == 0b100
doAssert 0b11100.bitsliced(0 ..< 3) == 0b100
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L91)  
```
func toMask[T: SomeInteger](slice: Slice[int]): T {...}{.inline.}
```
  Creates a bitmask based on a slice of bits. **Example:**

 
```
doAssert toMask[int32](1 .. 3) == 0b1110'i32
doAssert toMask[int32](0 .. 3) == 0b1111'i32
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L115)  
```
func masked[T: SomeInteger](v: T; slice: Slice[int]): T {...}{.inline.}
```
  Mutates `v`, with only the `1` bits in the range of `slice` matching those of `v` set to 1.

 Effectively maps to a `bitand` operation.

 **Example:**

 
```
var v = 0b0000_1011'u8
doAssert v.masked(1 .. 3) == 0b0000_1010'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L140)  
```
func setMasked[T: SomeInteger](v, mask: T): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits from `mask` set to 1.

 Effectively maps to a `bitor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.setMasked(0b0000_1010'u8) == 0b0000_1011'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L175)  
```
func setMasked[T: SomeInteger](v: T; slice: Slice[int]): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits in the range of `slice` set to 1.

 Effectively maps to a `bitor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.setMasked(2 .. 3) == 0b0000_1111'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L185)  
```
func clearMasked[T: SomeInteger](v, mask: T): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits from `mask` set to 0.

 Effectively maps to a `bitand` operation with an *inverted mask.*

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.clearMasked(0b0000_1010'u8) == 0b0000_0001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L217)  
```
func clearMasked[T: SomeInteger](v: T; slice: Slice[int]): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits in the range of `slice` set to 0.

 Effectively maps to a `bitand` operation with an *inverted mask.*

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.clearMasked(1 .. 3) == 0b0000_0001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L227)  
```
func flipMasked[T: SomeInteger](v, mask: T): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits from `mask` flipped.

 Effectively maps to a `bitxor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.flipMasked(0b0000_1010'u8) == 0b0000_1001'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L259)  
```
func flipMasked[T: SomeInteger](v: T; slice: Slice[int]): T {...}{.inline.}
```
  Returns `v`, with all the `1` bits in the range of `slice` flipped.

 Effectively maps to a `bitxor` operation.

 **Example:**

 
```
var v = 0b0000_0011'u8
doAssert v.flipMasked(1 .. 3) == 0b0000_1101'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L269)   Macros
------

  
```
macro bitand[T: SomeInteger](x, y: T; z: varargs[T]): T
```
  Computes the `bitwise and` of all arguments collectively. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L40)  
```
macro bitor[T: SomeInteger](x, y: T; z: varargs[T]): T
```
  Computes the `bitwise or` of all arguments collectively. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L47)  
```
macro bitxor[T: SomeInteger](x, y: T; z: varargs[T]): T
```
  Computes the `bitwise xor` of all arguments collectively. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L54)  
```
macro setBits(v: typed; bits: varargs[typed]): untyped
```
  Mutates `v`, with the bits at positions `bits` set to 1 **Example:**

 
```
var v = 0b0000_0011'u8
v.setBits(3, 5, 7)
doAssert v == 0b1010_1011'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L332)  
```
macro clearBits(v: typed; bits: varargs[typed]): untyped
```
  Mutates `v`, with the bits at positions `bits` set to 0 **Example:**

 
```
var v = 0b1111_1111'u8
v.clearBits(1, 3, 5, 7)
doAssert v == 0b0101_0101'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L344)  
```
macro flipBits(v: typed; bits: varargs[typed]): untyped
```
  Mutates `v`, with the bits at positions `bits` set to 0 **Example:**

 
```
var v = 0b0000_1111'u8
v.flipBits(1, 3, 5, 7)
doAssert v == 0b1010_0101'u8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/bitops.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/bitops.nim#L356)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/bitops.html>

system
======


The compiler depends on the System module to work properly and the System module depends on the compiler. Most of the routines listed here use special compiler magic.

 Each module implicitly imports the System module; it must not be listed explicitly. Because of this there cannot be a user-defined module named `system`.

 System module
-------------

The System module imports several separate modules, and their documentation is in separate files:* <iterators>
* <assertions>
* <dollars>
* <io>
* <widestrs>

 Here is a short overview of the most commonly used functions from the `system` module. Function names in the tables below are clickable and will take you to the full documentation of the function.

 The amount of available functions is much larger. Use the table of contents on the left-hand side and/or `Ctrl+F` to navigate through this module.

 ### Strings and characters




| Proc | Usage |
| --- | --- |
| [len(s)](#len,string) | Return the length of a string |
| [chr(i)](#chr,range%5B%5D) | Convert an `int` in the range `0..255` to a character |
| [ord(c)](#ord,T) | Return `int` value of a character |
| [a & b](#&,string,string) | Concatenate two strings |
| [s.add(c)](#add,string,char) | Add character to the string |
| [$](dollars) | Convert various types to string |


**See also:**

 * [strutils module](strutils) for common string functions
* [strformat module](strformat) for string interpolation and formatting
* [unicode module](unicode) for Unicode UTF-8 handling
* <strscans> for `scanf` and `scanp` macros, which offer easier substring extraction than regular expressions
* [strtabs module](strtabs) for efficient hash tables (dictionaries, in some programming languages) mapping from strings to strings

 ### Seqs




| Proc | Usage |
| --- | --- |
| [newSeq](#newSeq) | Create a new sequence of a given length |
| [newSeqOfCap](#newSeqOfCap,Natural) | Create a new sequence with zero length and a given capacity |
| [setLen](#setLen,seq%5BT%5D,Natural) | Set the length of a sequence |
| [len](#len,seq%5BT%5D) | Return the length of a sequence |
| [@](#@) | Turn an array into a sequence |
| [add](#add,seq%5BT%5D,) | Add an item to the sequence |
| [insert](#insert,seq%5BT%5D,) | Insert an item at a specific position |
| [delete](#delete,seq%5BT%5D,Natural) | Delete an item while preserving the order of elements (`O(n)` operation) |
| [del](#del,seq%5BT%5D,Natural) | `O(1)` removal, doesn't preserve the order |
| [pop](#pop,seq%5BT%5D) | Remove and return last item of a sequence |
| [x & y](#&,seq%5BT%5D,seq%5BT%5D) | Concatenate two sequences |
| [x[a .. b]](#%5B%5D,openArray%5BT%5D,HSlice%5BU,V%5D) | Slice of a sequence (both ends included) |
| [x[a .. ^b]](#%5B%5D,openArray%5BT%5D,HSlice%5BU,V%5D) | Slice of a sequence but `b` is a reversed index (both ends included) |
| [x[a ..< b]](#%5B%5D,openArray%5BT%5D,HSlice%5BU,V%5D) | Slice of a sequence (excluded upper bound) |


**See also:**

 * [sequtils module](sequtils) for operations on container types (including strings)
* [json module](json) for a structure which allows heterogeneous members
* [lists module](lists) for linked lists

 ### Sets


Built-in bit sets.

 

| Proc | Usage |
| --- | --- |
| [incl](#incl,set%5BT%5D,T) | Include element `y` in the set `x` |
| [excl](#excl,set%5BT%5D,T) | Exclude element `y` from the set `x` |
| [card](#card,set%5BT%5D) | Return the cardinality of the set, i.e. the number of elements |
| [a \* b](#*,set%5BT%5D,set%5BT%5D) | Intersection |
| [a + b](#+,set%5BT%5D,set%5BT%5D) | Union |
| [a - b](#-,set%5BT%5D,set%5BT%5D) | Difference |
| [contains](#contains,set%5BT%5D,T) | Check if an element is in the set |
| [a < b](#<,set%5BT%5D,set%5BT%5D) | Check if `a` is a subset of `b` |


**See also:**

 * [sets module](sets) for hash sets
* [intsets module](intsets) for efficient int sets

 ### Numbers




| Proc | Usage  | Also known as (in other languages) |
| --- | --- | --- |
| [div](#div,int,int) | Integer division | `//` |
| [mod](#mod,int,int) | Integer modulo (remainder) | `%` |
| [shl](#shl,int,SomeInteger) | Shift left | `<<` |
| [shr](#shr,int,SomeInteger) | Shift right | `>>` |
| [ashr](#ashr,int,SomeInteger) | Arithmetic shift right |  |
| [and](#and,int,int) | Bitwise `and` | `&` |
| [or](#or,int,int) | Bitwise `or` | `|` |
| [xor](#xor,int,int) | Bitwise `xor` | `^` |
| [not](#not,int) | Bitwise `not` (complement) | `~` |
| [toInt](#toInt,float) | Convert floating-point number into an `int` |  |
| [toFloat](#toFloat,int) | Convert an integer into a `float` |  |


**See also:**

 * [math module](math) for mathematical operations like trigonometric functions, logarithms, square and cubic roots, etc.
* [complex module](complex) for operations on complex numbers
* [rationals module](rationals) for rational numbers

 ### Ordinals


[Ordinal type](#Ordinal) includes integer, bool, character, and enumeration types, as well as their subtypes.

 

| Proc | Usage |
| --- | --- |
| [succ](#succ,T,int) | Successor of the value |
| [pred](#pred,T,int) | Predecessor of the value |
| [inc](#inc,T,int) | Increment the ordinal |
| [dec](#dec,T,int) | Decrement the ordinal |
| [high](#high,T) | Return the highest possible value |
| [low](#low,T) | Return the lowest possible value |
| [ord](#ord,T) | Return `int` value of an ordinal value |

 ### 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]](#%5E.t,int) | Take the element at the reversed index `x` |
| [a .. b](#..,T,U) | Binary slice that constructs an interval `[a, b]` |
| [a ..^ b](#..%5E.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 |

 Imports
-------

  <since>, <ansi_c>, <memory>, <assertions>, <iterators>, <dollars>, <miscdollars>, <stacktraces>, <formatfloat>, <widestrs>, <io>  Types
-----

  
```
float {...}{.magic: Float.}
```
  Default floating point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L26)  
```
float32 {...}{.magic: Float32.}
```
  32 bit floating point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L27)  
```
float64 {...}{.magic: Float.}
```
  64 bit floating point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L28)  
```
char {...}{.magic: Char.}
```
  Built-in 8 bit character type (unsigned). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L33)  
```
string {...}{.magic: String.}
```
  Built-in string type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L34)  
```
cstring {...}{.magic: Cstring.}
```
  Built-in cstring (*compatible string*) type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L35)  
```
pointer {...}{.magic: Pointer.}
```
  Built-in pointer type, use the `addr` operator to get a pointer to a variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L36)  
```
typedesc {...}{.magic: TypeDesc.}
```
  Meta type to denote a type description. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L39)  
```
ptr[T] {...}{.magic: Pointer.}
```
  Built-in generic untraced pointer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L42)  
```
ref[T] {...}{.magic: Pointer.}
```
  Built-in generic traced pointer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L43)  
```
void {...}{.magic: "VoidType".}
```
  Meta type to denote the absence of any type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L47)  
```
auto {...}{.magic: Expr.}
```
  Meta type for automatic type determination. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L48)  
```
any = distinct auto
```
  Meta type for any supported type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L49)  
```
untyped {...}{.magic: Expr.}
```
  Meta type to denote an expression that is not resolved (for templates). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L50)  
```
typed {...}{.magic: Stmt.}
```
  Meta type to denote an expression that is resolved (for templates). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L52)  
```
int {...}{.magic: "Int".}
```
  Default integer type; bitwidth depends on architecture, but is always the same as a pointer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L2) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L2)  
```
int8 {...}{.magic: "Int8".}
```
  Signed 8 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L4) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L4)  
```
int16 {...}{.magic: "Int16".}
```
  Signed 16 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L5) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L5)  
```
int32 {...}{.magic: "Int32".}
```
  Signed 32 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L6)  
```
int64 {...}{.magic: "Int64".}
```
  Signed 64 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L7) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L7)  
```
uint {...}{.magic: "UInt".}
```
  Unsigned default integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L8) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L8)  
```
uint8 {...}{.magic: "UInt8".}
```
  Unsigned 8 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L9) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L9)  
```
uint16 {...}{.magic: "UInt16".}
```
  Unsigned 16 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L10)  
```
uint32 {...}{.magic: "UInt32".}
```
  Unsigned 32 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L11)  
```
uint64 {...}{.magic: "UInt64".}
```
  Unsigned 64 bit integer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L12)  
```
bool {...}{.magic: "Bool".} = enum
  false = 0, true = 1
```
  Built-in boolean type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L15)  
```
SomeSignedInt = int | int8 | int16 | int32 | int64
```
  Type class matching all signed integer types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L23)  
```
SomeUnsignedInt = uint | uint8 | uint16 | uint32 | uint64
```
  Type class matching all unsigned integer types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L26)  
```
SomeInteger = SomeSignedInt | SomeUnsignedInt
```
  Type class matching all integer types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L29)  
```
SomeOrdinal = int | int8 | int16 | int32 | int64 | bool | enum | uint | uint8 |
    uint16 |
    uint32 |
    uint64
```
  Type class matching all ordinal types; however this includes enums with holes. See also `Ordinal` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L32)  
```
BiggestInt = int64
```
  is an alias for the biggest signed integer type the Nim compiler supports. Currently this is `int64`, but it is platform-dependent in general. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L36)  
```
SomeFloat = float | float32 | float64
```
  Type class matching all floating point number types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L88)  
```
SomeNumber = SomeInteger | SomeFloat
```
  Type class matching all number types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L91)  
```
Ordinal[T] {...}{.magic: Ordinal.}
```
  Generic ordinal type. Includes integer, bool, character, and enumeration types as well as their subtypes. See also `SomeOrdinal`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L109)  
```
static[T] {...}{.magic: "Static".}
```
  Meta type representing all values that can be evaluated at compile-time.

 The type coercion `static(x)` can be used to force the compile-time evaluation of the given expression `x`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L208)  
```
type[T] {...}{.magic: "Type".}
```
  Meta type representing the type of all type values.

 The coercion `type(x)` can be used to obtain the type of the given expression `x`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L214)  
```
TypeOfMode = enum
  typeOfProc,               ## Prefer the interpretation that means `x` is a proc call.
  typeOfIter                 ## Prefer the interpretation that means `x` is an iterator call.
```
  Possible modes of `typeof`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L227)  
```
range[T] {...}{.magic: "Range".}
```
  Generic type to construct range types. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L268)  
```
array[I; T] {...}{.magic: "Array".}
```
  Generic type to construct fixed-length arrays. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L269)  
```
openArray[T] {...}{.magic: "OpenArray".}
```
  Generic type to construct open arrays. Open arrays are implemented as a pointer to the array data and a length field. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L271)  
```
varargs[T] {...}{.magic: "Varargs".}
```
  Generic type to construct a varargs type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L275)  
```
seq[T] {...}{.magic: "Seq".}
```
  Generic type to construct sequences. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L276)  
```
set[T] {...}{.magic: "Set".}
```
  Generic type to construct bit sets. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L277)  
```
UncheckedArray[T] {...}{.magic: "UncheckedArray".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L281)  
```
sink[T] {...}{.magic: "BuiltinType".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L288)  
```
lent[T] {...}{.magic: "BuiltinType".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L289)  
```
HSlice[T; U] = object
  a*: T                      ## The lower bound (inclusive).
  b*: U                      ## The upper bound (inclusive).
```
  "Heterogeneous" slice type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L466)  
```
Slice[T] = HSlice[T, T]
```
  An alias for `HSlice[T, T]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L469)  
```
byte = uint8
```
  This is an alias for `uint8`, that is an unsigned integer, 8 bits wide. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L544)  
```
Natural = range[0 .. high(int)]
```
  is an `int` type ranging from zero to the maximum value of an `int`. This type is often useful for documentation and debugging. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L547)  
```
Positive = range[1 .. high(int)]
```
  is an `int` type ranging from one to the maximum value of an `int`. This type is often useful for documentation and debugging. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L551)  
```
RootObj {...}{.compilerproc, inheritable.} = object
```
  The root of Nim's object hierarchy.

 Objects should inherit from `RootObj` or one of its descendants. However, objects that have no ancestor are also allowed.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L555)  
```
RootRef = ref RootObj
```
  Reference to `RootObj`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L560)  
```
RootEffect {...}{.compilerproc.} = object of RootObj
```
   Base effect class.

 Each effect should inherit from `RootEffect` unless you know what you're doing.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L6)  
```
TimeEffect = object of RootEffect
```
  Time effect. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L11)  
```
IOEffect = object of RootEffect
```
  IO effect. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L12)  
```
ReadIOEffect = object of IOEffect
```
  Effect describing a read IO operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L13)  
```
WriteIOEffect = object of IOEffect
```
  Effect describing a write IO operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L14)  
```
ExecIOEffect = object of IOEffect
```
  Effect describing an executing IO operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L15)  
```
StackTraceEntry = object
  procname*: cstring         ## Name of the proc that is currently executing.
  line*: int                 ## Line number of the proc that is currently executing.
  filename*: cstring         ## Filename of the proc that is currently executing.
  when NimStackTraceMsgs:
      frameMsg*: string ## When a stacktrace is generated in a given frame and
                        ## rendered at a later time, we should ensure the stacktrace
                        ## data isn't invalidated; any pointer into PFrame is
                        ## subject to being invalidated so shouldn't be stored.
    
  when defined(nimStackTraceOverride):
      programCounter*: uint ## Program counter - will be used to get the rest of the info,
                            ## when `$` is called on this type. We can't use
                            ## "cuintptr_t" in here.
      procnameStr*, filenameStr*: string ## GC-ed alternatives to "procname" and "filename"
```
  In debug mode exceptions store the stack trace that led to them. A `StackTraceEntry` is a single entry of the stack trace. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L17)  
```
Exception {...}{.compilerproc, magic: "Exception".} = object of RootObj
  parent*: ref Exception     ## Parent exception (can be used as a stack).
  name*: cstring             ## The exception's name is its Nim identifier.
                             ## This field is filled automatically in the
                             ## ``raise`` statement.
  msg* {...}{.exportc: "message".}: string ## The exception's message. Not
                                      ## providing an exception message
                                      ## is bad style.
  when defined(js):
      trace: string

  else:
      trace: seq[StackTraceEntry]

  up: ref Exception
```
   Base exception class.

 Each exception has to inherit from `Exception`. See the full [exception hierarchy](manual#exception-handling-exception-hierarchy).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L34)  
```
Defect = object of Exception
```
  Abstract base class for all exceptions that Nim's runtime raises but that are strictly uncatchable as they can also be mapped to a `quit` / `trap` / `exit` operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L52)  
```
CatchableError = object of Exception
```
  Abstract class for all exceptions that are catchable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L57)  
```
IOError = object of CatchableError
```
  Raised if an IO error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L59)  
```
EOFError = object of IOError
```
  Raised if an IO "end of file" error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L61)  
```
OSError = object of CatchableError
  errorCode*: int32          ## OS-defined error code describing this error.
```
  Raised if an operating system service failed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L63)  
```
LibraryError = object of OSError
```
  Raised if a dynamic library could not be loaded. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L66)  
```
ResourceExhaustedError = object of CatchableError
```
  Raised if a resource request could not be fulfilled. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L68)  
```
ArithmeticDefect = object of Defect
```
  Raised if any kind of arithmetic error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L70)  
```
DivByZeroDefect = object of ArithmeticDefect
```
  Raised for runtime integer divide-by-zero errors. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L72)  
```
OverflowDefect = object of ArithmeticDefect
```
   Raised for runtime integer overflows.

 This happens for calculations whose results are too large to fit in the provided bits.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L75)  
```
AccessViolationDefect = object of Defect
```
  Raised for invalid memory access errors [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L80)  
```
AssertionDefect = object of Defect
```
   Raised when assertion is proved wrong.

 Usually the result of using the [assert() template](assertions#assert.t,untyped,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L82)  
```
ValueError = object of CatchableError
```
  Raised for string and object conversion errors. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L87)  
```
KeyError = object of ValueError
```
   Raised if a key cannot be found in a table.

 Mostly used by the <tables> module, it can also be raised by other collection modules like <sets> or <strtabs>.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L89)  
```
OutOfMemDefect = object of Defect
```
  Raised for unsuccessful attempts to allocate memory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L95)  
```
IndexDefect = object of Defect
```
  Raised if an array index is out of bounds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L97)  
```
FieldDefect = object of Defect
```
  Raised if a record field is not accessible because its discriminant's value does not fit. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L100)  
```
RangeDefect = object of Defect
```
  Raised if a range check error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L103)  
```
StackOverflowDefect = object of Defect
```
  Raised if the hardware stack used for subroutine calls overflowed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L105)  
```
ReraiseDefect = object of Defect
```
  Raised if there is no exception to reraise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L107)  
```
ObjectAssignmentDefect = object of Defect
```
  Raised if an object gets assigned to its parent's object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L109)  
```
ObjectConversionDefect = object of Defect
```
  Raised if an object is converted to an incompatible object type. You can use `of` operator to check if conversion will succeed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L111)  
```
FloatingPointDefect = object of Defect
```
  Base class for floating point exceptions. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L114)  
```
FloatInvalidOpDefect = object of FloatingPointDefect
```
   Raised by invalid operations according to IEEE.

 Raised by `0.0/0.0`, for example.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L116)  
```
FloatDivByZeroDefect = object of FloatingPointDefect
```
   Raised by division by zero.

 Divisor is zero and dividend is a finite nonzero number.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L120)  
```
FloatOverflowDefect = object of FloatingPointDefect
```
   Raised for overflows.

 The operation produced a result that exceeds the range of the exponent.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L124)  
```
FloatUnderflowDefect = object of FloatingPointDefect
```
   Raised for underflows.

 The operation produced a result that is too small to be represented as a normal number.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L128)  
```
FloatInexactDefect = object of FloatingPointDefect
```
   Raised for inexact results.

 The operation produced a result that cannot be represented with infinite precision -- for example: `2.0 / 3.0, log(1.1)`

 **Note**: Nim currently does not detect these!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L133)  
```
DeadThreadDefect = object of Defect
```
  Raised if it is attempted to send a message to a dead thread. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L140)  
```
NilAccessDefect = object of Defect
```
   Raised on dereferences of `nil` pointers.

 This is only raised if the [segfaults module](segfaults) was imported!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L142)  
```
ArithmeticError {...}{.deprecated: "See corresponding Defect".} = ArithmeticDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L147)  
```
DivByZeroError {...}{.deprecated: "See corresponding Defect".} = DivByZeroDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L148)  
```
OverflowError {...}{.deprecated: "See corresponding Defect".} = OverflowDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L149)  
```
AccessViolationError {...}{.deprecated: "See corresponding Defect".} = AccessViolationDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L150)  
```
AssertionError {...}{.deprecated: "See corresponding Defect".} = AssertionDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L151)  
```
OutOfMemError {...}{.deprecated: "See corresponding Defect".} = OutOfMemDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L152)  
```
IndexError {...}{.deprecated: "See corresponding Defect".} = IndexDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L153)  
```
FieldError {...}{.deprecated: "See corresponding Defect".} = FieldDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L155)  
```
RangeError {...}{.deprecated: "See corresponding Defect".} = RangeDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L156)  
```
StackOverflowError {...}{.deprecated: "See corresponding Defect".} = StackOverflowDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L157)  
```
ReraiseError {...}{.deprecated: "See corresponding Defect".} = ReraiseDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L158)  
```
ObjectAssignmentError {...}{.deprecated: "See corresponding Defect".} = ObjectAssignmentDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L159)  
```
ObjectConversionError {...}{.deprecated: "See corresponding Defect".} = ObjectConversionDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L160)  
```
FloatingPointError {...}{.deprecated: "See corresponding Defect".} = FloatingPointDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L161)  
```
FloatInvalidOpError {...}{.deprecated: "See corresponding Defect".} = FloatInvalidOpDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L162)  
```
FloatDivByZeroError {...}{.deprecated: "See corresponding Defect".} = FloatDivByZeroDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L163)  
```
FloatOverflowError {...}{.deprecated: "See corresponding Defect".} = FloatOverflowDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L164)  
```
FloatUnderflowError {...}{.deprecated: "See corresponding Defect".} = FloatUnderflowDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L165)  
```
FloatInexactError {...}{.deprecated: "See corresponding Defect".} = FloatInexactDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L166)  
```
DeadThreadError {...}{.deprecated: "See corresponding Defect".} = DeadThreadDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L167)  
```
NilAccessError {...}{.deprecated: "See corresponding Defect".} = NilAccessDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/exceptions.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/exceptions.nim#L168)  
```
JsRoot = ref object of RootObj
```
  Root type of the JavaScript object hierarchy [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L567)  
```
owned[T] {...}{.magic: "BuiltinType".}
```
  type constructor to mark a ref/ptr or a closure as `owned`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L824)  
```
Endianness = enum
  littleEndian, bigEndian
```
  Type describing the endianness of a processor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1037) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1037)  
```
TaintedString = string
```
  A distinct string type that is tainted, see [taint mode](manual_experimental#taint-mode) for details. It is an alias for `string` if the taint mode is not turned on. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1114)  
```
ByteAddress = int
```
  is the signed integer type that should be used for converting pointers to integer addresses for readability. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1348)  
```
BiggestFloat = float64
```
  is an alias for the biggest floating point type the Nim compiler supports. Currently this is `float64`, but it is platform-dependent in general. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1352)  
```
BiggestUInt = uint64
```
  is an alias for the biggest unsigned integer type the Nim compiler supports. Currently this is `uint32` for JS and `uint64` for other targets. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1363)  
```
clong {...}{.importc: "long", nodecl.} = int
```
  This is the same as the type `long` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1376)  
```
culong {...}{.importc: "unsigned long", nodecl.} = uint
```
  This is the same as the type `unsigned long` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1378)  
```
cchar {...}{.importc: "char", nodecl.} = char
```
  This is the same as the type `char` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1382)  
```
cschar {...}{.importc: "signed char", nodecl.} = int8
```
  This is the same as the type `signed char` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1384)  
```
cshort {...}{.importc: "short", nodecl.} = int16
```
  This is the same as the type `short` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1386)  
```
cint {...}{.importc: "int", nodecl.} = int32
```
  This is the same as the type `int` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1388)  
```
csize {...}{.importc: "size_t", nodecl, deprecated: "use `csize_t` instead".} = int
```
  This isn't the same as `size_t` in *C*. Don't use it. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1390)  
```
csize_t {...}{.importc: "size_t", nodecl.} = uint
```
  This is the same as the type `size_t` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1392)  
```
clonglong {...}{.importc: "long long", nodecl.} = int64
```
  This is the same as the type `long long` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1394)  
```
cfloat {...}{.importc: "float", nodecl.} = float32
```
  This is the same as the type `float` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1396)  
```
cdouble {...}{.importc: "double", nodecl.} = float64
```
  This is the same as the type `double` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1398)  
```
clongdouble {...}{.importc: "long double", nodecl.} = BiggestFloat
```
  This is the same as the type `long double` in *C*. This C type is not supported by Nim's code generator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1400)  
```
cuchar {...}{.importc: "unsigned char", nodecl.} = char
```
  This is the same as the type `unsigned char` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1404)  
```
cushort {...}{.importc: "unsigned short", nodecl.} = uint16
```
  This is the same as the type `unsigned short` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1406)  
```
cuint {...}{.importc: "unsigned int", nodecl.} = uint32
```
  This is the same as the type `unsigned int` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1408)  
```
culonglong {...}{.importc: "unsigned long long", nodecl.} = uint64
```
  This is the same as the type `unsigned long long` in *C*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1410)  
```
cstringArray {...}{.importc: "char**", nodecl.} = ptr UncheckedArray[cstring]
```
  This is binary compatible to the type `char**` in *C*. The array's high value is large enough to disable bounds checking in practice. Use [cstringArrayToSeq proc](#cstringArrayToSeq,cstringArray,Natural) to convert it into a `seq[string]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1413)  
```
PFloat32 = ptr float32
```
  An alias for `ptr float32`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1419)  
```
PFloat64 = ptr float64
```
  An alias for `ptr float64`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1420)  
```
PInt64 = ptr int64
```
  An alias for `ptr int64`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1421)  
```
PInt32 = ptr int32
```
  An alias for `ptr int32`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1422)  
```
AllocStats = object
  allocCount: int
  deallocCount: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L54)  
```
AtomType = SomeNumber | pointer | ptr | char | bool
```
  Type Class representing valid types for use with atomic procs [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/atomics.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/atomics.nim#L17)  
```
GC_Strategy = enum
  gcThroughput,             ## optimize for throughput
  gcResponsiveness,         ## optimize for responsiveness (default)
  gcOptimizeTime,           ## optimize for speed
  gcOptimizeSpace            ## optimize for memory footprint
```
  The strategy the GC should use for the application. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L10)  
```
PFrame = ptr TFrame
```
  Represents a runtime frame of the call stack; part of the debugger API. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1948) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1948)  
```
TFrame {...}{.importc, nodecl, final.} = object
  prev*: PFrame              ## Previous frame; used for chaining the call stack.
  procname*: cstring         ## Name of the proc that is currently executing.
  line*: int                 ## Line number of the proc that is currently executing.
  filename*: cstring         ## Filename of the proc that is currently executing.
  len*: int16                ## Length of the inspectable slots.
  calldepth*: int16          ## Used for max call depth checking.
  when NimStackTraceMsgs:
      frameMsgLen*: int      ## end position in frameMsgBuf for this frame.
```
  The frame itself. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1951) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1951)  
```
FileSeekPos = enum
  fspSet,                   ## Seek to absolute value
  fspCur,                   ## Seek relative to current position
  fspEnd                     ## Seek relative to end
```
  Position relative to which seek should happen. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2138)  
```
ForeignCell = object
  data*: pointer
  owner: ptr GcHeap
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L11)  
```
BackwardsIndex = distinct int
```
  Type that is constructed by `^` for reversed array accesses. (See [^ template](#%5E.t,int)) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2451)  
```
NimNode {...}{.magic: "PNimrodNode".} = ref NimNodeObj
```
  Represents a Nim AST node. Macros operate on this type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2750)  
```
ForLoopStmt {...}{.compilerproc.} = object
```
  A special type that marks a macro as a for-loop macro. See ["For Loop Macro"](manual#macros-for-loop-macro). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3056) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3056)   Vars
----

  
```
programResult: int
```
  deprecated, prefer `quit` or `exitprocs.getProgramResult`, `exitprocs.setProgramResult`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1138)  
```
globalRaiseHook: proc (e: ref Exception): bool {...}{.nimcall, gcsafe, locks: 0.}
```
  With this hook you can influence exception handling on a global level. If not nil, every 'raise' statement ends up calling this hook.

 **Warning**: Ordinary application code should never set this hook! You better know what you do when setting this.

 If `globalRaiseHook` returns false, the exception is caught and does not propagate further through the call stack.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1900) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1900)  
```
localRaiseHook: proc (e: ref Exception): bool {...}{.nimcall, gcsafe, locks: 0.}
```
  With this hook you can influence exception handling on a thread local level. If not nil, every 'raise' statement ends up calling this hook.

 **Warning**: Ordinary application code should never set this hook! You better know what you do when setting this.

 If `localRaiseHook` returns false, the exception is caught and does not propagate further through the call stack.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1910) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1910)  
```
outOfMemHook: proc () {...}{.nimcall, tags: [], gcsafe, locks: 0, raises: [].}
```
  Set this variable to provide a procedure that should be called in case of an out of memory event. The standard handler writes an error message and terminates the program.

 `outOfMemHook` can be used to raise an exception in case of OOM like so:

 
```
var gOutOfMem: ref EOutOfMemory
new(gOutOfMem) # need to be allocated *before* OOM really happened!
gOutOfMem.msg = "out of memory"

proc handleOOM() =
  raise gOutOfMem

system.outOfMemHook = handleOOM
```

If the handler does not raise an exception, ordinary control flow continues and the program is terminated.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1921) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1921)  
```
unhandledExceptionHook: proc (e: ref Exception) {...}{.nimcall, tags: [], gcsafe,
    locks: 0, raises: [].}
```
  Set this variable to provide a procedure that should be called in case of an `unhandle exception` event. The standard handler writes an error message and terminates the program, except when using `--os:any` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1941) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1941)  
```
errorMessageWriter: (proc (msg: string) {...}{.tags: [WriteIOEffect], gcsafe,
    locks: 0, nimcall.})
```
  Function that will be called instead of `stdmsg.write` when printing stacktrace. Unstable API. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L17)  
```
onUnhandledException: (proc (errorMsg: string) {...}{.nimcall, gcsafe.})
```
  Set this error handler to override the existing behaviour on an unhandled exception.

 The default is to write a stacktrace to `stderr` and then call `quit(1)`. Unstable API.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L337)   Lets
----

  
```
nimvm: bool = false
```
  May be used only in `when` expression. It is true in Nim VM context and false otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L503)   Consts
------

  
```
on = true
```
  Alias for `true`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L19)  
```
off = false
```
  Alias for `false`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L20)  
```
appType: string = ""
```
  A string that describes the application type. Possible values: `"console"`, `"gui"`, `"lib"`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L512)  
```
NoFakeVars = false
```
  `true` if the backend doesn't support "fake variables" like `var EBADF {.importc.}: cint`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L518)  
```
isMainModule: bool = false
```
  True only when accessed in the main module. This works thanks to compiler magic. It is useful to embed testing code in a module. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1041) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1041)  
```
CompileDate: string = "0000-00-00"
```
  The date (in UTC) of compilation as a string of the form `YYYY-MM-DD`. This works thanks to compiler magic. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1045) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1045)  
```
CompileTime: string = "00:00:00"
```
  The time (in UTC) of compilation as a string of the form `HH:MM:SS`. This works thanks to compiler magic. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1049) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1049)  
```
cpuEndian: Endianness = littleEndian
```
  The endianness of the target CPU. This is a valuable piece of information for low-level code only. This works thanks to compiler magic. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1053) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1053)  
```
hostOS: string = ""
```
  A string that describes the host operating system.

 Possible values: `"windows"`, `"macosx"`, `"linux"`, `"netbsd"`, `"freebsd"`, `"openbsd"`, `"solaris"`, `"aix"`, `"haiku"`, `"standalone"`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1058) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1058)  
```
hostCPU: string = ""
```
  A string that describes the host CPU.

 Possible values: `"i386"`, `"alpha"`, `"powerpc"`, `"powerpc64"`, `"powerpc64el"`, `"sparc"`, `"amd64"`, `"mips"`, `"mipsel"`, `"arm"`, `"arm64"`, `"mips64"`, `"mips64el"`, `"riscv64"`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1065) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1065)  
```
nimEnableCovariance = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1082) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1082)  
```
QuitSuccess = 0
```
  is the value that should be passed to [quit](#quit,int) to indicate success. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1129)  
```
QuitFailure = 1
```
  is the value that should be passed to [quit](#quit,int) to indicate failure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1133)  
```
Inf = 0x7FF0000000000000'f64
```
  Contains the IEEE floating point value of positive infinity. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1500)  
```
NegInf = 0xFFF0000000000000'f64
```
  Contains the IEEE floating point value of negative infinity. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1502)  
```
NaN = 0x7FF7FFFFFFFFFFFF'f64
```
  Contains an IEEE floating point value of *Not A Number*.

 Note that you cannot compare a floating point value to this value and expect a reasonable result - use the `classify` procedure in the [math module](math) for checking for NaN.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1504)  
```
nimCoroutines = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1890)  
```
NimMajor: int = 1
```
  is the major number of Nim's version. Example:
```
when (NimMajor, NimMinor, NimPatch) >= (1, 3, 1): discard
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2114)  
```
NimMinor: int = 4
```
  is the minor number of Nim's version. Odd for devel, even for releases. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2121)  
```
NimPatch: int = 8
```
  is the patch number of Nim's version. Odd for devel, even for releases. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2125)  
```
NimVersion: string = "1.4.8"
```
  is the version of Nim as a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2133)  
```
nativeStackTraceSupported = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L136)   Procs
-----

  
```
proc `not`(x: bool): bool {...}{.magic: "Not", noSideEffect.}
```
  Boolean not; returns true if `x == false`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L45)  
```
proc `and`(x, y: bool): bool {...}{.magic: "And", noSideEffect.}
```
  Boolean `and`; returns true if `x == y == true` (if both arguments are true).

 Evaluation is lazy: if `x` is false, `y` will not even be evaluated.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L48)  
```
proc `or`(x, y: bool): bool {...}{.magic: "Or", noSideEffect.}
```
  Boolean `or`; returns true if `not (not x and not y)` (if any of the arguments is true).

 Evaluation is lazy: if `x` is true, `y` will not even be evaluated.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L53)  
```
proc `xor`(x, y: bool): bool {...}{.magic: "Xor", noSideEffect.}
```
  Boolean `exclusive or`; returns true if `x != y` (if either argument is true while the other is false). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/basic_types.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/basic_types.nim#L58)  
```
proc compileOption(option: string): bool {...}{.magic: "CompileOption", noSideEffect.}
```
  Can be used to determine an `on|off` compile-time option. Example:
```
when compileOption("floatchecks"):
  echo "compiled with floating point NaN and Inf checks"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L58)  
```
proc compileOption(option, arg: string): bool {...}{.magic: "CompileOptionArg",
    noSideEffect.}
```
  Can be used to determine an enum compile-time option. Example:
```
when compileOption("opt", "size") and compileOption("gc", "boehm"):
  echo "compiled with optimization for size and uses Boehm's GC"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L66)  
```
proc `or`(a, b: typedesc): typedesc {...}{.magic: "TypeTrait", noSideEffect.}
```
  Constructs an `or` meta class. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L77)  
```
proc `and`(a, b: typedesc): typedesc {...}{.magic: "TypeTrait", noSideEffect.}
```
  Constructs an `and` meta class. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L80)  
```
proc `not`(a: typedesc): typedesc {...}{.magic: "TypeTrait", noSideEffect.}
```
  Constructs an `not` meta class. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L83)  
```
proc defined(x: untyped): bool {...}{.magic: "Defined", noSideEffect, compileTime.}
```
  Special compile-time procedure that checks whether `x` is defined.

 `x` is an external symbol introduced through the compiler's [-d:x switch](nimc#compiler-usage-compile-time-symbols) to enable build time conditionals:

 
```
when not defined(release):
  # Do here programmer friendly expensive sanity checks.
# Put here the normal code
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L94)  
```
proc runnableExamples(rdoccmd = ""; body: untyped) {...}{.magic: "RunnableExamples".}
```
  A section you should use to mark runnable example code with.* In normal debug and release builds code within a `runnableExamples` section is ignored.
* The documentation generator is aware of these examples and considers them part of the `##` doc comment. As the last step of documentation generation each runnableExample is put in its own file `$file_examples$i.nim`, compiled and tested. The collected examples are put into their own module to ensure the examples do not refer to non-exported symbols.

 Usage:

 
```
proc double*(x: int): int =
  ## This proc doubles a number.
  runnableExamples:
    ## at module scope
    assert double(5) == 10
    block: ## at block scope
      defer: echo "done"
  result = 2 * x
  runnableExamples "-d:foo -b:cpp":
    import std/compilesettings
    doAssert querySetting(backend) == "cpp"
  runnableExamples "-r:off": ## this one is only compiled
     import std/browsers
     openDefaultBrowser "https://forum.nim-lang.org/"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L120)  
```
proc declared(x: untyped): bool {...}{.magic: "Declared", noSideEffect, compileTime.}
```
  Special compile-time procedure that checks whether `x` is declared. `x` has to be an identifier or a qualified identifier.

 See also:

 * [declaredInScope](#declaredInScope,untyped)

 This can be used to check whether a library provides a certain feature or not:

 
```
when not declared(strutils.toUpper):
  # provide our own toUpper proc here, because strutils is
  # missing it.
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L154)  
```
proc declaredInScope(x: untyped): bool {...}{.magic: "DeclaredInScope", noSideEffect,
    compileTime.}
```
  Special compile-time procedure that checks whether `x` is declared in the current scope. `x` has to be an identifier. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L172)  
```
proc `addr`[T](x: var T): ptr T {...}{.magic: "Addr", noSideEffect.}
```
  Builtin `addr` operator for taking the address of a memory location. Cannot be overloaded.

 See also:

 * [unsafeAddr](#unsafeAddr,T)

 
```
var
  buf: seq[char] = @['a','b','c']
  p = buf[1].addr
echo p.repr # ref 0x7faa35c40059 --> 'b'
echo p[]    # b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L178)  
```
proc unsafeAddr[T](x: T): ptr T {...}{.magic: "Addr", noSideEffect.}
```
  Builtin `addr` operator for taking the address of a memory location. This works even for `let` variables or parameters for better interop with C and so it is considered even more unsafe than the ordinary [addr](#addr,T).

 **Note**: When you use it to write a wrapper for a C library, you should always check that the original library does never write to data behind the pointer that is returned from this procedure.

 Cannot be overloaded.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L193)  
```
proc typeof(x: untyped; mode = typeOfIter): typedesc {...}{.magic: "TypeOf",
    noSideEffect, compileTime.}
```
  Builtin `typeof` operation for accessing the type of an expression. Since version 0.20.0. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L231)  
```
proc internalNew[T](a: var ref T) {...}{.magic: "New", noSideEffect.}
```
  Leaked implementation detail. Do not use. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L240)  
```
proc new[T](a: var ref T; finalizer: proc (x: ref T) {...}{.nimcall.}) {...}{.
    magic: "NewFinalize", noSideEffect.}
```
  Creates a new object of type `T` and returns a safe (traced) reference to it in `a`.

 When the garbage collector frees the object, `finalizer` is called. The `finalizer` may not keep a reference to the object pointed to by `x`. The `finalizer` cannot prevent the GC from freeing the object.

 **Note**: The `finalizer` refers to the type `T`, not to the object! This means that for each object of type `T` the finalizer will be called!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L244)  
```
proc wasMoved[T](obj: var T) {...}{.magic: "WasMoved", noSideEffect.}
```
  Resets an object `obj` to its initial (binary zero) value to signify it was "moved" and to signify its destructor should do nothing and ideally be optimized away. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L257)  
```
proc move[T](x: var T): T {...}{.magic: "Move", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L263)  
```
proc high[T: Ordinal | enum | range](x: T): T {...}{.magic: "High", noSideEffect, deprecated: "Deprecated since v1.4; there should not be `high(value)`. Use `high(type)`.".}
```
   **Deprecated:** Deprecated since v1.4; there should not be `high(value)`. Use `high(type)`.  Returns the highest possible value of an ordinal value `x`.

 As a special semantic rule, `x` may also be a type identifier.

 **This proc is deprecated**, use this one instead:

 * [high(typedesc)](#high,typedesc%5BT%5D)

 
```
high(2) # => 9223372036854775807
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L291)  
```
proc high[T: Ordinal | enum | range](x: typedesc[T]): T {...}{.magic: "High",
    noSideEffect.}
```
  Returns the highest possible value of an ordinal or enum type.

 `high(int)` is Nim's way of writing INT\_MAX or MAX\_INT.

 See also:

 * [low(typedesc)](#low,typedesc%5BT%5D)

 
```
high(int) # => 9223372036854775807
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L303)  
```
proc high[T](x: openArray[T]): int {...}{.magic: "High", noSideEffect.}
```
  Returns the highest possible index of a sequence `x`.

 See also:

 * [low(openArray)](#low,openArray%5BT%5D)

 
```
var s = @[1, 2, 3, 4, 5, 6, 7]
high(s) # => 6
for i in low(s)..high(s):
  echo s[i]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L314)  
```
proc high[I, T](x: array[I, T]): I {...}{.magic: "High", noSideEffect.}
```
  Returns the highest possible index of an array `x`.

 See also:

 * [low(array)](#low,array%5BI,T%5D)

 
```
var arr = [1, 2, 3, 4, 5, 6, 7]
high(arr) # => 6
for i in low(arr)..high(arr):
  echo arr[i]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L326)  
```
proc high[I, T](x: typedesc[array[I, T]]): I {...}{.magic: "High", noSideEffect.}
```
  Returns the highest possible index of an array type.

 See also:

 * [low(typedesc[array])](#low,typedesc%5Barray%5BI,T%5D%5D)

 
```
high(array[7, int]) # => 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L338)  
```
proc high(x: cstring): int {...}{.magic: "High", noSideEffect.}
```
  Returns the highest possible index of a compatible string `x`. This is sometimes an O(n) operation.

 See also:

 * [low(cstring)](#low,cstring)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L347)  
```
proc high(x: string): int {...}{.magic: "High", noSideEffect.}
```
  Returns the highest possible index of a string `x`.

 See also:

 * [low(string)](#low,string)

 
```
var str = "Hello world!"
high(str) # => 11
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L354)  
```
proc low[T: Ordinal | enum | range](x: T): T {...}{.magic: "Low", noSideEffect, deprecated: "Deprecated since v1.4; there should not be `low(value)`. Use `low(type)`.".}
```
   **Deprecated:** Deprecated since v1.4; there should not be `low(value)`. Use `low(type)`.  Returns the lowest possible value of an ordinal value `x`. As a special semantic rule, `x` may also be a type identifier.

 **This proc is deprecated**, use this one instead:

 * [low(typedesc)](#low,typedesc%5BT%5D)

 
```
low(2) # => -9223372036854775808
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L364)  
```
proc low[T: Ordinal | enum | range](x: typedesc[T]): T {...}{.magic: "Low",
    noSideEffect.}
```
  Returns the lowest possible value of an ordinal or enum type.

 `low(int)` is Nim's way of writing INT\_MIN or MIN\_INT.

 See also:

 * [high(typedesc)](#high,typedesc%5BT%5D)

 
```
low(int) # => -9223372036854775808
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L375)  
```
proc low[T](x: openArray[T]): int {...}{.magic: "Low", noSideEffect.}
```
  Returns the lowest possible index of a sequence `x`.

 See also:

 * [high(openArray)](#high,openArray%5BT%5D)

 
```
var s = @[1, 2, 3, 4, 5, 6, 7]
low(s) # => 0
for i in low(s)..high(s):
  echo s[i]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L386)  
```
proc low[I, T](x: array[I, T]): I {...}{.magic: "Low", noSideEffect.}
```
  Returns the lowest possible index of an array `x`.

 See also:

 * [high(array)](#high,array%5BI,T%5D)

 
```
var arr = [1, 2, 3, 4, 5, 6, 7]
low(arr) # => 0
for i in low(arr)..high(arr):
  echo arr[i]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L398)  
```
proc low[I, T](x: typedesc[array[I, T]]): I {...}{.magic: "Low", noSideEffect.}
```
  Returns the lowest possible index of an array type.

 See also:

 * [high(typedesc[array])](#high,typedesc%5Barray%5BI,T%5D%5D)

 
```
low(array[7, int]) # => 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L410)  
```
proc low(x: cstring): int {...}{.magic: "Low", noSideEffect.}
```
  Returns the lowest possible index of a compatible string `x`.

 See also:

 * [high(cstring)](#high,cstring)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L419)  
```
proc low(x: string): int {...}{.magic: "Low", noSideEffect.}
```
  Returns the lowest possible index of a string `x`.

 See also:

 * [high(string)](#high,string)

 
```
var str = "Hello world!"
low(str) # => 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L425)  
```
proc shallowCopy[T](x: var T; y: T) {...}{.noSideEffect, magic: "ShallowCopy".}
```
  Use this instead of `=` for a shallow copy.

 The shallow copy only changes the semantics for sequences and strings (and types which contain those).

 Be careful with the changed semantics though! There is a reason why the default assignment does a deep copy of sequences and strings.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L435)  
```
proc `[]`[I: Ordinal; T](a: T; i: I): T {...}{.noSideEffect, magic: "ArrGet".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L447)  
```
proc `[]=`[I: Ordinal; T, S](a: T; i: I; x: sink S) {...}{.noSideEffect,
    magic: "ArrPut".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L449)  
```
proc `=`[T](dest: var T; src: T) {...}{.noSideEffect, magic: "Asgn".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L451)  
```
proc `=destroy`[T](x: var T) {...}{.inline, magic: "Destroy".}
```
  Generic destructor implementation that can be overridden. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L458)  
```
proc `=sink`[T](x: var T; y: T) {...}{.inline, magic: "Asgn".}
```
  Generic sink implementation that can be overridden. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L461)  
```
proc `..`[T, U](a: sink T; b: sink U): HSlice[T, U] {...}{.noSideEffect, inline,
    magic: "DotDot".}
```
  Binary slice operator that constructs an interval `[a, b]`, both `a` and `b` are inclusive.

 Slices can also be used in the set constructor and in ordinal case statements, but then they are special-cased by the compiler.

 
```
let a = [10, 20, 30, 40, 50]
echo a[2 .. 3] # @[30, 40]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L471)  
```
proc `..`[T](b: sink T): HSlice[int, T] {...}{.noSideEffect, inline, magic: "DotDot".}
```
  Unary slice operator that constructs an interval `[default(int), b]`.
```
let a = [10, 20, 30, 40, 50]
echo a[.. 2] # @[10, 20, 30]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L483)  
```
proc succ[T: Ordinal](x: T; y = 1): T {...}{.magic: "Succ", noSideEffect.}
```
  Returns the `y`-th successor (default: 1) of the value `x`. `T` has to be an [ordinal type](#Ordinal).

 If such a value does not exist, `OverflowDefect` is raised or a compile time error occurs.

 
```
let x = 5
echo succ(5)    # => 6
echo succ(5, 3) # => 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L1) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L1)  
```
proc pred[T: Ordinal](x: T; y = 1): T {...}{.magic: "Pred", noSideEffect.}
```
  Returns the `y`-th predecessor (default: 1) of the value `x`. `T` has to be an [ordinal type](#Ordinal).

 If such a value does not exist, `OverflowDefect` is raised or a compile time error occurs.

 
```
let x = 5
echo pred(5)    # => 4
echo pred(5, 3) # => 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L13)  
```
proc inc[T: Ordinal](x: var T; y = 1) {...}{.magic: "Inc", noSideEffect.}
```
  Increments the ordinal `x` by `y`.

 If such a value does not exist, `OverflowDefect` is raised or a compile time error occurs. This is a short notation for: `x = succ(x, y)`.

 
```
var i = 2
inc(i)    # i <- 3
inc(i, 3) # i <- 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L25)  
```
proc dec[T: Ordinal](x: var T; y = 1) {...}{.magic: "Dec", noSideEffect.}
```
  Decrements the ordinal `x` by `y`.

 If such a value does not exist, `OverflowDefect` is raised or a compile time error occurs. This is a short notation for: `x = pred(x, y)`.

 
```
var i = 2
dec(i)    # i <- 1
dec(i, 3) # i <- -2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L36)  
```
proc ze(x: int8): int {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int`. This treats `x` as unsigned. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L53)  
```
proc ze(x: int16): int {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int`. This treats `x` as unsigned. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L59)  
```
proc ze64(x: int8): int64 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int64`. This treats `x` as unsigned. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L65)  
```
proc ze64(x: int16): int64 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int64`. This treats `x` as unsigned. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L71)  
```
proc ze64(x: int32): int64 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int64`. This treats `x` as unsigned. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L77)  
```
proc ze64(x: int): int64 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  zero extends a smaller integer type to `int64`. This treats `x` as unsigned. Does nothing if the size of an `int` is the same as `int64`. (This is the case on 64 bit processors.) **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L83)  
```
proc toU8(x: int): int8 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  treats `x` as unsigned and converts it to a byte by taking the last 8 bits from `x`. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L90)  
```
proc toU16(x: int): int16 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  treats `x` as unsigned and converts it to an `int16` by taking the last 16 bits from `x`. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L96)  
```
proc toU32(x: int64): int32 {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  treats `x` as unsigned and converts it to an `int32` by taking the last 32 bits from `x`. **Deprecated since version 0.19.9**: Use unsigned integers instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L102)  
```
proc `+`(x: int): int {...}{.magic: "UnaryPlusI", noSideEffect.}
```
  Unary `+` operator for an integer. Has no effect. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L156)  
```
proc `+`(x: int8): int8 {...}{.magic: "UnaryPlusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L158)  
```
proc `+`(x: int16): int16 {...}{.magic: "UnaryPlusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L159)  
```
proc `+`(x: int32): int32 {...}{.magic: "UnaryPlusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L160)  
```
proc `+`(x: int64): int64 {...}{.magic: "UnaryPlusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L161)  
```
proc `-`(x: int): int {...}{.magic: "UnaryMinusI", noSideEffect.}
```
  Unary `-` operator for an integer. Negates `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L163)  
```
proc `-`(x: int8): int8 {...}{.magic: "UnaryMinusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L165)  
```
proc `-`(x: int16): int16 {...}{.magic: "UnaryMinusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L166)  
```
proc `-`(x: int32): int32 {...}{.magic: "UnaryMinusI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L167)  
```
proc `-`(x: int64): int64 {...}{.magic: "UnaryMinusI64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L168)  
```
proc `not`(x: int): int {...}{.magic: "BitnotI", noSideEffect.}
```
  Computes the `bitwise complement` of the integer `x`.
```
var
  a = 0'u8
  b = 0'i8
  c = 1000'u16
  d = 1000'i16

echo not a # => 255
echo not b # => -1
echo not c # => 64535
echo not d # => -1001
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L170)  
```
proc `not`(x: int8): int8 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L184)  
```
proc `not`(x: int16): int16 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L185)  
```
proc `not`(x: int32): int32 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L186)  
```
proc `not`(x: int64): int64 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L187)  
```
proc `+`(x, y: int): int {...}{.magic: "AddI", noSideEffect.}
```
  Binary `+` operator for an integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L189)  
```
proc `+`(x, y: int8): int8 {...}{.magic: "AddI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L191)  
```
proc `+`(x, y: int16): int16 {...}{.magic: "AddI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L192)  
```
proc `+`(x, y: int32): int32 {...}{.magic: "AddI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L193)  
```
proc `+`(x, y: int64): int64 {...}{.magic: "AddI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L194)  
```
proc `-`(x, y: int): int {...}{.magic: "SubI", noSideEffect.}
```
  Binary `-` operator for an integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L196)  
```
proc `-`(x, y: int8): int8 {...}{.magic: "SubI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L198)  
```
proc `-`(x, y: int16): int16 {...}{.magic: "SubI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L199)  
```
proc `-`(x, y: int32): int32 {...}{.magic: "SubI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L200)  
```
proc `-`(x, y: int64): int64 {...}{.magic: "SubI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L201)  
```
proc `*`(x, y: int): int {...}{.magic: "MulI", noSideEffect.}
```
  Binary `*` operator for an integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L203)  
```
proc `*`(x, y: int8): int8 {...}{.magic: "MulI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L205)  
```
proc `*`(x, y: int16): int16 {...}{.magic: "MulI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L206)  
```
proc `*`(x, y: int32): int32 {...}{.magic: "MulI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L207)  
```
proc `*`(x, y: int64): int64 {...}{.magic: "MulI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L208)  
```
proc `div`(x, y: int): int {...}{.magic: "DivI", noSideEffect.}
```
  Computes the integer division.

 This is roughly the same as `trunc(x/y)`.

 
```
( 1 div  2) ==  0
( 2 div  2) ==  1
( 3 div  2) ==  1
( 7 div  3) ==  2
(-7 div  3) == -2
( 7 div -3) == -2
(-7 div -3) ==  2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L210)  
```
proc `div`(x, y: int8): int8 {...}{.magic: "DivI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L223)  
```
proc `div`(x, y: int16): int16 {...}{.magic: "DivI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L224)  
```
proc `div`(x, y: int32): int32 {...}{.magic: "DivI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L225)  
```
proc `div`(x, y: int64): int64 {...}{.magic: "DivI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L226)  
```
proc `mod`(x, y: int): int {...}{.magic: "ModI", noSideEffect.}
```
  Computes the integer modulo operation (remainder).

 This is the same as `x - (x div y) * y`.

 
```
( 7 mod  5) ==  2
(-7 mod  5) == -2
( 7 mod -5) ==  2
(-7 mod -5) == -2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L228)  
```
proc `mod`(x, y: int8): int8 {...}{.magic: "ModI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L238)  
```
proc `mod`(x, y: int16): int16 {...}{.magic: "ModI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L239)  
```
proc `mod`(x, y: int32): int32 {...}{.magic: "ModI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L240)  
```
proc `mod`(x, y: int64): int64 {...}{.magic: "ModI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L241)  
```
proc `shr`(x: int; y: SomeInteger): int {...}{.magic: "AshrI", noSideEffect.}
```
  Computes the `shift right` operation of `x` and `y`, filling vacant bit positions with the sign bit.

 **Note**: [Operator precedence](manual#syntax-precedence) is different than in *C*.

 See also:

 * [ashr proc](#ashr,int,SomeInteger) for arithmetic shift right

 
```
0b0001_0000'i8 shr 2 == 0b0000_0100'i8
0b0000_0001'i8 shr 1 == 0b0000_0000'i8
0b1000_0000'i8 shr 4 == 0b1111_1000'i8
-1 shr 5 == -1
1 shr 5 == 0
16 shr 2 == 4
-16 shr 2 == -4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L251)  
```
proc `shr`(x: int8; y: SomeInteger): int8 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L269)  
```
proc `shr`(x: int16; y: SomeInteger): int16 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L270)  
```
proc `shr`(x: int32; y: SomeInteger): int32 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L271)  
```
proc `shr`(x: int64; y: SomeInteger): int64 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L272)  
```
proc `shl`(x: int; y: SomeInteger): int {...}{.magic: "ShlI", noSideEffect.}
```
  Computes the `shift left` operation of `x` and `y`.

 **Note**: [Operator precedence](manual#syntax-precedence) is different than in *C*.

 
```
1'i32 shl 4 == 0x0000_0010
1'i64 shl 4 == 0x0000_0000_0000_0010
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L275)  
```
proc `shl`(x: int8; y: SomeInteger): int8 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L284)  
```
proc `shl`(x: int16; y: SomeInteger): int16 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L285)  
```
proc `shl`(x: int32; y: SomeInteger): int32 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L286)  
```
proc `shl`(x: int64; y: SomeInteger): int64 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L287)  
```
proc ashr(x: int; y: SomeInteger): int {...}{.magic: "AshrI", noSideEffect.}
```
  Shifts right by pushing copies of the leftmost bit in from the left, and let the rightmost bits fall off.

 Note that `ashr` is not an operator so use the normal function call syntax for it.

 See also:

 * [shr proc](#shr,int,SomeInteger)

 
```
ashr(0b0001_0000'i8, 2) == 0b0000_0100'i8
ashr(0b1000_0000'i8, 8) == 0b1111_1111'i8
ashr(0b1000_0000'i8, 1) == 0b1100_0000'i8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L290)  
```
proc ashr(x: int8; y: SomeInteger): int8 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L304)  
```
proc ashr(x: int16; y: SomeInteger): int16 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L305)  
```
proc ashr(x: int32; y: SomeInteger): int32 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L306)  
```
proc ashr(x: int64; y: SomeInteger): int64 {...}{.magic: "AshrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L307)  
```
proc `and`(x, y: int): int {...}{.magic: "BitandI", noSideEffect.}
```
  Computes the `bitwise and` of numbers `x` and `y`.
```
(0b0011 and 0b0101) == 0b0001
(0b0111 and 0b1100) == 0b0100
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L312)  
```
proc `and`(x, y: int8): int8 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L318)  
```
proc `and`(x, y: int16): int16 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L319)  
```
proc `and`(x, y: int32): int32 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L320)  
```
proc `and`(x, y: int64): int64 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L321)  
```
proc `or`(x, y: int): int {...}{.magic: "BitorI", noSideEffect.}
```
  Computes the `bitwise or` of numbers `x` and `y`.
```
(0b0011 or 0b0101) == 0b0111
(0b0111 or 0b1100) == 0b1111
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L323)  
```
proc `or`(x, y: int8): int8 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L329)  
```
proc `or`(x, y: int16): int16 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L330)  
```
proc `or`(x, y: int32): int32 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L331)  
```
proc `or`(x, y: int64): int64 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L332)  
```
proc `xor`(x, y: int): int {...}{.magic: "BitxorI", noSideEffect.}
```
  Computes the `bitwise xor` of numbers `x` and `y`.
```
(0b0011 xor 0b0101) == 0b0110
(0b0111 xor 0b1100) == 0b1011
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L334)  
```
proc `xor`(x, y: int8): int8 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L340)  
```
proc `xor`(x, y: int16): int16 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L341)  
```
proc `xor`(x, y: int32): int32 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L342)  
```
proc `xor`(x, y: int64): int64 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L343)  
```
proc `not`(x: uint): uint {...}{.magic: "BitnotI", noSideEffect.}
```
  Computes the `bitwise complement` of the integer `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L346)  
```
proc `not`(x: uint8): uint8 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L348)  
```
proc `not`(x: uint16): uint16 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L349)  
```
proc `not`(x: uint32): uint32 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L350)  
```
proc `not`(x: uint64): uint64 {...}{.magic: "BitnotI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L351)  
```
proc `shr`(x: uint; y: SomeInteger): uint {...}{.magic: "ShrI", noSideEffect.}
```
  Computes the `shift right` operation of `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L353)  
```
proc `shr`(x: uint8; y: SomeInteger): uint8 {...}{.magic: "ShrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L355)  
```
proc `shr`(x: uint16; y: SomeInteger): uint16 {...}{.magic: "ShrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L356)  
```
proc `shr`(x: uint32; y: SomeInteger): uint32 {...}{.magic: "ShrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L357)  
```
proc `shr`(x: uint64; y: SomeInteger): uint64 {...}{.magic: "ShrI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L358)  
```
proc `shl`(x: uint; y: SomeInteger): uint {...}{.magic: "ShlI", noSideEffect.}
```
  Computes the `shift left` operation of `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L360)  
```
proc `shl`(x: uint8; y: SomeInteger): uint8 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L362)  
```
proc `shl`(x: uint16; y: SomeInteger): uint16 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L363)  
```
proc `shl`(x: uint32; y: SomeInteger): uint32 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L364)  
```
proc `shl`(x: uint64; y: SomeInteger): uint64 {...}{.magic: "ShlI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L365)  
```
proc `and`(x, y: uint): uint {...}{.magic: "BitandI", noSideEffect.}
```
  Computes the `bitwise and` of numbers `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L367) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L367)  
```
proc `and`(x, y: uint8): uint8 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L369)  
```
proc `and`(x, y: uint16): uint16 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L370)  
```
proc `and`(x, y: uint32): uint32 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L371)  
```
proc `and`(x, y: uint64): uint64 {...}{.magic: "BitandI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L372)  
```
proc `or`(x, y: uint): uint {...}{.magic: "BitorI", noSideEffect.}
```
  Computes the `bitwise or` of numbers `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L374)  
```
proc `or`(x, y: uint8): uint8 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L376)  
```
proc `or`(x, y: uint16): uint16 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L377)  
```
proc `or`(x, y: uint32): uint32 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L378)  
```
proc `or`(x, y: uint64): uint64 {...}{.magic: "BitorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L379)  
```
proc `xor`(x, y: uint): uint {...}{.magic: "BitxorI", noSideEffect.}
```
  Computes the `bitwise xor` of numbers `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L381)  
```
proc `xor`(x, y: uint8): uint8 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L383)  
```
proc `xor`(x, y: uint16): uint16 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L384)  
```
proc `xor`(x, y: uint32): uint32 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L385)  
```
proc `xor`(x, y: uint64): uint64 {...}{.magic: "BitxorI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L386)  
```
proc `+`(x, y: uint): uint {...}{.magic: "AddU", noSideEffect.}
```
  Binary `+` operator for unsigned integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L388)  
```
proc `+`(x, y: uint8): uint8 {...}{.magic: "AddU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L390)  
```
proc `+`(x, y: uint16): uint16 {...}{.magic: "AddU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L391)  
```
proc `+`(x, y: uint32): uint32 {...}{.magic: "AddU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L392)  
```
proc `+`(x, y: uint64): uint64 {...}{.magic: "AddU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L393) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L393)  
```
proc `-`(x, y: uint): uint {...}{.magic: "SubU", noSideEffect.}
```
  Binary `-` operator for unsigned integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L395)  
```
proc `-`(x, y: uint8): uint8 {...}{.magic: "SubU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L397)  
```
proc `-`(x, y: uint16): uint16 {...}{.magic: "SubU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L398)  
```
proc `-`(x, y: uint32): uint32 {...}{.magic: "SubU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L399)  
```
proc `-`(x, y: uint64): uint64 {...}{.magic: "SubU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L400)  
```
proc `*`(x, y: uint): uint {...}{.magic: "MulU", noSideEffect.}
```
  Binary `*` operator for unsigned integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L402)  
```
proc `*`(x, y: uint8): uint8 {...}{.magic: "MulU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L404)  
```
proc `*`(x, y: uint16): uint16 {...}{.magic: "MulU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L405)  
```
proc `*`(x, y: uint32): uint32 {...}{.magic: "MulU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L406)  
```
proc `*`(x, y: uint64): uint64 {...}{.magic: "MulU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L407)  
```
proc `div`(x, y: uint): uint {...}{.magic: "DivU", noSideEffect.}
```
  Computes the integer division for unsigned integers. This is roughly the same as `trunc(x/y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L409)  
```
proc `div`(x, y: uint8): uint8 {...}{.magic: "DivU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L412)  
```
proc `div`(x, y: uint16): uint16 {...}{.magic: "DivU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L413)  
```
proc `div`(x, y: uint32): uint32 {...}{.magic: "DivU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L414)  
```
proc `div`(x, y: uint64): uint64 {...}{.magic: "DivU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L415)  
```
proc `mod`(x, y: uint): uint {...}{.magic: "ModU", noSideEffect.}
```
  Computes the integer modulo operation (remainder) for unsigned integers. This is the same as `x - (x div y) * y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L417)  
```
proc `mod`(x, y: uint8): uint8 {...}{.magic: "ModU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L420)  
```
proc `mod`(x, y: uint16): uint16 {...}{.magic: "ModU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L421)  
```
proc `mod`(x, y: uint32): uint32 {...}{.magic: "ModU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L422)  
```
proc `mod`(x, y: uint64): uint64 {...}{.magic: "ModU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L423)  
```
proc `+%`(x, y: int): int {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and adds them.

 The result is truncated to fit into the result. This implements modulo arithmetic. No overflow errors are possible.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L425)  
```
proc `+%`(x, y: int8): int8 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L431)  
```
proc `+%`(x, y: int16): int16 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L432)  
```
proc `+%`(x, y: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L433)  
```
proc `+%`(x, y: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L434)  
```
proc `-%`(x, y: int): int {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and subtracts them.

 The result is truncated to fit into the result. This implements modulo arithmetic. No overflow errors are possible.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L436)  
```
proc `-%`(x, y: int8): int8 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L442)  
```
proc `-%`(x, y: int16): int16 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L443)  
```
proc `-%`(x, y: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L444)  
```
proc `-%`(x, y: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L445)  
```
proc `*%`(x, y: int): int {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and multiplies them.

 The result is truncated to fit into the result. This implements modulo arithmetic. No overflow errors are possible.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L447)  
```
proc `*%`(x, y: int8): int8 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L453)  
```
proc `*%`(x, y: int16): int16 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L454)  
```
proc `*%`(x, y: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L455)  
```
proc `*%`(x, y: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L456)  
```
proc `/%`(x, y: int): int {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and divides them.

 The result is truncated to fit into the result. This implements modulo arithmetic. No overflow errors are possible.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L458)  
```
proc `/%`(x, y: int8): int8 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L464)  
```
proc `/%`(x, y: int16): int16 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L465)  
```
proc `/%`(x, y: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L466)  
```
proc `/%`(x, y: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L467)  
```
proc `%%`(x, y: int): int {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and compute the modulo of `x` and `y`.

 The result is truncated to fit into the result. This implements modulo arithmetic. No overflow errors are possible.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L469)  
```
proc `%%`(x, y: int8): int8 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L475)  
```
proc `%%`(x, y: int16): int16 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L476)  
```
proc `%%`(x, y: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L477)  
```
proc `%%`(x, y: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L478)  
```
proc `+=`[T: SomeInteger](x: var T; y: T) {...}{.magic: "Inc", noSideEffect.}
```
  Increments an integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L480)  
```
proc `-=`[T: SomeInteger](x: var T; y: T) {...}{.magic: "Dec", noSideEffect.}
```
  Decrements an integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L484)  
```
proc `*=`[T: SomeInteger](x: var T; y: T) {...}{.inline, noSideEffect.}
```
  Binary `*=` operator for integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/arithmetics.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/arithmetics.nim#L488)  
```
proc `==`[Enum: enum](x, y: Enum): bool {...}{.magic: "EqEnum", noSideEffect.}
```
  Checks whether values within the *same enum* have the same underlying value.
```
type
  Enum1 = enum
    Field1 = 3, Field2
  Enum2 = enum
    Place1, Place2 = 3
var
  e1 = Field1
  e2 = Enum1(Place2)
echo (e1 == e2) # true
echo (e1 == Place2) # raises error
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L2) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L2)  
```
proc `==`(x, y: pointer): bool {...}{.magic: "EqRef", noSideEffect.}
```
  
```
var # this is a wildly dangerous example
  a = cast[pointer](0)
  b = cast[pointer](nil)
echo (a == b) # true due to the special meaning of `nil`/0 as a pointer
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L16)  
```
proc `==`(x, y: string): bool {...}{.magic: "EqStr", noSideEffect.}
```
  Checks for equality between two `string` variables. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L22)  
```
proc `==`(x, y: char): bool {...}{.magic: "EqCh", noSideEffect.}
```
  Checks for equality between two `char` variables. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L25)  
```
proc `==`(x, y: bool): bool {...}{.magic: "EqB", noSideEffect.}
```
  Checks for equality between two `bool` variables. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L27)  
```
proc `==`[T](x, y: set[T]): bool {...}{.magic: "EqSet", noSideEffect.}
```
  Checks for equality between two variables of type `set`.
```
var a = {1, 2, 2, 3} # duplication in sets is ignored
var b = {1, 2, 3}
echo (a == b) # true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L29)  
```
proc `==`[T](x, y: ref T): bool {...}{.magic: "EqRef", noSideEffect.}
```
  Checks that two `ref` variables refer to the same item. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L36)  
```
proc `==`[T](x, y: ptr T): bool {...}{.magic: "EqRef", noSideEffect.}
```
  Checks that two `ptr` variables refer to the same item. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L38)  
```
proc `==`[T: proc](x, y: T): bool {...}{.magic: "EqProc", noSideEffect.}
```
  Checks that two `proc` variables refer to the same procedure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L40)  
```
proc `<=`[Enum: enum](x, y: Enum): bool {...}{.magic: "LeEnum", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L43)  
```
proc `<=`(x, y: string): bool {...}{.magic: "LeStr", noSideEffect.}
```
  Compares two strings and returns true if `x` is lexicographically before `y` (uppercase letters come before lowercase letters).
```
let
  a = "abc"
  b = "abd"
  c = "ZZZ"
assert a <= b
assert a <= a
assert (a <= c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L44)  
```
proc `<=`(x, y: char): bool {...}{.magic: "LeCh", noSideEffect.}
```
  Compares two chars and returns true if `x` is lexicographically before `y` (uppercase letters come before lowercase letters).
```
let
  a = 'a'
  b = 'b'
  c = 'Z'
assert a <= b
assert a <= a
assert (a <= c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L56)  
```
proc `<=`[T](x, y: set[T]): bool {...}{.magic: "LeSet", noSideEffect.}
```
  Returns true if `x` is a subset of `y`.

 A subset `x` has all of its members in `y` and `y` doesn't necessarily have more members than `x`. That is, `x` can be equal to `y`.

 
```
let
  a = {3, 5}
  b = {1, 3, 5, 7}
  c = {2}
assert a <= b
assert a <= a
assert (a <= c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L68)  
```
proc `<=`(x, y: bool): bool {...}{.magic: "LeB", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L82)  
```
proc `<=`[T](x, y: ref T): bool {...}{.magic: "LePtr", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L83)  
```
proc `<=`(x, y: pointer): bool {...}{.magic: "LePtr", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L84)  
```
proc `<`[Enum: enum](x, y: Enum): bool {...}{.magic: "LtEnum", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L86)  
```
proc `<`(x, y: string): bool {...}{.magic: "LtStr", noSideEffect.}
```
  Compares two strings and returns true if `x` is lexicographically before `y` (uppercase letters come before lowercase letters).
```
let
  a = "abc"
  b = "abd"
  c = "ZZZ"
assert a < b
assert (a < a) == false
assert (a < c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L87)  
```
proc `<`(x, y: char): bool {...}{.magic: "LtCh", noSideEffect.}
```
  Compares two chars and returns true if `x` is lexicographically before `y` (uppercase letters come before lowercase letters).
```
let
  a = 'a'
  b = 'b'
  c = 'Z'
assert a < b
assert (a < a) == false
assert (a < c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L99)  
```
proc `<`[T](x, y: set[T]): bool {...}{.magic: "LtSet", noSideEffect.}
```
  Returns true if `x` is a strict or proper subset of `y`.

 A strict or proper subset `x` has all of its members in `y` but `y` has more elements than `y`.

 
```
let
  a = {3, 5}
  b = {1, 3, 5, 7}
  c = {2}
assert a < b
assert (a < a) == false
assert (a < c) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L111)  
```
proc `<`(x, y: bool): bool {...}{.magic: "LtB", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L125)  
```
proc `<`[T](x, y: ref T): bool {...}{.magic: "LtPtr", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L126)  
```
proc `<`[T](x, y: ptr T): bool {...}{.magic: "LtPtr", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L127)  
```
proc `<`(x, y: pointer): bool {...}{.magic: "LtPtr", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L128)  
```
proc `==`(x, y: int): bool {...}{.magic: "EqI", noSideEffect.}
```
  Compares two integers for equality. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L143)  
```
proc `==`(x, y: int8): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L145)  
```
proc `==`(x, y: int16): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L146)  
```
proc `==`(x, y: int32): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L147)  
```
proc `==`(x, y: int64): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L148)  
```
proc `<=`(x, y: int): bool {...}{.magic: "LeI", noSideEffect.}
```
  Returns true if `x` is less than or equal to `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L150)  
```
proc `<=`(x, y: int8): bool {...}{.magic: "LeI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L152)  
```
proc `<=`(x, y: int16): bool {...}{.magic: "LeI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L153)  
```
proc `<=`(x, y: int32): bool {...}{.magic: "LeI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L154)  
```
proc `<=`(x, y: int64): bool {...}{.magic: "LeI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L155)  
```
proc `<`(x, y: int): bool {...}{.magic: "LtI", noSideEffect.}
```
  Returns true if `x` is less than `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L157)  
```
proc `<`(x, y: int8): bool {...}{.magic: "LtI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L159)  
```
proc `<`(x, y: int16): bool {...}{.magic: "LtI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L160)  
```
proc `<`(x, y: int32): bool {...}{.magic: "LtI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L161)  
```
proc `<`(x, y: int64): bool {...}{.magic: "LtI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L162)  
```
proc `<=`(x, y: uint): bool {...}{.magic: "LeU", noSideEffect.}
```
  Returns true if `x <= y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L164)  
```
proc `<=`(x, y: uint8): bool {...}{.magic: "LeU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L166)  
```
proc `<=`(x, y: uint16): bool {...}{.magic: "LeU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L167)  
```
proc `<=`(x, y: uint32): bool {...}{.magic: "LeU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L168)  
```
proc `<=`(x, y: uint64): bool {...}{.magic: "LeU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L169)  
```
proc `<`(x, y: uint): bool {...}{.magic: "LtU", noSideEffect.}
```
  Returns true if `x < y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L171)  
```
proc `<`(x, y: uint8): bool {...}{.magic: "LtU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L173)  
```
proc `<`(x, y: uint16): bool {...}{.magic: "LtU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L174)  
```
proc `<`(x, y: uint32): bool {...}{.magic: "LtU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L175)  
```
proc `<`(x, y: uint64): bool {...}{.magic: "LtU", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L176)  
```
proc `<=%`(x, y: int): bool {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and compares them. Returns true if `unsigned(x) <= unsigned(y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L178)  
```
proc `<=%`(x, y: int8): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L182)  
```
proc `<=%`(x, y: int16): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L183)  
```
proc `<=%`(x, y: int32): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L184)  
```
proc `<=%`(x, y: int64): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L185)  
```
proc `<%`(x, y: int): bool {...}{.inline, raises: [], tags: [].}
```
  Treats `x` and `y` as unsigned and compares them. Returns true if `unsigned(x) < unsigned(y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L187)  
```
proc `<%`(x, y: int8): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L191)  
```
proc `<%`(x, y: int16): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L192)  
```
proc `<%`(x, y: int32): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L193)  
```
proc `<%`(x, y: int64): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L194)  
```
proc `==`(x, y: uint): bool {...}{.magic: "EqI", noSideEffect.}
```
  Compares two unsigned integers for equality. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L204)  
```
proc `==`(x, y: uint8): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L206)  
```
proc `==`(x, y: uint16): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L207)  
```
proc `==`(x, y: uint32): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L208)  
```
proc `==`(x, y: uint64): bool {...}{.magic: "EqI", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L209)  
```
proc min(x, y: int): int {...}{.magic: "MinI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L214)  
```
proc min(x, y: int8): int8 {...}{.magic: "MinI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L216)  
```
proc min(x, y: int16): int16 {...}{.magic: "MinI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L218)  
```
proc min(x, y: int32): int32 {...}{.magic: "MinI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L220)  
```
proc min(x, y: int64): int64 {...}{.magic: "MinI", noSideEffect, raises: [], tags: [].}
```
  The minimum value of two integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L222)  
```
proc max(x, y: int): int {...}{.magic: "MaxI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L226)  
```
proc max(x, y: int8): int8 {...}{.magic: "MaxI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L228)  
```
proc max(x, y: int16): int16 {...}{.magic: "MaxI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L230)  
```
proc max(x, y: int32): int32 {...}{.magic: "MaxI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L232)  
```
proc max(x, y: int64): int64 {...}{.magic: "MaxI", noSideEffect, raises: [], tags: [].}
```
  The maximum value of two integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L234)  
```
proc min[T](x: openArray[T]): T
```
  The minimum value of `x`. `T` needs to have a `<` operator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L239)  
```
proc max[T](x: openArray[T]): T
```
  The maximum value of `x`. `T` needs to have a `<` operator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L245)  
```
proc clamp[T](x, a, b: T): T
```
  Limits the value `x` within the interval [a, b].
```
assert((1.4).clamp(0.0, 1.0) == 1.0)
assert((0.5).clamp(0.0, 1.0) == 0.5)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L254)  
```
proc `==`[I, T](x, y: array[I, T]): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L265)  
```
proc `==`[T](x, y: openArray[T]): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L271)  
```
proc `==`[T](x, y: seq[T]): bool {...}{.noSideEffect.}
```
  Generic equals operator for sequences: relies on a equals operator for the element type `T`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L280)  
```
proc unsafeNew[T](a: var ref T; size: Natural) {...}{.magic: "New", noSideEffect.}
```
  Creates a new object of type `T` and returns a safe (traced) reference to it in `a`.

 This is **unsafe** as it allocates an object of the passed `size`. This should only be used for optimization purposes when you know what you're doing!

 See also:

 * [new](#new,ref.T,proc(ref.T))

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L570)  
```
proc sizeof[T](x: T): int {...}{.magic: "SizeOf", noSideEffect.}
```
  Returns the size of `x` in bytes.

 Since this is a low-level proc, its usage is discouraged - using [new](#new,ref.T,proc(ref.T)) for the most cases suffices that one never needs to know `x`'s size.

 As a special semantic rule, `x` may also be a type identifier (`sizeof(int)` is valid).

 Limitations: If used for types that are imported from C or C++, sizeof should fallback to the `sizeof` in the C compiler. The result isn't available for the Nim compiler and therefore can't be used inside of macros.

 
```
sizeof('A') # => 1
sizeof(2) # => 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L581)  
```
proc alignof[T](x: T): int {...}{.magic: "AlignOf", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L601)  
```
proc alignof(x: typedesc): int {...}{.magic: "AlignOf", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L602)  
```
proc sizeof(x: typedesc): int {...}{.magic: "SizeOf", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L616)  
```
proc newSeq[T](s: var seq[T]; len: Natural) {...}{.magic: "NewSeq", noSideEffect.}
```
  Creates a new sequence of type `seq[T]` with length `len`.

 This is equivalent to `s = @[]; setlen(s, len)`, but more efficient since no reallocation is needed.

 Note that the sequence will be filled with zeroed entries. After the creation of the sequence you should assign entries to the sequence instead of adding them. Example:

 
```
var inputStrings : seq[string]
newSeq(inputStrings, 3)
assert len(inputStrings) == 3
inputStrings[0] = "The fourth"
inputStrings[1] = "assignment"
inputStrings[2] = "would crash"
#inputStrings[3] = "out of bounds"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L619)  
```
proc newSeq[T](len = 0.Natural): seq[T]
```
  Creates a new sequence of type `seq[T]` with length `len`.

 Note that the sequence will be filled with zeroed entries. After the creation of the sequence you should assign entries to the sequence instead of adding them.

 See also:

 * [newSeqOfCap](#newSeqOfCap,Natural)
* [newSeqUninitialized](#newSeqUninitialized,Natural)

 
```
var inputStrings = newSeq[string](3)
assert len(inputStrings) == 3
inputStrings[0] = "The fourth"
inputStrings[1] = "assignment"
inputStrings[2] = "would crash"
#inputStrings[3] = "out of bounds"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L638) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L638)  
```
proc newSeqOfCap[T](cap: Natural): seq[T] {...}{.magic: "NewSeqOfCap", noSideEffect.}
```
  Creates a new sequence of type `seq[T]` with length zero and capacity `cap`.
```
var x = newSeqOfCap[int](5)
assert len(x) == 0
x.add(10)
assert len(x) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L658)  
```
proc newSeqUninitialized[T: SomeNumber](len: Natural): seq[T]
```
  Creates a new sequence of type `seq[T]` with length `len`.

 Only available for numbers types. Note that the sequence will be uninitialized. After the creation of the sequence you should assign entries to the sequence instead of adding them.

 
```
var x = newSeqUninitialized[int](3)
assert len(x) == 3
x[0] = 10
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L671)  
```
proc len[TOpenArray: openArray | varargs](x: TOpenArray): int {...}{.
    magic: "LengthOpenArray", noSideEffect.}
```
  Returns the length of an openArray.
```
var s = [1, 1, 1, 1, 1]
echo len(s) # => 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L689)  
```
proc len(x: string): int {...}{.magic: "LengthStr", noSideEffect.}
```
  Returns the length of a string.
```
var str = "Hello world!"
echo len(str) # => 12
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L697)  
```
proc len(x: cstring): int {...}{.magic: "LengthStr", noSideEffect.}
```
  Returns the length of a compatible string. This is sometimes an O(n) operation.

 **Note:** On the JS backend this currently counts UTF-16 code points instead of bytes at runtime (not at compile time). For now, if you need the byte length of the UTF-8 encoding, convert to string with `$` first then call `len`.

 
```
var str: cstring = "Hello world!"
len(str) # => 12
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L704)  
```
proc len(x: (type array) | array): int {...}{.magic: "LengthArray", noSideEffect.}
```
  Returns the length of an array or an array type. This is roughly the same as `high(T)-low(T)+1`.
```
var arr = [1, 1, 1, 1, 1]
echo len(arr) # => 5
echo len(array[3..8, int]) # => 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L717)  
```
proc len[T](x: seq[T]): int {...}{.magic: "LengthSeq", noSideEffect.}
```
  Returns the length of a sequence.
```
var s = @[1, 1, 1, 1, 1]
echo len(s) # => 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L726)  
```
proc ord[T: Ordinal | enum](x: T): int {...}{.magic: "Ord", noSideEffect.}
```
  Returns the internal `int` value of an ordinal value `x`.
```
echo ord('A') # => 65
echo ord('a') # => 97
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L734) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L734)  
```
proc chr(u: range[0 .. 255]): char {...}{.magic: "Chr", noSideEffect.}
```
  Converts an `int` in the range `0..255` to a character.
```
echo chr(65) # => A
echo chr(97) # => a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L741)  
```
proc `+`(x: float32): float32 {...}{.magic: "UnaryPlusF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L750)  
```
proc `-`(x: float32): float32 {...}{.magic: "UnaryMinusF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L751)  
```
proc `+`(x, y: float32): float32 {...}{.magic: "AddF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L752) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L752)  
```
proc `-`(x, y: float32): float32 {...}{.magic: "SubF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L753) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L753)  
```
proc `*`(x, y: float32): float32 {...}{.magic: "MulF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L754)  
```
proc `/`(x, y: float32): float32 {...}{.magic: "DivF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L755) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L755)  
```
proc `+`(x: float): float {...}{.magic: "UnaryPlusF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L757) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L757)  
```
proc `-`(x: float): float {...}{.magic: "UnaryMinusF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L758) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L758)  
```
proc `+`(x, y: float): float {...}{.magic: "AddF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L759) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L759)  
```
proc `-`(x, y: float): float {...}{.magic: "SubF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L760)  
```
proc `*`(x, y: float): float {...}{.magic: "MulF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L761) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L761)  
```
proc `/`(x, y: float): float {...}{.magic: "DivF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L762) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L762)  
```
proc `==`(x, y: float32): bool {...}{.magic: "EqF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L764) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L764)  
```
proc `<=`(x, y: float32): bool {...}{.magic: "LeF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L765) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L765)  
```
proc `<`(x, y: float32): bool {...}{.magic: "LtF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L766)  
```
proc `==`(x, y: float): bool {...}{.magic: "EqF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L768) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L768)  
```
proc `<=`(x, y: float): bool {...}{.magic: "LeF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L769)  
```
proc `<`(x, y: float): bool {...}{.magic: "LtF64", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L770) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L770)  
```
proc incl[T](x: var set[T]; y: T) {...}{.magic: "Incl", noSideEffect.}
```
  Includes element `y` in the set `x`.

 This is the same as `x = x + {y}`, but it might be more efficient.

 
```
var a = {1, 3, 5}
a.incl(2) # a <- {1, 2, 3, 5}
a.incl(4) # a <- {1, 2, 3, 4, 5}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L1) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L1)  
```
proc excl[T](x: var set[T]; y: T) {...}{.magic: "Excl", noSideEffect.}
```
  Excludes element `y` from the set `x`.

 This is the same as `x = x - {y}`, but it might be more efficient.

 
```
var b = {2, 3, 5, 6, 12, 545}
b.excl(5)  # b <- {2, 3, 6, 12, 545}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L20)  
```
proc card[T](x: set[T]): int {...}{.magic: "Card", noSideEffect.}
```
  Returns the cardinality of the set `x`, i.e. the number of elements in the set.
```
var a = {1, 3, 5, 7}
echo card(a) # => 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L38)  
```
proc len[T](x: set[T]): int {...}{.magic: "Card", noSideEffect.}
```
  An alias for `card(x)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L46)  
```
proc `*`[T](x, y: set[T]): set[T] {...}{.magic: "MulSet", noSideEffect.}
```
  This operator computes the intersection of two sets.
```
let
  a = {1, 2, 3}
  b = {2, 3, 4}
echo a * b # => {2, 3}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L50)  
```
proc `+`[T](x, y: set[T]): set[T] {...}{.magic: "PlusSet", noSideEffect.}
```
  This operator computes the union of two sets.
```
let
  a = {1, 2, 3}
  b = {2, 3, 4}
echo a + b # => {1, 2, 3, 4}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L58)  
```
proc `-`[T](x, y: set[T]): set[T] {...}{.magic: "MinusSet", noSideEffect.}
```
  This operator computes the difference of two sets.
```
let
  a = {1, 2, 3}
  b = {2, 3, 4}
echo a - b # => {1}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L66)  
```
proc contains[T](x: set[T]; y: T): bool {...}{.magic: "InSet", noSideEffect.}
```
  One should overload this proc if one wants to overload the `in` operator.

 The parameters are in reverse order! `a in b` is a template for `contains(b, a)`. This is because the unification algorithm that Nim uses for overload resolution works from left to right. But for the `in` operator that would be the wrong direction for this piece of code:

 
```
var s: set[range['a'..'z']] = {'a'..'c'}
assert s.contains('c')
assert 'b' in s
```

If `in` had been declared as `[T](elem: T, s: set[T])` then `T` would have been bound to `char`. But `s` is not compatible to type `set[char]`! The solution is to bind `T` to `range['a'..'z']`. This is achieved by reversing the parameters for `contains`; `in` then passes its arguments in reverse order.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L75)  
```
proc contains[U, V, W](s: HSlice[U, V]; value: W): bool {...}{.noSideEffect, inline.}
```
  Checks if `value` is within the range of `s`; returns true if `value >= s.a and value <= s.b`
```
assert((1..3).contains(1) == true)
assert((1..3).contains(2) == true)
assert((1..3).contains(4) == false)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L776) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L776)  
```
proc `is`[T, S](x: T; y: S): bool {...}{.magic: "Is", noSideEffect.}
```
  Checks if `T` is of the same type as `S`.

 For a negated version, use [isnot](#isnot.t,untyped,untyped).

 
```
assert 42 is int
assert @[1, 2] is seq

proc test[T](a: T): int =
  when (T is int):
    return a
  else:
    return 0

assert(test[int](3) == 3)
assert(test[string]("xyz") == 0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L799)  
```
proc new[T](a: var ref T) {...}{.magic: "New", noSideEffect.}
```
  Creates a new object of type `T` and returns a safe (traced) reference to it in `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L855) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L855)  
```
proc new(t: typedesc): auto
```
  Creates a new object of type `T` and returns a safe (traced) reference to it as result value.

 When `T` is a ref type then the resulting type will be `T`, otherwise it will be `ref T`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L859)  
```
proc `of`[T, S](x: typedesc[T]; y: typedesc[S]): bool {...}{.magic: "Of",
    noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L882) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L882)  
```
proc `of`[T, S](x: T; y: typedesc[S]): bool {...}{.magic: "Of", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L883) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L883)  
```
proc `of`[T, S](x: T; y: S): bool {...}{.magic: "Of", noSideEffect.}
```
  Checks if `x` has a type of `y`.
```
assert(FloatingPointDefect of Exception)
assert(DivByZeroDefect of Exception)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L884) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L884)  
```
proc cmp[T](x, y: T): int
```
  Generic compare proc.

 Returns:

 * a value less than zero, if `x < y`
* a value greater than zero, if `x > y`
* zero, if `x == y`

 This is useful for writing generic algorithms without performance loss. This generic implementation uses the `==` and `<` operators.

 
```
import algorithm
echo sorted(@[4, 2, 6, 5, 8, 7], cmp[int])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L891) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L891)  
```
proc `@`[IDX, T](a: sink array[IDX, T]): seq[T] {...}{.magic: "ArrToSeq",
    noSideEffect.}
```
  Turns an array into a sequence.

 This most often useful for constructing sequences with the array constructor: `@[1, 2, 3]` has the type `seq[int]`, while `[1, 2, 3]` has the type `array[0..2, int]`.

 
```
let
  a = [1, 3, 5]
  b = "foo"

echo @a # => @[1, 3, 5]
echo @b # => @['f', 'o', 'o']
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L916) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L916)  
```
proc default(T: typedesc): T:type {...}{.magic: "Default", noSideEffect.}
```
  returns the default value of the type `T`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L932) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L932)  
```
proc reset[T](obj: var T) {...}{.noSideEffect.}
```
  Resets an object `obj` to its default value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L935) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L935)  
```
proc setLen[T](s: var seq[T]; newlen: Natural) {...}{.magic: "SetLengthSeq",
    noSideEffect.}
```
  Sets the length of seq `s` to `newlen`. `T` may be any sequence type.

 If the current length is greater than the new length, `s` will be truncated.

 
```
var x = @[10, 20]
x.setLen(5)
x[4] = 50
assert x == @[10, 20, 0, 0, 50]
x.setLen(1)
assert x == @[10]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L947) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L947)  
```
proc setLen(s: var string; newlen: Natural) {...}{.magic: "SetLengthStr",
    noSideEffect.}
```
  Sets the length of string `s` to `newlen`.

 If the current length is greater than the new length, `s` will be truncated.

 
```
var myS = "Nim is great!!"
myS.setLen(3) # myS <- "Nim"
echo myS, " is fantastic!!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L962) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L962)  
```
proc newString(len: Natural): string {...}{.magic: "NewString",
                                       importc: "mnewString", noSideEffect.}
```
  Returns a new string of length `len` but with uninitialized content. One needs to fill the string character after character with the index operator `s[i]`.

 This procedure exists only for optimization purposes; the same effect can be achieved with the `&` operator or with `add`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L974) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L974)  
```
proc newStringOfCap(cap: Natural): string {...}{.magic: "NewStringOfCap",
    importc: "rawNewString", noSideEffect.}
```
  Returns a new string of length `0` but with capacity `cap`.

 This procedure exists only for optimization purposes; the same effect can be achieved with the `&` operator or with `add`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L983) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L983)  
```
proc `&`(x: string; y: char): string {...}{.magic: "ConStrStr", noSideEffect, merge.}
```
  Concatenates `x` with `y`.
```
assert("ab" & 'c' == "abc")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L990) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L990)  
```
proc `&`(x, y: char): string {...}{.magic: "ConStrStr", noSideEffect, merge.}
```
  Concatenates characters `x` and `y` into a string.
```
assert('a' & 'b' == "ab")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L996) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L996)  
```
proc `&`(x, y: string): string {...}{.magic: "ConStrStr", noSideEffect, merge.}
```
  Concatenates strings `x` and `y`.
```
assert("ab" & "cd" == "abcd")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1002) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1002)  
```
proc `&`(x: char; y: string): string {...}{.magic: "ConStrStr", noSideEffect, merge.}
```
  Concatenates `x` with `y`.
```
assert('a' & "bc" == "abc")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1008)  
```
proc add(x: var string; y: char) {...}{.magic: "AppendStrCh", noSideEffect.}
```
  Appends `y` to `x` in place.
```
var tmp = ""
tmp.add('a')
tmp.add('b')
assert(tmp == "ab")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1018) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1018)  
```
proc add(x: var string; y: string) {...}{.magic: "AppendStrStr", noSideEffect.}
```
  Concatenates `x` and `y` in place.
```
var tmp = ""
tmp.add("ab")
tmp.add("cd")
assert(tmp == "abcd")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1026) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1026)  
```
proc quit(errorcode: int = QuitSuccess) {...}{.magic: "Exit", noreturn.}
```
  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#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](#GC_fullCollect).

 The proc `quit(QuitSuccess)` is called implicitly when your nim program finishes without incident for platforms where this is the expected behavior. A raised unhandled exception is equivalent to calling `quit(QuitFailure)`.

 Note that this is a *runtime* call and using `quit` inside a macro won't have any compile time effect. If you need to stop the compiler inside a macro, use the [error](manual#pragmas-error-pragma) or [fatal](manual#pragmas-fatal-pragma) pragmas.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1151)  
```
proc add[T](x: var seq[T]; y: sink T) {...}{.magic: "AppendSeqElem", noSideEffect.}
```
  Generic proc for adding a data item `y` to a container `x`.

 For containers that have an order, `add` means *append*. New generic containers should also call their adding proc `add` for consistency. Generic code becomes much easier to write if the Nim naming scheme is respected.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1210)  
```
proc add[T](x: var seq[T]; y: openArray[T]) {...}{.noSideEffect.}
```
  Generic proc for adding a container `y` to a container `x`.

 For containers that have an order, `add` means *append*. New generic containers should also call their adding proc `add` for consistency. Generic code becomes much easier to write if the Nim naming scheme is respected.

 See also:

 * [& proc](#&,seq%5BT%5D%5BT%5D,seq%5BT%5D%5BT%5D)

 
```
var s: seq[string] = @["test2","test2"]
s.add("test") # s <- @[test2, test2, test]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1244)  
```
proc del[T](x: var seq[T]; i: Natural) {...}{.noSideEffect.}
```
  Deletes the item at index `i` by putting `x[high(x)]` into position `i`.

 This is an `O(1)` operation.

 See also:

 * [delete](#delete,seq%5BT%5D%5BT%5D,Natural) for preserving the order

 
```
var i = @[1, 2, 3, 4, 5]
i.del(2) # => @[1, 2, 5, 4]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1271)  
```
proc delete[T](x: var seq[T]; i: Natural) {...}{.noSideEffect.}
```
  Deletes the item at index `i` by moving all `x[i+1..]` items by one position.

 This is an `O(n)` operation.

 See also:

 * [del](#delete,seq%5BT%5D%5BT%5D,Natural) for O(1) operation

 
```
var i = @[1, 2, 3, 4, 5]
i.delete(2) # => @[1, 2, 4, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1286)  
```
proc insert[T](x: var seq[T]; item: sink T; i = 0.Natural) {...}{.noSideEffect.}
```
  Inserts `item` into `x` at position `i`.
```
var i = @[1, 3, 5]
i.insert(99, 0) # i <- @[99, 1, 3, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1310)  
```
proc repr[T](x: T): string {...}{.magic: "Repr", noSideEffect.}
```
  Takes any Nim variable and returns its string representation.

 It works even for complex data graphs with cycles. This is a great debugging tool.

 
```
var s: seq[string] = @["test2", "test2"]
var i = @[1, 2, 3, 4, 5]
echo repr(s) # => 0x1055eb050[0x1055ec050"test2", 0x1055ec078"test2"]
echo repr(i) # => 0x1055ed050[1, 2, 3, 4, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1335)  
```
proc toFloat(i: int): float {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  Converts an integer `i` into a `float`.

 If the conversion fails, `ValueError` is raised. However, on most platforms the conversion cannot fail.

 
```
let
  a = 2
  b = 3.7

echo a.toFloat + b # => 5.7
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1424)  
```
proc toBiggestFloat(i: BiggestInt): BiggestFloat {...}{.noSideEffect, inline,
    raises: [], tags: [].}
```
  Same as [toFloat](#toFloat,int) but for `BiggestInt` to `BiggestFloat`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1438)  
```
proc toInt(f: float): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Converts a floating point number `f` into an `int`.

 Conversion rounds `f` half away from 0, see [Round half away from zero](https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero).

 Note that some floating point numbers (e.g. infinity or even 1e19) cannot be accurately converted.

 
```
doAssert toInt(0.49) == 0
doAssert toInt(0.5) == 1
doAssert toInt(-0.5) == -1 # rounding is symmetrical
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1442)  
```
proc toBiggestInt(f: BiggestFloat): BiggestInt {...}{.noSideEffect, raises: [],
    tags: [].}
```
  Same as [toInt](#toInt,float) but for `BiggestFloat` to `BiggestInt`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1458)  
```
proc addQuitProc(quitProc: proc () {...}{.noconv.}) {...}{.importc: "atexit",
    header: "<stdlib.h>", deprecated: "use exitprocs.addExitProc".}
```
   **Deprecated:** use exitprocs.addExitProc  Adds/registers a quit procedure.

 Each call to `addQuitProc` registers another quit procedure. Up to 30 procedures can be registered. They are executed on a last-in, first-out basis (that is, the last function registered is the first to be executed). `addQuitProc` raises an EOutOfIndex exception if `quitProc` cannot be registered.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1462)  
```
proc swap[T](a, b: var T) {...}{.magic: "Swap", noSideEffect.}
```
  Swaps the values `a` and `b`.

 This is often more efficient than `tmp = a; a = b; b = tmp`. Particularly useful for sorting algorithms.

 
```
var
  a = 5
  b = 9

swap(a, b)

assert a == 9
assert b == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1476)  
```
proc `-`(a, b: AllocStats): AllocStats {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L58)  
```
proc getAllocStats(): AllocStats {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L75)  
```
proc createU(T: typedesc; size = 1.Positive): ptr T:type {...}{.inline, gcsafe,
    locks: 0, raises: [].}
```
  Allocates a new memory block with at least `T.sizeof * size` bytes.

 The block has to be freed with [resize(block, 0)](#resize,ptr.T,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 [createSharedU](#createSharedU,typedesc) to allocate from a shared heap.

 See also:

 * [create](#create,typedesc)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L93)  
```
proc create(T: typedesc; size = 1.Positive): ptr T:type {...}{.inline, gcsafe,
    locks: 0, raises: [].}
```
  Allocates a new memory block with at least `T.sizeof * size` bytes.

 The block has to be freed with [resize(block, 0)](#resize,ptr.T,Natural) or [dealloc(block)](#dealloc,pointer). The block is initialized with all bytes containing zero, so it is somewhat safer than [createU](#createU,typedesc).

 The allocated memory belongs to its allocating thread! Use [createShared](#createShared,typedesc) to allocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L121)  
```
proc resize[T](p: ptr T; newSize: Natural): ptr T {...}{.inline, gcsafe, locks: 0,
    raises: [].}
```
  Grows or shrinks a given memory block.

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `T.sizeof * newSize` bytes. If `newSize == 0` and `p` is not **nil** `resize` calls `dealloc(p)`. In other cases the block has to be freed with `free`.

 The allocated memory belongs to its allocating thread! Use [resizeShared](#resizeShared,ptr.T,Natural) to reallocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L164)  
```
proc dealloc(p: pointer) {...}{.noconv, compilerproc, gcsafe, gcsafe, locks: 0,
                           raises: [], tags: [].}
```
  Frees the memory allocated with `alloc`, `alloc0` or `realloc`.

 **This procedure is dangerous!** If one forgets to free the memory a leak occurs; if one tries to access freed memory (or just freeing it twice!) a core dump may happen or other memory may be corrupted.

 The freed memory must belong to its allocating thread! Use [deallocShared](#deallocShared,pointer) to deallocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L177)  
```
proc createSharedU(T: typedesc; size = 1.Positive): ptr T:type {...}{.inline,
    tags: [], gcsafe, locks: 0, raises: [].}
```
  Allocates a new memory block on the shared heap with at least `T.sizeof * size` bytes.

 The block has to be freed with [resizeShared(block, 0)](#resizeShared,ptr.T,Natural) or [freeShared(block)](#freeShared,ptr.T).

 The block is not initialized, so reading from it before writing to it is undefined behaviour!

 See also:

 * [createShared](#createShared,typedesc)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L207)  
```
proc createShared(T: typedesc; size = 1.Positive): ptr T:type {...}{.inline.}
```
  Allocates a new memory block on the shared heap with at least `T.sizeof * size` bytes.

 The block has to be freed with [resizeShared(block, 0)](#resizeShared,ptr.T,Natural) or [freeShared(block)](#freeShared,ptr.T).

 The block is initialized with all bytes containing zero, so it is somewhat safer than [createSharedU](#createSharedU,typedesc).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L237)  
```
proc resizeShared[T](p: ptr T; newSize: Natural): ptr T {...}{.inline, raises: [].}
```
  Grows or shrinks a given memory block on the heap.

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `T.sizeof * newSize` bytes. If `newSize == 0` and `p` is not **nil** `resizeShared` calls `freeShared(p)`. In other cases the block has to be freed with [freeShared](#freeShared,ptr.T).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L275)  
```
proc deallocShared(p: pointer) {...}{.noconv, compilerproc, gcsafe, gcsafe, locks: 0,
                                 raises: [], tags: [].}
```
  Frees the memory allocated with `allocShared`, `allocShared0` or `reallocShared`.

 **This procedure is dangerous!** If one forgets to free the memory a leak occurs; if one tries to access freed memory (or just freeing it twice!) a core dump may happen or other memory may be corrupted.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L286)  
```
proc freeShared[T](p: ptr T) {...}{.inline, gcsafe, locks: 0, raises: [].}
```
  Frees the memory allocated with `createShared`, `createSharedU` or `resizeShared`.

 **This procedure is dangerous!** If one forgets to free the memory a leak occurs; if one tries to access freed memory (or just freeing it twice!) a core dump may happen or other memory may be corrupted.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L297)  
```
proc `|`(a, b: typedesc): typedesc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1515)  
```
proc abs(x: float64): float64 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1522)  
```
proc abs(x: float32): float32 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1524)  
```
proc min(x, y: float32): float32 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1526)  
```
proc min(x, y: float64): float64 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1528)  
```
proc max(x, y: float32): float32 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1530)  
```
proc max(x, y: float64): float64 {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1532)  
```
proc min[T: not SomeFloat](x, y: T): T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1534)  
```
proc max[T: not SomeFloat](x, y: T): T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1536) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1536)  
```
proc high(T: typedesc[SomeFloat]): T:type
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1542)  
```
proc low(T: typedesc[SomeFloat]): T:type
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1543)  
```
proc len[U: Ordinal; V: Ordinal](x: HSlice[U, V]): int {...}{.noSideEffect, inline.}
```
  Length of ordinal slice. When x.b < x.a returns zero length.
```
assert((0..5).len == 6)
assert((5..2).len == 0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1545)  
```
proc isNil[T](x: seq[T]): bool {...}{.noSideEffect, magic: "IsNil", error.}
```
  Requires `--nilseqs:on` since 0.19.

 Seqs are no longer nil by default, but set and empty. Check for zero length instead.

 See also:

 * [isNil(string)](#isNil,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1561)  
```
proc isNil[T](x: ref T): bool {...}{.noSideEffect, magic: "IsNil".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1570)  
```
proc isNil(x: string): bool {...}{.noSideEffect, magic: "IsNil", error.}
```
  Requires `--nilseqs:on`.

 See also:

 * [isNil(seq[T])](#isNil,seq%5BT%5D%5BT%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1571)  
```
proc isNil[T](x: ptr T): bool {...}{.noSideEffect, magic: "IsNil".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1577)  
```
proc isNil(x: pointer): bool {...}{.noSideEffect, magic: "IsNil".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1578)  
```
proc isNil(x: cstring): bool {...}{.noSideEffect, magic: "IsNil".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1579)  
```
proc isNil[T: proc](x: T): bool {...}{.noSideEffect, magic: "IsNil".}
```
  Fast check whether `x` is nil. This is sometimes more efficient than `== nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1580)  
```
proc `@`[T](a: openArray[T]): seq[T]
```
  Turns an *openArray* into a sequence.

 This is not as efficient as turning a fixed length array into a sequence as it always copies every element of `a`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1585)  
```
proc `&`[T](x, y: seq[T]): seq[T] {...}{.noSideEffect.}
```
  Concatenates two sequences.

 Requires copying of the sequences.

 See also:

 * [add(var seq[T], openArray[T])](#add,seq%5BT%5D%5BT%5D,openArray%5BT%5D)

 
```
assert(@[1, 2, 3, 4] & @[5, 6] == @[1, 2, 3, 4, 5, 6])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1641)  
```
proc `&`[T](x: seq[T]; y: T): seq[T] {...}{.noSideEffect.}
```
  Appends element y to the end of the sequence.

 Requires copying of the sequence.

 See also:

 * [add(var seq[T], T)](#add,seq%5BT%5D%5BT%5D,T)

 
```
assert(@[1, 2, 3] & 4 == @[1, 2, 3, 4])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1657)  
```
proc `&`[T](x: T; y: seq[T]): seq[T] {...}{.noSideEffect.}
```
  Prepends the element x to the beginning of the sequence.

 Requires copying of the sequence.

 
```
assert(1 & @[2, 3, 4] == @[1, 2, 3, 4])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1672)  
```
proc astToStr[T](x: T): string {...}{.magic: "AstToStr", noSideEffect.}
```
  Converts the AST of `x` into a string representation. This is very useful for debugging. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1685)  
```
proc instantiationInfo(index = -1; fullPaths = false): tuple[filename: string,
    line: int, column: int] {...}{.magic: "InstantiationInfo", noSideEffect.}
```
  Provides access to the compiler's instantiation stack line information of a template.

 While similar to the caller info of other languages, it is determined at compile time.

 This proc is mostly useful for meta programming (eg. `assert` template) to retrieve information about the current filename and line number. Example:

 
```
import strutils

template testException(exception, code: untyped): typed =
  try:
    let pos = instantiationInfo()
    discard(code)
    echo "Test failure at $1:$2 with '$3'" % [pos.filename,
      $pos.line, astToStr(code)]
    assert false, "A test expecting failure succeeded?"
  except exception:
    discard

proc tester(pos: int): int =
  let
    a = @[1, 2, 3]
  result = a[pos]

when isMainModule:
  testException(IndexDefect, tester(30))
  testException(IndexDefect, tester(1))
  # --> Test failure at example.nim:20 with 'tester(1)'
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1689)  
```
proc compiles(x: untyped): bool {...}{.magic: "Compiles", noSideEffect, compileTime,
                                  raises: [], tags: [].}
```
  Special compile-time procedure that checks whether `x` can be compiled without any semantic error. This can be used to check whether a type supports some operation:
```
when compiles(3 + 4):
  echo "'+' for integers is available"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1724)  
```
proc atomicInc(memLoc: var int; x: int = 1): int {...}{.inline, discardable, gcsafe,
    locks: 0, raises: [], tags: [].}
```
  Atomic increment of `memLoc`. Returns the value after the operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1778) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1778)  
```
proc atomicDec(memLoc: var int; x: int = 1): int {...}{.inline, discardable, gcsafe,
    locks: 0, raises: [], tags: [].}
```
  Atomic decrement of `memLoc`. Returns the value after the operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1782) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1782)  
```
proc addAndFetch(p: ptr int; val: int): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/atomics.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/atomics.nim#L214)  
```
proc cas[T: bool | int | ptr](p: ptr T; oldValue, newValue: T): bool {...}{.
    importc: "__sync_bool_compare_and_swap", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/atomics.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/atomics.nim#L314)  
```
proc cpuRelax() {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/atomics.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/atomics.nim#L322)  
```
proc find[T, S](a: T; item: S): int {...}{.inline.}
```
  Returns the first index of `item` in `a` or -1 if not found. This requires appropriate `items` and `==` operations to work. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1801) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1801)  
```
proc contains[T](a: openArray[T]; item: T): bool {...}{.inline.}
```
  Returns true if `item` is in `a` or false if not found. This is a shortcut for `find(a, item) >= 0`.

 This allows the `in` operator: `a.contains(item)` is the same as `item in a`.

 
```
var a = @[1, 3, 5]
assert a.contains(5)
assert 3 in a
assert 99 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1810) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1810)  
```
proc pop[T](s: var seq[T]): T {...}{.inline, noSideEffect.}
```
  Returns the last item of `s` and decreases `s.len` by one. This treats `s` as a stack and implements the common *pop* operation. **Example:**

 
```
var a = @[1, 3, 5, 7]
let b = pop(a)
assert b == 7
assert a == @[1, 3, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1824)  
```
proc `==`[T: tuple | object](x, y: T): bool
```
  Generic `==` operator for tuples that is lifted from the components. of `x` and `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1841)  
```
proc `<=`[T: tuple](x, y: T): bool
```
  Generic lexicographic `<=` operator for tuples that is lifted from the components of `x` and `y`. This implementation uses `cmp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1848) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1848)  
```
proc `<`[T: tuple](x, y: T): bool
```
  Generic lexicographic `<` operator for tuples that is lifted from the components of `x` and `y`. This implementation uses `cmp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1857) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1857)  
```
proc GC_ref[T](x: ref T) {...}{.magic: "GCref", gcsafe, locks: 0.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L44)  
```
proc GC_ref[T](x: seq[T]) {...}{.magic: "GCref", gcsafe, locks: 0.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L45)  
```
proc GC_ref(x: string) {...}{.magic: "GCref", gcsafe, locks: 0.}
```
  Marks the object `x` as referenced, so that it will not be freed until it is unmarked via `GC_unref`. If called n-times for the same object `x`, n calls to `GC_unref` are needed to unmark `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L46)  
```
proc GC_unref[T](x: ref T) {...}{.magic: "GCunref", gcsafe, locks: 0.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L52)  
```
proc GC_unref[T](x: seq[T]) {...}{.magic: "GCunref", gcsafe, locks: 0.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L53)  
```
proc GC_unref(x: string) {...}{.magic: "GCunref", gcsafe, locks: 0.}
```
  See the documentation of [GC\_ref](#GC_ref,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_interface.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_interface.nim#L54)  
```
proc add(x: var string; y: cstring) {...}{.asmNoStackFrame, raises: [], tags: [].}
```
  Appends `y` to `x` in place. **Example:**

 
```
var tmp = ""
tmp.add(cstring("ab"))
tmp.add(cstring("cd"))
doAssert tmp == "abcd"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1962) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1962)  
```
proc add(x: var cstring; y: cstring) {...}{.magic: "AppendStrStr", raises: [],
                                       tags: [].}
```
  Appends `y` to `x` in place. Only implemented for JS backend. **Example:**

 
```
when defined(js):
  var tmp: cstring = ""
  tmp.add(cstring("ab"))
  tmp.add(cstring("cd"))
  doAssert tmp == cstring("abcd")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1977) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1977)  
```
proc echo(x: varargs[typed, `$`]) {...}{.magic: "Echo", tags: [WriteIOEffect],
                                    gcsafe, locks: 0, sideEffect.}
```
  Writes and flushes the parameters to the standard output.

 Special built-in that takes a variable number of arguments. Each argument is converted to a string via `$`, so it works for user-defined types that have an overloaded `$` operator. It is roughly equivalent to `writeLine(stdout, x); flushFile(stdout)`, but available for the JavaScript target too.

 Unlike other IO operations this is guaranteed to be thread-safe as `echo` is very often used for debugging convenience. If you want to use `echo` inside a [proc without side effects](manual#pragmas-nosideeffect-pragma) you can use [debugEcho](#debugEcho,varargs%5Btyped,%5D) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L1998) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L1998)  
```
proc debugEcho(x: varargs[typed, `$`]) {...}{.magic: "Echo", noSideEffect, tags: [],
    raises: [].}
```
  Same as [echo](#echo,varargs%5Btyped,%5D), but as a special semantic rule, `debugEcho` pretends to be free of side effects, so that it can be used for debugging routines marked as [noSideEffect](manual#pragmas-nosideeffect-pragma). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2014) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2014)  
```
proc getTypeInfo[T](x: T): pointer {...}{.magic: "GetTypeInfo", gcsafe, locks: 0.}
```
  Get type information for `x`.

 Ordinary code should not use this, but the [typeinfo module](typeinfo) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2037) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2037)  
```
proc abs(x: int): int {...}{.magic: "AbsI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2044) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2044)  
```
proc abs(x: int8): int8 {...}{.magic: "AbsI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2046) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2046)  
```
proc abs(x: int16): int16 {...}{.magic: "AbsI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2048) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2048)  
```
proc abs(x: int32): int32 {...}{.magic: "AbsI", noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2050)  
```
proc abs(x: int64): int64 {...}{.magic: "AbsI", noSideEffect, raises: [], tags: [].}
```
  Returns the absolute value of `x`.

 If `x` is `low(x)` (that is -MININT for its type), an overflow exception is thrown (if overflow checking is turned on).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2052) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2052)  
```
proc zeroMem(p: pointer; size: Natural) {...}{.inline, noSideEffect, tags: [],
    locks: 0, raises: [].}
```
  Overwrites the contents of the memory at `p` with the value 0.

 Exactly `size` bytes will be overwritten. Like any procedure dealing with raw memory this is **unsafe**.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2183)  
```
proc copyMem(dest, source: pointer; size: Natural) {...}{.inline, gcsafe, locks: 0,
    tags: [], locks: 0, raises: [].}
```
  Copies the contents from the memory at `source` to the memory at `dest`. Exactly `size` bytes will be copied. The memory regions may not overlap. Like any procedure dealing with raw memory this is **unsafe**. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2187)  
```
proc moveMem(dest, source: pointer; size: Natural) {...}{.inline, gcsafe, locks: 0,
    tags: [], locks: 0, raises: [].}
```
  Copies the contents from the memory at `source` to the memory at `dest`.

 Exactly `size` bytes will be copied. The memory regions may overlap, `moveMem` handles this case appropriately and is thus somewhat more safe than `copyMem`. Like any procedure dealing with raw memory this is still **unsafe**, though.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2191)  
```
proc equalMem(a, b: pointer; size: Natural): bool {...}{.inline, noSideEffect,
    tags: [], locks: 0, raises: [].}
```
  Compares the memory blocks `a` and `b`. `size` bytes will be compared.

 If the blocks are equal, `true` is returned, `false` otherwise. Like any procedure dealing with raw memory this is **unsafe**.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2195)  
```
proc cmp(x, y: string): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Compare proc for strings. More efficient than the generic version.

 **Note**: The precise result values depend on the used C runtime library and can differ between operating systems!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2199)  
```
proc cstringArrayToSeq(a: cstringArray; len: Natural): seq[string] {...}{.raises: [],
    tags: [].}
```
  Converts a `cstringArray` to a `seq[string]`. `a` is supposed to be of length `len`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2212)  
```
proc cstringArrayToSeq(a: cstringArray): seq[string] {...}{.raises: [], tags: [].}
```
  Converts a `cstringArray` to a `seq[string]`. `a` is supposed to be terminated by `nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2218)  
```
proc allocCStringArray(a: openArray[string]): cstringArray {...}{.raises: [],
    tags: [].}
```
  Creates a NULL terminated cstringArray from `a`. The result has to be freed with `deallocCStringArray` after it's not needed anymore. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2227)  
```
proc deallocCStringArray(a: cstringArray) {...}{.raises: [], tags: [].}
```
  Frees a NULL terminated cstringArray. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2237)  
```
proc setControlCHook(hook: proc () {...}{.noconv.}) {...}{.raises: [], tags: [].}
```
  Allows you to override the behaviour of your application when CTRL+C is pressed. Only one such hook is supported. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2264)  
```
proc unsetControlCHook() {...}{.raises: [], tags: [RootEffect, WriteIOEffect].}
```
  Reverts a call to setControlCHook. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2269)  
```
proc getStackTrace(): string {...}{.gcsafe, raises: [], tags: [].}
```
  Gets the current stack trace. This only works for debug builds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2273)  
```
proc getStackTrace(e: ref Exception): string {...}{.gcsafe, raises: [], tags: [].}
```
  Gets the stack trace associated with `e`, which is the stack that lead to the `raise` statement. This only works for debug builds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2276)  
```
proc getFrameState(): FrameState {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L75)  
```
proc setFrameState(state: FrameState) {...}{.compilerproc, inline, raises: [],
                                        tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L78)  
```
proc getFrame(): PFrame {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L84)  
```
proc setFrame(s: PFrame) {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L101)  
```
proc getGcFrame(): GcFrame {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L104)  
```
proc popGcFrame() {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L105)  
```
proc setGcFrame(s: GcFrame) {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L106)  
```
proc pushGcFrame(s: GcFrame) {...}{.compilerproc, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L107)  
```
proc stackTraceAvailable(): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L296)  
```
proc writeStackTrace() {...}{.tags: [], gcsafe, raises: [].}
```
  Writes the current stack trace to `stderr`. This is only works for debug builds. Since it's usually used for debugging, this is proclaimed to have no IO effect! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L499)  
```
proc getStackTraceEntries(e: ref Exception): seq[StackTraceEntry] {...}{.raises: [],
    tags: [].}
```
  Returns the attached stack trace to the exception `e` as a `seq`. This is not yet available for the JS backend. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L520)  
```
proc getStackTraceEntries(): seq[StackTraceEntry] {...}{.raises: [], tags: [].}
```
  Returns the stack trace entries for the current stack trace. This is not yet available for the JS backend. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/excpt.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/excpt.nim#L528)  
```
proc iterToProc(iter: typed; envType: typedesc; procName: untyped) {...}{.
    magic: "Plugin", compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L402)  
```
proc allocImpl(size: Natural): pointer {...}{.noconv, gcsafe, tags: [], gcsafe,
    locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1030) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1030)  
```
proc alloc0Impl(size: Natural): pointer {...}{.noconv, gcsafe, tags: [], gcsafe,
    locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1033) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1033)  
```
proc deallocImpl(p: pointer) {...}{.noconv, gcsafe, tags: [], gcsafe, locks: 0,
                               raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1036) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1036)  
```
proc reallocImpl(p: pointer; newSize: Natural): pointer {...}{.noconv, gcsafe,
    tags: [], gcsafe, locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1039)  
```
proc realloc0Impl(p: pointer; oldSize, newSize: Natural): pointer {...}{.noconv,
    gcsafe, tags: [], gcsafe, locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1042) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1042)  
```
proc getFreeMem(): int {...}{.gcsafe, raises: [], tags: [].}
```
  Returns the number of bytes that are owned by the process, but do not hold any meaningful data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1055) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1055)  
```
proc getTotalMem(): int {...}{.gcsafe, raises: [], tags: [].}
```
  Returns the number of bytes that are owned by the process. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1059)  
```
proc getOccupiedMem(): int {...}{.gcsafe, raises: [], tags: [].}
```
  Returns the number of bytes that are owned by the process and hold data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1060) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1060)  
```
proc getMaxMem(): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1061) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1061)  
```
proc allocSharedImpl(size: Natural): pointer {...}{.noconv, compilerproc, gcsafe,
    gcsafe, locks: 0, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1072) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1072)  
```
proc allocShared0Impl(size: Natural): pointer {...}{.noconv, gcsafe, gcsafe,
    locks: 0, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1080) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1080)  
```
proc deallocSharedImpl(p: pointer) {...}{.noconv, gcsafe, gcsafe, locks: 0,
                                     raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1084) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1084)  
```
proc reallocSharedImpl(p: pointer; newSize: Natural): pointer {...}{.noconv, gcsafe,
    tags: [], gcsafe, locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1092) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1092)  
```
proc reallocShared0Impl(p: pointer; oldSize, newSize: Natural): pointer {...}{.
    noconv, gcsafe, tags: [], gcsafe, locks: 0, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/alloc.nim#L1100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/alloc.nim#L1100)  
```
proc protect(x: pointer): ForeignCell {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L15)  
```
proc dispose(x: ForeignCell) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L96)  
```
proc isNotForeign(x: ForeignCell): bool {...}{.raises: [], tags: [].}
```
  returns true if 'x' belongs to the calling thread. No deep copy has to be performed then. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L106)  
```
proc setupForeignThreadGc() {...}{.gcsafe, raises: [], tags: [].}
```
  Call this if you registered a callback that will be run from a thread not under your control. This has a cheap thread-local guard, so the GC for this thread will only be initialized once per thread, no matter how often it is called.

 This function is available only when `--threads:on` and `--tlsEmulation:off` switches are used

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L163)  
```
proc tearDownForeignThreadGc() {...}{.gcsafe, raises: [], tags: [].}
```
  Call this to tear down the GC, previously initialized by `setupForeignThreadGc`. If GC has not been previously initialized, or has already been torn down, the call does nothing.

 This function is available only when `--threads:on` and `--tlsEmulation:off` switches are used

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L173)  
```
proc nimGC_setStackBottom(theStackBottom: pointer) {...}{.compilerproc, noinline,
    gcsafe, locks: 0, raises: [], tags: [].}
```
  Expands operating GC stack range to `theStackBottom`. Does nothing if current stack bottom is already lower than `theStackBottom`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L280)  
```
proc deallocHeap(runFinalizers = true; allowGcAfterwards = true) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Frees the thread local heap. Runs every finalizer if `runFinalizers` is true. If `allowGcAfterwards` is true, a minimal amount of allocation happens to ensure the GC can continue to work after the call to `deallocHeap`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc_common.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc_common.nim#L434)  
```
proc gcInvariant() {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L390)  
```
proc GC_collectZct() {...}{.raises: [Exception], tags: [RootEffect].}
```
  Collect the ZCT (zero count table). Unstable, experimental API for testing purposes. DO NOT USE! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L801) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L801)  
```
proc GC_disable() {...}{.gcsafe, inline, gcsafe, locks: 0, raises: [], tags: [].}
```
  Disables the GC. If called `n` times, `n` calls to `GC_enable` are needed to reactivate the GC.

 Note that in most circumstances one should only disable the mark and sweep phase with [GC\_disableMarkAndSweep](#GC_disableMarkAndSweep).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L843)  
```
proc GC_enable() {...}{.gcsafe, inline, gcsafe, locks: 0, raises: [], tags: [].}
```
  Enables the GC again. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L845)  
```
proc GC_enableMarkAndSweep() {...}{.gcsafe, gcsafe, locks: 0, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L855) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L855)  
```
proc GC_disableMarkAndSweep() {...}{.gcsafe, gcsafe, locks: 0, raises: [], tags: [].}
```
  The current implementation uses a reference counting garbage collector with a seldomly run mark and sweep phase to free cycles. The mark and sweep phase may take a long time and is not needed if the application does not create cycles. Thus the mark and sweep phase can be deactivated and activated separately from the rest of the GC. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L858) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L858)  
```
proc GC_fullCollect() {...}{.gcsafe, gcsafe, locks: 0, raises: [Exception],
                        tags: [RootEffect].}
```
  Forces a full garbage collection pass. Ordinary code does not need to call this (and should not). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L862) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L862)  
```
proc GC_getStatistics(): string {...}{.gcsafe, gcsafe, locks: 0, raises: [], tags: [].}
```
  Returns an informative string about the GC's activity. This may be useful for tweaking. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/gc.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/gc.nim#L868)  
```
proc addInt(result: var string; x: int64) {...}{.raises: [], tags: [].}
```
  Converts integer to its string representation and appends it to `result`.
```
var
  a = "123"
  b = 45
a.addInt(b) # a <- "12345"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/strmantle.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/strmantle.nim#L43)  
```
proc addFloat(result: var string; x: float) {...}{.raises: [], tags: [].}
```
  Converts float to its string representation and appends it to `result`.
```
var
  a = "123"
  b = 45.67
a.addFloat(b) # a <- "12345.67"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/strmantle.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/strmantle.nim#L82)  
```
proc getCurrentException(): ref Exception {...}{.compilerproc, inline, gcsafe,
    locks: 0, raises: [], tags: [].}
```
  Retrieves the current exception; if there is none, `nil` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2360)  
```
proc getCurrentExceptionMsg(): string {...}{.inline, gcsafe, locks: 0, raises: [],
                                        tags: [].}
```
  Retrieves the error message that was attached to the current exception; if there is none, `""` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2369)  
```
proc setCurrentException(exc: ref Exception) {...}{.inline, gcsafe, locks: 0,
    raises: [], tags: [].}
```
  Sets the current exception.

 **Warning**: Only use this if you know what you are doing.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2374)  
```
proc rawProc[T: proc](x: T): pointer {...}{.noSideEffect, inline.}
```
  Retrieves the raw proc pointer of the closure `x`. This is useful for interfacing closures with C. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2387)  
```
proc rawEnv[T: proc](x: T): pointer {...}{.noSideEffect, inline.}
```
  Retrieves the raw environment pointer of the closure `x`. This is useful for interfacing closures with C. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2394)  
```
proc finished[T: proc](x: T): bool {...}{.noSideEffect, inline.}
```
  can be used to determine if a first class iterator has finished. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2401)  
```
proc quit(errormsg: string; errorcode = QuitFailure) {...}{.noreturn, raises: [],
    tags: [].}
```
  A shorthand for `echo(errormsg); quit(errorcode)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2424)  
```
proc `/`(x, y: int): float {...}{.inline, noSideEffect, raises: [], tags: [].}
```
  Division of integers that results in a float.

 See also:

 * [div](#div,int,int)
* [mod](#mod,int,int)

 
```
echo 7 / 5 # => 1.4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2439)  
```
proc `[]`[T, U](s: string; x: HSlice[T, U]): string {...}{.inline.}
```
  Slice operation for strings. Returns the inclusive range `[s[x.a], s[x.b]]`:
```
var s = "abcdef"
assert s[1..3] == "bcd"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2501)  
```
proc `[]=`[T, U](s: var string; x: HSlice[T, U]; b: string)
```
  Slice assignment for strings.

 If `b.len` is not exactly the number of elements that are referred to by `x`, a splice is performed: 

 **Example:**

 
```
var s = "abcdefgh"
s[1 .. ^2] = "xyz"
assert s == "axyzh"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2513)  
```
proc `[]`[Idx, T, U, V](a: array[Idx, T]; x: HSlice[U, V]): seq[T]
```
  Slice operation for arrays. Returns the inclusive range `[a[x.a], a[x.b]]`:
```
var a = [1, 2, 3, 4]
assert a[0..2] == @[1, 2, 3]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2531)  
```
proc `[]=`[Idx, T, U, V](a: var array[Idx, T]; x: HSlice[U, V]; b: openArray[T])
```
  Slice assignment for arrays.
```
var a = [10, 20, 30, 40, 50]
a[1..2] = @[99, 88]
assert a == [10, 99, 88, 40, 50]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2543)  
```
proc `[]`[T, U, V](s: openArray[T]; x: HSlice[U, V]): seq[T]
```
  Slice operation for sequences. Returns the inclusive range `[s[x.a], s[x.b]]`:
```
var s = @[1, 2, 3, 4]
assert s[0..2] == @[1, 2, 3]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2557)  
```
proc `[]=`[T, U, V](s: var seq[T]; x: HSlice[U, V]; b: openArray[T])
```
  Slice assignment for sequences.

 If `b.len` is not exactly the number of elements that are referred to by `x`, a splice is performed.

 **Example:**

 
```
var s = @"abcdefgh"
s[1 .. ^2] = @"xyz"
assert s == @"axyzh"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2569)  
```
proc `[]`[T](s: openArray[T]; i: BackwardsIndex): T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2586)  
```
proc `[]`[Idx, T](a: array[Idx, T]; i: BackwardsIndex): T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2589)  
```
proc `[]`(s: string; i: BackwardsIndex): char {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2591)  
```
proc `[]`[T](s: var openArray[T]; i: BackwardsIndex): var T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2593)  
```
proc `[]`[Idx, T](a: var array[Idx, T]; i: BackwardsIndex): var T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2595)  
```
proc `[]=`[T](s: var openArray[T]; i: BackwardsIndex; x: T) {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2598)  
```
proc `[]=`[Idx, T](a: var array[Idx, T]; i: BackwardsIndex; x: T) {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2600) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2600)  
```
proc `[]=`(s: var string; i: BackwardsIndex; x: char) {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2602)  
```
proc slurp(filename: string): string {...}{.magic: "Slurp".}
```
  This is an alias for [staticRead](#staticRead,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2605)  
```
proc staticRead(filename: string): string {...}{.magic: "Slurp".}
```
  Compile-time [readFile](io#readFile,string) proc for easy resource embedding:

 The maximum file size limit that `staticRead` and `slurp` can read is near or equal to the *free* memory of the device you are using to compile.

 
```
const myResource = staticRead"mydatafile.bin"
```

[slurp](#slurp,string) is an alias for `staticRead`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2608)  
```
proc gorge(command: string; input = ""; cache = ""): string {...}{.
    magic: "StaticExec", raises: [], tags: [].}
```
  This is an alias for [staticExec](#staticExec,string,string,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2620)  
```
proc staticExec(command: string; input = ""; cache = ""): string {...}{.
    magic: "StaticExec", raises: [], tags: [].}
```
  Executes an external process at compile-time and returns its text output (stdout + stderr).

 If `input` is not an empty string, it will be passed as a standard input to the executed program.

 
```
const buildInfo = "Revision " & staticExec("git rev-parse HEAD") &
                  "\nCompiled on " & staticExec("uname -v")
```

[gorge](#gorge,string,string,string) is an alias for `staticExec`.

 Note that you can use this proc inside a pragma like [passc](manual#implementation-specific-pragmas-passc-pragma) or [passl](manual#implementation-specific-pragmas-passl-pragma).

 If `cache` is not empty, the results of `staticExec` are cached within the `nimcache` directory. Use `--forceBuild` to get rid of this caching behaviour then. `command & input & cache` (the concatenated string) is used to determine whether the entry in the cache is still valid. You can use versioning information for `cache`:

 
```
const stateMachine = staticExec("dfaoptimizer", "input", "0.8.0")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2624) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2624)  
```
proc gorgeEx(command: string; input = ""; cache = ""): tuple[output: string,
    exitCode: int] {...}{.raises: [], tags: [].}
```
  Similar to [gorge](#gorge,string,string,string) but also returns the precious exit code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2651)  
```
proc `+=`[T: float | float32 | float64](x: var T; y: T) {...}{.inline, noSideEffect.}
```
  Increments in place a floating point number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2658)  
```
proc `-=`[T: float | float32 | float64](x: var T; y: T) {...}{.inline, noSideEffect.}
```
  Decrements in place a floating point number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2663)  
```
proc `*=`[T: float | float32 | float64](x: var T; y: T) {...}{.inline, noSideEffect.}
```
  Multiplies in place a floating point number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2668)  
```
proc `/=`(x: var float64; y: float64) {...}{.inline, noSideEffect, raises: [],
                                        tags: [].}
```
  Divides in place a floating point number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2673)  
```
proc `/=`[T: float | float32](x: var T; y: T) {...}{.inline, noSideEffect.}
```
  Divides in place a floating point number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2677)  
```
proc `&=`(x: var string; y: string) {...}{.magic: "AppendStrStr", noSideEffect.}
```
  Appends in place to a string.
```
var a = "abc"
a &= "de" # a <- "abcde"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2681)  
```
proc shallow[T](s: var seq[T]) {...}{.noSideEffect, inline.}
```
  Marks a sequence `s` as shallow. Subsequent assignments will not perform deep copies of `s`.

 This is only useful for optimization purposes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2724)  
```
proc shallow(s: var string) {...}{.noSideEffect, inline, raises: [], tags: [].}
```
  Marks a string `s` as shallow. Subsequent assignments will not perform deep copies of `s`.

 This is only useful for optimization purposes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2734) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2734)  
```
proc insert(x: var string; item: string; i = 0.Natural) {...}{.noSideEffect,
    raises: [], tags: [].}
```
  Inserts `item` into `x` at position `i`.
```
var a = "abc"
a.insert("zz", 0) # a <- "zzabc"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2772)  
```
proc addEscapedChar(s: var string; c: char) {...}{.noSideEffect, inline, raises: [],
    tags: [].}
```
  Adds a char to string `s` and applies the following escaping:* replaces any `\` by `\\`
* replaces any `'` by `\'`
* replaces any `"` by `\"`
* replaces any `\a` by `\\a`
* replaces any `\b` by `\\b`
* replaces any `\t` by `\\t`
* replaces any `\n` by `\\n`
* replaces any `\v` by `\\v`
* replaces any `\f` by `\\f`
* replaces any `\c` by `\\c`
* replaces any `\e` by `\\e`
* replaces any other character not in the set `{'\21..'\126'} by ``\xHH` where `HH` is its hexadecimal value.

 The procedure has been designed so that its output is usable for many different common syntaxes.

 **Note**: This is **not correct** for producing Ansi C code!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2792)  
```
proc addQuoted[T](s: var string; x: T)
```
  Appends `x` to string `s` in place, applying quoting and escaping if `x` is a string or char.

 See [addEscapedChar](#addEscapedChar,string,char) for the escaping scheme. When `x` is a string, characters in the range `{\128..\255}` are never escaped so that multibyte UTF-8 characters are untouched (note that this behavior is different from `addEscapedChar`).

 The Nim standard library uses this function on the elements of collections when producing a string representation of a collection. It is recommended to use this function as well for user-side collections. Users may overload `addQuoted` for custom (string-like) types if they want to implement a customized element representation.

 
```
var tmp = ""
tmp.addQuoted(1)
tmp.add(", ")
tmp.addQuoted("string")
tmp.add(", ")
tmp.addQuoted('c')
assert(tmp == """1, "string", 'c'""")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2833)  
```
proc locals(): RootObj {...}{.magic: "Plugin", noSideEffect, raises: [], tags: [].}
```
  Generates a tuple constructor expression listing all the local variables in the current scope.

 This is quite fast as it does not rely on any debug or runtime information. Note that in contrast to what the official signature says, the return type is *not* `RootObj` but a tuple of a structure that depends on the current scope. Example:

 
```
proc testLocals() =
  var
    a = "something"
    b = 4
    c = locals()
    d = "super!"
  
  b = 1
  for name, value in fieldPairs(c):
    echo "name ", name, " with value ", value
  echo "B is ", b
# -> name a with value something
# -> name b with value 4
# -> B is 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2881) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2881)  
```
proc deepCopy[T](x: var T; y: T) {...}{.noSideEffect, magic: "DeepCopy".}
```
  Performs a deep copy of `y` and copies it into `x`.

 This is also used by the code generator for the implementation of `spawn`.

 For `--gc:arc` or `--gc:orc` deepcopy support has to be enabled via `--deepcopy:on`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2909) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2909)  
```
proc deepCopy[T](y: T): T
```
  Convenience wrapper around `deepCopy` overload. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2919) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2919)  
```
proc procCall(x: untyped) {...}{.magic: "ProcCall", compileTime, raises: [], tags: [].}
```
  Special magic to prohibit dynamic binding for method calls. This is similar to super in ordinary OO languages.
```
# 'someMethod' will be resolved fully statically:
procCall someMethod(a, b)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2925) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2925)  
```
proc `==`(x, y: cstring): bool {...}{.magic: "EqCString", noSideEffect, inline,
                                 raises: [], tags: [].}
```
  Checks for equality between two `cstring` variables. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2935) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2935)  
```
proc `==`(x: string; y: type(nil) | type(nil)): bool {...}{.error: "\'nil\' is now invalid for \'string\'; compile with --nilseqs:on for a migration period".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2948) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2948)  
```
proc `==`(x: type(nil) | type(nil); y: string): bool {...}{.error: "\'nil\' is now invalid for \'string\'; compile with --nilseqs:on for a migration period".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2951) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2951)  
```
proc substr(s: string; first, last: int): string {...}{.raises: [], tags: [].}
```
  Copies a slice of `s` into a new string and returns this new string.

 The bounds `first` and `last` denote the indices of the first and last characters that shall be copied. If `last` is omitted, it is treated as `high(s)`. If `last >= s.len`, `s.len` is used instead: This means `substr` can also be used to cut or limit a string's length.

 **Example:**

 
```
let a = "abcdefgh"
assert a.substr(2, 5) == "cdef"
assert a.substr(2) == "cdefgh"
assert a.substr(5, 99) == "fgh"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3003) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3003)  
```
proc substr(s: string; first = 0): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3024) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3024)  
```
proc toOpenArray[T](x: ptr UncheckedArray[T]; first, last: int): openArray[T] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3031) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3031)  
```
proc toOpenArray(x: cstring; first, last: int): openArray[char] {...}{.magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3034) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3034)  
```
proc toOpenArrayByte(x: cstring; first, last: int): openArray[byte] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3036) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3036)  
```
proc toOpenArray[T](x: seq[T]; first, last: int): openArray[T] {...}{.magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3039)  
```
proc toOpenArray[T](x: openArray[T]; first, last: int): openArray[T] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3041) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3041)  
```
proc toOpenArray[I, T](x: array[I, T]; first, last: I): openArray[T] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3043) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3043)  
```
proc toOpenArray(x: string; first, last: int): openArray[char] {...}{.magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3045) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3045)  
```
proc toOpenArrayByte(x: string; first, last: int): openArray[byte] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3048) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3048)  
```
proc toOpenArrayByte(x: openArray[char]; first, last: int): openArray[byte] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3050)  
```
proc toOpenArrayByte(x: seq[char]; first, last: int): openArray[byte] {...}{.
    magic: "Slice".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L3052) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L3052)   Iterators
---------

  
```
iterator countdown[T](a, b: T; step: Positive = 1): T {...}{.inline.}
```
  Counts from ordinal value `a` down to `b` (inclusive) with the given step count.

 `T` may be any ordinal type, `step` may only be positive.

 **Note**: This fails to count to `low(int)` if T = int for efficiency reasons.

 
```
for i in countdown(7, 3):
  echo i # => 7; 6; 5; 4; 3

for i in countdown(9, 2, 3):
  echo i # => 9; 6; 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L6)  
```
iterator countup[T](a, b: T; step: Positive = 1): T {...}{.inline.}
```
  Counts from ordinal value `a` to `b` (inclusive) with the given step count.

 `T` may be any ordinal type, `step` may only be positive.

 **Note**: This fails to count to `high(int)` if T = int for efficiency reasons.

 
```
for i in countup(3, 7):
  echo i # => 3; 4; 5; 6; 7

for i in countup(2, 9, 3):
  echo i # => 2; 5; 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L39)  
```
iterator `..`[T](a, b: T): T {...}{.inline.}
```
  An alias for `countup(a, b, 1)`.

 See also:

 * [..<](#..<.i,T,T)

 
```
for i in 3 .. 7:
  echo i # => 3; 4; 5; 6; 7
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L66)  
```
iterator `..`(a, b: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..` for convenience so that mixing integer types works better.

 See also:

 * [..<](#..<.i,T,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L99)  
```
iterator `..`(a, b: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..` for convenience so that mixing integer types works better.

 See also:

 * [..<](#..<.i,T,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L100)  
```
iterator `..`(a, b: uint64): uint64 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..` for convenience so that mixing integer types works better.

 See also:

 * [..<](#..<.i,T,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L101)  
```
iterator `..`(a, b: uint32): uint32 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..` for convenience so that mixing integer types works better.

 See also:

 * [..<](#..<.i,T,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L102)  
```
iterator `..<`[T](a, b: T): T {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L104)  
```
iterator `..<`(a, b: int64): int64 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..<` for convenience so that mixing integer types works better. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L120)  
```
iterator `..<`(a, b: int32): int32 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..<` for convenience so that mixing integer types works better. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L121)  
```
iterator `..<`(a, b: uint64): uint64 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..<` for convenience so that mixing integer types works better. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L122)  
```
iterator `..<`(a, b: uint32): uint32 {...}{.inline, raises: [], tags: [].}
```
  A type specialized version of `..<` for convenience so that mixing integer types works better. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L123)  
```
iterator `||`[S, T](a: S; b: T; annotation: static string = "parallel for"): T {...}{.
    inline, magic: "OmpParFor", sideEffect.}
```
  OpenMP parallel loop iterator. Same as `..` but the loop may run in parallel.

 `annotation` is an additional annotation for the code generator to use. The default annotation is `parallel for`. Please refer to the [OpenMP Syntax Reference](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf) for further information.

 Note that the compiler maps that to the `#pragma omp parallel for` construct of OpenMP and as such isn't aware of the parallelism in your code! Be careful! Later versions of `||` will get proper support by Nim's code generator and GC.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L181)  
```
iterator `||`[S, T](a: S; b: T; step: Positive;
                    annotation: static string = "parallel for"): T {...}{.inline,
    magic: "OmpParFor", sideEffect.}
```
  OpenMP parallel loop iterator with stepping. Same as `countup` but the loop may run in parallel.

 `annotation` is an additional annotation for the code generator to use. The default annotation is `parallel for`. Please refer to the [OpenMP Syntax Reference](https://www.openmp.org/wp-content/uploads/OpenMP-4.5-1115-CPP-web.pdf) for further information.

 Note that the compiler maps that to the `#pragma omp parallel for` construct of OpenMP and as such isn't aware of the parallelism in your code! Be careful! Later versions of `||` will get proper support by Nim's code generator and GC.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators_1.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators_1.nim#L198)   Macros
------

  
```
macro varargsLen(x: varargs[untyped]): int
```
  returns number of variadic arguments in `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2757) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2757)   Templates
---------

  
```
template `!=`(x, y: untyped): untyped
```
  Unequals operator. This is a shorthand for `not (x == y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L130)  
```
template `>=`(x, y: untyped): untyped
```
  "is greater or equals" operator. This is the same as `y <= x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L134)  
```
template `>`(x, y: untyped): untyped
```
  "is greater" operator. This is the same as `y < x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L138)  
```
template `>=%`(x, y: untyped): untyped
```
  Treats `x` and `y` as unsigned and compares them. Returns true if `unsigned(x) >= unsigned(y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L196)  
```
template `>%`(x, y: untyped): untyped
```
  Treats `x` and `y` as unsigned and compares them. Returns true if `unsigned(x) > unsigned(y)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/comparisons.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/comparisons.nim#L200)  
```
template offsetOf[T; ](t: typedesc[T]; member: untyped): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L606)  
```
template offsetOf[T](value: T; member: untyped): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L610)  
```
template incl[T](x: var set[T]; y: set[T])
```
  Includes the set `y` in the set `x`.
```
var a = {1, 3, 5, 7}
var b = {4, 5, 6}
a.incl(b)  # a <- {1, 3, 4, 5, 6, 7}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L11)  
```
template excl[T](x: var set[T]; y: set[T])
```
  Excludes the set `y` from the set `x`.
```
var a = {1, 3, 5, 7}
var b = {3, 4, 5}
a.excl(b)  # a <- {1, 7}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/setops.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/setops.nim#L29)  
```
template `in`(x, y: untyped): untyped {...}{.dirty.}
```
  Sugar for `contains`.
```
assert(1 in (1..3) == true)
assert(5 in (1..3) == false)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L786) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L786)  
```
template `notin`(x, y: untyped): untyped {...}{.dirty.}
```
  Sugar for `not contains`.
```
assert(1 notin (1..3) == false)
assert(5 notin (1..3) == true)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L792)  
```
template `isnot`(x, y: untyped): untyped
```
  Negated version of [is](#is,T,S). Equivalent to `not(x is y)`.
```
assert 42 isnot float
assert @[1, 2] isnot enum
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L816)  
```
template unown(x: typed): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L853)  
```
template `<//>`(t: untyped): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L873) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L873)  
```
template disarm(x: typed)
```
  Useful for `disarming` dangling pointers explicitly for the

|  |  |
| --- | --- |
| --newruntime. Regardless of whether --newruntime is used or not |  |


this sets the pointer or callback `x` to `nil`. This is an experimental API!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L875) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L875)  
```
template dumpAllocstats(code: untyped)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L62)  
```
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) 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.

 See also:

 * [alloc0](#alloc0,Natural)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L77)  
```
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) or [dealloc(block)](#dealloc,pointer). The block is initialized with all bytes containing zero, so it is somewhat safer than [alloc](#alloc,Natural).

 The allocated memory belongs to its allocating thread! Use [allocShared0](#allocShared0,Natural) to allocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L108)  
```
template realloc(p: pointer; newSize: Natural): pointer
```
  Grows or shrinks a given memory block.

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `newSize` bytes. If `newSize == 0` and `p` is not **nil** `realloc` calls `dealloc(p)`. In other cases the block has to be freed with [dealloc(block)](#dealloc,pointer).

 The allocated memory belongs to its allocating thread! Use [reallocShared](#reallocShared,pointer,Natural) to reallocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L133)  
```
template realloc0(p: pointer; oldSize, newSize: Natural): pointer
```
  Grows or shrinks a given memory block.

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `newSize` bytes. If `newSize == 0` and `p` is not **nil** `realloc` calls `dealloc(p)`. In other cases the block has to be freed with [dealloc(block)](#dealloc,pointer).

 The block is initialized with all bytes containing zero, so it is somewhat safer then realloc

 The allocated memory belongs to its allocating thread! Use [reallocShared](#reallocShared,pointer,Natural) to reallocate from a shared heap.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L147)  
```
template allocShared(size: Natural): pointer
```
  Allocates a new memory block on the shared heap with at least `size` bytes.

 The block has to be freed with [reallocShared(block, 0)](#reallocShared,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).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L191)  
```
template allocShared0(size: Natural): pointer
```
  Allocates a new memory block on the shared heap with at least `size` bytes.

 The block has to be freed with [reallocShared(block, 0)](#reallocShared,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).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L223)  
```
template reallocShared(p: pointer; newSize: Natural): pointer
```
  Grows or shrinks a given memory block on the heap.

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `newSize` bytes. If `newSize == 0` and `p` is not **nil** `reallocShared` calls `deallocShared(p)`. In other cases the block has to be freed with [deallocShared](#deallocShared,pointer).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L250)  
```
template reallocShared0(p: pointer; oldSize, newSize: Natural): pointer
```
  Grows or shrinks a given memory block on the heap.

 When growing, the new bytes of the block is initialized with all bytes containing zero, so it is somewhat safer then reallocShared

 If `p` is **nil** then a new memory block is returned. In either way the block has at least `newSize` bytes. If `newSize == 0` and `p` is not **nil** `reallocShared` calls `deallocShared(p)`. In other cases the block has to be freed with [deallocShared](#deallocShared,pointer).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/memalloc.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/memalloc.nim#L261)  
```
template newException(exceptn: typedesc; message: string;
                      parentException: ref Exception = nil): untyped
```
  Creates an exception object of type `exceptn` and sets its `msg` field to `message`. Returns the new exception object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2026) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2026)  
```
template likely(val: bool): bool
```
  Hints the optimizer that `val` is likely going to be true.

 You can use this template to decorate a branch condition. On certain platforms this can help the processor predict better which branch is going to be run. Example:

 
```
for value in inputValues:
  if likely(value <= 100):
    process(value)
  else:
    echo "Value too big!"
```

On backends without branch prediction (JS and the nimscript VM), this template will not affect code execution.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2065) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2065)  
```
template unlikely(val: bool): bool
```
  Hints the optimizer that `val` is likely going to be false.

 You can use this proc to decorate a branch condition. On certain platforms this can help the processor predict better which branch is going to be run. Example:

 
```
for value in inputValues:
  if unlikely(value > 100):
    echo "Value too big!"
  else:
    process(value)
```

On backends without branch prediction (JS and the nimscript VM), this template will not affect code execution.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2089) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2089)  
```
template formatErrorIndexBound[T](i, a, b: T): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/indexerrors.nim#L3) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/indexerrors.nim#L3)  
```
template formatErrorIndexBound[T](i, n: T): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/indexerrors.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/indexerrors.nim#L10)  
```
template `^`(x: int): BackwardsIndex
```
  Builtin roof operator that can be used for convenient array access. `a[^x]` is a shortcut for `a[a.len-x]`.
```
let
  a = [1, 3, 5, 7, 9]
  b = "abcdefgh"

echo a[^1] # => 9
echo b[^2] # => g
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2455)  
```
template `..^`(a, b: untyped): untyped
```
  A shortcut for `.. ^` to avoid the common gotcha that a space between '..' and '^' is required. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2467)  
```
template `..<`(a, b: untyped): untyped
```
  A shortcut for `a .. pred(b)`.
```
for i in 5 ..< 9:
  echo i # => 5; 6; 7; 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2472)  
```
template `[]`(s: string; i: int): char
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2498)  
```
template `[]=`(s: string; i: int; val: char)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2499)  
```
template `&=`(x, y: typed)
```
  Generic 'sink' operator for Nim.

 For files an alias for `write`. If not specialized further, an alias for `add`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2688)  
```
template currentSourcePath(): string
```
  Returns the full file-system path of the current source.

 To get the directory containing the current source, use it with [os.parentDir()](os#parentDir%2Cstring) as `currentSourcePath.parentDir()`.

 The path returned by this template is set at compile time.

 See the docstring of [macros.getProjectPath()](macros#getProjectPath) for an example to see the distinction between the `currentSourcePath` and `getProjectPath`.

 See also:

 * [getCurrentDir proc](os#getCurrentDir)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2697)  
```
template rangeCheck(cond)
```
  Helper for performing user-defined range checks. Such checks will be performed only when the `rangechecks` compile-time option is enabled. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2713)  
```
template closureScope(body: untyped): untyped
```
  Useful when creating a closure in a loop to capture local loop variables by their current iteration values.

 Note: This template may not work in some cases, use [capture](sugar#capture.m,openArray%5Btyped%5D,untyped) instead.

 Example:

 
```
var myClosure : proc()
# without closureScope:
for i in 0 .. 5:
  let j = i
  if j == 3:
    myClosure = proc() = echo j
myClosure() # outputs 5. `j` is changed after closure creation
# with closureScope:
for i in 0 .. 5:
  closureScope: # Everything in this scope is locked after closure creation
    let j = i
    if j == 3:
      myClosure = proc() = echo j
myClosure() # outputs 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2958) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2958)  
```
template once(body: untyped): untyped
```
  Executes a block of code only once (the first time the block is reached).
```
proc draw(t: Triangle) =
  once:
    graphicsInit()
  line(t.p1, t.p2)
  line(t.p2, t.p3)
  line(t.p3, t.p1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system.nim#L2984) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system.nim#L2984)   Exports
-------

  [doAssertRaises](assertions#doAssertRaises.t,typedesc,untyped), [raiseAssert](assertions#raiseAssert,string), [failedAssertImpl](assertions#failedAssertImpl,string), [doAssert](assertions#doAssert.t,untyped,string), [assert](assertions#assert.t,untyped,string), [onFailedAssert](assertions#onFailedAssert.t,untyped,untyped), [items](iterators#items.i,string), [mpairs](iterators#mpairs.i,string), [items](iterators#items.i,typedesc%5B%5D), [fieldPairs](iterators#fieldPairs.i,S,T), [items](iterators#items.i,seq%5BT%5D), [pairs](iterators#pairs.i,array%5BIX,T%5D), [fieldPairs](iterators#fieldPairs.i,T), [mitems](iterators#mitems.i,openArray%5BT%5D), [fields](iterators#fields.i,T), [mpairs](iterators#mpairs.i,openArray%5BT%5D), [pairs](iterators#pairs.i,cstring), [mitems](iterators#mitems.i,array%5BIX,T%5D), [items](iterators#items.i,set%5BT%5D), [items](iterators#items.i,array%5BIX,T%5D), [fields](iterators#fields.i,S,T), [mitems](iterators#mitems.i,string), [items](iterators#items.i,openArray%5BT%5D), [mpairs](iterators#mpairs.i,cstring), [mpairs](iterators#mpairs.i,array%5BIX,T%5D), [items](iterators#items.i,cstring), [mpairs](iterators#mpairs.i,seq%5BT%5D), [pairs](iterators#pairs.i,seq%5BT%5D), [pairs](iterators#pairs.i,openArray%5BT%5D), [items](iterators#items.i,HSlice%5BT,T%5D), [mitems](iterators#mitems.i,seq%5BT%5D), [items](iterators#items.i,openArray%5BT%5D_2), [pairs](iterators#pairs.i,string), [mitems](iterators#mitems.i,cstring), [$](dollars#%24,int), [$](dollars#%24,cstring), [$](dollars#%24,array%5BIDX,T%5D), [$](dollars#%24,seq%5BT%5D), [$](dollars#%24,char), [$](dollars#%24,int64), [$](dollars#%24,Enum), [$](dollars#%24,openArray%5BT%5D), [$](dollars#%24,set%5BT%5D), [$](dollars#%24,T), [$](dollars#%24,bool), [$](dollars#%24,typedesc), [$](dollars#%24,HSlice%5BT,U%5D), [$](dollars#%24,string), [$](dollars#%24,uint64), [$](dollars#%24,float), [len](widestrs#len,WideCString), [$](widestrs#%24,WideCString,int,int), [newWideCString](widestrs#newWideCString,cstring,int), [Utf16Char](widestrs#Utf16Char), [WideCStringObj](widestrs#WideCStringObj), [$](widestrs#%24,WideCString), [newWideCString](widestrs#newWideCString,string), [WideCString](widestrs#WideCString), [newWideCString](widestrs#newWideCString,cstring), [writeFile](io#writeFile,string,string), [write](io#write,File,BiggestFloat), [File](io#File), [write](io#write,File,float32), [writeChars](io#writeChars,File,openArray%5Bchar%5D,Natural,Natural), [endOfFile](io#endOfFile,File), [getFilePos](io#getFilePos,File), [readChars](io#readChars,File,openArray%5Bchar%5D,Natural,Natural), [readLines](io#readLines,string,Natural), [write](io#write,File,cstring), [readLine](io#readLine,File,TaintedString), [open](io#open,File,string,FileMode,int), [reopen](io#reopen,File,string,FileMode), [readChar](io#readChar,File), [writeBuffer](io#writeBuffer,File,pointer,Natural), [stdmsg](io#stdmsg.t), [getFileHandle](io#getFileHandle,File), [close](io#close,File), [write](io#write,File,char), [getOsFileHandle](io#getOsFileHandle,File), [readFile](io#readFile,string), [setFilePos](io#setFilePos,File,int64,FileSeekPos), [write](io#write,File,int), [setStdIoUnbuffered](io#setStdIoUnbuffered), [writeFile](io#writeFile,string,openArray%5Bbyte%5D), [lines](io#lines.i,File), [stdout](io#stdout), [readLines](io#readLines.t,string), [getFileSize](io#getFileSize,File), [FileHandle](io#FileHandle), [write](io#write,File,BiggestInt), [write](io#write,File,string), [readBytes](io#readBytes,File,openArray%5B%5D,Natural,Natural), [writeLine](io#writeLine,File,varargs%5BTy,%5D), [write](io#write,File,bool), [setInheritable](io#setInheritable,FileHandle,bool), [readLine](io#readLine,File), [open](io#open,File,FileHandle,FileMode), [flushFile](io#flushFile,File), [readAll](io#readAll,File), [FileMode](io#FileMode), [write](io#write,File,varargs%5Bstring,%5D), [readBuffer](io#readBuffer,File,pointer,Natural), [stderr](io#stderr), [stdin](io#stdin), [open](io#open,string,FileMode,int), [writeBytes](io#writeBytes,File,openArray%5B%5D,Natural,Natural), [lines](io#lines.i,string) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/system.html>

algorithm
=========

 This module implements some common generic algorithms. 


Basic usage
-----------



```
import algorithm

type People = tuple
  year: int
  name: string

var a: seq[People]

a.add((2000, "John"))
a.add((2005, "Marie"))
a.add((2010, "Jane"))

# Sorting with default system.cmp
a.sort()
assert a == @[(year: 2000, name: "John"), (year: 2005, name: "Marie"),
              (year: 2010, name: "Jane")]

proc myCmp(x, y: People): int =
  if x.name < y.name: -1
  elif x.name == y.name: 0
  else: 1

# Sorting with custom proc
a.sort(myCmp)
assert a == @[(year: 2010, name: "Jane"), (year: 2000, name: "John"),
              (year: 2005, name: "Marie")]
```
 See also
--------


* [sequtils module](sequtils) for working with the built-in seq type
* [tables module](tables) for sorting tables

 Types
-----

  
```
SortOrder = enum
  Descending, Ascending
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L50)   Procs
-----

  
```
proc `*`(x: int; order: SortOrder): int {...}{.inline, raises: [], tags: [].}
```
  Flips `x` if `order == Descending`. If `order == Ascending` then `x` is returned.

 `x` is supposed to be the result of a comparator, i.e.


`< 0` for *less than*,  
`== 0` for *equal*,  
`> 0` for *greater than*.  


 **Example:**

 
```
assert `*`(-123, Descending) == 123
assert `*`(123, Descending) == -123
assert `*`(-123, Ascending) == -123
assert `*`(123, Ascending) == 123
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L53)  
```
proc fill[T](a: var openArray[T]; first, last: Natural; value: T)
```
  Fills the slice `a[first..last]` with `value`.

 If an invalid range is passed, it raises IndexDefect.

 **Example:**

 
```
var a: array[6, int]
a.fill(1, 3, 9)
assert a == [0, 9, 9, 9, 0, 0]
a.fill(3, 5, 7)
assert a == [0, 9, 9, 7, 7, 7]
doAssertRaises(IndexDefect, a.fill(1, 7, 9))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L75)  
```
proc fill[T](a: var openArray[T]; value: T)
```
  Fills the container `a` with `value`. **Example:**

 
```
var a: array[6, int]
a.fill(9)
assert a == [9, 9, 9, 9, 9, 9]
a.fill(4)
assert a == [4, 4, 4, 4, 4, 4]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L88)  
```
proc reverse[T](a: var openArray[T]; first, last: Natural)
```
  Reverses the slice `a[first..last]`.

 If an invalid range is passed, it raises IndexDefect.

 **See also:**

 * [reversed proc](#reversed,openArray%5BT%5D,Natural,int) reverse a slice and returns a `seq[T]`
* [reversed proc](#reversed,openArray%5BT%5D) reverse and returns a `seq[T]`

 **Example:**

 
```
var a = [1, 2, 3, 4, 5, 6]
a.reverse(1, 3)
assert a == [1, 4, 3, 2, 5, 6]
a.reverse(1, 3)
assert a == [1, 2, 3, 4, 5, 6]
doAssertRaises(IndexDefect, a.reverse(1, 7))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L99)  
```
proc reverse[T](a: var openArray[T])
```
  Reverses the contents of the container `a`.

 **See also:**

 * [reversed proc](#reversed,openArray%5BT%5D,Natural,int) reverse a slice and returns a `seq[T]`
* [reversed proc](#reversed,openArray%5BT%5D) reverse and returns a `seq[T]`

 **Example:**

 
```
var a = [1, 2, 3, 4, 5, 6]
a.reverse()
assert a == [6, 5, 4, 3, 2, 1]
a.reverse()
assert a == [1, 2, 3, 4, 5, 6]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L121)  
```
proc reversed[T](a: openArray[T]; first: Natural; last: int): seq[T]
```
  Returns the reverse of the slice `a[first..last]`.

 If an invalid range is passed, it raises IndexDefect.

 **See also:**

 * [reverse proc](#reverse,openArray%5BT%5D,Natural,Natural) reverse a slice
* [reverse proc](#reverse,openArray%5BT%5D)

 **Example:**

 
```
let
  a = [1, 2, 3, 4, 5, 6]
  b = a.reversed(1, 3)
assert b == @[4, 3, 2]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L135)  
```
proc reversed[T](a: openArray[T]): seq[T]
```
  Returns the reverse of the container `a`.

 **See also:**

 * [reverse proc](#reverse,openArray%5BT%5D,Natural,Natural) reverse a slice
* [reverse proc](#reverse,openArray%5BT%5D)

 **Example:**

 
```
let
  a = [1, 2, 3, 4, 5, 6]
  b = reversed(a)
assert b == @[6, 5, 4, 3, 2, 1]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L157)  
```
proc binarySearch[T, K](a: openArray[T]; key: K;
                        cmp: proc (x: T; y: K): int {...}{.closure.}): int
```
  Binary search for `key` in `a`. Returns -1 if not found.

 `cmp` is the comparator function to use, the expected return values are the same as that of system.cmp.

 **Example:**

 
```
assert binarySearch(["a", "b", "c", "d"], "d", system.cmp[string]) == 3
assert binarySearch(["a", "b", "d", "c"], "d", system.cmp[string]) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L170)  
```
proc binarySearch[T](a: openArray[T]; key: T): int
```
  Binary search for `key` in `a`. Returns -1 if not found. **Example:**

 
```
assert binarySearch([0, 1, 2, 3, 4], 4) == 4
assert binarySearch([0, 1, 4, 2, 3], 4) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L220)  
```
proc lowerBound[T, K](a: openArray[T]; key: K;
                      cmp: proc (x: T; k: K): int {...}{.closure.}): int
```
  Returns a position to the first element in the `a` that is greater than `key`, or last if no such element is found. In other words if you have a sorted sequence and you call `insert(thing, elm, lowerBound(thing, elm))` the sequence will still be sorted.

 If an invalid range is passed, it raises IndexDefect.

 The version uses `cmp` to compare the elements. The expected return values are the same as that of `system.cmp`.

 **See also:**

 * [upperBound proc](#upperBound,openArray%5BT%5D,K,proc(T,K)) sorted by `cmp` in the specified order
* [upperBound proc](#upperBound,openArray%5BT%5D,T)

 **Example:**

 
```
var arr = @[1, 2, 3, 5, 6, 7, 8, 9]
assert arr.lowerBound(3, system.cmp[int]) == 2
assert arr.lowerBound(4, system.cmp[int]) == 3
assert arr.lowerBound(5, system.cmp[int]) == 3
arr.insert(4, arr.lowerBound(4, system.cmp[int]))
assert arr == [1, 2, 3, 4, 5, 6, 7, 8, 9]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L230)  
```
proc lowerBound[T](a: openArray[T]; key: T): int
```
  Returns a position to the first element in the `a` that is greater than `key`, or last if no such element is found. In other words if you have a sorted sequence and you call `insert(thing, elm, lowerBound(thing, elm))` the sequence will still be sorted.

 The version uses the default comparison function `cmp`.

 **See also:**

 * [upperBound proc](#upperBound,openArray%5BT%5D,K,proc(T,K)) sorted by `cmp` in the specified order
* [upperBound proc](#upperBound,openArray%5BT%5D,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L265)  
```
proc upperBound[T, K](a: openArray[T]; key: K;
                      cmp: proc (x: T; k: K): int {...}{.closure.}): int
```
  Returns a position to the first element in the `a` that is not less (i.e. greater or equal to) than `key`, or last if no such element is found. In other words if you have a sorted sequence and you call `insert(thing, elm, upperBound(thing, elm))` the sequence will still be sorted.

 If an invalid range is passed, it raises IndexDefect.

 The version uses `cmp` to compare the elements. The expected return values are the same as that of `system.cmp`.

 **See also:**

 * [lowerBound proc](#lowerBound,openArray%5BT%5D,K,proc(T,K)) sorted by `cmp` in the specified order
* [lowerBound proc](#lowerBound,openArray%5BT%5D,T)

 **Example:**

 
```
var arr = @[1, 2, 3, 5, 6, 7, 8, 9]
assert arr.upperBound(2, system.cmp[int]) == 2
assert arr.upperBound(3, system.cmp[int]) == 3
assert arr.upperBound(4, system.cmp[int]) == 3
arr.insert(4, arr.upperBound(3, system.cmp[int]))
assert arr == [1, 2, 3, 4, 5, 6, 7, 8, 9]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L278)  
```
proc upperBound[T](a: openArray[T]; key: T): int
```
  Returns a position to the first element in the `a` that is not less (i.e. greater or equal to) than `key`, or last if no such element is found. In other words if you have a sorted sequence and you call `insert(thing, elm, upperBound(thing, elm))` the sequence will still be sorted.

 The version uses the default comparison function `cmp`.

 **See also:**

 * [lowerBound proc](#lowerBound,openArray%5BT%5D,K,proc(T,K)) sorted by `cmp` in the specified order
* [lowerBound proc](#lowerBound,openArray%5BT%5D,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L313)  
```
proc sort[T](a: var openArray[T]; order = SortOrder.Ascending)
```
  Shortcut version of `sort` that uses `system.cmp[T]` as the comparison function.

 **See also:**

 * [sort func](#sort,openArray%5BT%5D,proc(T,T))
* [sorted proc](#sorted,openArray%5BT%5D,proc(T,T)) sorted by `cmp` in the specified order
* [sorted proc](#sorted,openArray%5BT%5D)
* [sortedByIt template](#sortedByIt.t,untyped,untyped)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L426)  
```
proc sorted[T](a: openArray[T]; cmp: proc (x, y: T): int {...}{.closure.};
               order = SortOrder.Ascending): seq[T]
```
  Returns `a` sorted by `cmp` in the specified `order`.

 **See also:**

 * [sort func](#sort,openArray%5BT%5D,proc(T,T))
* [sort proc](#sort,openArray%5BT%5D)
* [sortedByIt template](#sortedByIt.t,untyped,untyped)

 **Example:**

 
```
let
  a = [2, 3, 1, 5, 4]
  b = sorted(a, system.cmp[int])
  c = sorted(a, system.cmp[int], Descending)
  d = sorted(["adam", "dande", "brian", "cat"], system.cmp[string])
assert b == @[1, 2, 3, 4, 5]
assert c == @[5, 4, 3, 2, 1]
assert d == @["adam", "brian", "cat", "dande"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L436)  
```
proc sorted[T](a: openArray[T]; order = SortOrder.Ascending): seq[T]
```
  Shortcut version of `sorted` that uses `system.cmp[T]` as the comparison function.

 **See also:**

 * [sort func](#sort,openArray%5BT%5D,proc(T,T))
* [sort proc](#sort,openArray%5BT%5D)
* [sortedByIt template](#sortedByIt.t,untyped,untyped)

 **Example:**

 
```
let
  a = [2, 3, 1, 5, 4]
  b = sorted(a)
  c = sorted(a, Descending)
  d = sorted(["adam", "dande", "brian", "cat"])
assert b == @[1, 2, 3, 4, 5]
assert c == @[5, 4, 3, 2, 1]
assert d == @["adam", "brian", "cat", "dande"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L458)  
```
proc isSorted[T](a: openArray[T]; order = SortOrder.Ascending): bool
```
  Shortcut version of `isSorted` that uses `system.cmp[T]` as the comparison function.

 **See also:**

 * [isSorted func](#isSorted,openArray%5BT%5D,proc(T,T))

 **Example:**

 
```
let
  a = [2, 3, 1, 5, 4]
  b = [1, 2, 3, 4, 5]
  c = [5, 4, 3, 2, 1]
  d = ["adam", "brian", "cat", "dande"]
  e = ["adam", "dande", "brian", "cat"]
assert isSorted(a) == false
assert isSorted(b) == true
assert isSorted(c) == false
assert isSorted(c, Descending) == true
assert isSorted(d) == true
assert isSorted(e) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L539)  
```
proc product[T](x: openArray[seq[T]]): seq[seq[T]]
```
  Produces the Cartesian product of the array. Warning: complexity may explode. **Example:**

 
```
assert product(@[@[1], @[2]]) == @[@[1, 2]]
assert product(@[@["A", "K"], @["Q"]]) == @[@["K", "Q"], @["A", "Q"]]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L559)  
```
proc nextPermutation[T](x: var openArray[T]): bool {...}{.discardable.}
```
  Calculates the next lexicographic permutation, directly modifying `x`. The result is whether a permutation happened, otherwise we have reached the last-ordered permutation.

 If you start with an unsorted array/seq, the repeated permutations will **not** give you all permutations but stop with last.

 **See also:**

 * [prevPermutation proc](#prevPermutation,openArray%5BT%5D)

 **Example:**

 
```
var v = @[0, 1, 2, 3]
assert v.nextPermutation() == true
assert v == @[0, 1, 3, 2]
assert v.nextPermutation() == true
assert v == @[0, 2, 1, 3]
assert v.prevPermutation() == true
assert v == @[0, 1, 3, 2]
v = @[3, 2, 1, 0]
assert v.nextPermutation() == false
assert v == @[3, 2, 1, 0]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L593)  
```
proc prevPermutation[T](x: var openArray[T]): bool {...}{.discardable.}
```
  Calculates the previous lexicographic permutation, directly modifying `x`. The result is whether a permutation happened, otherwise we have reached the first-ordered permutation.

 **See also:**

 * [nextPermutation proc](#nextPermutation,openArray%5BT%5D)

 **Example:**

 
```
var v = @[0, 1, 2, 3]
assert v.prevPermutation() == false
assert v == @[0, 1, 2, 3]
assert v.nextPermutation() == true
assert v == @[0, 1, 3, 2]
assert v.prevPermutation() == true
assert v == @[0, 1, 2, 3]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L633)  
```
proc rotateLeft[T](arg: var openArray[T]; slice: HSlice[int, int]; dist: int): int {...}{.
    discardable.}
```
  Performs a left rotation on a range of elements. If you want to rotate right, use a negative `dist`. Specifically, `rotateLeft` rotates the elements at `slice` by `dist` positions.The element at index `slice.a + dist` will be at index `slice.a`.  
The element at index `slice.b` will be at `slice.a + dist -1`.  
The element at index `slice.a` will be at `slice.b + 1 - dist`.  
The element at index `slice.a + dist - 1` will be at `slice.b`.  



Elements outside of `slice` will be left unchanged. The time complexity is linear to `slice.b - slice.a + 1`. If an invalid range (`HSlice`) is passed, it raises IndexDefect.

 
`slice` The indices of the element range that should be rotated. `dist` The distance in amount of elements that the data should be rotated. Can be negative, can be any number.  **See also:**

 * [rotateLeft proc](#rotateLeft,openArray%5BT%5D,int) for a version which rotates the whole container
* [rotatedLeft proc](#rotatedLeft,openArray%5BT%5D,HSlice%5Bint,int%5D,int) for a version which returns a `seq[T]`

 **Example:**

 
```
var a = [0, 1, 2, 3, 4, 5]
a.rotateLeft(1 .. 4, 3)
assert a == [0, 4, 1, 2, 3, 5]
a.rotateLeft(1 .. 4, 3)
assert a == [0, 3, 4, 1, 2, 5]
a.rotateLeft(1 .. 4, -3)
assert a == [0, 4, 1, 2, 3, 5]
doAssertRaises(IndexDefect, a.rotateLeft(1 .. 7, 2))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L720)  
```
proc rotateLeft[T](arg: var openArray[T]; dist: int): int {...}{.discardable.}
```
  Default arguments for slice, so that this procedure operates on the entire `arg`, and not just on a part of it.

 **See also:**

 * [rotateLeft proc](#rotateLeft,openArray%5BT%5D,HSlice%5Bint,int%5D,int) for a version which rotates a range
* [rotatedLeft proc](#rotatedLeft,openArray%5BT%5D,int) for a version which returns a `seq[T]`

 **Example:**

 
```
var a = [1, 2, 3, 4, 5]
a.rotateLeft(2)
assert a == [3, 4, 5, 1, 2]
a.rotateLeft(4)
assert a == [2, 3, 4, 5, 1]
a.rotateLeft(-6)
assert a == [1, 2, 3, 4, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L758) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L758)  
```
proc rotatedLeft[T](arg: openArray[T]; slice: HSlice[int, int]; dist: int): seq[
    T]
```
  Same as `rotateLeft`, just with the difference that it does not modify the argument. It creates a new `seq` instead.

 Elements outside of `slice` will be left unchanged. If an invalid range (`HSlice`) is passed, it raises IndexDefect.

 
`slice` The indices of the element range that should be rotated. `dist` The distance in amount of elements that the data should be rotated. Can be negative, can be any number.  **See also:**

 * [rotateLeft proc](#rotateLeft,openArray%5BT%5D,HSlice%5Bint,int%5D,int) for the in-place version of this proc
* [rotatedLeft proc](#rotatedLeft,openArray%5BT%5D,int) for a version which rotates the whole container

 **Example:**

 
```
var a = @[1, 2, 3, 4, 5]
a = rotatedLeft(a, 1 .. 4, 3)
assert a == @[1, 5, 2, 3, 4]
a = rotatedLeft(a, 1 .. 3, 2)
assert a == @[1, 3, 5, 2, 4]
a = rotatedLeft(a, 1 .. 3, -2)
assert a == @[1, 5, 2, 3, 4]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L777) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L777)  
```
proc rotatedLeft[T](arg: openArray[T]; dist: int): seq[T]
```
  Same as `rotateLeft`, just with the difference that it does not modify the argument. It creates a new `seq` instead.

 **See also:**

 * [rotateLeft proc](#rotateLeft,openArray%5BT%5D,int) for the in-place version of this proc
* [rotatedLeft proc](#rotatedLeft,openArray%5BT%5D,HSlice%5Bint,int%5D,int) for a version which rotates a range

 **Example:**

 
```
var a = @[1, 2, 3, 4, 5]
a = rotatedLeft(a, 2)
assert a == @[3, 4, 5, 1, 2]
a = rotatedLeft(a, 4)
assert a == @[2, 3, 4, 5, 1]
a = rotatedLeft(a, -6)
assert a == @[1, 2, 3, 4, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L807) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L807)   Funcs
-----

  
```
func sort[T](a: var openArray[T]; cmp: proc (x, y: T): int {...}{.closure.};
             order = SortOrder.Ascending)
```
  Default Nim sort (an implementation of merge sort). The sorting is guaranteed to be stable and the worst case is guaranteed to be O(n log n).

 The current implementation uses an iterative mergesort to achieve this. It uses a temporary sequence of length `a.len div 2`. If you do not wish to provide your own `cmp`, you may use `system.cmp` or instead call the overloaded version of `sort`, which uses `system.cmp`.

 
```
sort(myIntArray, system.cmp[int])
# do not use cmp[string] here as we want to use the specialized
# overload:
sort(myStrArray, system.cmp)
```

You can inline adhoc comparison procs with the [do notation](manual_experimental#do-notation). Example:

 
```
people.sort do (x, y: Person) -> int:
  result = cmp(x.surname, y.surname)
  if result == 0:
    result = cmp(x.name, y.name)
```

**See also:**

 * [sort proc](#sort,openArray%5BT%5D)
* [sorted proc](#sorted,openArray%5BT%5D,proc(T,T)) sorted by `cmp` in the specified order
* [sorted proc](#sorted,openArray%5BT%5D)
* [sortedByIt template](#sortedByIt.t,untyped,untyped)

 **Example:**

 
```
var d = ["boo", "fo", "barr", "qux"]
proc myCmp(x, y: string): int =
  if x.len() > y.len() or x.len() == y.len(): 1
  else: -1
sort(d, myCmp)
assert d == ["fo", "qux", "boo", "barr"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L373)  
```
func isSorted[T](a: openArray[T]; cmp: proc (x, y: T): int {...}{.closure.};
                 order = SortOrder.Ascending): bool
```
  Checks to see whether `a` is already sorted in `order` using `cmp` for the comparison. Parameters identical to `sort`. Requires O(n) time.

 **See also:**

 * [isSorted proc](#isSorted,openArray%5BT%5D)

 **Example:**

 
```
let
  a = [2, 3, 1, 5, 4]
  b = [1, 2, 3, 4, 5]
  c = [5, 4, 3, 2, 1]
  d = ["adam", "brian", "cat", "dande"]
  e = ["adam", "dande", "brian", "cat"]
assert isSorted(a) == false
assert isSorted(b) == true
assert isSorted(c) == false
assert isSorted(c, Descending) == true
assert isSorted(d) == true
assert isSorted(e) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L512)   Templates
---------

  
```
template sortedByIt(seq1, op: untyped): untyped
```
  Convenience template around the `sorted` proc to reduce typing.

 The template injects the `it` variable which you can use directly in an expression.

 Because the underlying `cmp()` is defined for tuples you can do a nested sort.

 **See also:**

 * [sort func](#sort,openArray%5BT%5D,proc(T,T))
* [sort proc](#sort,openArray%5BT%5D)
* [sorted proc](#sorted,openArray%5BT%5D,proc(T,T)) sorted by `cmp` in the specified order
* [sorted proc](#sorted,openArray%5BT%5D)

 **Example:**

 
```
type Person = tuple[name: string, age: int]
var
  p1: Person = (name: "p1", age: 60)
  p2: Person = (name: "p2", age: 20)
  p3: Person = (name: "p3", age: 30)
  p4: Person = (name: "p4", age: 30)
  people = @[p1, p2, p4, p3]

assert people.sortedByIt(it.name) == @[(name: "p1", age: 60), (name: "p2",
    age: 20), (name: "p3", age: 30), (name: "p4", age: 30)]
# Nested sort
assert people.sortedByIt((it.age, it.name)) == @[(name: "p2", age: 20),
   (name: "p3", age: 30), (name: "p4", age: 30), (name: "p1", age: 60)]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/algorithm.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/algorithm.nim#L476)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/algorithm.html>

sequtils
========

 Although this module has `seq` in its name, it implements operations not only for seq type, but for three built-in container types under the `openArray` umbrella:


* sequences
* strings
* array

 The system module defines several common functions, such as:

 * `newSeq[T]` for creating new sequences of type `T`
* `@` for converting arrays and strings to sequences
* `add` for adding new elements to strings and sequences
* `&` for string and seq concatenation
* `in` (alias for `contains`) and `notin` for checking if an item is in a container

 This module builds upon that, providing additional functionality in form of procs, iterators and templates inspired by functional programming languages.

 For functional style programming you have different options at your disposal:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* pass [anonymous proc](manual#procedures-anonymous-procs)
* import [sugar module](sugar) and use [=> macro](#)
* use [...It templates](#18) ([mapIt](#mapIt.t,typed,untyped), [filterIt](#filterIt.t,untyped,untyped), etc.)

 The chaining of functions is possible thanks to the [method call syntax](manual#procedures-method-call-syntax).

 
```
import sequtils, sugar

# Creating a sequence from 1 to 10, multiplying each member by 2,
# keeping only the members which are not divisible by 6.
let
  foo = toSeq(1..10).map(x => x*2).filter(x => x mod 6 != 0)
  bar = toSeq(1..10).mapIt(it*2).filterIt(it mod 6 != 0)
  baz = collect(newSeq):
    for i in 1..10:
      let j = 2*i
      if j mod 6 != 0:
        j

doAssert foo == bar
doAssert foo == baz
echo foo                  # @[2, 4, 8, 10, 14, 16, 20]

echo foo.any(x => x > 17) # true
echo bar.allIt(it < 20)   # false
echo foo.foldl(a + b)     # 74; sum of all members
```


```
import sequtils
from strutils import join

let
  vowels = @"aeiou" # creates a sequence @['a', 'e', 'i', 'o', 'u']
  foo = "sequtils is an awesome module"

echo foo.filterIt(it notin vowels).join # "sqtls s n wsm mdl"
```



---

 **See also**:

 * [strutils module](strutils) for common string functions
* [sugar module](sugar) for syntactic sugar macros
* [algorithm module](algorithm) for common generic algorithms
* [json module](json) for a structure which allows heterogeneous members

 Imports
-------

  <since>, <macros>  Procs
-----

  
```
proc concat[T](seqs: varargs[seq[T]]): seq[T]
```
  Takes several sequences' items and returns them inside a new sequence. All sequences must be of the same type.

 See also:

 * [distribute proc](#distribute,seq%5BT%5D,Positive) for a reverse operation

 **Example:**

 
```
let
  s1 = @[1, 2, 3]
  s2 = @[4, 5]
  s3 = @[6, 7]
  total = concat(s1, s2, s3)
assert total == @[1, 2, 3, 4, 5, 6, 7]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L113)  
```
proc count[T](s: openArray[T]; x: T): int
```
  Returns the number of occurrences of the item `x` in the container `s`. **Example:**

 
```
let
  a = @[1, 2, 2, 3, 2, 4, 2]
  b = "abracadabra"
assert count(a, 2) == 4
assert count(a, 99) == 0
assert count(b, 'r') == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L138)  
```
proc cycle[T](s: openArray[T]; n: Natural): seq[T]
```
  Returns a new sequence with the items of the container `s` repeated `n` times. `n` must be a non-negative number (zero or more). **Example:**

 
```
let
  s = @[1, 2, 3]
  total = s.cycle(3)
assert total == @[1, 2, 3, 1, 2, 3, 1, 2, 3]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L153)  
```
proc repeat[T](x: T; n: Natural): seq[T]
```
  Returns a new sequence with the item `x` repeated `n` times. `n` must be a non-negative number (zero or more). **Example:**

 
```
let
  total = repeat(5, 3)
assert total == @[5, 5, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L171)  
```
proc deduplicate[T](s: openArray[T]; isSorted: bool = false): seq[T]
```
  Returns a new sequence without duplicates.

 Setting the optional argument `isSorted` to `true` (default: false) uses a faster algorithm for deduplication. 

 **Example:**

 
```
let
  dup1 = @[1, 1, 3, 4, 2, 2, 8, 1, 4]
  dup2 = @["a", "a", "c", "d", "d"]
  unique1 = deduplicate(dup1)
  unique2 = deduplicate(dup2, isSorted = true)
assert unique1 == @[1, 3, 4, 2, 8]
assert unique2 == @["a", "c", "d"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L184)  
```
proc minIndex[T](s: openArray[T]): int
```
  Returns the index of the minimum value of `s`. `T` needs to have a `<` operator. **Example:**

 
```
let
  a = @[1, 2, 3, 4]
  b = @[6, 5, 4, 3]
  c = [2, -7, 8, -5]
  d = "ziggy"
assert minIndex(a) == 0
assert minIndex(b) == 3
assert minIndex(c) == 1
assert minIndex(d) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L212)  
```
proc maxIndex[T](s: openArray[T]): int
```
  Returns the index of the maximum value of `s`. `T` needs to have a `<` operator. **Example:**

 
```
let
  a = @[1, 2, 3, 4]
  b = @[6, 5, 4, 3]
  c = [2, -7, 8, -5]
  d = "ziggy"
assert maxIndex(a) == 3
assert maxIndex(b) == 0
assert maxIndex(c) == 2
assert maxIndex(d) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L229)  
```
proc zip[S, T](s1: openArray[S]; s2: openArray[T]): seq[(S, T)]
```
  Returns a new sequence with a combination of the two input containers.

 The input containers can be of different types. If one container is shorter, the remaining items in the longer container are discarded.

 **Note**: For Nim 1.0.x and older version, `zip` returned a seq of named tuple with fields `a` and `b`. For Nim versions 1.1.x and newer, `zip` returns a seq of unnamed tuples.

 **Example:**

 
```
let
  short = @[1, 2, 3]
  long = @[6, 5, 4, 3, 2, 1]
  words = @["one", "two", "three"]
  letters = "abcd"
  zip1 = zip(short, long)
  zip2 = zip(short, words)
assert zip1 == @[(1, 6), (2, 5), (3, 4)]
assert zip2 == @[(1, "one"), (2, "two"), (3, "three")]
assert zip1[2][0] == 3
assert zip2[1][1] == "two"
when (NimMajor, NimMinor) <= (1, 0):
  let
    zip3 = zip(long, letters)
  assert zip3 == @[(a: 6, b: 'a'), (5, 'b'), (4, 'c'), (3, 'd')]
  assert zip3[0].b == 'a'
else:
  let
    zip3: seq[tuple[num: int, letter: char]] = zip(long, letters)
  assert zip3 == @[(6, 'a'), (5, 'b'), (4, 'c'), (3, 'd')]
  assert zip3[0].letter == 'a'
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L289)  
```
proc unzip[S, T](s: openArray[(S, T)]): (seq[S], seq[T])
```
  Returns a tuple of two sequences split out from a sequence of 2-field tuples. **Example:**

 
```
let
  zipped = @[(1, 'a'), (2, 'b'), (3, 'c')]
  unzipped1 = @[1, 2, 3]
  unzipped2 = @['a', 'b', 'c']
assert zipped.unzip() == (unzipped1, unzipped2)
assert zip(unzipped1, unzipped2).unzip() == (unzipped1, unzipped2)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L291)  
```
proc distribute[T](s: seq[T]; num: Positive; spread = true): seq[seq[T]]
```
  Splits and distributes a sequence `s` into `num` sub-sequences.

 Returns a sequence of `num` sequences. For *some* input values this is the inverse of the [concat](#concat,varargs%5Bseq%5BT%5D%5D) proc. The input sequence `s` can be empty, which will produce `num` empty sequences.

 If `spread` is false and the length of `s` is not a multiple of `num`, the proc will max out the first sub-sequence with `1 + len(s) div num` entries, leaving the remainder of elements to the last sequence.

 On the other hand, if `spread` is true, the proc will distribute evenly the remainder of the division across all sequences, which makes the result more suited to multithreading where you are passing equal sized work units to a thread pool and want to maximize core usage. 

 **Example:**

 
```
let numbers = @[1, 2, 3, 4, 5, 6, 7]
assert numbers.distribute(3) == @[@[1, 2, 3], @[4, 5], @[6, 7]]
assert numbers.distribute(3, false) == @[@[1, 2, 3], @[4, 5, 6], @[7]]
assert numbers.distribute(6)[0] == @[1, 2]
assert numbers.distribute(6)[1] == @[3]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L306)  
```
proc map[T, S](s: openArray[T]; op: proc (x: T): S {...}{.closure.}): seq[S] {...}{.inline.}
```
  Returns a new sequence with the results of `op` proc applied to every item in the container `s`.

 Since the input is not modified you can use it to transform the type of the elements in the input container.

 Instead of using `map` and `filter`, consider using the `collect` macro from the `sugar` module.

 See also:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* [mapIt template](#mapIt.t,typed,untyped)
* [apply proc](#apply,openArray%5BT%5D,proc(T)_2) for the in-place version

 **Example:**

 
```
let
  a = @[1, 2, 3, 4]
  b = map(a, proc(x: int): string = $x)
assert b == @["1", "2", "3", "4"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L363)  
```
proc apply[T](s: var openArray[T]; op: proc (x: var T) {...}{.closure.}) {...}{.inline.}
```
  Applies `op` to every item in `s` modifying it directly.

 Note that container `s` must be declared as a `var` and it is required for your input and output types to be the same, since `s` is modified in-place. The parameter function takes a `var T` type parameter.

 See also:

 * [applyIt template](#applyIt.t,untyped,untyped)
* [map proc](#map,openArray%5BT%5D,proc(T))

 **Example:**

 
```
var a = @["1", "2", "3", "4"]
apply(a, proc(x: var string) = x &= "42")
assert a == @["142", "242", "342", "442"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L389)  
```
proc apply[T](s: var openArray[T]; op: proc (x: T): T {...}{.closure.}) {...}{.inline.}
```
  Applies `op` to every item in `s` modifying it directly.

 Note that container `s` must be declared as a `var` and it is required for your input and output types to be the same, since `s` is modified in-place. The parameter function takes and returns a `T` type variable.

 See also:

 * [applyIt template](#applyIt.t,untyped,untyped)
* [map proc](#map,openArray%5BT%5D,proc(T))

 **Example:**

 
```
var a = @["1", "2", "3", "4"]
apply(a, proc(x: string): string = x & "42")
assert a == @["142", "242", "342", "442"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L409)  
```
proc apply[T](s: openArray[T]; op: proc (x: T) {...}{.closure.}) {...}{.inline.}
```
  Same as `apply` but for proc that do not return and do not mutate `s` directly. **Example:**

 
```
apply([0, 1, 2, 3, 4], proc(item: int) = echo item)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L429)  
```
proc filter[T](s: openArray[T]; pred: proc (x: T): bool {...}{.closure.}): seq[T] {...}{.
    inline.}
```
  Returns a new sequence with all the items of `s` that fulfilled the predicate `pred` (function that returns a `bool`).

 Instead of using `map` and `filter`, consider using the `collect` macro from the `sugar` module.

 See also:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* [filterIt template](#filterIt.t,untyped,untyped)
* [filter iterator](#filter.i,openArray%5BT%5D,proc(T))
* [keepIf proc](#keepIf,seq%5BT%5D,proc(T)) for the in-place version

 **Example:**

 
```
let
  colors = @["red", "yellow", "black"]
  f1 = filter(colors, proc(x: string): bool = x.len < 6)
  f2 = filter(colors, proc(x: string): bool = x.contains('y'))
assert f1 == @["red", "black"]
assert f2 == @["yellow"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L457)  
```
proc keepIf[T](s: var seq[T]; pred: proc (x: T): bool {...}{.closure.}) {...}{.inline.}
```
  Keeps the items in the passed sequence `s` if they fulfilled the predicate `pred` (function that returns a `bool`).

 Note that `s` must be declared as a `var`.

 Similar to the [filter proc](#filter,openArray%5BT%5D,proc(T)), but modifies the sequence directly.

 See also:

 * [keepItIf template](#keepItIf.t,seq,untyped)
* [filter proc](#filter,openArray%5BT%5D,proc(T))

 **Example:**

 
```
var floats = @[13.0, 12.5, 5.8, 2.0, 6.1, 9.9, 10.1]
keepIf(floats, proc(x: float): bool = x > 10)
assert floats == @[13.0, 12.5, 10.1]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L484)  
```
proc delete[T](s: var seq[T]; first, last: Natural)
```
  Deletes in the items of a sequence `s` at positions `first..last` (including both ends of a range). This modifies `s` itself, it does not return a copy. **Example:**

 
```
let outcome = @[1, 1, 1, 1, 1, 1, 1, 1]
var dest = @[1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1]
dest.delete(3, 8)
assert outcome == dest
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L514)  
```
proc insert[T](dest: var seq[T]; src: openArray[T]; pos = 0)
```
  Inserts items from `src` into `dest` at position `pos`. This modifies `dest` itself, it does not return a copy.

 Notice that `src` and `dest` must be of the same type. 

 **Example:**

 
```
var dest = @[1, 1, 1, 1, 1, 1, 1, 1]
let
  src = @[2, 2, 2, 2, 2, 2]
  outcome = @[1, 1, 1, 2, 2, 2, 2, 2, 2, 1, 1, 1, 1, 1]
dest.insert(src, 3)
assert dest == outcome
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L539)  
```
proc all[T](s: openArray[T]; pred: proc (x: T): bool {...}{.closure.}): bool
```
  Iterates through a container and checks if every item fulfills the predicate.

 See also:

 * [allIt template](#allIt.t,untyped,untyped)
* [any proc](#any,openArray%5BT%5D,proc(T))

 **Example:**

 
```
let numbers = @[1, 4, 5, 8, 9, 7, 4]
assert all(numbers, proc (x: int): bool = return x < 10) == true
assert all(numbers, proc (x: int): bool = return x < 9) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L651)  
```
proc any[T](s: openArray[T]; pred: proc (x: T): bool {...}{.closure.}): bool
```
  Iterates through a container and checks if some item fulfills the predicate.

 See also:

 * [anyIt template](#anyIt.t,untyped,untyped)
* [all proc](#all,openArray%5BT%5D,proc(T))

 **Example:**

 
```
let numbers = @[1, 4, 5, 8, 9, 7, 4]
assert any(numbers, proc (x: int): bool = return x > 8) == true
assert any(numbers, proc (x: int): bool = return x > 9) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L693)   Iterators
---------

  
```
iterator filter[T](s: openArray[T]; pred: proc (x: T): bool {...}{.closure.}): T
```
  Iterates through a container `s` and yields every item that fulfills the predicate `pred` (function that returns a `bool`).

 Instead of using `map` and `filter`, consider using the `collect` macro from the `sugar` module.

 See also:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* [filter proc](#filter,openArray%5BT%5D,proc(T))
* [filterIt template](#filterIt.t,untyped,untyped)

 **Example:**

 
```
let numbers = @[1, 4, 5, 8, 9, 7, 4]
var evens = newSeq[int]()
for n in filter(numbers, proc (x: int): bool = x mod 2 == 0):
  evens.add(n)
assert evens == @[4, 8, 4]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L434)  
```
iterator items[T](xs: iterator (): T): T
```
  iterates over each element yielded by a closure iterator. This may not seem particularly useful on its own, but this allows closure iterators to be used by the the mapIt, filterIt, allIt, anyIt, etc. templates. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L1101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L1101)   Macros
------

  
```
macro mapLiterals(constructor, op: untyped; nested = true): untyped
```
  Applies `op` to each of the **atomic** literals like `3` or `"abc"` in the specified `constructor` AST. This can be used to map every array element to some target type:

 Example:

 
```
let x = mapLiterals([0.1, 1.2, 2.3, 3.4], int)
doAssert x is array[4, int]
```

Short notation for:

 
```
let x = [int(0.1), int(1.2), int(2.3), int(3.4)]
```

If `nested` is true (which is the default), the literals are replaced everywhere in the `constructor` AST, otherwise only the first level is considered:

 
```
let a = mapLiterals((1.2, (2.3, 3.4), 4.8), int)
let b = mapLiterals((1.2, (2.3, 3.4), 4.8), int, nested=false)
assert a == (1, (2, 3), 4)
assert b == (1, (2.3, 3.4), 4)

let c = mapLiterals((1, (2, 3), 4, (5, 6)), `$`)
let d = mapLiterals((1, (2, 3), 4, (5, 6)), `$`, nested=false)
assert c == ("1", ("2", "3"), "4", ("5", "6"))
assert d == ("1", (2, 3), "4", (5, 6))
```

There are no constraints for the `constructor` AST, it works for nested tuples of arrays of sets etc.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L1065) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L1065)   Templates
---------

  
```
template filterIt(s, pred: untyped): untyped
```
  Returns a new sequence with all the items of `s` that fulfilled the predicate `pred`.

 Unlike the [filter proc](#filter,openArray%5BT%5D,proc(T)) and [filter iterator](#filter.i,openArray%5BT%5D,proc(T)), the predicate needs to be an expression using the `it` variable for testing, like: `filterIt("abcxyz", it == 'x')`.

 Instead of using `mapIt` and `filterIt`, consider using the `collect` macro from the `sugar` module.

 See also:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* [fliter proc](#filter,openArray%5BT%5D,proc(T))
* [filter iterator](#filter.i,openArray%5BT%5D,proc(T))

 **Example:**

 
```
let
  temperatures = @[-272.15, -2.0, 24.5, 44.31, 99.9, -113.44]
  acceptable = temperatures.filterIt(it < 50 and it > -10)
  notAcceptable = temperatures.filterIt(it > 50 or it < -10)
assert acceptable == @[-2.0, 24.5, 44.31]
assert notAcceptable == @[-272.15, 99.9, -113.44]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L573)  
```
template keepItIf(varSeq: seq; pred: untyped)
```
  Keeps the items in the passed sequence (must be declared as a `var`) if they fulfilled the predicate.

 Unlike the [keepIf proc](#keepIf,seq%5BT%5D,proc(T)), the predicate needs to be an expression using the `it` variable for testing, like: `keepItIf("abcxyz", it == 'x')`.

 See also:

 * [keepIf proc](#keepIf,seq%5BT%5D,proc(T))
* [filterIt template](#filterIt.t,untyped,untyped)

 **Example:**

 
```
var candidates = @["foo", "bar", "baz", "foobar"]
candidates.keepItIf(it.len == 3 and it[0] == 'b')
assert candidates == @["bar", "baz"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L603)  
```
template countIt(s, pred: untyped): int
```
  Returns a count of all the items that fulfilled the predicate.

 The predicate needs to be an expression using the `it` variable for testing, like: `countIt(@[1, 2, 3], it > 2)`. 

 **Example:**

 
```
let numbers = @[-3, -2, -1, 0, 1, 2, 3, 4, 5, 6]
iterator iota(n: int): int =
  for i in 0..<n: yield i
assert numbers.countIt(it < 0) == 3
assert countIt(iota(10), it < 2) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L633)  
```
template allIt(s, pred: untyped): bool
```
  Iterates through a container and checks if every item fulfills the predicate.

 Unlike the [all proc](#all,openArray%5BT%5D,proc(T)), the predicate needs to be an expression using the `it` variable for testing, like: `allIt("abba", it == 'a')`.

 See also:

 * [all proc](#all,openArray%5BT%5D,proc(T))
* [anyIt template](#anyIt.t,untyped,untyped)

 **Example:**

 
```
let numbers = @[1, 4, 5, 8, 9, 7, 4]
assert numbers.allIt(it < 10) == true
assert numbers.allIt(it < 9) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L669)  
```
template anyIt(s, pred: untyped): bool
```
  Iterates through a container and checks if some item fulfills the predicate.

 Unlike the [any proc](#any,openArray%5BT%5D,proc(T)), the predicate needs to be an expression using the `it` variable for testing, like: `anyIt("abba", it == 'a')`.

 See also:

 * [any proc](#any,openArray%5BT%5D,proc(T))
* [allIt template](#allIt.t,untyped,untyped)

 **Example:**

 
```
let numbers = @[1, 4, 5, 8, 9, 7, 4]
assert numbers.anyIt(it > 8) == true
assert numbers.anyIt(it > 9) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L711)  
```
template toSeq(iter: untyped): untyped
```
  Transforms any iterable (anything that can be iterated over, e.g. with a for-loop) into a sequence. **Example:**

 
```
let
  myRange = 1..5
  mySet: set[int8] = {5'i8, 3, 1}
assert typeof(myRange) is HSlice[system.int, system.int]
assert typeof(mySet) is set[int8]

let
  mySeq1 = toSeq(myRange)
  mySeq2 = toSeq(mySet)
assert mySeq1 == @[1, 2, 3, 4, 5]
assert mySeq2 == @[1'i8, 3, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L776) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L776)  
```
template foldl(sequence, operation: untyped): untyped
```
  Template to fold a sequence from left to right, returning the accumulation.

 The sequence is required to have at least a single element. Debug versions of your program will assert in this situation but release versions will happily go ahead. If the sequence has a single element it will be returned without applying `operation`.

 The `operation` parameter should be an expression which uses the variables `a` and `b` for each step of the fold. Since this is a left fold, for non associative binary operations like subtraction think that the sequence of numbers 1, 2 and 3 will be parenthesized as (((1) - 2) - 3).

 See also:

 * [foldl template](#foldl.t,,,) with a starting parameter
* [foldr template](#foldr.t,untyped,untyped)

 **Example:**

 
```
let
  numbers = @[5, 9, 11]
  addition = foldl(numbers, a + b)
  subtraction = foldl(numbers, a - b)
  multiplication = foldl(numbers, a * b)
  words = @["nim", "is", "cool"]
  concatenation = foldl(words, a & b)
  procs = @["proc", "Is", "Also", "Fine"]


proc foo(acc, cur: string): string =
  result = acc & cur

assert addition == 25, "Addition is (((5)+9)+11)"
assert subtraction == -15, "Subtraction is (((5)-9)-11)"
assert multiplication == 495, "Multiplication is (((5)*9)*11)"
assert concatenation == "nimiscool"
assert foldl(procs, foo(a, b)) == "procIsAlsoFine"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L814) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L814)  
```
template foldl(sequence, operation, first): untyped
```
  Template to fold a sequence from left to right, returning the accumulation.

 This version of `foldl` gets a **starting parameter**. This makes it possible to accumulate the sequence into a different type than the sequence elements.

 The `operation` parameter should be an expression which uses the variables `a` and `b` for each step of the fold. The `first` parameter is the start value (the first `a`) and therefor defines the type of the result.

 See also:

 * [foldr template](#foldr.t,untyped,untyped)

 **Example:**

 
```
let
  numbers = @[0, 8, 1, 5]
  digits = foldl(numbers, a & (chr(b + ord('0'))), "")
assert digits == "0815"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L863)  
```
template foldr(sequence, operation: untyped): untyped
```
  Template to fold a sequence from right to left, returning the accumulation.

 The sequence is required to have at least a single element. Debug versions of your program will assert in this situation but release versions will happily go ahead. If the sequence has a single element it will be returned without applying `operation`.

 The `operation` parameter should be an expression which uses the variables `a` and `b` for each step of the fold. Since this is a right fold, for non associative binary operations like subtraction think that the sequence of numbers 1, 2 and 3 will be parenthesized as (1 - (2 - (3))).

 See also:

 * [foldl template](#foldl.t,untyped,untyped)
* [foldl template](#foldl.t,,,) with a starting parameter

 **Example:**

 
```
let
  numbers = @[5, 9, 11]
  addition = foldr(numbers, a + b)
  subtraction = foldr(numbers, a - b)
  multiplication = foldr(numbers, a * b)
  words = @["nim", "is", "cool"]
  concatenation = foldr(words, a & b)
assert addition == 25, "Addition is (5+(9+(11)))"
assert subtraction == 7, "Subtraction is (5-(9-(11)))"
assert multiplication == 495, "Multiplication is (5*(9*(11)))"
assert concatenation == "nimiscool"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L890)  
```
template mapIt(s: typed; op: untyped): untyped
```
  Returns a new sequence with the results of `op` proc applied to every item in the container `s`.

 Since the input is not modified you can use it to transform the type of the elements in the input container.

 The template injects the `it` variable which you can use directly in an expression.

 Instead of using `mapIt` and `filterIt`, consider using the `collect` macro from the `sugar` module.

 See also:

 * [sugar.collect macro](sugar#collect.m%2Cuntyped%2Cuntyped)
* [map proc](#map,openArray%5BT%5D,proc(T))
* [applyIt template](#applyIt.t,untyped,untyped) for the in-place version

 **Example:**

 
```
let
  nums = @[1, 2, 3, 4]
  strings = nums.mapIt($(4 * it))
assert strings == @["4", "8", "12", "16"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L932) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L932)  
```
template applyIt(varSeq, op: untyped)
```
  Convenience template around the mutable `apply` proc to reduce typing.

 The template injects the `it` variable which you can use directly in an expression. The expression has to return the same type as the sequence you are mutating.

 See also:

 * [apply proc](#apply,openArray%5BT%5D,proc(T)_2)
* [mapIt template](#mapIt.t,typed,untyped)

 **Example:**

 
```
var nums = @[1, 2, 3, 4]
nums.applyIt(it * 3)
assert nums[0] + nums[3] == 15
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L1007) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L1007)  
```
template newSeqWith(len: int; init: untyped): untyped
```
  Creates a new sequence of length `len`, calling `init` to initialize each value of the sequence.

 Useful for creating "2D" sequences - sequences containing other sequences or to populate fields of the created sequence. 

 **Example:**

 
```
## Creates a sequence containing 5 bool sequences, each of length of 3.
var seq2D = newSeqWith(5, newSeq[bool](3))
assert seq2D.len == 5
assert seq2D[0].len == 3
assert seq2D[4][2] == false

## Creates a sequence of 20 random numbers from 1 to 10
import random
var seqRand = newSeqWith(20, rand(10))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sequtils.nim#L1028) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sequtils.nim#L1028)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sequtils.html>

critbits
========

 This module implements a crit bit tree which is an efficient container for a sorted set of strings, or for a sorted mapping of strings. Based on the excellent paper by Adam Langley. (A crit bit tree is a form of radix tree or patricia trie.) 


**Example:**

 
```
static:
  block:
    var critbitAsSet: CritBitTree[void]
    doAssert critbitAsSet.len == 0
    incl critbitAsSet, "kitten"
    doAssert critbitAsSet.len == 1
    incl critbitAsSet, "puppy"
    doAssert critbitAsSet.len == 2
    incl critbitAsSet, "kitten"
    doAssert critbitAsSet.len == 2
    incl critbitAsSet, ""
    doAssert critbitAsSet.len == 3
block:
  var critbitAsDict: CritBitTree[int]
  critbitAsDict["key"] = 42
  doAssert critbitAsDict["key"] == 42
  critbitAsDict["key"] = 0
  doAssert critbitAsDict["key"] == 0
  critbitAsDict["key"] = -int.high
  doAssert critbitAsDict["key"] == -int.high
  critbitAsDict["key"] = int.high
  doAssert critbitAsDict["key"] == int.high
```
 Imports
-------

  <since>  Types
-----

  
```
CritBitTree[T] = object
  root: Node[T]
  count: int
```
  The crit bit tree can either be used as a mapping from strings to some type `T` or as a set of strings if `T` is void. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L29)   Procs
-----

  
```
proc excl[T](c: var CritBitTree[T]; key: string)
```
  Removes `key` (and its associated value) from the set `c`. If the `key` does not exist, nothing happens.

 See also:

 * [incl proc](#incl,CritBitTree%5Bvoid%5D,string)
* [incl proc](#incl,CritBitTree%5BT%5D,string,T)

 **Example:**

 
```
var c: CritBitTree[void]
incl(c, "key")
excl(c, "key")
doAssert not c.contains("key")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L143)  
```
proc missingOrExcl[T](c: var CritBitTree[T]; key: string): bool
```
  Returns true if `c` does not contain the given `key`. If the key does exist, c.excl(key) is performed.

 See also:

 * [excl proc](#excl,CritBitTree%5BT%5D,string)
* [containsOrIncl proc](#containsOrIncl,CritBitTree%5BT%5D,string,T)
* [containsOrIncl proc](#containsOrIncl,CritBitTree%5Bvoid%5D,string)

 **Example:**

 
```
block:
  var c: CritBitTree[void]
  doAssert c.missingOrExcl("key")
block:
  var c: CritBitTree[void]
  incl(c, "key")
  doAssert not c.missingOrExcl("key")
  doAssert not c.contains("key")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L158)  
```
proc containsOrIncl[T](c: var CritBitTree[T]; key: string; val: T): bool
```
  Returns true if `c` contains the given `key`. If the key does not exist `c[key] = val` is performed.

 See also:

 * [incl proc](#incl,CritBitTree%5Bvoid%5D,string)
* [incl proc](#incl,CritBitTree%5BT%5D,string,T)
* [containsOrIncl proc](#containsOrIncl,CritBitTree%5Bvoid%5D,string)
* [missingOrExcl proc](#missingOrExcl,CritBitTree%5BT%5D,string)

 **Example:**

 
```
block:
  var c: CritBitTree[int]
  doAssert not c.containsOrIncl("key", 42)
  doAssert c.contains("key")
block:
  var c: CritBitTree[int]
  incl(c, "key", 21)
  doAssert c.containsOrIncl("key", 42)
  doAssert c["key"] == 21
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L180)  
```
proc containsOrIncl(c: var CritBitTree[void]; key: string): bool {...}{.raises: [],
    tags: [].}
```
  Returns true if `c` contains the given `key`. If the key does not exist it is inserted into `c`.

 See also:

 * [incl proc](#incl,CritBitTree%5Bvoid%5D,string)
* [incl proc](#incl,CritBitTree%5BT%5D,string,T)
* [containsOrIncl proc](#containsOrIncl,CritBitTree%5BT%5D,string,T)
* [missingOrExcl proc](#missingOrExcl,CritBitTree%5BT%5D,string)

 **Example:**

 
```
block:
  var c: CritBitTree[void]
  doAssert not c.containsOrIncl("key")
  doAssert c.contains("key")
block:
  var c: CritBitTree[void]
  incl(c, "key")
  doAssert c.containsOrIncl("key")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L206)  
```
proc inc(c: var CritBitTree[int]; key: string; val: int = 1) {...}{.raises: [],
    tags: [].}
```
  Increments `c[key]` by `val`. **Example:**

 
```
var c: CritBitTree[int]
c["key"] = 1
inc(c, "key")
doAssert c["key"] == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L229)  
```
proc incl(c: var CritBitTree[void]; key: string) {...}{.raises: [], tags: [].}
```
  Includes `key` in `c`.

 See also:

 * [excl proc](#excl,CritBitTree%5BT%5D,string)
* [incl proc](#incl,CritBitTree%5BT%5D,string,T)

 **Example:**

 
```
var c: CritBitTree[void]
incl(c, "key")
doAssert c.hasKey("key")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L240)  
```
proc incl[T](c: var CritBitTree[T]; key: string; val: T)
```
  Inserts `key` with value `val` into `c`.

 See also:

 * [excl proc](#excl,CritBitTree%5BT%5D,string)
* [incl proc](#incl,CritBitTree%5Bvoid%5D,string)

 **Example:**

 
```
var c: CritBitTree[int]
incl(c, "key", 42)
doAssert c["key"] == 42
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L253)  
```
proc `[]=`[T](c: var CritBitTree[T]; key: string; val: T)
```
  Puts a (key, value)-pair into `t`.

 See also:

 * [[] proc](#%5B%5D,CritBitTree%5BT%5D,string)
* [[] proc](#%5B%5D,CritBitTree%5BT%5D,string_2)

 **Example:**

 
```
var c: CritBitTree[int]
c["key"] = 42
doAssert c["key"] == 42
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L267)   Funcs
-----

  
```
func len[T](c: CritBitTree[T]): int {...}{.inline.}
```
  Returns the number of elements in `c` in O(1). **Example:**

 
```
var c: CritBitTree[void]
incl(c, "key1")
incl(c, "key2")
doAssert c.len == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L36)  
```
func contains[T](c: CritBitTree[T]; key: string): bool {...}{.inline.}
```
  Returns true if `c` contains the given `key`. **Example:**

 
```
var c: CritBitTree[void]
incl(c, "key")
doAssert c.contains("key")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L56)  
```
func hasKey[T](c: CritBitTree[T]; key: string): bool {...}{.inline.}
```
  Alias for [contains](#contains,CritBitTree%5BT%5D,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L65)  
```
func `[]`[T](c: CritBitTree[T]; key: string): T {...}{.inline.}
```
  Retrieves the value at `c[key]`. If `key` is not in `t`, the `KeyError` exception is raised. One can check with `hasKey` whether the key exists.

 See also:

 * [[] proc](#%5B%5D,CritBitTree%5BT%5D,string_2)
* [[]= proc](#%5B%5D=,CritBitTree%5BT%5D,string,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L288)  
```
func `[]`[T](c: var CritBitTree[T]; key: string): var T {...}{.inline.}
```
  Retrieves the value at `c[key]`. The value can be modified. If `key` is not in `t`, the `KeyError` exception is raised.

 See also:

 * [[] proc](#%5B%5D,CritBitTree%5BT%5D,string)
* [[]= proc](#%5B%5D=,CritBitTree%5BT%5D,string,T)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L298)  
```
func `$`[T](c: CritBitTree[T]): string
```
  Turns `c` into a string representation. Example outputs: `{keyA: value, keyB: value}`, `{:}` If `T` is void the outputs look like: `{keyA, keyB}`, `{}`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L488)  
```
func commonPrefixLen[T](c: CritBitTree[T]): int {...}{.inline.}
```
  Returns longest common prefix length of all keys of `c`. If `c` is empty, returns 0. **Example:**

 
```
var c: CritBitTree[void]
doAssert c.commonPrefixLen == 0
incl(c, "key1")
doAssert c.commonPrefixLen == 4
incl(c, "key2")
doAssert c.commonPrefixLen == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L518)  
```
func toCritBitTree[A, B](pairs: openArray[(A, B)]): CritBitTree[A]
```
  Creates a new `CritBitTree` that contains the given `pairs`. **Example:**

 
```
doAssert {"a": "0", "b": "1", "c": "2"}.toCritBitTree is CritBitTree[string]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L534)  
```
func toCritBitTree[T](items: openArray[T]): CritBitTree[void]
```
  Creates a new `CritBitTree` that contains the given `items`. **Example:**

 
```
doAssert ["a", "b", "c"].toCritBitTree is CritBitTree[void]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L540)   Iterators
---------

  
```
iterator keys[T](c: CritBitTree[T]): string
```
  Yields all keys in lexicographical order. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 1
c["key2"] = 2
var keys: seq[string]
for key in c.keys:
  keys.add(key)
doAssert keys == @["key1", "key2"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L320)  
```
iterator values[T](c: CritBitTree[T]): T
```
  Yields all values of `c` in the lexicographical order of the corresponding keys. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 1
c["key2"] = 2
var vals: seq[int]
for val in c.values:
  vals.add(val)
doAssert vals == @[1, 2]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L333)  
```
iterator mvalues[T](c: var CritBitTree[T]): var T
```
  Yields all values of `c` in the lexicographical order of the corresponding keys. The values can be modified.

 See also:

 * [values iterator](#values.i,CritBitTree%5BT%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L347)  
```
iterator items[T](c: CritBitTree[T]): string
```
  Yields all keys in lexicographical order. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 1
c["key2"] = 2
var keys: seq[string]
for key in c.items:
  keys.add(key)
doAssert keys == @["key1", "key2"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L355)  
```
iterator pairs[T](c: CritBitTree[T]): tuple[key: string, val: T]
```
  Yields all (key, value)-pairs of `c`. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 1
c["key2"] = 2
var ps: seq[tuple[key: string, val: int]]
for p in c.pairs:
  ps.add(p)
doAssert ps == @[(key: "key1", val: 1), (key: "key2", val: 2)]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L368)  
```
iterator mpairs[T](c: var CritBitTree[T]): tuple[key: string, val: var T]
```
  Yields all (key, value)-pairs of `c`. The yielded values can be modified.

 See also:

 * [pairs iterator](#pairs.i,CritBitTree%5BT%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L381)  
```
iterator itemsWithPrefix[T](c: CritBitTree[T]; prefix: string;
                            longestMatch = false): string
```
  Yields all keys starting with `prefix`. If `longestMatch` is true, the longest match is returned, it doesn't have to be a complete match then. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 42
c["key2"] = 43
var keys: seq[string]
for key in c.itemsWithPrefix("key"):
  keys.add(key)
doAssert keys == @["key1", "key2"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L404)  
```
iterator keysWithPrefix[T](c: CritBitTree[T]; prefix: string;
                           longestMatch = false): string
```
  Yields all keys starting with `prefix`. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 42
c["key2"] = 43
var keys: seq[string]
for key in c.keysWithPrefix("key"):
  keys.add(key)
doAssert keys == @["key1", "key2"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L420)  
```
iterator valuesWithPrefix[T](c: CritBitTree[T]; prefix: string;
                             longestMatch = false): T
```
  Yields all values of `c` starting with `prefix` of the corresponding keys. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 42
c["key2"] = 43
var vals: seq[int]
for val in c.valuesWithPrefix("key"):
  vals.add(val)
doAssert vals == @[42, 43]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L435)  
```
iterator mvaluesWithPrefix[T](c: var CritBitTree[T]; prefix: string;
                              longestMatch = false): var T
```
  Yields all values of `c` starting with `prefix` of the corresponding keys. The values can be modified.

 See also:

 * [valuesWithPrefix iterator](#valuesWithPrefix.i,CritBitTree%5BT%5D,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L451)  
```
iterator pairsWithPrefix[T](c: CritBitTree[T]; prefix: string;
                            longestMatch = false): tuple[key: string, val: T]
```
  Yields all (key, value)-pairs of `c` starting with `prefix`. **Example:**

 
```
var c: CritBitTree[int]
c["key1"] = 42
c["key2"] = 43
var ps: seq[tuple[key: string, val: int]]
for p in c.pairsWithPrefix("key"):
  ps.add(p)
doAssert ps == @[(key: "key1", val: 42), (key: "key2", val: 43)]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L461)  
```
iterator mpairsWithPrefix[T](c: var CritBitTree[T]; prefix: string;
                             longestMatch = false): tuple[key: string,
    val: var T]
```
  Yields all (key, value)-pairs of `c` starting with `prefix`. The yielded values can be modified.

 See also:

 * [pairsWithPrefix iterator](#pairsWithPrefix.i,CritBitTree%5BT%5D,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/critbits.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/critbits.nim#L477)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/critbits.html>

deques
======


Implementation of a deque (double-ended queue). The underlying implementation uses a `seq`.

 None of the procs that get an individual value from the deque can be used on an empty deque. If compiled with `boundChecks` option, those procs will raise an `IndexDefect` on such access. This should not be relied upon, as `-d:danger` or `--checks:off` will disable those checks and may return garbage or crash the program.

 As such, a check to see if the deque is empty is needed before any access, unless your program logic guarantees it indirectly.

 
```
import deques

var a = initDeque[int]()

doAssertRaises(IndexDefect, echo a[0])

for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"

assert a.peekFirst == 10
assert a.peekLast == 50
assert len(a) == 5

assert a.popFirst == 10
assert a.popLast == 50
assert len(a) == 3

a.addFirst(11)
a.addFirst(22)
a.addFirst(33)
assert $a == "[33, 22, 11, 20, 30, 40]"

a.shrink(fromFirst = 1, fromLast = 2)
assert $a == "[22, 11, 20]"
```

**See also:**

 * [lists module](lists) for singly and doubly linked lists and rings
* [channels module](channels) for inter-thread communication

 Imports
-------

  <since>, <math>  Types
-----

  
```
Deque[T] = object
  data: seq[T]
  head, tail, count, mask: int
```
  A double-ended queue backed with a ringed seq buffer.

 To initialize an empty deque use [initDeque proc](#initDeque,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L59)   Consts
------

  
```
defaultInitialSize = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L67)   Procs
-----

  
```
proc initDeque[T](initialSize: int = 4): Deque[T]
```
  Creates a new empty deque.

 Optionally, the initial capacity can be reserved via `initialSize` as a performance optimization. The length of a newly created deque will still be 0.

 See also:

 * [toDeque proc](#toDeque,openArray%5BT%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L79)  
```
proc toDeque[T](x: openArray[T]): Deque[T]
```
  Creates a new deque that contains the elements of `x` (in the same order).

 See also:

 * [initDeque proc](#initDeque,int)

 **Example:**

 
```
var a = toDeque([7, 8, 9])
assert len(a) == 3
assert a.popFirst == 7
assert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L90)  
```
proc len[T](deq: Deque[T]): int {...}{.inline.}
```
  Returns the number of elements of `deq`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L105)  
```
proc `[]`[T](deq: Deque[T]; i: Natural): T {...}{.inline.}
```
  Accesses the i-th element of `deq`. **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert a[0] == 10
assert a[3] == 40
doAssertRaises(IndexDefect, echo a[8])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L125)  
```
proc `[]`[T](deq: var Deque[T]; i: Natural): var T {...}{.inline.}
```
  Accesses the i-th element of `deq` and return a mutable reference to it. **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert a[0] == 10
assert a[3] == 40
doAssertRaises(IndexDefect, echo a[8])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L138)  
```
proc `[]=`[T](deq: var Deque[T]; i: Natural; val: T) {...}{.inline.}
```
  Changes the i-th element of `deq`. **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
a[0] = 99
a[3] = 66
assert $a == "[99, 20, 30, 66, 50]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L152)  
```
proc `[]`[T](deq: Deque[T]; i: BackwardsIndex): T {...}{.inline.}
```
  Accesses the backwards indexed i-th element.

 `deq[^1]` is the last element.

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert a[^1] == 50
assert a[^4] == 20
doAssertRaises(IndexDefect, echo a[^9])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L166)  
```
proc `[]`[T](deq: var Deque[T]; i: BackwardsIndex): var T {...}{.inline.}
```
  Accesses the backwards indexed i-th element.

 `deq[^1]` is the last element.

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert a[^1] == 50
assert a[^4] == 20
doAssertRaises(IndexDefect, echo a[^9])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L181)  
```
proc `[]=`[T](deq: var Deque[T]; i: BackwardsIndex; x: T) {...}{.inline.}
```
  Changes the backwards indexed i-th element.

 `deq[^1]` is the last element.

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
a[^1] = 99
a[^3] = 77
assert $a == "[10, 20, 77, 40, 99]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L196)  
```
proc contains[T](deq: Deque[T]; item: T): bool {...}{.inline.}
```
  Returns true if `item` is in `deq` or false if not found.

 Usually used via the `in` operator. It is the equivalent of `deq.find(item) >= 0`.

 
```
if x in q:
  assert q.contains(x)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L272)  
```
proc addFirst[T](deq: var Deque[T]; item: T)
```
  Adds an `item` to the beginning of the `deq`.

 See also:

 * [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addFirst(10*i)
assert $a == "[50, 40, 30, 20, 10]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L300)  
```
proc addLast[T](deq: var Deque[T]; item: T)
```
  Adds an `item` to the end of the `deq`.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L320)  
```
proc peekFirst[T](deq: Deque[T]): T {...}{.inline.}
```
  Returns the first element of `deq`, but does not remove it from the deque.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.peekFirst == 10
assert len(a) == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L340)  
```
proc peekLast[T](deq: Deque[T]): T {...}{.inline.}
```
  Returns the last element of `deq`, but does not remove it from the deque.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.peekLast == 50
assert len(a) == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L360)  
```
proc peekFirst[T](deq: var Deque[T]): var T {...}{.inline.}
```
  Returns the first element of `deq`, but does not remove it from the deque.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.peekFirst == 10
assert len(a) == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L380)  
```
proc peekLast[T](deq: var Deque[T]): var T {...}{.inline.}
```
  Returns the last element of `deq`, but does not remove it from the deque.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.peekLast == 50
assert len(a) == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L400)  
```
proc popFirst[T](deq: var Deque[T]): T {...}{.inline, discardable.}
```
  Removes and returns the first element of the `deq`.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popLast proc](#popLast,Deque%5BT%5D)
* [clear proc](#clear,Deque%5BT%5D)
* [shrink proc](#shrink,Deque%5BT%5D,int,int)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.popFirst == 10
assert $a == "[20, 30, 40, 50]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L423)  
```
proc popLast[T](deq: var Deque[T]): T {...}{.inline, discardable.}
```
  Removes and returns the last element of the `deq`.

 See also:

 * [addFirst proc](#addFirst,Deque%5BT%5D,T)
* [addLast proc](#addLast,Deque%5BT%5D,T)
* [peekFirst proc](#peekFirst,Deque%5BT%5D)
* [peekLast proc](#peekLast,Deque%5BT%5D)
* [popFirst proc](#popFirst,Deque%5BT%5D)
* [clear proc](#clear,Deque%5BT%5D)
* [shrink proc](#shrink,Deque%5BT%5D,int,int)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
assert a.popLast == 50
assert $a == "[10, 20, 30, 40]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L448)  
```
proc clear[T](deq: var Deque[T]) {...}{.inline.}
```
  Resets the deque so that it is empty.

 See also:

 * [clear proc](#clear,Deque%5BT%5D)
* [shrink proc](#shrink,Deque%5BT%5D,int,int)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addFirst(10*i)
assert $a == "[50, 40, 30, 20, 10]"
clear(a)
assert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L473)  
```
proc shrink[T](deq: var Deque[T]; fromFirst = 0; fromLast = 0)
```
  Removes `fromFirst` elements from the front of the deque and `fromLast` elements from the back.

 If the supplied number of elements exceeds the total number of elements in the deque, the deque will remain empty.

 See also:

 * [clear proc](#clear,Deque%5BT%5D)

 **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addFirst(10*i)
assert $a == "[50, 40, 30, 20, 10]"
a.shrink(fromFirst = 2, fromLast = 1)
assert $a == "[30, 20]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L491)  
```
proc `$`[T](deq: Deque[T]): string
```
  Turns a deque into its string representation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L522)   Iterators
---------

  
```
iterator items[T](deq: Deque[T]): T
```
  Yields every element of `deq`.

 **Examples:**

 
```
var a = initDeque[int]()
for i in 1 .. 3:
  a.addLast(10*i)

for x in a:  # the same as: for x in items(a):
  echo x

# 10
# 20
# 30
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L212)  
```
iterator mitems[T](deq: var Deque[T]): var T
```
  Yields every element of `deq`, which can be modified. **Example:**

 
```
var a = initDeque[int]()
for i in 1 .. 5:
  a.addLast(10*i)
assert $a == "[10, 20, 30, 40, 50]"
for x in mitems(a):
  x = 5*x - 1
assert $a == "[49, 99, 149, 199, 249]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L234)  
```
iterator pairs[T](deq: Deque[T]): tuple[key: int, val: T]
```
  Yields every (position, value) of `deq`.

 **Examples:**

 
```
var a = initDeque[int]()
for i in 1 .. 3:
  a.addLast(10*i)

for k, v in pairs(a):
  echo "key: ", k, ", value: ", v

# key: 0, value: 10
# key: 1, value: 20
# key: 2, value: 30
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/deques.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/deques.nim#L250)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/deques.html>

heapqueue
=========

 The `heapqueue` module implements a [heap data structure](https://en.wikipedia.org/wiki/Heap_(data_structure)) that can be used as a [priority queue](https://en.wikipedia.org/wiki/Priority_queue). Heaps are arrays for which `a[k] <= a[2*k+1]` and `a[k] <= a[2*k+2]` for all `k`, counting elements from 0. The interesting property of a heap is that `a[0]` is always its smallest element. 


Basic usage
-----------

 **Example:**

 
```
var heap = initHeapQueue[int]()
heap.push(8)
heap.push(2)
heap.push(5)
# The first element is the lowest element
assert heap[0] == 2
# Remove and return the lowest element
assert heap.pop() == 2
# The lowest element remaining is 5
assert heap[0] == 5
```
 Usage with custom object
------------------------


To use a `HeapQueue` with a custom object, the `<` operator must be implemented.

 **Example:**

 
```
type Job = object
  priority: int

proc `<`(a, b: Job): bool = a.priority < b.priority

var jobs = initHeapQueue[Job]()
jobs.push(Job(priority: 1))
jobs.push(Job(priority: 2))

assert jobs[0].priority == 1
```
 Imports
-------

  <since>  Types
-----

  
```
HeapQueue[T] = object
  data: seq[T]
```
  A heap queue, commonly known as a priority queue. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L53)   Procs
-----

  
```
proc initHeapQueue[T](): HeapQueue[T]
```
  Creates a new empty heap.

 See also:

 * [toHeapQueue proc](#toHeapQueue,openArray%5BT%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L57)  
```
proc len[T](heap: HeapQueue[T]): int {...}{.inline.}
```
  Returns the number of elements of `heap`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L64)  
```
proc `[]`[T](heap: HeapQueue[T]; i: Natural): lent T {...}{.inline.}
```
  Accesses the i-th element of `heap`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L68)  
```
proc push[T](heap: var HeapQueue[T]; item: sink T)
```
  Pushes `item` onto heap, maintaining the heap invariant. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L114)  
```
proc toHeapQueue[T](x: openArray[T]): HeapQueue[T]
```
  Creates a new HeapQueue that contains the elements of `x`.

 See also:

 * [initHeapQueue proc](#initHeapQueue)

 **Example:**

 
```
var heap = toHeapQueue([9, 5, 8])
assert heap.pop() == 5
assert heap[0] == 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L119)  
```
proc pop[T](heap: var HeapQueue[T]): T
```
  Pops and returns the smallest item from `heap`, maintaining the heap invariant. **Example:**

 
```
var heap = toHeapQueue([9, 5, 8])
assert heap.pop() == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L133)  
```
proc find[T](heap: HeapQueue[T]; x: T): int
```
  Linear scan to find index of item `x` or -1 if not found. **Example:**

 
```
var heap = toHeapQueue([9, 5, 8])
assert heap.find(5) == 0
assert heap.find(9) == 1
assert heap.find(777) == -1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L147)  
```
proc del[T](heap: var HeapQueue[T]; index: Natural)
```
  Removes the element at `index` from `heap`, maintaining the heap invariant. **Example:**

 
```
var heap = toHeapQueue([9, 5, 8])
heap.del(1)
assert heap[0] == 5
assert heap[1] == 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L158)  
```
proc replace[T](heap: var HeapQueue[T]; item: sink T): T
```
  Pops and returns the current smallest value, and add the new item. This is more efficient than pop() followed by push(), and can be more appropriate when using a fixed-size heap. Note that the value returned may be larger than item! That constrains reasonable uses of this routine unless written as part of a conditional replacement: **Example:**

 
```
var heap = initHeapQueue[int]()
heap.push(5)
heap.push(12)
assert heap.replace(6) == 5
assert heap.len == 2
assert heap[0] == 6
assert heap.replace(4) == 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L171)  
```
proc pushpop[T](heap: var HeapQueue[T]; item: sink T): T
```
  Fast version of a push followed by a pop. **Example:**

 
```
var heap = initHeapQueue[int]()
heap.push(5)
heap.push(12)
assert heap.pushpop(6) == 5
assert heap.len == 2
assert heap[0] == 6
assert heap.pushpop(4) == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L189)  
```
proc clear[T](heap: var HeapQueue[T])
```
  Removes all elements from `heap`, making it empty. **Example:**

 
```
var heap = initHeapQueue[int]()
heap.push(1)
heap.clear()
assert heap.len == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L204)  
```
proc `$`[T](heap: HeapQueue[T]): string
```
  Turns a heap into its string representation. **Example:**

 
```
var heap = initHeapQueue[int]()
heap.push(1)
heap.push(2)
assert $heap == "[1, 2]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/heapqueue.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/heapqueue.nim#L213)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/heapqueue.html>

intsets
=======


The `intsets` module implements an efficient `int` set implemented as a sparse bit set.

 **Note**: Currently the assignment operator `=` for `IntSet` performs some rather meaningless shallow copy. Since Nim currently does not allow the assignment operator to be overloaded, use [assign proc](#assign,IntSet,IntSet) to get a deep copy.

 **See also:**

 * [sets module](sets) for more general hash sets

 Imports
-------

  <since>, <hashes>, <sequtils>, <algorithm>  Types
-----

  
```
IntSet = object
  elems: int
  counter, max: int
  head: PTrunk
  data: TrunkSeq
  a: array[0 .. 33, int]
```
  An efficient set of `int` implemented as a sparse bit set. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L45)   Procs
-----

  
```
proc initIntSet(): IntSet {...}{.raises: [], tags: [].}
```
  Returns an empty IntSet.

 See also:

 * [toIntSet proc](#toIntSet,openArray%5Bint%5D)

 **Example:**

 
```
var a = initIntSet()
assert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L161)  
```
proc contains(s: IntSet; key: int): bool {...}{.raises: [], tags: [].}
```
  Returns true if `key` is in `s`.

 This allows the usage of `in` operator.

 **Example:**

 
```
var a = initIntSet()
for x in [1, 3, 5]:
  a.incl(x)
assert a.contains(3)
assert 3 in a
assert(not a.contains(8))
assert 8 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L180)  
```
proc incl(s: var IntSet; key: int) {...}{.raises: [], tags: [].}
```
  Includes an element `key` in `s`.

 This doesn't do anything if `key` is already in `s`.

 See also:

 * [excl proc](#excl,IntSet,int) for excluding an element
* [incl proc](#incl,IntSet,IntSet) for including other set
* [containsOrIncl proc](#containsOrIncl,IntSet,int)

 **Example:**

 
```
var a = initIntSet()
a.incl(3)
a.incl(3)
assert len(a) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L205)  
```
proc incl(s: var IntSet; other: IntSet) {...}{.raises: [], tags: [].}
```
  Includes all elements from `other` into `s`.

 This is the in-place version of [s + other](#+,IntSet,IntSet).

 See also:

 * [excl proc](#excl,IntSet,IntSet) for excluding other set
* [incl proc](#incl,IntSet,int) for including an element
* [containsOrIncl proc](#containsOrIncl,IntSet,int)

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1)
b.incl(5)
a.incl(b)
assert len(a) == 2
assert 5 in a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L235)  
```
proc toIntSet(x: openArray[int]): IntSet {...}{.raises: [], tags: [].}
```
  Creates a new IntSet that contains the elements of `x`.

 Duplicates are removed.

 See also:

 * [initIntSet proc](#initIntSet)

 **Example:**

 
```
var
  a = toIntSet([5, 6, 7])
  b = toIntSet(@[1, 8, 8, 8])
assert len(a) == 3
assert len(b) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L256)  
```
proc containsOrIncl(s: var IntSet; key: int): bool {...}{.raises: [], tags: [].}
```
  Includes `key` in the set `s` and tells if `key` was already in `s`.

 The difference with regards to the [incl proc](#incl,IntSet,int) is that this proc returns `true` if `s` already contained `key`. The proc will return `false` if `key` was added as a new value to `s` during this call.

 See also:

 * [incl proc](#incl,IntSet,int) for including an element
* [missingOrExcl proc](#missingOrExcl,IntSet,int)

 **Example:**

 
```
var a = initIntSet()
assert a.containsOrIncl(3) == false
assert a.containsOrIncl(3) == true
assert a.containsOrIncl(4) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L274)  
```
proc excl(s: var IntSet; key: int) {...}{.raises: [], tags: [].}
```
  Excludes `key` from the set `s`.

 This doesn't do anything if `key` is not found in `s`.

 See also:

 * [incl proc](#incl,IntSet,int) for including an element
* [excl proc](#excl,IntSet,IntSet) for excluding other set
* [missingOrExcl proc](#missingOrExcl,IntSet,int)

 **Example:**

 
```
var a = initIntSet()
a.incl(3)
a.excl(3)
a.excl(3)
a.excl(99)
assert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L309)  
```
proc excl(s: var IntSet; other: IntSet) {...}{.raises: [], tags: [].}
```
  Excludes all elements from `other` from `s`.

 This is the in-place version of [s - other](#-,IntSet,IntSet).

 See also:

 * [incl proc](#incl,IntSet,IntSet) for including other set
* [excl proc](#excl,IntSet,int) for excluding an element
* [missingOrExcl proc](#missingOrExcl,IntSet,int)

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1)
a.incl(5)
b.incl(5)
a.excl(b)
assert len(a) == 1
assert 5 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L327)  
```
proc len(s: IntSet): int {...}{.inline, raises: [], tags: [].}
```
  Returns the number of elements in `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L349)  
```
proc missingOrExcl(s: var IntSet; key: int): bool {...}{.raises: [], tags: [].}
```
  Excludes `key` in the set `s` and tells if `key` was already missing from `s`.

 The difference with regards to the [excl proc](#excl,IntSet,int) is that this proc returns `true` if `key` was missing from `s`. The proc will return `false` if `key` was in `s` and it was removed during this call.

 See also:

 * [excl proc](#excl,IntSet,int) for excluding an element
* [excl proc](#excl,IntSet,IntSet) for excluding other set
* [containsOrIncl proc](#containsOrIncl,IntSet,int)

 **Example:**

 
```
var a = initIntSet()
a.incl(5)
assert a.missingOrExcl(5) == false
assert a.missingOrExcl(5) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L358)  
```
proc clear(result: var IntSet) {...}{.raises: [], tags: [].}
```
  Clears the IntSet back to an empty state. **Example:**

 
```
var a = initIntSet()
a.incl(5)
a.incl(7)
clear(a)
assert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L380)  
```
proc isNil(x: IntSet): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L401)  
```
proc assign(dest: var IntSet; src: IntSet) {...}{.raises: [], tags: [].}
```
  Copies `src` to `dest`. `dest` does not need to be initialized by [initIntSet proc](#initIntSet). **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
b.incl(5)
b.incl(7)
a.assign(b)
assert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L403)  
```
proc union(s1, s2: IntSet): IntSet {...}{.raises: [], tags: [].}
```
  Returns the union of the sets `s1` and `s2`.

 The same as [s1 + s2](#+,IntSet,IntSet).

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1); a.incl(2); a.incl(3)
b.incl(3); b.incl(4); b.incl(5)
assert union(a, b).len == 5
## {1, 2, 3, 4, 5}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L446)  
```
proc intersection(s1, s2: IntSet): IntSet {...}{.raises: [], tags: [].}
```
  Returns the intersection of the sets `s1` and `s2`.

 The same as [s1 \* s2](#*,IntSet,IntSet).

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1); a.incl(2); a.incl(3)
b.incl(3); b.incl(4); b.incl(5)
assert intersection(a, b).len == 1
## {3}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L462)  
```
proc difference(s1, s2: IntSet): IntSet {...}{.raises: [], tags: [].}
```
  Returns the difference of the sets `s1` and `s2`.

 The same as [s1 - s2](#-,IntSet,IntSet).

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1); a.incl(2); a.incl(3)
b.incl(3); b.incl(4); b.incl(5)
assert difference(a, b).len == 2
## {1, 2}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L480)  
```
proc symmetricDifference(s1, s2: IntSet): IntSet {...}{.raises: [], tags: [].}
```
  Returns the symmetric difference of the sets `s1` and `s2`. **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1); a.incl(2); a.incl(3)
b.incl(3); b.incl(4); b.incl(5)
assert symmetricDifference(a, b).len == 4
## {1, 2, 4, 5}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L498)  
```
proc `+`(s1, s2: IntSet): IntSet {...}{.inline, raises: [], tags: [].}
```
  Alias for [union(s1, s2)](#union,IntSet,IntSet). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L513)  
```
proc `*`(s1, s2: IntSet): IntSet {...}{.inline, raises: [], tags: [].}
```
  Alias for [intersection(s1, s2)](#intersection,IntSet,IntSet). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L517)  
```
proc `-`(s1, s2: IntSet): IntSet {...}{.inline, raises: [], tags: [].}
```
  Alias for [difference(s1, s2)](#difference,IntSet,IntSet). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L521)  
```
proc disjoint(s1, s2: IntSet): bool {...}{.raises: [], tags: [].}
```
  Returns true if the sets `s1` and `s2` have no items in common. **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1); a.incl(2)
b.incl(2); b.incl(3)
assert disjoint(a, b) == false
b.excl(2)
assert disjoint(a, b) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L525)  
```
proc card(s: IntSet): int {...}{.inline, raises: [], tags: [].}
```
  Alias for [len()](#len,IntSet). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L542)  
```
proc `<=`(s1, s2: IntSet): bool {...}{.raises: [], tags: [].}
```
  Returns true if `s1` is subset of `s2`.

 A subset `s1` has all of its elements in `s2`, and `s2` doesn't necessarily have more elements than `s1`. That is, `s1` can be equal to `s2`.

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1)
b.incl(1); b.incl(2)
assert a <= b
a.incl(2)
assert a <= b
a.incl(3)
assert(not (a <= b))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L546)  
```
proc `<`(s1, s2: IntSet): bool {...}{.raises: [], tags: [].}
```
  Returns true if `s1` is proper subset of `s2`.

 A strict or proper subset `s1` has all of its elements in `s2`, but `s2` has more elements than `s1`.

 **Example:**

 
```
var
  a = initIntSet()
  b = initIntSet()
a.incl(1)
b.incl(1); b.incl(2)
assert a < b
a.incl(2)
assert(not (a < b))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L568)  
```
proc `==`(s1, s2: IntSet): bool {...}{.raises: [], tags: [].}
```
  Returns true if both `s1` and `s2` have the same elements and set size. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L584)  
```
proc `$`(s: IntSet): string {...}{.raises: [], tags: [].}
```
  The `$` operator for int sets.

 Converts the set `s` to a string, mostly for logging and printing purposes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L588)   Iterators
---------

  
```
iterator items(s: IntSet): int {...}{.inline, raises: [], tags: [].}
```
  Iterates over any included element of `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/intsets.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/intsets.nim#L138)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/intsets.html>

lists
=====

 Implementation of:


* [singly linked lists](#SinglyLinkedList)
* [doubly linked lists](#DoublyLinkedList)
* [singly linked rings](#SinglyLinkedRing) (circular lists)
* [doubly linked rings](#DoublyLinkedRing) (circular lists)

 Basic Usage
-----------


Because it makes no sense to do otherwise, the `next` and `prev` pointers are not hidden from you and can be manipulated directly for efficiency.

 ### Lists



```
import lists

var
  l = initDoublyLinkedList[int]()
  a = newDoublyLinkedNode[int](3)
  b = newDoublyLinkedNode[int](7)
  c = newDoublyLinkedNode[int](9)

l.append(a)
l.append(b)
l.prepend(c)

assert a.next == b
assert a.prev == c
assert c.next == a
assert c.next.next == b
assert c.prev == nil
assert b.next == nil
```
 ### Rings



```
import lists

var
  l = initSinglyLinkedRing[int]()
  a = newSinglyLinkedNode[int](3)
  b = newSinglyLinkedNode[int](7)
  c = newSinglyLinkedNode[int](9)

l.append(a)
l.append(b)
l.prepend(c)

assert c.next == a
assert a.next == b
assert c.next.next == b
assert b.next == c
assert c.next.next.next == c
```
 See also
--------


* [deques module](deques) for double-ended queues
* [sharedlist module](sharedlist) for shared singly-linked lists

 Types
-----

  
```
DoublyLinkedNodeObj[T] = object
  next*: (ref DoublyLinkedNodeObj[T])
  prev* {...}{.cursor.}: ref DoublyLinkedNodeObj[T]
  value*: T
```
   A node a doubly linked list consists of.

 It consists of a `value` field, and pointers to `next` and `prev`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L83)  
```
DoublyLinkedNode[T] = ref DoublyLinkedNodeObj[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L90)  
```
SinglyLinkedNodeObj[T] = object
  next*: (ref SinglyLinkedNodeObj[T])
  value*: T
```
   A node a singly linked list consists of.

 It consists of a `value` field, and a pointer to `next`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L92)  
```
SinglyLinkedNode[T] = ref SinglyLinkedNodeObj[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L98)  
```
SinglyLinkedList[T] = object
  head*: (SinglyLinkedNode[T])
  tail* {...}{.cursor.}: SinglyLinkedNode[T]
```
   A singly linked list.

 Use [initSinglyLinkedList proc](#initSinglyLinkedList) to create a new empty list.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L100)  
```
DoublyLinkedList[T] = object
  head*: (DoublyLinkedNode[T])
  tail* {...}{.cursor.}: DoublyLinkedNode[T]
```
   A doubly linked list.

 Use [initDoublyLinkedList proc](#initDoublyLinkedList) to create a new empty list.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L108)  
```
SinglyLinkedRing[T] = object
  head*: (SinglyLinkedNode[T])
  tail* {...}{.cursor.}: SinglyLinkedNode[T]
```
   A singly linked ring.

 Use [initSinglyLinkedRing proc](#initSinglyLinkedRing) to create a new empty ring.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L116)  
```
DoublyLinkedRing[T] = object
  head*: DoublyLinkedNode[T]
```
   A doubly linked ring.

 Use [initDoublyLinkedRing proc](#initDoublyLinkedRing) to create a new empty ring.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L124)  
```
SomeLinkedList[T] = SinglyLinkedList[T] | DoublyLinkedList[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L131)  
```
SomeLinkedRing[T] = SinglyLinkedRing[T] | DoublyLinkedRing[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L133)  
```
SomeLinkedCollection[T] = SomeLinkedList[T] | SomeLinkedRing[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L135)  
```
SomeLinkedNode[T] = SinglyLinkedNode[T] | DoublyLinkedNode[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L137)   Procs
-----

  
```
proc initSinglyLinkedList[T](): SinglyLinkedList[T]
```
  Creates a new singly linked list that is empty. **Example:**

 
```
var a = initSinglyLinkedList[int]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L139)  
```
proc initDoublyLinkedList[T](): DoublyLinkedList[T]
```
  Creates a new doubly linked list that is empty. **Example:**

 
```
var a = initDoublyLinkedList[int]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L145)  
```
proc initSinglyLinkedRing[T](): SinglyLinkedRing[T]
```
  Creates a new singly linked ring that is empty. **Example:**

 
```
var a = initSinglyLinkedRing[int]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L151)  
```
proc initDoublyLinkedRing[T](): DoublyLinkedRing[T]
```
  Creates a new doubly linked ring that is empty. **Example:**

 
```
var a = initDoublyLinkedRing[int]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L157)  
```
proc newDoublyLinkedNode[T](value: T): (DoublyLinkedNode[T])
```
  Creates a new doubly linked node with the given `value`. **Example:**

 
```
var n = newDoublyLinkedNode[int](5)
assert n.value == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L163)  
```
proc newSinglyLinkedNode[T](value: T): (SinglyLinkedNode[T])
```
  Creates a new singly linked node with the given `value`. **Example:**

 
```
var n = newSinglyLinkedNode[int](5)
assert n.value == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L172)  
```
proc `$`[T](L: SomeLinkedCollection[T]): string
```
  Turns a list into its string representation for logging and printing. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L323)  
```
proc find[T](L: SomeLinkedCollection[T]; value: T): SomeLinkedNode[T]
```
  Searches in the list for a value. Returns `nil` if the value does not exist.

 See also:

 * [contains proc](#contains,SomeLinkedCollection%5BT%5D,T)

 **Example:**

 
```
var a = initSinglyLinkedList[int]()
a.append(9)
a.append(8)
assert a.find(9).value == 9
assert a.find(1) == nil
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L331)  
```
proc contains[T](L: SomeLinkedCollection[T]; value: T): bool {...}{.inline.}
```
  Searches in the list for a value. Returns `false` if the value does not exist, `true` otherwise.

 See also:

 * [find proc](#find,SomeLinkedCollection%5BT%5D,T)

 **Example:**

 
```
var a = initSinglyLinkedList[int]()
a.append(9)
a.append(8)
assert a.contains(9)
assert 8 in a
assert(not a.contains(1))
assert 2 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L347)  
```
proc append[T](L: var SinglyLinkedList[T]; n: SinglyLinkedNode[T]) {...}{.inline.}
```
  Appends (adds to the end) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,T) for prepending a value

 **Example:**

 
```
var
  a = initSinglyLinkedList[int]()
  n = newSinglyLinkedNode[int](9)
a.append(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L364)  
```
proc append[T](L: var SinglyLinkedList[T]; value: T) {...}{.inline.}
```
  Appends (adds to the end) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,T) for prepending a value

 **Example:**

 
```
var a = initSinglyLinkedList[int]()
a.append(9)
a.append(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L387)  
```
proc prepend[T](L: var SinglyLinkedList[T]; n: SinglyLinkedNode[T]) {...}{.inline.}
```
  Prepends (adds to the beginning) a node to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedList%5BT%5D,SinglyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,SinglyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,T) for prepending a value

 **Example:**

 
```
var
  a = initSinglyLinkedList[int]()
  n = newSinglyLinkedNode[int](9)
a.prepend(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L402)  
```
proc prepend[T](L: var SinglyLinkedList[T]; value: T) {...}{.inline.}
```
  Prepends (adds to the beginning) a node to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedList%5BT%5D,SinglyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,SinglyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedList%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node

 **Example:**

 
```
var a = initSinglyLinkedList[int]()
a.prepend(9)
a.prepend(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L422)  
```
proc append[T](L: var DoublyLinkedList[T]; n: DoublyLinkedNode[T])
```
  Appends (adds to the end) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var
  a = initDoublyLinkedList[int]()
  n = newDoublyLinkedNode[int](9)
a.append(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L440)  
```
proc append[T](L: var DoublyLinkedList[T]; value: T)
```
  Appends (adds to the end) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var a = initDoublyLinkedList[int]()
a.append(9)
a.append(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L465)  
```
proc prepend[T](L: var DoublyLinkedList[T]; n: DoublyLinkedNode[T])
```
  Prepends (adds to the beginning) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,DoublyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var
  a = initDoublyLinkedList[int]()
  n = newDoublyLinkedNode[int](9)
a.prepend(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L483)  
```
proc prepend[T](L: var DoublyLinkedList[T]; value: T)
```
  Prepends (adds to the beginning) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,DoublyLinkedList%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [remove proc](#remove,DoublyLinkedList%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var a = initDoublyLinkedList[int]()
a.prepend(9)
a.prepend(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L508)  
```
proc remove[T](L: var DoublyLinkedList[T]; n: DoublyLinkedNode[T])
```
  Removes a node `n` from `L`. Efficiency: O(1). **Example:**

 
```
var
  a = initDoublyLinkedList[int]()
  n = newDoublyLinkedNode[int](5)
a.append(n)
assert 5 in a
a.remove(n)
assert 5 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L526)  
```
proc append[T](L: var SinglyLinkedRing[T]; n: SinglyLinkedNode[T])
```
  Appends (adds to the end) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,T) for prepending a value

 **Example:**

 
```
var
  a = initSinglyLinkedRing[int]()
  n = newSinglyLinkedNode[int](9)
a.append(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L544)  
```
proc append[T](L: var SinglyLinkedRing[T]; value: T)
```
  Appends (adds to the end) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for appending a node
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,T) for prepending a value

 **Example:**

 
```
var a = initSinglyLinkedRing[int]()
a.append(9)
a.append(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L569)  
```
proc prepend[T](L: var SinglyLinkedRing[T]; n: SinglyLinkedNode[T])
```
  Prepends (adds to the beginning) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,SinglyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,T) for prepending a value

 **Example:**

 
```
var
  a = initSinglyLinkedRing[int]()
  n = newSinglyLinkedNode[int](9)
a.prepend(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L585)  
```
proc prepend[T](L: var SinglyLinkedRing[T]; value: T)
```
  Prepends (adds to the beginning) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,SinglyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,SinglyLinkedRing%5BT%5D,SinglyLinkedNode%5BT%5D) for prepending a node

 **Example:**

 
```
var a = initSinglyLinkedRing[int]()
a.prepend(9)
a.prepend(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L609)  
```
proc append[T](L: var DoublyLinkedRing[T]; n: DoublyLinkedNode[T])
```
  Appends (adds to the end) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var
  a = initDoublyLinkedRing[int]()
  n = newDoublyLinkedNode[int](9)
a.append(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L627)  
```
proc append[T](L: var DoublyLinkedRing[T]; value: T)
```
  Appends (adds to the end) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var a = initDoublyLinkedRing[int]()
a.append(9)
a.append(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L654)  
```
proc prepend[T](L: var DoublyLinkedRing[T]; n: DoublyLinkedNode[T])
```
  Prepends (adds to the beginning) a node `n` to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,DoublyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,T) for prepending a value
* [remove proc](#remove,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var
  a = initDoublyLinkedRing[int]()
  n = newDoublyLinkedNode[int](9)
a.prepend(n)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L672)  
```
proc prepend[T](L: var DoublyLinkedRing[T]; value: T)
```
  Prepends (adds to the beginning) a value to `L`. Efficiency: O(1).

 See also:

 * [append proc](#append,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for appending a node
* [append proc](#append,DoublyLinkedRing%5BT%5D,T) for appending a value
* [prepend proc](#prepend,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for prepending a node
* [remove proc](#remove,DoublyLinkedRing%5BT%5D,DoublyLinkedNode%5BT%5D) for removing a node

 **Example:**

 
```
var a = initDoublyLinkedRing[int]()
a.prepend(9)
a.prepend(8)
assert a.contains(9)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L699)  
```
proc remove[T](L: var DoublyLinkedRing[T]; n: DoublyLinkedNode[T])
```
  Removes `n` from `L`. Efficiency: O(1). **Example:**

 
```
var
  a = initDoublyLinkedRing[int]()
  n = newDoublyLinkedNode[int](5)
a.append(n)
assert 5 in a
a.remove(n)
assert 5 notin a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L717)   Iterators
---------

  
```
iterator items[T](L: SomeLinkedList[T]): T
```
  Yields every value of `L`.

 See also:

 * [mitems iterator](#mitems.i,SomeLinkedList%5BT%5D)
* [nodes iterator](#nodes.i,SomeLinkedList%5BT%5D)

 **Examples:**

 
```
var a = initSinglyLinkedList[int]()
for i in 1 .. 3:
  a.append(10*i)

for x in a:  # the same as: for x in items(a):
  echo x

# 10
# 20
# 30
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L195)  
```
iterator items[T](L: SomeLinkedRing[T]): T
```
  Yields every value of `L`.

 See also:

 * [mitems iterator](#mitems.i,SomeLinkedRing%5BT%5D)
* [nodes iterator](#nodes.i,SomeLinkedRing%5BT%5D)

 **Examples:**

 
```
var a = initSinglyLinkedRing[int]()
for i in 1 .. 3:
  a.append(10*i)

for x in a:  # the same as: for x in items(a):
  echo x

# 10
# 20
# 30
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L217)  
```
iterator mitems[T](L: var SomeLinkedList[T]): var T
```
  Yields every value of `L` so that you can modify it.

 See also:

 * [items iterator](#items.i,SomeLinkedList%5BT%5D)
* [nodes iterator](#nodes.i,SomeLinkedList%5BT%5D)

 **Example:**

 
```
var a = initSinglyLinkedList[int]()
for i in 1 .. 5:
  a.append(10*i)
assert $a == "[10, 20, 30, 40, 50]"
for x in mitems(a):
  x = 5*x - 1
assert $a == "[49, 99, 149, 199, 249]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L239)  
```
iterator mitems[T](L: var SomeLinkedRing[T]): var T
```
  Yields every value of `L` so that you can modify it.

 See also:

 * [items iterator](#items.i,SomeLinkedRing%5BT%5D)
* [nodes iterator](#nodes.i,SomeLinkedRing%5BT%5D)

 **Example:**

 
```
var a = initSinglyLinkedRing[int]()
for i in 1 .. 5:
  a.append(10*i)
assert $a == "[10, 20, 30, 40, 50]"
for x in mitems(a):
  x = 5*x - 1
assert $a == "[49, 99, 149, 199, 249]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L255)  
```
iterator nodes[T](L: SomeLinkedList[T]): SomeLinkedNode[T]
```
  Iterates over every node of `x`. Removing the current node from the list during traversal is supported.

 See also:

 * [items iterator](#items.i,SomeLinkedList%5BT%5D)
* [mitems iterator](#mitems.i,SomeLinkedList%5BT%5D)

 **Example:**

 
```
var a = initDoublyLinkedList[int]()
for i in 1 .. 5:
  a.append(10*i)
assert $a == "[10, 20, 30, 40, 50]"
for x in nodes(a):
  if x.value == 30:
    a.remove(x)
  else:
    x.value = 5*x.value - 1
assert $a == "[49, 99, 199, 249]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L271)  
```
iterator nodes[T](L: SomeLinkedRing[T]): SomeLinkedNode[T]
```
  Iterates over every node of `x`. Removing the current node from the list during traversal is supported.

 See also:

 * [items iterator](#items.i,SomeLinkedRing%5BT%5D)
* [mitems iterator](#mitems.i,SomeLinkedRing%5BT%5D)

 **Example:**

 
```
var a = initDoublyLinkedRing[int]()
for i in 1 .. 5:
  a.append(10*i)
assert $a == "[10, 20, 30, 40, 50]"
for x in nodes(a):
  if x.value == 30:
    a.remove(x)
  else:
    x.value = 5*x.value - 1
assert $a == "[49, 99, 199, 249]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/lists.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/lists.nim#L296)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/lists.html>

options
=======


This module implements types which encapsulate an optional value.

 A value of type `Option[T]` either contains a value `x` (represented as `some(x)`) or is empty (`none(T)`).

 This can be useful when you have a value that can be present or not. The absence of a value is often represented by `nil`, but it is not always available, nor is it always a good solution.

 Basic usage
-----------


Let's start with an example: a procedure that finds the index of a character in a string.

 
```
import options

proc find(haystack: string, needle: char): Option[int] =
  for i, c in haystack:
    if c == needle:
      return some(i)
  return none(int)  # This line is actually optional,
                    # because the default is empty
```


```
let found = "abc".find('c')
assert found.isSome and found.get() == 2
```

The `get` operation demonstrated above returns the underlying value, or raises `UnpackDefect` if there is no value. Note that `UnpackDefect` inherits from `system.Defect`, and should therefore never be caught. Instead, rely on checking if the option contains a value with [isSome](#isSome,Option%5BT%5D) and [isNone](#isNone,Option%5BT%5D) procs.

 How to deal with an absence of a value:

 
```
let result = "team".find('i')

# Nothing was found, so the result is `none`.
assert(result == none(int))
# It has no value:
assert(result.isNone)
```
 Imports
-------

  <typetraits>  Types
-----

  
```
Option[T] = object
  when T is SomePointer:
    val
  else:
      val
      has
```
  An optional type that stores its value and state separately in a boolean. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L69)  
```
UnpackDefect = object of Defect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L77)  
```
UnpackError {...}{.deprecated: "See corresponding Defect".} = UnpackDefect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L78)   Procs
-----

  
```
proc option[T](val: T): Option[T] {...}{.inline.}
```
  Can be used to convert a pointer type (`ptr` or `ref` or `proc`) to an option type. It converts `nil` to `None`.

 See also:

 * [some](#some,T)
* [none](#none,typedesc)

 **Example:**

 
```
type
  Foo = ref object
    a: int
    b: string
var c: Foo
assert c.isNil
var d = option(c)
assert d.isNone
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L80)  
```
proc some[T](val: T): Option[T] {...}{.inline.}
```
  Returns an `Option` that has the value `val`.

 See also:

 * [option](#option,T)
* [none](#none,typedesc)
* [isSome](#isSome,Option%5BT%5D)

 **Example:**

 
```
var
  a = some("abc")
  b = some(42)
assert $type(a) == "Option[system.string]"
assert b.isSome
assert a.get == "abc"
assert $b == "Some(42)"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L101)  
```
proc none(T: typedesc): Option[T] {...}{.inline.}
```
  Returns an `Option` for this type that has no value.

 See also:

 * [option](#option,T)
* [some](#some,T)
* [isNone](#isNone,Option%5BT%5D)

 **Example:**

 
```
var a = none(int)
assert a.isNone
assert $type(a) == "Option[system.int]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L124)  
```
proc none[T](): Option[T] {...}{.inline.}
```
  Alias for [none(T) proc](#none,typedesc). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L139)  
```
proc isSome[T](self: Option[T]): bool {...}{.inline.}
```
  Checks if an `Option` contains a value. **Example:**

 
```
var
  a = some(42)
  b = none(string)
assert a.isSome
assert not b.isSome
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L143)  
```
proc isNone[T](self: Option[T]): bool {...}{.inline.}
```
  Checks if an `Option` is empty. **Example:**

 
```
var
  a = some(42)
  b = none(string)
assert not a.isNone
assert b.isNone
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L157)  
```
proc get[T](self: Option[T]): lent T {...}{.inline.}
```
  Returns contents of an `Option`. If it is `None`, then an exception is thrown.

 See also:

 * [get proc](#get,Option%5BT%5D,T) with the default return value

 **Example:**

 
```
let
  a = some(42)
  b = none(string)
assert a.get == 42
doAssertRaises(UnpackDefect):
  echo b.get
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L170)  
```
proc get[T](self: Option[T]; otherwise: T): T {...}{.inline.}
```
  Returns the contents of the `Option` or an `otherwise` value if the `Option` is `None`. **Example:**

 
```
var
  a = some(42)
  b = none(int)
assert a.get(9999) == 42
assert b.get(9999) == 9999
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L188)  
```
proc get[T](self: var Option[T]): var T {...}{.inline.}
```
  Returns contents of the `var Option`. If it is `None`, then an exception is thrown. **Example:**

 
```
let
  a = some(42)
  b = none(string)
assert a.get == 42
doAssertRaises(UnpackDefect):
  echo b.get
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L203)  
```
proc map[T](self: Option[T]; callback: proc (input: T)) {...}{.inline.}
```
  Applies a `callback` function to the value of the `Option`, if it has one.

 See also:

 * [map proc](#map,Option%5BT%5D,proc(T)_2) for a version with a callback which returns a value
* [filter proc](#filter,Option%5BT%5D,proc(T))

 **Example:**

 
```
var d = 0
proc saveDouble(x: int) =
  d = 2*x

let
  a = some(42)
  b = none(int)

b.map(saveDouble)
assert d == 0
a.map(saveDouble)
assert d == 84
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L218)  
```
proc map[T, R](self: Option[T]; callback: proc (input: T): R): Option[R] {...}{.
    inline.}
```
  Applies a `callback` function to the value of the `Option` and returns an `Option` containing the new value.

 If the `Option` is `None`, `None` of the return type of the `callback` will be returned.

 See also:

 * [flatMap proc](#flatMap,Option%5BA%5D,proc(A)) for a version with a callback which returns an `Option`
* [filter proc](#filter,Option%5BT%5D,proc(T))

 **Example:**

 
```
var
  a = some(42)
  b = none(int)

proc isEven(x: int): bool =
  x mod 2 == 0

assert $(a.map(isEven)) == "Some(true)"
assert $(b.map(isEven)) == "None[bool]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L242)  
```
proc flatten[A](self: Option[Option[A]]): Option[A] {...}{.inline.}
```
  Remove one level of structure in a nested `Option`. **Example:**

 
```
let a = some(some(42))
assert $flatten(a) == "Some(42)"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L269)  
```
proc flatMap[A, B](self: Option[A]; callback: proc (input: A): Option[B]): Option[
    B] {...}{.inline.}
```
  Applies a `callback` function to the value of the `Option` and returns an `Option` containing the new value.

 If the `Option` is `None`, `None` of the return type of the `callback` will be returned.

 Similar to `map`, with the difference that the `callback` returns an `Option`, not a raw value. This allows multiple procs with a signature of `A -> Option[B]` to be chained together.

 See also:

 * [flatten proc](#flatten,Option%5BOption%5BA%5D%5D)
* [filter proc](#filter,Option%5BT%5D,proc(T))

 **Example:**

 
```
proc doublePositives(x: int): Option[int] =
  if x > 0:
    return some(2*x)
  else:
    return none(int)
let
  a = some(42)
  b = none(int)
  c = some(-11)
assert a.flatMap(doublePositives) == some(84)
assert b.flatMap(doublePositives) == none(int)
assert c.flatMap(doublePositives) == none(int)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L280)  
```
proc filter[T](self: Option[T]; callback: proc (input: T): bool): Option[T] {...}{.
    inline.}
```
  Applies a `callback` to the value of the `Option`.

 If the `callback` returns `true`, the option is returned as `Some`. If it returns `false`, it is returned as `None`.

 See also:

 * [map proc](#map,Option%5BT%5D,proc(T)_2)
* [flatMap proc](#flatMap,Option%5BA%5D,proc(A))

 **Example:**

 
```
proc isEven(x: int): bool =
  x mod 2 == 0
let
  a = some(42)
  b = none(int)
  c = some(-11)
assert a.filter(isEven) == some(42)
assert b.filter(isEven) == none(int)
assert c.filter(isEven) == none(int)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L311)  
```
proc `==`(a, b: Option): bool {...}{.inline.}
```
  Returns `true` if both `Option`s are `None`, or if they are both `Some` and have equal values. **Example:**

 
```
let
  a = some(42)
  b = none(int)
  c = some(42)
  d = none(int)

assert a == c
assert b == d
assert not (a == b)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L336)  
```
proc `$`[T](self: Option[T]): string
```
  Get the string representation of the `Option`.

 If the `Option` has a value, the result will be `Some(x)` where `x` is the string representation of the contained value. If the `Option` does not have a value, the result will be `None[T]` where `T` is the name of the type contained in the `Option`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L352)  
```
proc unsafeGet[T](self: Option[T]): lent T {...}{.inline.}
```
  Returns the value of a `some`. Behavior is undefined for `none`.

 **Note:** Use it only when you are **absolutely sure** the value is present (e.g. after checking [isSome](#isSome,Option%5BT%5D)). Generally, using [get proc](#get,Option%5BT%5D) is preferred.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/options.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/options.nim#L366)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/options.html>

sets
====


The `sets` module implements an efficient hash set and ordered hash set.

 Hash sets are different from the [built in set type](manual#types-set-type). Sets allow you to store any value that can be [hashed](hashes) and they don't contain duplicate entries.

 Common usages of sets:

 * removing duplicates from a container by converting it with [toHashSet proc](#toHashSet,openArray%5BA%5D) (see also [sequtils.deduplicate proc](sequtils#deduplicate,openArray%5BT%5D,bool))
* membership testing
* mathematical operations on two sets, such as [union](#union,HashSet%5BA%5D,HashSet%5BA%5D), [intersection](#intersection,HashSet%5BA%5D,HashSet%5BA%5D), [difference](#difference,HashSet%5BA%5D,HashSet%5BA%5D), and [symmetric difference](#symmetricDifference,HashSet%5BA%5D,HashSet%5BA%5D)

 
```
echo toHashSet([9, 5, 1])     # {9, 1, 5}
echo toOrderedSet([9, 5, 1])  # {9, 5, 1}

let
  s1 = toHashSet([9, 5, 1])
  s2 = toHashSet([3, 5, 7])

echo s1 + s2    # {9, 1, 3, 5, 7}
echo s1 - s2    # {1, 9}
echo s1 * s2    # {5}
echo s1 -+- s2  # {9, 1, 3, 7}
```

Note: The data types declared here have *value semantics*: This means that `=` performs a copy of the set.

 **See also:**

 * [intsets module](intsets) for efficient int sets
* [tables module](tables) for hash tables

 Imports
-------

  <hashes>, <math>  Types
-----

  
```
HashSet[A] {...}{..} = object
  data: KeyValuePairSeq[A]
  counter: int
```
   A generic hash set.

 Use [init proc](#init,HashSet%5BA%5D,int) or [initHashSet proc](#initHashSet,int) before calling other procs on it.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L64)  
```
OrderedSet[A] {...}{..} = object
  data: OrderedKeyValuePairSeq[A]
  counter, first, last: int
```
   A generic hash set that remembers insertion order.

 Use [init proc](#init,OrderedSet%5BA%5D,int) or [initOrderedSet proc](#initOrderedSet,int) before calling other procs on it.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L76)  
```
SomeSet[A] = HashSet[A] | OrderedSet[A]
```
  Type union representing `HashSet` or `OrderedSet`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L83)   Consts
------

  
```
defaultInitialSize = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L87)   Procs
-----

  
```
proc rightSize(count: Natural): int {...}{.inline,
                                      deprecated: "Deprecated since 1.4.0",
                                      raises: [], tags: [].}
```
   **Deprecated:** Deprecated since 1.4.0  **Deprecated since Nim v1.4.0**, it is not needed anymore because picking the correct size is done internally.

 Return the value of `initialSize` to support `count` items.

 If more items are expected to be added, simply add that expected extra amount to the parameter before calling this.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/hashcommon.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/hashcommon.nim#L41)  
```
proc init[A](s: var HashSet[A]; initialSize = defaultInitialSize)
```
  Initializes a hash set.

 Starting from Nim v0.20, sets are initialized by default and it is not necessary to call this function explicitly.

 You can call this proc on a previously initialized hash set, which will discard all its values. This might be more convenient than iterating over existing values and calling [excl()](#excl,HashSet%5BA%5D,A) on them.

 See also:

 * [initHashSet proc](#initHashSet,int)
* [toHashSet proc](#toHashSet,openArray%5BA%5D)

 **Example:**

 
```
var a: HashSet[int]
init(a)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L96)  
```
proc initHashSet[A](initialSize = defaultInitialSize): HashSet[A]
```
  Wrapper around [init proc](#init,HashSet%5BA%5D,int) for initialization of hash sets.

 Returns an empty hash set you can assign directly in `var` blocks in a single line.

 Starting from Nim v0.20, sets are initialized by default and it is not necessary to call this function explicitly.

 See also:

 * [toHashSet proc](#toHashSet,openArray%5BA%5D)

 **Example:**

 
```
var a = initHashSet[int]()
a.incl(3)
assert len(a) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L115)  
```
proc `[]`[A](s: var HashSet[A]; key: A): var A
```
  Returns the element that is actually stored in `s` which has the same value as `key` or raises the `KeyError` exception.

 This is useful when one overloaded `hash` and `==` but still needs reference semantics for sharing.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L134)  
```
proc contains[A](s: HashSet[A]; key: A): bool
```
  Returns true if `key` is in `s`.

 This allows the usage of `in` operator.

 See also:

 * [incl proc](#incl,HashSet%5BA%5D,A)
* [containsOrIncl proc](#containsOrIncl,HashSet%5BA%5D,A)

 **Example:**

 
```
var values = initHashSet[int]()
assert(not values.contains(2))
assert 2 notin values

values.incl(2)
assert values.contains(2)
assert 2 in values
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L149)  
```
proc incl[A](s: var HashSet[A]; key: A)
```
  Includes an element `key` in `s`.

 This doesn't do anything if `key` is already in `s`.

 See also:

 * [excl proc](#excl,HashSet%5BA%5D,A) for excluding an element
* [incl proc](#incl,HashSet%5BA%5D,HashSet%5BA%5D) for including other set
* [containsOrIncl proc](#containsOrIncl,HashSet%5BA%5D,A)

 **Example:**

 
```
var values = initHashSet[int]()
values.incl(2)
values.incl(2)
assert values.len == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L170)  
```
proc incl[A](s: var HashSet[A]; other: HashSet[A])
```
  Includes all elements from `other` set into `s` (must be declared as `var`).

 This is the in-place version of [s + other](#+,HashSet%5BA%5D,HashSet%5BA%5D).

 See also:

 * [excl proc](#excl,HashSet%5BA%5D,HashSet%5BA%5D) for excluding other set
* [incl proc](#incl,HashSet%5BA%5D,A) for including an element
* [containsOrIncl proc](#containsOrIncl,HashSet%5BA%5D,A)

 **Example:**

 
```
var
  values = toHashSet([1, 2, 3])
  others = toHashSet([3, 4, 5])
values.incl(others)
assert values.len == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L187)  
```
proc toHashSet[A](keys: openArray[A]): HashSet[A]
```
  Creates a new hash set that contains the members of the given collection (seq, array, or string) `keys`.

 Duplicates are removed.

 See also:

 * [initHashSet proc](#initHashSet,int)

 **Example:**

 
```
let
  a = toHashSet([5, 3, 2])
  b = toHashSet("abracadabra")
assert len(a) == 3
## a == {2, 3, 5}
assert len(b) == 5
## b == {'a', 'b', 'c', 'd', 'r'}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L205)  
```
proc containsOrIncl[A](s: var HashSet[A]; key: A): bool
```
  Includes `key` in the set `s` and tells if `key` was already in `s`.

 The difference with regards to the [incl proc](#incl,HashSet%5BA%5D,A) is that this proc returns `true` if `s` already contained `key`. The proc will return `false` if `key` was added as a new value to `s` during this call.

 See also:

 * [incl proc](#incl,HashSet%5BA%5D,A) for including an element
* [incl proc](#incl,HashSet%5BA%5D,HashSet%5BA%5D) for including other set
* [missingOrExcl proc](#missingOrExcl,HashSet%5BA%5D,A)

 **Example:**

 
```
var values = initHashSet[int]()
assert values.containsOrIncl(2) == false
assert values.containsOrIncl(2) == true
assert values.containsOrIncl(3) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L247)  
```
proc excl[A](s: var HashSet[A]; key: A)
```
  Excludes `key` from the set `s`.

 This doesn't do anything if `key` is not found in `s`.

 See also:

 * [incl proc](#incl,HashSet%5BA%5D,A) for including an element
* [excl proc](#excl,HashSet%5BA%5D,HashSet%5BA%5D) for excluding other set
* [missingOrExcl proc](#missingOrExcl,HashSet%5BA%5D,A)

 **Example:**

 
```
var s = toHashSet([2, 3, 6, 7])
s.excl(2)
s.excl(2)
assert s.len == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L267)  
```
proc excl[A](s: var HashSet[A]; other: HashSet[A])
```
  Excludes all elements of `other` set from `s`.

 This is the in-place version of [s - other](#-,HashSet%5BA%5D,HashSet%5BA%5D).

 See also:

 * [incl proc](#incl,HashSet%5BA%5D,HashSet%5BA%5D) for including other set
* [excl proc](#excl,HashSet%5BA%5D,A) for excluding an element
* [missingOrExcl proc](#missingOrExcl,HashSet%5BA%5D,A)

 **Example:**

 
```
var
  numbers = toHashSet([1, 2, 3, 4, 5])
  even = toHashSet([2, 4, 6, 8])
numbers.excl(even)
assert len(numbers) == 3
## numbers == {1, 3, 5}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L284)  
```
proc missingOrExcl[A](s: var HashSet[A]; key: A): bool
```
  Excludes `key` in the set `s` and tells if `key` was already missing from `s`.

 The difference with regards to the [excl proc](#excl,HashSet%5BA%5D,A) is that this proc returns `true` if `key` was missing from `s`. The proc will return `false` if `key` was in `s` and it was removed during this call.

 See also:

 * [excl proc](#excl,HashSet%5BA%5D,A) for excluding an element
* [excl proc](#excl,HashSet%5BA%5D,HashSet%5BA%5D) for excluding other set
* [containsOrIncl proc](#containsOrIncl,HashSet%5BA%5D,A)

 **Example:**

 
```
var s = toHashSet([2, 3, 6, 7])
assert s.missingOrExcl(4) == true
assert s.missingOrExcl(6) == false
assert s.missingOrExcl(6) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L303)  
```
proc pop[A](s: var HashSet[A]): A
```
  Removes and returns an arbitrary element from the set `s`.

 Raises KeyError if the set `s` is empty.

 See also:

 * [clear proc](#clear,HashSet%5BA%5D)

 **Example:**

 
```
var s = toHashSet([2, 1])
assert [s.pop, s.pop] in [[1, 2], [2,1]] # order unspecified
doAssertRaises(KeyError, echo s.pop)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L323)  
```
proc clear[A](s: var HashSet[A])
```
  Clears the HashSet back to an empty state, without shrinking any of the existing storage.

 `O(n)` operation, where `n` is the size of the hash bucket.

 See also:

 * [pop proc](#pop,HashSet%5BA%5D)

 **Example:**

 
```
var s = toHashSet([3, 5, 7])
clear(s)
assert len(s) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L342)  
```
proc len[A](s: HashSet[A]): int
```
  Returns the number of elements in `s`.

 Due to an implementation detail you can call this proc on variables which have not been initialized yet. The proc will return zero as the length then.

 **Example:**

 
```
var a: HashSet[string]
assert len(a) == 0
let s = toHashSet([3, 5, 7])
assert len(s) == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L360)  
```
proc card[A](s: HashSet[A]): int
```
  Alias for [len()](#len,HashSet%5BA%5D).

 Card stands for the [cardinality](http://en.wikipedia.org/wiki/Cardinality) of a set.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L374)  
```
proc union[A](s1, s2: HashSet[A]): HashSet[A]
```
  Returns the union of the sets `s1` and `s2`.

 The same as [s1 + s2](#+,HashSet%5BA%5D,HashSet%5BA%5D).

 The union of two sets is represented mathematically as *A ∪ B* and is the set of all objects that are members of `s1`, `s2` or both.

 See also:

 * [intersection proc](#intersection,HashSet%5BA%5D,HashSet%5BA%5D)
* [difference proc](#difference,HashSet%5BA%5D,HashSet%5BA%5D)
* [symmetricDifference proc](#symmetricDifference,HashSet%5BA%5D,HashSet%5BA%5D)

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = union(a, b)
assert c == toHashSet(["a", "b", "c"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L382)  
```
proc intersection[A](s1, s2: HashSet[A]): HashSet[A]
```
  Returns the intersection of the sets `s1` and `s2`.

 The same as [s1 \* s2](#*,HashSet%5BA%5D,HashSet%5BA%5D).

 The intersection of two sets is represented mathematically as *A ∩ B* and is the set of all objects that are members of `s1` and `s2` at the same time.

 See also:

 * [union proc](#union,HashSet%5BA%5D,HashSet%5BA%5D)
* [difference proc](#difference,HashSet%5BA%5D,HashSet%5BA%5D)
* [symmetricDifference proc](#symmetricDifference,HashSet%5BA%5D,HashSet%5BA%5D)

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = intersection(a, b)
assert c == toHashSet(["b"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L404)  
```
proc difference[A](s1, s2: HashSet[A]): HashSet[A]
```
  Returns the difference of the sets `s1` and `s2`.

 The same as [s1 - s2](#-,HashSet%5BA%5D,HashSet%5BA%5D).

 The difference of two sets is represented mathematically as *A ∖ B* and is the set of all objects that are members of `s1` and not members of `s2`.

 See also:

 * [union proc](#union,HashSet%5BA%5D,HashSet%5BA%5D)
* [intersection proc](#intersection,HashSet%5BA%5D,HashSet%5BA%5D)
* [symmetricDifference proc](#symmetricDifference,HashSet%5BA%5D,HashSet%5BA%5D)

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = difference(a, b)
assert c == toHashSet(["a"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L435)  
```
proc symmetricDifference[A](s1, s2: HashSet[A]): HashSet[A]
```
  Returns the symmetric difference of the sets `s1` and `s2`.

 The same as [s1 -+- s2](#-+-,HashSet%5BA%5D,HashSet%5BA%5D).

 The symmetric difference of two sets is represented mathematically as *A △ B* or *A ⊖ B* and is the set of all objects that are members of `s1` or `s2` but not both at the same time.

 See also:

 * [union proc](#union,HashSet%5BA%5D,HashSet%5BA%5D)
* [intersection proc](#intersection,HashSet%5BA%5D,HashSet%5BA%5D)
* [difference proc](#difference,HashSet%5BA%5D,HashSet%5BA%5D)

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = symmetricDifference(a, b)
assert c == toHashSet(["a", "c"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L459)  
```
proc `+`[A](s1, s2: HashSet[A]): HashSet[A] {...}{.inline.}
```
  Alias for [union(s1, s2)](#union,HashSet%5BA%5D,HashSet%5BA%5D). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L483)  
```
proc `*`[A](s1, s2: HashSet[A]): HashSet[A] {...}{.inline.}
```
  Alias for [intersection(s1, s2)](#intersection,HashSet%5BA%5D,HashSet%5BA%5D). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L487)  
```
proc `-`[A](s1, s2: HashSet[A]): HashSet[A] {...}{.inline.}
```
  Alias for [difference(s1, s2)](#difference,HashSet%5BA%5D,HashSet%5BA%5D). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L491)  
```
proc `-+-`[A](s1, s2: HashSet[A]): HashSet[A] {...}{.inline.}
```
  Alias for [symmetricDifference(s1, s2)](#symmetricDifference,HashSet%5BA%5D,HashSet%5BA%5D). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L495)  
```
proc disjoint[A](s1, s2: HashSet[A]): bool
```
  Returns `true` if the sets `s1` and `s2` have no items in common. **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
assert disjoint(a, b) == false
assert disjoint(a, b - a) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L500)  
```
proc `<`[A](s, t: HashSet[A]): bool
```
  Returns true if `s` is a strict or proper subset of `t`.

 A strict or proper subset `s` has all of its members in `t` but `t` has more elements than `s`.

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = intersection(a, b)
assert c < a and c < b
assert(not (a < a))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L513)  
```
proc `<=`[A](s, t: HashSet[A]): bool
```
  Returns true if `s` is a subset of `t`.

 A subset `s` has all of its members in `t` and `t` doesn't necessarily have more members than `s`. That is, `s` can be equal to `t`.

 **Example:**

 
```
let
  a = toHashSet(["a", "b"])
  b = toHashSet(["b", "c"])
  c = intersection(a, b)
assert c <= a and c <= b
assert a <= a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L528)  
```
proc `==`[A](s, t: HashSet[A]): bool
```
  Returns true if both `s` and `t` have the same members and set size. **Example:**

 
```
var
  a = toHashSet([1, 2])
  b = toHashSet([2, 1])
assert a == b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L549)  
```
proc map[A, B](data: HashSet[A]; op: proc (x: A): B {...}{.closure.}): HashSet[B]
```
  Returns a new set after applying `op` proc on each of the elements of `data` set.

 You can use this proc to transform the elements from a set.

 **Example:**

 
```
let
  a = toHashSet([1, 2, 3])
  b = a.map(proc (x: int): string = $x)
assert b == toHashSet(["1", "2", "3"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L559)  
```
proc hash[A](s: HashSet[A]): Hash
```
  Hashing of HashSet. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L573)  
```
proc `$`[A](s: HashSet[A]): string
```
  Converts the set `s` to a string, mostly for logging and printing purposes.

 Don't use this proc for serialization, the representation may change at any moment and values are not escaped.

 **Examples:**

 
```
echo toHashSet([2, 4, 5])
# --> {2, 4, 5}
echo toHashSet(["no", "esc'aping", "is \" provided"])
# --> {no, esc'aping, is " provided}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L579)  
```
proc initSet[A](initialSize = defaultInitialSize): HashSet[A] {...}{.
    deprecated: "Deprecated since v0.20, use \'initHashSet\'".}
```
   **Deprecated:** Deprecated since v0.20, use 'initHashSet'  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L595)  
```
proc toSet[A](keys: openArray[A]): HashSet[A] {...}{.
    deprecated: "Deprecated since v0.20, use \'toHashSet\'".}
```
   **Deprecated:** Deprecated since v0.20, use 'toHashSet'  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L598)  
```
proc isValid[A](s: HashSet[A]): bool {...}{.deprecated: "Deprecated since v0.20; sets are initialized by default".}
```
   **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%5BA%5D,int)).

 **Examples:**

 
```
proc savePreferences(options: HashSet[string]) =
  assert options.isValid, "Pass an initialized set!"
  # Do stuff here, may crash in release builds!
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L601)  
```
proc init[A](s: var OrderedSet[A]; initialSize = defaultInitialSize)
```
  Initializes an ordered hash set.

 Starting from Nim v0.20, sets are initialized by default and it is not necessary to call this function explicitly.

 You can call this proc on a previously initialized hash set, which will discard all its values. This might be more convenient than iterating over existing values and calling [excl()](#excl,HashSet%5BA%5D,A) on them.

 See also:

 * [initOrderedSet proc](#initOrderedSet,int)
* [toOrderedSet proc](#toOrderedSet,openArray%5BA%5D)

 **Example:**

 
```
var a: OrderedSet[int]
init(a)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L632)  
```
proc initOrderedSet[A](initialSize = defaultInitialSize): OrderedSet[A]
```
  Wrapper around [init proc](#init,OrderedSet%5BA%5D,int) for initialization of ordered hash sets.

 Returns an empty ordered hash set you can assign directly in `var` blocks in a single line.

 Starting from Nim v0.20, sets are initialized by default and it is not necessary to call this function explicitly.

 See also:

 * [toOrderedSet proc](#toOrderedSet,openArray%5BA%5D)

 **Example:**

 
```
var a = initOrderedSet[int]()
a.incl(3)
assert len(a) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L651)  
```
proc toOrderedSet[A](keys: openArray[A]): OrderedSet[A]
```
  Creates a new hash set that contains the members of the given collection (seq, array, or string) `keys`.

 Duplicates are removed.

 See also:

 * [initOrderedSet proc](#initOrderedSet,int)

 **Example:**

 
```
let
  a = toOrderedSet([5, 3, 2])
  b = toOrderedSet("abracadabra")
assert len(a) == 3
## a == {5, 3, 2} # different than in HashSet
assert len(b) == 5
## b == {'a', 'b', 'r', 'c', 'd'} # different than in HashSet
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L670)  
```
proc contains[A](s: OrderedSet[A]; key: A): bool
```
  Returns true if `key` is in `s`.

 This allows the usage of `in` operator.

 See also:

 * [incl proc](#incl,OrderedSet%5BA%5D,A)
* [containsOrIncl proc](#containsOrIncl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var values = initOrderedSet[int]()
assert(not values.contains(2))
assert 2 notin values

values.incl(2)
assert values.contains(2)
assert 2 in values
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L690)  
```
proc incl[A](s: var OrderedSet[A]; key: A)
```
  Includes an element `key` in `s`.

 This doesn't do anything if `key` is already in `s`.

 See also:

 * [excl proc](#excl,OrderedSet%5BA%5D,A) for excluding an element
* [incl proc](#incl,HashSet%5BA%5D,OrderedSet%5BA%5D) for including other set
* [containsOrIncl proc](#containsOrIncl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var values = initOrderedSet[int]()
values.incl(2)
values.incl(2)
assert values.len == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L711)  
```
proc incl[A](s: var HashSet[A]; other: OrderedSet[A])
```
  Includes all elements from the OrderedSet `other` into HashSet `s` (must be declared as `var`).

 See also:

 * [incl proc](#incl,OrderedSet%5BA%5D,A) for including an element
* [containsOrIncl proc](#containsOrIncl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var
  values = toHashSet([1, 2, 3])
  others = toOrderedSet([3, 4, 5])
values.incl(others)
assert values.len == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L728)  
```
proc containsOrIncl[A](s: var OrderedSet[A]; key: A): bool
```
  Includes `key` in the set `s` and tells if `key` was already in `s`.

 The difference with regards to the [incl proc](#incl,OrderedSet%5BA%5D,A) is that this proc returns `true` if `s` already contained `key`. The proc will return false if `key` was added as a new value to `s` during this call.

 See also:

 * [incl proc](#incl,OrderedSet%5BA%5D,A) for including an element
* [missingOrExcl proc](#missingOrExcl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var values = initOrderedSet[int]()
assert values.containsOrIncl(2) == false
assert values.containsOrIncl(2) == true
assert values.containsOrIncl(3) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L744)  
```
proc excl[A](s: var OrderedSet[A]; key: A)
```
  Excludes `key` from the set `s`. Efficiency: `O(n)`.

 This doesn't do anything if `key` is not found in `s`.

 See also:

 * [incl proc](#incl,OrderedSet%5BA%5D,A) for including an element
* [missingOrExcl proc](#missingOrExcl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var s = toOrderedSet([2, 3, 6, 7])
s.excl(2)
s.excl(2)
assert s.len == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L763) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L763)  
```
proc missingOrExcl[A](s: var OrderedSet[A]; key: A): bool
```
  Excludes `key` in the set `s` and tells if `key` was already missing from `s`. Efficiency: O(n).

 The difference with regards to the [excl proc](#excl,OrderedSet%5BA%5D,A) is that this proc returns `true` if `key` was missing from `s`. The proc will return `false` if `key` was in `s` and it was removed during this call.

 See also:

 * [excl proc](#excl,OrderedSet%5BA%5D,A)
* [containsOrIncl proc](#containsOrIncl,OrderedSet%5BA%5D,A)

 **Example:**

 
```
var s = toOrderedSet([2, 3, 6, 7])
assert s.missingOrExcl(4) == true
assert s.missingOrExcl(6) == false
assert s.missingOrExcl(6) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L779)  
```
proc clear[A](s: var OrderedSet[A])
```
  Clears the OrderedSet back to an empty state, without shrinking any of the existing storage.

 `O(n)` operation where `n` is the size of the hash bucket.

 **Example:**

 
```
var s = toOrderedSet([3, 5, 7])
clear(s)
assert len(s) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L799)  
```
proc len[A](s: OrderedSet[A]): int {...}{.inline.}
```
  Returns the number of elements in `s`.

 Due to an implementation detail you can call this proc on variables which have not been initialized yet. The proc will return zero as the length then.

 **Example:**

 
```
var a: OrderedSet[string]
assert len(a) == 0
let s = toHashSet([3, 5, 7])
assert len(s) == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L817) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L817)  
```
proc card[A](s: OrderedSet[A]): int {...}{.inline.}
```
  Alias for [len()](#len,OrderedSet%5BA%5D).

 Card stands for the [cardinality](http://en.wikipedia.org/wiki/Cardinality) of a set.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L831) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L831)  
```
proc `==`[A](s, t: OrderedSet[A]): bool
```
  Equality for ordered sets. **Example:**

 
```
let
  a = toOrderedSet([1, 2])
  b = toOrderedSet([2, 1])
assert(not (a == b))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L838) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L838)  
```
proc hash[A](s: OrderedSet[A]): Hash
```
  Hashing of OrderedSet. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L862) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L862)  
```
proc `$`[A](s: OrderedSet[A]): string
```
  Converts the ordered hash set `s` to a string, mostly for logging and printing purposes.

 Don't use this proc for serialization, the representation may change at any moment and values are not escaped.

 **Examples:**

 
```
echo toOrderedSet([2, 4, 5])
# --> {2, 4, 5}
echo toOrderedSet(["no", "esc'aping", "is \" provided"])
# --> {no, esc'aping, is " provided}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L868)   Iterators
---------

  
```
iterator items[A](s: HashSet[A]): A
```
  Iterates over elements of the set `s`.

 If you need a sequence with the elements you can use [sequtils.toSeq template](sequtils#toSeq.t,untyped).

 
```
type
  pair = tuple[a, b: int]
var
  a, b = initHashSet[pair]()
a.incl((2, 3))
a.incl((3, 2))
a.incl((2, 3))
for x, y in a.items:
  b.incl((x - 2, y + 1))
assert a.len == 2
echo b
# --> {(a: 1, b: 3), (a: 0, b: 4)}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L225)  
```
iterator items[A](s: OrderedSet[A]): A
```
  Iterates over keys in the ordered set `s` in insertion order.

 If you need a sequence with the elements you can use [sequtils.toSeq template](sequtils#toSeq.t,untyped).

 
```
var a = initOrderedSet[int]()
for value in [9, 2, 1, 5, 1, 8, 4, 2]:
  a.incl(value)
for value in a.items:
  echo "Got ", value
# --> Got 9
# --> Got 2
# --> Got 1
# --> Got 5
# --> Got 8
# --> Got 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L886) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L886)  
```
iterator pairs[A](s: OrderedSet[A]): tuple[a: int, b: A]
```
  Iterates through (position, value) tuples of OrderedSet `s`. **Example:**

 
```
let a = toOrderedSet("abracadabra")
var p = newSeq[(int, char)]()
for x in pairs(a):
  p.add(x)
assert p == @[(0, 'a'), (1, 'b'), (2, 'r'), (3, 'c'), (4, 'd')]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sets.nim#L907) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sets.nim#L907)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sets.html>

sharedlist
==========


Shared list support.

 Unstable API.

 Imports
-------

  <locks>  Types
-----

  
```
SharedList[A] = object
  head, tail: SharedListNode[A]
  lock*: Lock
```
  generic shared list [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L28)   Procs
-----

  
```
proc iterAndMutate[A](x: var SharedList[A]; action: proc (x: A): bool)
```
  iterates over the list. If 'action' returns true, the current item is removed from the list. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L37)  
```
proc add[A](x: var SharedList[A]; y: A)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L65)  
```
proc init[A](t: var SharedList[A])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L81)  
```
proc clear[A](t: var SharedList[A])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L86)  
```
proc deinitSharedList[A](t: var SharedList[A])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L96)   Iterators
---------

  
```
iterator items[A](x: var SharedList[A]): A
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedlist.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedlist.nim#L57)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sharedlist.html>

sharedtables
============


Shared table support for Nim. Use plain old non GC'ed keys and values or you'll be in trouble. Uses a single lock to protect the table, lockfree implementations welcome but if lock contention is so high that you need a lockfree hash table, you're doing it wrong.

 Unstable API.

 Imports
-------

  <hashes>, <math>, <locks>  Types
-----

  
```
SharedTable[A; B] = object
  data: KeyValuePairSeq[A, B]
  counter, dataLen: int
  lock: Lock
```
  generic hash SharedTable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L23)   Procs
-----

  
```
proc rightSize(count: Natural): int {...}{.inline,
                                      deprecated: "Deprecated since 1.4.0",
                                      raises: [], tags: [].}
```
   **Deprecated:** Deprecated since 1.4.0  **Deprecated since Nim v1.4.0**, it is not needed anymore because picking the correct size is done internally.

 Return the value of `initialSize` to support `count` items.

 If more items are expected to be added, simply add that expected extra amount to the parameter before calling this.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/hashcommon.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/hashcommon.nim#L41)  
```
proc mget[A, B](t: var SharedTable[A, B]; key: A): var B
```
  retrieves the value at `t[key]`. The value can be modified. If `key` is not in `t`, the `KeyError` exception is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L114)  
```
proc mgetOrPut[A, B](t: var SharedTable[A, B]; key: A; val: B): var B
```
  retrieves value at `t[key]` or puts `val` if not present, either way returning a value which can be modified. **Note**: This is inherently unsafe in the context of multi-threading since it returns a pointer to `B`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L128)  
```
proc hasKeyOrPut[A, B](t: var SharedTable[A, B]; key: A; val: B): bool
```
  returns true if `key` is in the table, otherwise inserts `value`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L136)  
```
proc withKey[A, B](t: var SharedTable[A, B]; key: A;
                   mapper: proc (key: A; val: var B; pairExists: var bool))
```
  Computes a new mapping for the `key` with the specified `mapper` procedure.

 The `mapper` takes 3 arguments:

 1. `key` - the current key, if it exists, or the key passed to `withKey` otherwise;
2. `val` - the current value, if the key exists, or default value of the type otherwise;
3. `pairExists` - `true` if the key exists, `false` otherwise.

 The `mapper` can can modify `val` and `pairExists` values to change the mapping of the key or delete it from the table. When adding a value, make sure to set `pairExists` to `true` along with modifying the `val`.

 The operation is performed atomically and other operations on the table will be blocked while the `mapper` is invoked, so it should be short and simple.

 Example usage:

 
```
# If value exists, decrement it.
# If it becomes zero or less, delete the key
t.withKey(1'i64) do (k: int64, v: var int, pairExists: var bool):
  if pairExists:
    dec v
    if v <= 0:
      pairExists = false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L145)  
```
proc `[]=`[A, B](t: var SharedTable[A, B]; key: A; val: B)
```
  puts a (key, value)-pair into `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L193)  
```
proc add[A, B](t: var SharedTable[A, B]; key: A; val: B)
```
  puts a new (key, value)-pair into `t` even if `t[key]` already exists. This can introduce duplicate keys into the table! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L198)  
```
proc del[A, B](t: var SharedTable[A, B]; key: A)
```
  deletes `key` from hash table `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L204)  
```
proc len[A, B](t: var SharedTable[A, B]): int
```
  number of elements in `t` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L209)  
```
proc init[A, B](t: var SharedTable[A, B]; initialSize = 32)
```
  creates a new hash table that is empty.

 This proc must be called before any other usage of `t`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L214)  
```
proc deinitSharedTable[A, B](t: var SharedTable[A, B])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L225)   Templates
---------

  
```
template withValue[A; B](t: var SharedTable[A, B]; key: A; value, body: untyped)
```
  retrieves the value at `t[key]`. `value` can be modified in the scope of the `withValue` call.
```
sharedTable.withValue(key, value) do:
  # block is executed only if ``key`` in ``t``
  # value is threadsafe in block
  value.name = "username"
  value.uid = 1000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L61)  
```
template withValue[A; B](t: var SharedTable[A, B]; key: A;
                         value, body1, body2: untyped)
```
  retrieves the value at `t[key]`. `value` can be modified in the scope of the `withValue` call.
```
sharedTable.withValue(key, value) do:
  # block is executed only if ``key`` in ``t``
  # value is threadsafe in block
  value.name = "username"
  value.uid = 1000
do:
  # block is executed when ``key`` not in ``t``
  raise newException(KeyError, "Key not found")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/sharedtables.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/sharedtables.nim#L85)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sharedtables.html>

tables
======


The `tables` module implements variants of an efficient hash table (also often named dictionary in other programming languages) that is a mapping from keys to values.

 There are several different types of hash tables available:

 * [Table](#Table) is the usual hash table,
* [OrderedTable](#OrderedTable) is like `Table` but remembers insertion order,
* [CountTable](#CountTable) is a mapping from a key to its number of occurrences

 For consistency with every other data type in Nim these have **value** semantics, this means that `=` performs a copy of the hash table.

 For [ref semantics](manual#types-reference-and-pointer-types) use their `Ref` variants: [TableRef](#TableRef), [OrderedTableRef](#OrderedTableRef), and [CountTableRef](#CountTableRef).

 To give an example, when `a` is a `Table`, then `var b = a` gives `b` as a new independent table. `b` is initialised with the contents of `a`. Changing `b` does not affect `a` and vice versa:

 
```
import tables

var
  a = {1: "one", 2: "two"}.toTable  # creates a Table
  b = a

echo a, b  # output: {1: one, 2: two}{1: one, 2: two}

b[3] = "three"
echo a, b  # output: {1: one, 2: two}{1: one, 2: two, 3: three}
echo a == b  # output: false
```

On the other hand, when `a` is a `TableRef` instead, then changes to `b` also affect `a`. Both `a` and `b` **ref** the same data structure:

 
```
import tables

var
  a = {1: "one", 2: "two"}.newTable  # creates a TableRef
  b = a

echo a, b  # output: {1: one, 2: two}{1: one, 2: two}

b[3] = "three"
echo a, b  # output: {1: one, 2: two, 3: three}{1: one, 2: two, 3: three}
echo a == b  # output: true
```



---

 Basic usage
-----------

 ### Table



```
import tables
from sequtils import zip

let
  names = ["John", "Paul", "George", "Ringo"]
  years = [1940, 1942, 1943, 1940]

var beatles = initTable[string, int]()

for pairs in zip(names, years):
  let (name, birthYear) = pairs
  beatles[name] = birthYear

echo beatles
# {"George": 1943, "Ringo": 1940, "Paul": 1942, "John": 1940}


var beatlesByYear = initTable[int, seq[string]]()

for pairs in zip(years, names):
  let (birthYear, name) = pairs
  if not beatlesByYear.hasKey(birthYear):
    # if a key doesn't exist, we create one with an empty sequence
    # before we can add elements to it
    beatlesByYear[birthYear] = @[]
  beatlesByYear[birthYear].add(name)

echo beatlesByYear
# {1940: @["John", "Ringo"], 1942: @["Paul"], 1943: @["George"]}
```
 ### OrderedTable


[OrderedTable](#OrderedTable) is used when it is important to preserve the insertion order of keys.

 
```
import tables

let
  a = [('z', 1), ('y', 2), ('x', 3)]
  t = a.toTable          # regular table
  ot = a.toOrderedTable  # ordered tables

echo t   # {'x': 3, 'y': 2, 'z': 1}
echo ot  # {'z': 1, 'y': 2, 'x': 3}
```
 ### CountTable


[CountTable](#CountTable) is useful for counting number of items of some container (e.g. string, sequence or array), as it is a mapping where the items are the keys, and their number of occurrences are the values. For that purpose [toCountTable proc](#toCountTable,openArray%5BA%5D) comes handy:

 
```
import tables

let myString = "abracadabra"
let letterFrequencies = toCountTable(myString)
echo letterFrequencies
# output: {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r': 2}
```

The same could have been achieved by manually iterating over a container and increasing each key's value with [inc proc](#inc,CountTable%5BA%5D,A,Positive):

 
```
import tables

let myString = "abracadabra"
var letterFrequencies = initCountTable[char]()
for c in myString:
  letterFrequencies.inc(c)
echo letterFrequencies
# output: {'a': 5, 'b': 2, 'c': 1, 'd': 1, 'r': 2}
```



---

 ### Hashing


If you are using simple standard types like `int` or `string` for the keys of the table you won't have any problems, but as soon as you try to use a more complex object as a key you will be greeted by a strange compiler error:

 
> Error: type mismatch: got (Person) but expected one of: hashes.hash(x: openArray[A]): Hash hashes.hash(x: int): Hash hashes.hash(x: float): Hash …
> 
> 

 What is happening here is that the types used for table keys require to have a `hash()` proc which will convert them to a [Hash](hashes#Hash) value, and the compiler is listing all the hash functions it knows. Additionally there has to be a `==` operator that provides the same semantics as its corresponding `hash` proc.

 After you add `hash` and `==` for your custom type everything will work. Currently, however, `hash` for objects is not defined, whereas `system.==` for objects does exist and performs a "deep" comparison (every field is compared) which is usually what you want. So in the following example implementing only `hash` suffices:

 
```
import tables, hashes

type
  Person = object
    firstName, lastName: string

proc hash(x: Person): Hash =
  ## Piggyback on the already available string hash proc.
  ##
  ## Without this proc nothing works!
  result = x.firstName.hash !& x.lastName.hash
  result = !$result

var
  salaries = initTable[Person, int]()
  p1, p2: Person

p1.firstName = "Jon"
p1.lastName = "Ross"
salaries[p1] = 30_000

p2.firstName = "소진"
p2.lastName = "박"
salaries[p2] = 45_000
```



---

 See also
--------


* [json module](json) for table-like structure which allows heterogeneous members
* [sharedtables module](sharedtables) for shared hash table support
* [strtabs module](strtabs) for efficient hash tables mapping from strings to strings
* [hashes module](hashes) for helper functions for hashing

 Imports
-------

  <since>, <hashes>, <math>, <algorithm>  Types
-----

  
```
Table[A; B] = object
  data: KeyValuePairSeq[A, B]
  counter: int
```
  Generic hash table, consisting of a key-value pair.

 `data` and `counter` are internal implementation details which can't be accessed.

 For creating an empty Table, use [initTable proc](#initTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L227)  
```
TableRef[A; B] = ref Table[A, B]
```
  Ref version of [Table](#Table).

 For creating a new empty TableRef, use [newTable proc](#newTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L236)  
```
OrderedTable[A; B] = object
  data: OrderedKeyValuePairSeq[A, B]
  counter, first, last: int
```
  Hash table that remembers insertion order.

 For creating an empty OrderedTable, use [initOrderedTable proc](#initOrderedTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1227)  
```
OrderedTableRef[A; B] = ref OrderedTable[A, B]
```
  Ref version of [OrderedTable](#OrderedTable).

 For creating a new empty OrderedTableRef, use [newOrderedTable proc](#newOrderedTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1234)  
```
CountTable[A] = object
  data: seq[tuple[key: A, val: int]]
  counter: int
  isSorted: bool
```
  Hash table that counts the number of each key.

 For creating an empty CountTable, use [initCountTable proc](#initCountTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2207)  
```
CountTableRef[A] = ref CountTable[A]
```
  Ref version of [CountTable](#CountTable).

 For creating a new empty CountTableRef, use [newCountTable proc](#newCountTable,int).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2215)   Consts
------

  
```
defaultInitialSize = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L242)   Procs
-----

  
```
proc rightSize(count: Natural): int {...}{.inline,
                                      deprecated: "Deprecated since 1.4.0",
                                      raises: [], tags: [].}
```
   **Deprecated:** Deprecated since 1.4.0  **Deprecated since Nim v1.4.0**, it is not needed anymore because picking the correct size is done internally.

 Return the value of `initialSize` to support `count` items.

 If more items are expected to be added, simply add that expected extra amount to the parameter before calling this.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/hashcommon.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/hashcommon.nim#L41)  
```
proc initTable[A, B](initialSize = defaultInitialSize): Table[A, B]
```
  Creates a new hash table that is empty.

 Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly.

 See also:

 * [toTable proc](#toTable,openArray%5B%5D)
* [newTable proc](#newTable,int) for creating a `TableRef`

 **Example:**

 
```
let
  a = initTable[int, string]()
  b = initTable[char, seq[int]]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L288)  
```
proc `[]=`[A, B](t: var Table[A, B]; key: A; val: sink B)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [hasKeyOrPut proc](#hasKeyOrPut,Table%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,Table%5BA,B%5D,A,B)
* [del proc](#del,Table%5BA,B%5D,A) for removing a key from the table

 **Example:**

 
```
var a = initTable[char, int]()
a['x'] = 7
a['y'] = 33
doAssert a == {'x': 7, 'y': 33}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L303)  
```
proc toTable[A, B](pairs: openArray[(A, B)]): Table[A, B]
```
  Creates a new hash table that contains the given `pairs`.

 `pairs` is a container consisting of `(key, value)` tuples.

 See also:

 * [initTable proc](#initTable,int)
* [newTable proc](#newTable,openArray%5B%5D) for a `TableRef` version

 **Example:**

 
```
let a = [('a', 5), ('b', 9)]
let b = toTable(a)
assert b == {'a': 5, 'b': 9}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L319)  
```
proc `[]`[A, B](t: Table[A, B]; key: A): B
```
  Retrieves the value at `t[key]`.

 If `key` is not in `t`, the `KeyError` exception is raised. One can check with [hasKey proc](#hasKey,Table%5BA,B%5D,A) whether the key exists.

 See also:

 * [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,Table%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,Table%5BA,B%5D,A) for checking if a key is in the table

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert a['a'] == 5
doAssertRaises(KeyError):
  echo a['z']
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L335)  
```
proc `[]`[A, B](t: var Table[A, B]; key: A): var B
```
  Retrieves the value at `t[key]`. The value can be modified.

 If `key` is not in `t`, the `KeyError` exception is raised.

 See also:

 * [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,Table%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,Table%5BA,B%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L358)  
```
proc hasKey[A, B](t: Table[A, B]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,Table%5BA,B%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert a.hasKey('a') == true
doAssert a.hasKey('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L374)  
```
proc contains[A, B](t: Table[A, B]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,Table%5BA,B%5D,A) for use with the `in` operator. **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert 'b' in a == true
doAssert a.contains('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L392)  
```
proc hasKeyOrPut[A, B](t: var Table[A, B]; key: A; val: B): bool
```
  Returns true if `key` is in the table, otherwise inserts `value`.

 See also:

 * [hasKey proc](#hasKey,Table%5BA,B%5D,A)
* [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.toTable
if a.hasKeyOrPut('a', 50):
  a['a'] = 99
if a.hasKeyOrPut('z', 50):
  a['z'] = 99
doAssert a == {'a': 99, 'b': 9, 'z': 50}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L402)  
```
proc getOrDefault[A, B](t: Table[A, B]; key: A): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, the default initialization value for type `B` is returned (e.g. 0 for any integer type).

 See also:

 * [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,Table%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,Table%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,Table%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert a.getOrDefault('a') == 5
doAssert a.getOrDefault('z') == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L422)  
```
proc getOrDefault[A, B](t: Table[A, B]; key: A; default: B): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, `default` is returned.

 See also:

 * [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,Table%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,Table%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,Table%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert a.getOrDefault('a', 99) == 5
doAssert a.getOrDefault('z', 99) == 99
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L441)  
```
proc mgetOrPut[A, B](t: var Table[A, B]; key: A; val: B): var B
```
  Retrieves value at `t[key]` or puts `val` if not present, either way returning a value which can be modified.

 Note that while the value returned is of type `var B`, it is easy to accidentally create an copy of the value at `t[key]`. Remember that seqs and strings are value types, and therefore cannot be copied into a separate variable for modification. See the example below.

 See also:

 * [[] proc](#%5B%5D,Table%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,Table%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,Table%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,Table%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.toTable
doAssert a.mgetOrPut('a', 99) == 5
doAssert a.mgetOrPut('z', 99) == 99
doAssert a == {'a': 5, 'b': 9, 'z': 99}.toTable

# An example of accidentally creating a copy
var t = initTable[int, seq[int]]()
# In this example, we expect t[10] to be modified,
# but it is not.
var copiedSeq = t.mgetOrPut(10, @[10])
copiedSeq.add(20)
doAssert t[10] == @[10]
# Correct
t.mgetOrPut(25, @[25]).add(35)
doAssert t[25] == @[25, 35]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L459)  
```
proc len[A, B](t: Table[A, B]): int
```
  Returns the number of keys in `t`. **Example:**

 
```
let a = {'a': 5, 'b': 9}.toTable
doAssert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L497)  
```
proc add[A, B](t: var Table[A, B]; key: A; val: sink B) {...}{.deprecated: "Deprecated since v1.4; it was more confusing than useful, use `[]=`".}
```
   **Deprecated:** Deprecated since v1.4; it was more confusing than useful, use `[]=`  Puts a new `(key, value)` pair into `t` even if `t[key]` already exists.

 **This can introduce duplicate keys into the table!**

 Use [[]= proc](#%5B%5D=,Table%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table without introducing duplicates.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L505)  
```
proc del[A, B](t: var Table[A, B]; key: A)
```
  Deletes `key` from hash table `t`. Does nothing if the key does not exist.

 See also:

 * [pop proc](#pop,Table%5BA,B%5D,A,B)
* [clear proc](#clear,Table%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.toTable
a.del('a')
doAssert a == {'b': 9, 'c': 13}.toTable
a.del('z')
doAssert a == {'b': 9, 'c': 13}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L519)  
```
proc pop[A, B](t: var Table[A, B]; key: A; val: var B): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 See also:

 * [del proc](#del,Table%5BA,B%5D,A)
* [clear proc](#clear,Table%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var
  a = {'a': 5, 'b': 9, 'c': 13}.toTable
  i: int
doAssert a.pop('b', i) == true
doAssert a == {'a': 5, 'c': 13}.toTable
doAssert i == 9
i = 0
doAssert a.pop('z', i) == false
doAssert a == {'a': 5, 'c': 13}.toTable
doAssert i == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L534)  
```
proc take[A, B](t: var Table[A, B]; key: A; val: var B): bool {...}{.inline.}
```
  Alias for:* [pop proc](#pop,Table%5BA,B%5D,A,B)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L562)  
```
proc clear[A, B](t: var Table[A, B])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,Table%5BA,B%5D,A)
* [pop proc](#pop,Table%5BA,B%5D,A,B)

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.toTable
doAssert len(a) == 3
clear(a)
doAssert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L567)  
```
proc `$`[A, B](t: Table[A, B]): string
```
  The `$` operator for hash tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L581)  
```
proc `==`[A, B](s, t: Table[A, B]): bool
```
  The `==` operator for hash tables. Returns `true` if the content of both tables contains the same key-value pairs. Insert order does not matter. **Example:**

 
```
let
  a = {'a': 5, 'b': 9, 'c': 13}.toTable
  b = {'b': 9, 'c': 13, 'a': 5}.toTable
doAssert a == b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L586)  
```
proc indexBy[A, B, C](collection: A; index: proc (x: B): C): Table[C, B]
```
  Index the collection with the proc provided. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L597)  
```
proc newTable[A, B](initialSize = defaultInitialSize): TableRef[A, B]
```
  Creates a new ref hash table that is empty.

 See also:

 * [newTable proc](#newTable,openArray%5B%5D) for creating a `TableRef` from a collection of `(key, value)` pairs
* [initTable proc](#initTable,int) for creating a `Table`

 **Example:**

 
```
let
  a = newTable[int, string]()
  b = newTable[char, seq[int]]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L798) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L798)  
```
proc newTable[A, B](pairs: openArray[(A, B)]): TableRef[A, B]
```
  Creates a new ref hash table that contains the given `pairs`.

 `pairs` is a container consisting of `(key, value)` tuples.

 See also:

 * [newTable proc](#newTable,int)
* [toTable proc](#toTable,openArray%5B%5D) for a `Table` version

 **Example:**

 
```
let a = [('a', 5), ('b', 9)]
let b = newTable(a)
assert b == {'a': 5, 'b': 9}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L813) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L813)  
```
proc newTableFrom[A, B, C](collection: A; index: proc (x: B): C): TableRef[C, B]
```
  Index the collection with the proc provided. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L829)  
```
proc `[]`[A, B](t: TableRef[A, B]; key: A): var B
```
  Retrieves the value at `t[key]`.

 If `key` is not in `t`, the `KeyError` exception is raised. One can check with [hasKey proc](#hasKey,TableRef%5BA,B%5D,A) whether the key exists.

 See also:

 * [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,TableRef%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,TableRef%5BA,B%5D,A) for checking if a key is in the table

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert a['a'] == 5
doAssertRaises(KeyError):
  echo a['z']
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L836) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L836)  
```
proc `[]=`[A, B](t: TableRef[A, B]; key: A; val: sink B)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKeyOrPut proc](#hasKeyOrPut,TableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,TableRef%5BA,B%5D,A,B)
* [del proc](#del,TableRef%5BA,B%5D,A) for removing a key from the table

 **Example:**

 
```
var a = newTable[char, int]()
a['x'] = 7
a['y'] = 33
doAssert a == {'x': 7, 'y': 33}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L860) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L860)  
```
proc hasKey[A, B](t: TableRef[A, B]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,TableRef%5BA,B%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert a.hasKey('a') == true
doAssert a.hasKey('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L876) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L876)  
```
proc contains[A, B](t: TableRef[A, B]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,TableRef%5BA,B%5D,A) for use with the `in` operator. **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert 'b' in a == true
doAssert a.contains('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L894) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L894)  
```
proc hasKeyOrPut[A, B](t: var TableRef[A, B]; key: A; val: B): bool
```
  Returns true if `key` is in the table, otherwise inserts `value`.

 See also:

 * [hasKey proc](#hasKey,TableRef%5BA,B%5D,A)
* [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.newTable
if a.hasKeyOrPut('a', 50):
  a['a'] = 99
if a.hasKeyOrPut('z', 50):
  a['z'] = 99
doAssert a == {'a': 99, 'b': 9, 'z': 50}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L904) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L904)  
```
proc getOrDefault[A, B](t: TableRef[A, B]; key: A): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, the default initialization value for type `B` is returned (e.g. 0 for any integer type).

 See also:

 * [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,TableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,TableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,TableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert a.getOrDefault('a') == 5
doAssert a.getOrDefault('z') == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L924)  
```
proc getOrDefault[A, B](t: TableRef[A, B]; key: A; default: B): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, `default` is returned.

 See also:

 * [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,TableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,TableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,TableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert a.getOrDefault('a', 99) == 5
doAssert a.getOrDefault('z', 99) == 99
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L943) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L943)  
```
proc mgetOrPut[A, B](t: TableRef[A, B]; key: A; val: B): var B
```
  Retrieves value at `t[key]` or puts `val` if not present, either way returning a value which can be modified.

 Note that while the value returned is of type `var B`, it is easy to accidentally create an copy of the value at `t[key]`. Remember that seqs and strings are value types, and therefore cannot be copied into a separate variable for modification. See the example below.

 See also:

 * [[] proc](#%5B%5D,TableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,TableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,TableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,TableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.newTable
doAssert a.mgetOrPut('a', 99) == 5
doAssert a.mgetOrPut('z', 99) == 99
doAssert a == {'a': 5, 'b': 9, 'z': 99}.newTable

# An example of accidentally creating a copy
var t = newTable[int, seq[int]]()
# In this example, we expect t[10] to be modified,
# but it is not.
var copiedSeq = t.mgetOrPut(10, @[10])
copiedSeq.add(20)
doAssert t[10] == @[10]
# Correct
t.mgetOrPut(25, @[25]).add(35)
doAssert t[25] == @[25, 35]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L961) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L961)  
```
proc len[A, B](t: TableRef[A, B]): int
```
  Returns the number of keys in `t`. **Example:**

 
```
let a = {'a': 5, 'b': 9}.newTable
doAssert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L997) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L997)  
```
proc add[A, B](t: TableRef[A, B]; key: A; val: sink B) {...}{.deprecated: "Deprecated since v1.4; it was more confusing than useful, use `[]=`".}
```
   **Deprecated:** Deprecated since v1.4; it was more confusing than useful, use `[]=`  Puts a new `(key, value)` pair into `t` even if `t[key]` already exists.

 **This can introduce duplicate keys into the table!**

 Use [[]= proc](#%5B%5D=,TableRef%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table without introducing duplicates.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1005) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1005)  
```
proc del[A, B](t: TableRef[A, B]; key: A)
```
  Deletes `key` from hash table `t`. Does nothing if the key does not exist.

 **If duplicate keys were added, this may need to be called multiple times.**

 See also:

 * [pop proc](#pop,TableRef%5BA,B%5D,A,B)
* [clear proc](#clear,TableRef%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.newTable
a.del('a')
doAssert a == {'b': 9, 'c': 13}.newTable
a.del('z')
doAssert a == {'b': 9, 'c': 13}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1015) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1015)  
```
proc pop[A, B](t: TableRef[A, B]; key: A; val: var B): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 **If duplicate keys were added, this may need to be called multiple times.**

 See also:

 * [del proc](#del,TableRef%5BA,B%5D,A)
* [clear proc](#clear,TableRef%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var
  a = {'a': 5, 'b': 9, 'c': 13}.newTable
  i: int
doAssert a.pop('b', i) == true
doAssert a == {'a': 5, 'c': 13}.newTable
doAssert i == 9
i = 0
doAssert a.pop('z', i) == false
doAssert a == {'a': 5, 'c': 13}.newTable
doAssert i == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1032) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1032)  
```
proc take[A, B](t: TableRef[A, B]; key: A; val: var B): bool {...}{.inline.}
```
  Alias for:* [pop proc](#pop,TableRef%5BA,B%5D,A,B)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1057) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1057)  
```
proc clear[A, B](t: TableRef[A, B])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,Table%5BA,B%5D,A)
* [pop proc](#pop,Table%5BA,B%5D,A,B)

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.newTable
doAssert len(a) == 3
clear(a)
doAssert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1062) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1062)  
```
proc `$`[A, B](t: TableRef[A, B]): string
```
  The `$` operator for hash tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1076) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1076)  
```
proc `==`[A, B](s, t: TableRef[A, B]): bool
```
  The `==` operator for hash tables. Returns `true` if either both tables are `nil`, or neither is `nil` and the content of both tables contains the same key-value pairs. Insert order does not matter. **Example:**

 
```
let
  a = {'a': 5, 'b': 9, 'c': 13}.newTable
  b = {'b': 9, 'c': 13, 'a': 5}.newTable
doAssert a == b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1081) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1081)  
```
proc initOrderedTable[A, B](initialSize = defaultInitialSize): OrderedTable[A, B]
```
  Creates a new ordered hash table that is empty.

 Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly.

 See also:

 * [toOrderedTable proc](#toOrderedTable,openArray%5B%5D)
* [newOrderedTable proc](#newOrderedTable,int) for creating an `OrderedTableRef`

 **Example:**

 
```
let
  a = initOrderedTable[int, string]()
  b = initOrderedTable[char, seq[int]]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1289)  
```
proc `[]=`[A, B](t: var OrderedTable[A, B]; key: A; val: sink B)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTable%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTable%5BA,B%5D,A,B)
* [del proc](#del,OrderedTable%5BA,B%5D,A) for removing a key from the table

 **Example:**

 
```
var a = initOrderedTable[char, int]()
a['x'] = 7
a['y'] = 33
doAssert a == {'x': 7, 'y': 33}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1305)  
```
proc toOrderedTable[A, B](pairs: openArray[(A, B)]): OrderedTable[A, B]
```
  Creates a new ordered hash table that contains the given `pairs`.

 `pairs` is a container consisting of `(key, value)` tuples.

 See also:

 * [initOrderedTable proc](#initOrderedTable,int)
* [newOrderedTable proc](#newOrderedTable,openArray%5B%5D) for an `OrderedTableRef` version

 **Example:**

 
```
let a = [('a', 5), ('b', 9)]
let b = toOrderedTable(a)
assert b == {'a': 5, 'b': 9}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1321)  
```
proc `[]`[A, B](t: OrderedTable[A, B]; key: A): B
```
  Retrieves the value at `t[key]`.

 If `key` is not in `t`, the `KeyError` exception is raised. One can check with [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A) whether the key exists.

 See also:

 * [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,OrderedTable%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A) for checking if a key is in the table

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert a['a'] == 5
doAssertRaises(KeyError):
  echo a['z']
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1338)  
```
proc `[]`[A, B](t: var OrderedTable[A, B]; key: A): var B
```
  Retrieves the value at `t[key]`. The value can be modified.

 If `key` is not in `t`, the `KeyError` exception is raised.

 See also:

 * [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,OrderedTable%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1362)  
```
proc hasKey[A, B](t: OrderedTable[A, B]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,OrderedTable%5BA,B%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert a.hasKey('a') == true
doAssert a.hasKey('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1378)  
```
proc contains[A, B](t: OrderedTable[A, B]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A) for use with the `in` operator. **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert 'b' in a == true
doAssert a.contains('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1397)  
```
proc hasKeyOrPut[A, B](t: var OrderedTable[A, B]; key: A; val: B): bool
```
  Returns true if `key` is in the table, otherwise inserts `value`.

 See also:

 * [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A)
* [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.toOrderedTable
if a.hasKeyOrPut('a', 50):
  a['a'] = 99
if a.hasKeyOrPut('z', 50):
  a['z'] = 99
doAssert a == {'a': 99, 'b': 9, 'z': 50}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1407)  
```
proc getOrDefault[A, B](t: OrderedTable[A, B]; key: A): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, the default initialization value for type `B` is returned (e.g. 0 for any integer type).

 See also:

 * [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTable%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTable%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert a.getOrDefault('a') == 5
doAssert a.getOrDefault('z') == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1427)  
```
proc getOrDefault[A, B](t: OrderedTable[A, B]; key: A; default: B): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, `default` is returned.

 See also:

 * [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTable%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTable%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert a.getOrDefault('a', 99) == 5
doAssert a.getOrDefault('z', 99) == 99
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1446)  
```
proc mgetOrPut[A, B](t: var OrderedTable[A, B]; key: A; val: B): var B
```
  Retrieves value at `t[key]` or puts `val` if not present, either way returning a value which can be modified.

 See also:

 * [[] proc](#%5B%5D,OrderedTable%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTable%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTable%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTable%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.toOrderedTable
doAssert a.mgetOrPut('a', 99) == 5
doAssert a.mgetOrPut('z', 99) == 99
doAssert a == {'a': 5, 'b': 9, 'z': 99}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1464)  
```
proc len[A, B](t: OrderedTable[A, B]): int {...}{.inline.}
```
  Returns the number of keys in `t`. **Example:**

 
```
let a = {'a': 5, 'b': 9}.toOrderedTable
doAssert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1484)  
```
proc add[A, B](t: var OrderedTable[A, B]; key: A; val: sink B) {...}{.deprecated: "Deprecated since v1.4; it was more confusing than useful, use `[]=`".}
```
   **Deprecated:** Deprecated since v1.4; it was more confusing than useful, use `[]=`  Puts a new `(key, value)` pair into `t` even if `t[key]` already exists.

 **This can introduce duplicate keys into the table!**

 Use [[]= proc](#%5B%5D=,OrderedTable%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table without introducing duplicates.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1492)  
```
proc del[A, B](t: var OrderedTable[A, B]; key: A)
```
  Deletes `key` from hash table `t`. Does nothing if the key does not exist.

 O(n) complexity.

 See also:

 * [pop proc](#pop,OrderedTable%5BA,B%5D,A,B)
* [clear proc](#clear,OrderedTable%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.toOrderedTable
a.del('a')
doAssert a == {'b': 9, 'c': 13}.toOrderedTable
a.del('z')
doAssert a == {'b': 9, 'c': 13}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1502)  
```
proc pop[A, B](t: var OrderedTable[A, B]; key: A; val: var B): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 O(n) complexity.

 See also:

 * [del proc](#del,OrderedTable%5BA,B%5D,A)
* [clear proc](#clear,OrderedTable%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var
  a = {'c': 5, 'b': 9, 'a': 13}.toOrderedTable
  i: int
doAssert a.pop('b', i) == true
doAssert a == {'c': 5, 'a': 13}.toOrderedTable
doAssert i == 9
i = 0
doAssert a.pop('z', i) == false
doAssert a == {'c': 5, 'a': 13}.toOrderedTable
doAssert i == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1535)  
```
proc clear[A, B](t: var OrderedTable[A, B])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,OrderedTable%5BA,B%5D,A)
* [pop proc](#pop,OrderedTable%5BA,B%5D,A,B)

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.toOrderedTable
doAssert len(a) == 3
clear(a)
doAssert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1565)  
```
proc sort[A, B](t: var OrderedTable[A, B]; cmp: proc (x, y: (A, B)): int;
                order = SortOrder.Ascending)
```
  Sorts `t` according to the function `cmp`.

 This modifies the internal list that kept the insertion order, so insertion order is lost after this call but key lookup and insertions remain possible after `sort` (in contrast to the [sort proc](#sort,CountTable%5BA%5D) for count tables).

 **Example:**

 
```
import algorithm
var a = initOrderedTable[char, int]()
for i, c in "cab":
  a[c] = 10*i
doAssert a == {'c': 0, 'a': 10, 'b': 20}.toOrderedTable
a.sort(system.cmp)
doAssert a == {'a': 10, 'b': 20, 'c': 0}.toOrderedTable
a.sort(system.cmp, order = SortOrder.Descending)
doAssert a == {'c': 0, 'b': 20, 'a': 10}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1581)  
```
proc `$`[A, B](t: OrderedTable[A, B]): string
```
  The `$` operator for ordered hash tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1640)  
```
proc `==`[A, B](s, t: OrderedTable[A, B]): bool
```
  The `==` operator for ordered hash tables. Returns `true` if both the content and the order are equal. **Example:**

 
```
let
  a = {'a': 5, 'b': 9, 'c': 13}.toOrderedTable
  b = {'b': 9, 'c': 13, 'a': 5}.toOrderedTable
doAssert a != b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1645)  
```
proc newOrderedTable[A, B](initialSize = defaultInitialSize): OrderedTableRef[A,
    B]
```
  Creates a new ordered ref hash table that is empty.

 See also:

 * [newOrderedTable proc](#newOrderedTable,openArray%5B%5D) for creating an `OrderedTableRef` from a collection of `(key, value)` pairs
* [initOrderedTable proc](#initOrderedTable,int) for creating an `OrderedTable`

 **Example:**

 
```
let
  a = newOrderedTable[int, string]()
  b = newOrderedTable[char, seq[int]]()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1793) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1793)  
```
proc newOrderedTable[A, B](pairs: openArray[(A, B)]): OrderedTableRef[A, B]
```
  Creates a new ordered ref hash table that contains the given `pairs`.

 `pairs` is a container consisting of `(key, value)` tuples.

 See also:

 * [newOrderedTable proc](#newOrderedTable,int)
* [toOrderedTable proc](#toOrderedTable,openArray%5B%5D) for an `OrderedTable` version

 **Example:**

 
```
let a = [('a', 5), ('b', 9)]
let b = newOrderedTable(a)
assert b == {'a': 5, 'b': 9}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1808) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1808)  
```
proc `[]`[A, B](t: OrderedTableRef[A, B]; key: A): var B
```
  Retrieves the value at `t[key]`.

 If `key` is not in `t`, the `KeyError` exception is raised. One can check with [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A) whether the key exists.

 See also:

 * [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D=,OrderedTableRef%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A) for checking if a key is in the table

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert a['a'] == 5
doAssertRaises(KeyError):
  echo a['z']
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1826) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1826)  
```
proc `[]=`[A, B](t: OrderedTableRef[A, B]; key: A; val: sink B)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [del proc](#del,OrderedTableRef%5BA,B%5D,A) for removing a key from the table

 **Example:**

 
```
var a = newOrderedTable[char, int]()
a['x'] = 7
a['y'] = 33
doAssert a == {'x': 7, 'y': 33}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1849) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1849)  
```
proc hasKey[A, B](t: OrderedTableRef[A, B]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,OrderedTableRef%5BA,B%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert a.hasKey('a') == true
doAssert a.hasKey('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1865) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1865)  
```
proc contains[A, B](t: OrderedTableRef[A, B]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A) for use with the `in` operator. **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert 'b' in a == true
doAssert a.contains('z') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1883) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1883)  
```
proc hasKeyOrPut[A, B](t: var OrderedTableRef[A, B]; key: A; val: B): bool
```
  Returns true if `key` is in the table, otherwise inserts `value`.

 See also:

 * [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A)
* [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.newOrderedTable
if a.hasKeyOrPut('a', 50):
  a['a'] = 99
if a.hasKeyOrPut('z', 50):
  a['z'] = 99
doAssert a == {'a': 99, 'b': 9, 'z': 50}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1893) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1893)  
```
proc getOrDefault[A, B](t: OrderedTableRef[A, B]; key: A): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, the default initialization value for type `B` is returned (e.g. 0 for any integer type).

 See also:

 * [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert a.getOrDefault('a') == 5
doAssert a.getOrDefault('z') == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1913) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1913)  
```
proc getOrDefault[A, B](t: OrderedTableRef[A, B]; key: A; default: B): B
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise, `default` is returned.

 See also:

 * [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [mgetOrPut proc](#mgetOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist

 **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert a.getOrDefault('a', 99) == 5
doAssert a.getOrDefault('z', 99) == 99
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1932) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1932)  
```
proc mgetOrPut[A, B](t: OrderedTableRef[A, B]; key: A; val: B): var B
```
  Retrieves value at `t[key]` or puts `val` if not present, either way returning a value which can be modified.

 See also:

 * [[] proc](#%5B%5D,OrderedTableRef%5BA,B%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,OrderedTableRef%5BA,B%5D,A)
* [hasKeyOrPut proc](#hasKeyOrPut,OrderedTableRef%5BA,B%5D,A,B)
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A) to return a default value (e.g. zero for int) if the key doesn't exist
* [getOrDefault proc](#getOrDefault,OrderedTableRef%5BA,B%5D,A,B) to return a custom value if the key doesn't exist

 **Example:**

 
```
var a = {'a': 5, 'b': 9}.newOrderedTable
doAssert a.mgetOrPut('a', 99) == 5
doAssert a.mgetOrPut('z', 99) == 99
doAssert a == {'a': 5, 'b': 9, 'z': 99}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1950) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1950)  
```
proc len[A, B](t: OrderedTableRef[A, B]): int {...}{.inline.}
```
  Returns the number of keys in `t`. **Example:**

 
```
let a = {'a': 5, 'b': 9}.newOrderedTable
doAssert len(a) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1970) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1970)  
```
proc add[A, B](t: OrderedTableRef[A, B]; key: A; val: sink B) {...}{.deprecated: "Deprecated since v1.4; it was more confusing than useful, use `[]=`".}
```
   **Deprecated:** Deprecated since v1.4; it was more confusing than useful, use `[]=`  Puts a new `(key, value)` pair into `t` even if `t[key]` already exists.

 **This can introduce duplicate keys into the table!**

 Use [[]= proc](#%5B%5D=,OrderedTableRef%5BA,B%5D,A,B) for inserting a new (key, value) pair in the table without introducing duplicates.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1978) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1978)  
```
proc del[A, B](t: OrderedTableRef[A, B]; key: A)
```
  Deletes `key` from hash table `t`. Does nothing if the key does not exist.

 See also:

 * [clear proc](#clear,OrderedTableRef%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.newOrderedTable
a.del('a')
doAssert a == {'b': 9, 'c': 13}.newOrderedTable
a.del('z')
doAssert a == {'b': 9, 'c': 13}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1988) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1988)  
```
proc pop[A, B](t: OrderedTableRef[A, B]; key: A; val: var B): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 See also:

 * [del proc](#del,OrderedTableRef%5BA,B%5D,A)
* [clear proc](#clear,OrderedTableRef%5BA,B%5D) to empty the whole table

 **Example:**

 
```
var
  a = {'c': 5, 'b': 9, 'a': 13}.newOrderedTable
  i: int
doAssert a.pop('b', i) == true
doAssert a == {'c': 5, 'a': 13}.newOrderedTable
doAssert i == 9
i = 0
doAssert a.pop('z', i) == false
doAssert a == {'c': 5, 'a': 13}.newOrderedTable
doAssert i == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2002) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2002)  
```
proc clear[A, B](t: OrderedTableRef[A, B])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,OrderedTableRef%5BA,B%5D,A)

 **Example:**

 
```
var a = {'a': 5, 'b': 9, 'c': 13}.newOrderedTable
doAssert len(a) == 3
clear(a)
doAssert len(a) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2025) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2025)  
```
proc sort[A, B](t: OrderedTableRef[A, B]; cmp: proc (x, y: (A, B)): int;
                order = SortOrder.Ascending)
```
  Sorts `t` according to the function `cmp`.

 This modifies the internal list that kept the insertion order, so insertion order is lost after this call but key lookup and insertions remain possible after `sort` (in contrast to the [sort proc](#sort,CountTableRef%5BA%5D) for count tables).

 **Example:**

 
```
import algorithm
var a = newOrderedTable[char, int]()
for i, c in "cab":
  a[c] = 10*i
doAssert a == {'c': 0, 'a': 10, 'b': 20}.newOrderedTable
a.sort(system.cmp)
doAssert a == {'a': 10, 'b': 20, 'c': 0}.newOrderedTable
a.sort(system.cmp, order = SortOrder.Descending)
doAssert a == {'c': 0, 'b': 20, 'a': 10}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2038) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2038)  
```
proc `$`[A, B](t: OrderedTableRef[A, B]): string
```
  The `$` operator for hash tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2059)  
```
proc `==`[A, B](s, t: OrderedTableRef[A, B]): bool
```
  The `==` operator for ordered hash tables. Returns true if either both tables are `nil`, or neither is `nil` and the content and the order of both are equal. **Example:**

 
```
let
  a = {'a': 5, 'b': 9, 'c': 13}.newOrderedTable
  b = {'b': 9, 'c': 13, 'a': 5}.newOrderedTable
doAssert a != b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2064) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2064)  
```
proc initCountTable[A](initialSize = defaultInitialSize): CountTable[A]
```
  Creates a new count table that is empty.

 Starting from Nim v0.20, tables are initialized by default and it is not necessary to call this function explicitly.

 See also:

 * [toCountTable proc](#toCountTable,openArray%5BA%5D)
* [newCountTable proc](#newCountTable,int) for creating a `CountTableRef`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2255)  
```
proc toCountTable[A](keys: openArray[A]): CountTable[A]
```
  Creates a new count table with every member of a container `keys` having a count of how many times it occurs in that container. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2267)  
```
proc `[]`[A](t: CountTable[A]; key: A): int
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise `0` is returned.

 See also:

 * [getOrDefault](#getOrDefault,CountTable%5BA%5D,A,int) to return a custom value if the key doesn't exist
* [[]= proc](#%5B%5D%3D,CountTable%5BA%5D,A,int) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,CountTable%5BA%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2273)  
```
proc `[]=`[A](t: var CountTable[A]; key: A; val: int)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,CountTable%5BA%5D,A) for retrieving a value of a key
* [inc proc](#inc,CountTable%5BA%5D,A,Positive) for incrementing a value of a key

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2291)  
```
proc inc[A](t: var CountTable[A]; key: A; val = 1)
```
  Increments `t[key]` by `val` (default: 1). **Example:**

 
```
var a = toCountTable("aab")
a.inc('a')
a.inc('b', 10)
doAssert a == toCountTable("aaabbbbbbbbbbb")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2309)  
```
proc len[A](t: CountTable[A]): int
```
  Returns the number of keys in `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2327)  
```
proc smallest[A](t: CountTable[A]): tuple[key: A, val: int]
```
  Returns the `(key, value)` pair with the smallest `val`. Efficiency: O(n)

 See also:

 * [largest proc](#largest,CountTable%5BA%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2331)  
```
proc largest[A](t: CountTable[A]): tuple[key: A, val: int]
```
  Returns the `(key, value)` pair with the largest `val`. Efficiency: O(n)

 See also:

 * [smallest proc](#smallest,CountTable%5BA%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2344)  
```
proc hasKey[A](t: CountTable[A]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,CountTable%5BA%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,CountTable%5BA%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,CountTable%5BA%5D,A,int) to return a custom value if the key doesn't exist

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2356)  
```
proc contains[A](t: CountTable[A]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,CountTable%5BA%5D,A) for use with the `in` operator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2368)  
```
proc getOrDefault[A](t: CountTable[A]; key: A; default: int = 0): int
```
  Retrieves the value at `t[key]` if`key` is in `t`. Otherwise, the integer value of `default` is returned.

 See also:

 * [[] proc](#%5B%5D,CountTable%5BA%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,CountTable%5BA%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2373)  
```
proc del[A](t: var CountTable[A]; key: A)
```
  Deletes `key` from table `t`. Does nothing if the key does not exist.

 See also:

 * [pop proc](#pop,CountTable%5BA%5D,A,int)
* [clear proc](#clear,CountTable%5BA%5D) to empty the whole table

 **Example:**

 
```
var a = toCountTable("aabbbccccc")
a.del('b')
assert a == toCountTable("aaccccc")
a.del('b')
assert a == toCountTable("aaccccc")
a.del('c')
assert a == toCountTable("aa")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2383)  
```
proc pop[A](t: var CountTable[A]; key: A; val: var int): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 See also:

 * [del proc](#del,CountTable%5BA%5D,A)
* [clear proc](#clear,CountTable%5BA%5D) to empty the whole table

 **Example:**

 
```
var a = toCountTable("aabbbccccc")
var i = 0
assert a.pop('b', i)
assert i == 3
i = 99
assert not a.pop('b', i)
assert i == 99
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2400)  
```
proc clear[A](t: var CountTable[A])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,CountTable%5BA%5D,A)
* [pop proc](#pop,CountTable%5BA%5D,A,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2424)  
```
proc sort[A](t: var CountTable[A]; order = SortOrder.Descending)
```
  Sorts the count table so that, by default, the entry with the highest counter comes first.

 **WARNING:** This is destructive! Once sorted, you must not modify `t` afterwards!

 You can use the iterators [pairs](#pairs.i,CountTable%5BA%5D), [keys](#keys.i,CountTable%5BA%5D), and [values](#values.i,CountTable%5BA%5D) to iterate over `t` in the sorted order.

 **Example:**

 
```
import algorithm, sequtils
var a = toCountTable("abracadabra")
doAssert a == "aaaaabbrrcd".toCountTable
a.sort()
doAssert toSeq(a.values) == @[5, 2, 2, 1, 1]
a.sort(SortOrder.Ascending)
doAssert toSeq(a.values) == @[1, 1, 2, 2, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2436)  
```
proc merge[A](s: var CountTable[A]; t: CountTable[A])
```
  Merges the second table into the first one (must be declared as `var`). **Example:**

 
```
var a = toCountTable("aaabbc")
let b = toCountTable("bcc")
a.merge(b)
doAssert a == toCountTable("aaabbbccc")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2457)  
```
proc `$`[A](t: CountTable[A]): string
```
  The `$` operator for count tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2483)  
```
proc `==`[A](s, t: CountTable[A]): bool
```
  The `==` operator for count tables. Returns `true` if both tables contain the same keys with the same count. Insert order does not matter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2488)  
```
proc newCountTable[A](initialSize = defaultInitialSize): CountTableRef[A]
```
  Creates a new ref count table that is empty.

 See also:

 * [newCountTable proc](#newCountTable,openArray%5BA%5D) for creating a `CountTableRef` from a collection
* [initCountTable proc](#initCountTable,int) for creating a `CountTable`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2613) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2613)  
```
proc newCountTable[A](keys: openArray[A]): CountTableRef[A]
```
  Creates a new ref count table with every member of a container `keys` having a count of how many times it occurs in that container. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2624) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2624)  
```
proc `[]`[A](t: CountTableRef[A]; key: A): int
```
  Retrieves the value at `t[key]` if `key` is in `t`. Otherwise `0` is returned.

 See also:

 * [getOrDefault](#getOrDefault,CountTableRef%5BA%5D,A,int) to return a custom value if the key doesn't exist
* [inc proc](#inc,CountTableRef%5BA%5D,A) to inc even if missing
* [[]= proc](#%5B%5D%3D,CountTableRef%5BA%5D,A,int) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,CountTableRef%5BA%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2630)  
```
proc `[]=`[A](t: CountTableRef[A]; key: A; val: int)
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,CountTableRef%5BA%5D,A) for retrieving a value of a key
* [inc proc](#inc,CountTableRef%5BA%5D,A,int) for incrementing a value of a key

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2644)  
```
proc inc[A](t: CountTableRef[A]; key: A; val = 1)
```
  Increments `t[key]` by `val` (default: 1). **Example:**

 
```
var a = newCountTable("aab")
a.inc('a')
a.inc('b', 10)
doAssert a == newCountTable("aaabbbbbbbbbbb")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2654)  
```
proc smallest[A](t: CountTableRef[A]): tuple[key: A, val: int]
```
  Returns the `(key, value)` pair with the smallest `val`. Efficiency: O(n)

 See also:

 * [largest proc](#largest,CountTableRef%5BA%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2663)  
```
proc largest[A](t: CountTableRef[A]): tuple[key: A, val: int]
```
  Returns the `(key, value)` pair with the largest `val`. Efficiency: O(n)

 See also:

 * [smallest proc](#smallest,CountTable%5BA%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2670)  
```
proc hasKey[A](t: CountTableRef[A]; key: A): bool
```
  Returns true if `key` is in the table `t`.

 See also:

 * [contains proc](#contains,CountTableRef%5BA%5D,A) for use with the `in` operator
* [[] proc](#%5B%5D,CountTableRef%5BA%5D,A) for retrieving a value of a key
* [getOrDefault proc](#getOrDefault,CountTableRef%5BA%5D,A,int) to return a custom value if the key doesn't exist

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2677)  
```
proc contains[A](t: CountTableRef[A]; key: A): bool
```
  Alias of [hasKey proc](#hasKey,CountTableRef%5BA%5D,A) for use with the `in` operator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2688)  
```
proc getOrDefault[A](t: CountTableRef[A]; key: A; default: int): int
```
  Retrieves the value at `t[key]` if`key` is in `t`. Otherwise, the integer value of `default` is returned.

 See also:

 * [[] proc](#%5B%5D,CountTableRef%5BA%5D,A) for retrieving a value of a key
* [hasKey proc](#hasKey,CountTableRef%5BA%5D,A) for checking if a key is in the table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2693)  
```
proc len[A](t: CountTableRef[A]): int
```
  Returns the number of keys in `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2703)  
```
proc del[A](t: CountTableRef[A]; key: A)
```
  Deletes `key` from table `t`. Does nothing if the key does not exist.

 See also:

 * [pop proc](#pop,CountTableRef%5BA%5D,A,int)
* [clear proc](#clear,CountTableRef%5BA%5D) to empty the whole table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2707)  
```
proc pop[A](t: CountTableRef[A]; key: A; val: var int): bool
```
  Deletes the `key` from the table. Returns `true`, if the `key` existed, and sets `val` to the mapping of the key. Otherwise, returns `false`, and the `val` is unchanged.

 See also:

 * [del proc](#del,CountTableRef%5BA%5D,A)
* [clear proc](#clear,CountTableRef%5BA%5D) to empty the whole table

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2715)  
```
proc clear[A](t: CountTableRef[A])
```
  Resets the table so that it is empty.

 See also:

 * [del proc](#del,CountTableRef%5BA%5D,A)
* [pop proc](#pop,CountTableRef%5BA%5D,A,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2726)  
```
proc sort[A](t: CountTableRef[A]; order = SortOrder.Descending)
```
  Sorts the count table so that, by default, the entry with the highest counter comes first.

 **This is destructive! You must not modify `t` afterwards!**

 You can use the iterators [pairs](#pairs.i,CountTableRef%5BA%5D), [keys](#keys.i,CountTableRef%5BA%5D), and [values](#values.i,CountTableRef%5BA%5D) to iterate over `t` in the sorted order.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2734) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2734)  
```
proc merge[A](s, t: CountTableRef[A])
```
  Merges the second table into the first one. **Example:**

 
```
let
  a = newCountTable("aaabbc")
  b = newCountTable("bcc")
a.merge(b)
doAssert a == newCountTable("aaabbbccc")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2745)  
```
proc `$`[A](t: CountTableRef[A]): string
```
  The `$` operator for count tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2756) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2756)  
```
proc `==`[A](s, t: CountTableRef[A]): bool
```
  The `==` operator for count tables. Returns `true` if either both tables are `nil`, or neither is `nil` and both contain the same keys with the same count. Insert order does not matter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2761) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2761)   Iterators
---------

  
```
iterator pairs[A, B](t: Table[A, B]): (A, B)
```
  Iterates over any `(key, value)` pair in the table `t`.

 See also:

 * [mpairs iterator](#mpairs.i,Table%5BA,B%5D)
* [keys iterator](#keys.i,Table%5BA,B%5D)
* [values iterator](#values.i,Table%5BA,B%5D)

 **Examples:**

 
```
let a = {
  'o': [1, 5, 7, 9],
  'e': [2, 4, 6, 8]
  }.toTable

for k, v in a.pairs:
  echo "key: ", k
  echo "value: ", v

# key: e
# value: [2, 4, 6, 8]
# key: o
# value: [1, 5, 7, 9]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L653)  
```
iterator mpairs[A, B](t: var Table[A, B]): (A, var B)
```
  Iterates over any `(key, value)` pair in the table `t` (must be declared as `var`). The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,Table%5BA,B%5D)
* [mvalues iterator](#mvalues.i,Table%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toTable
for k, v in a.mpairs:
  v.add(v[0] + 10)
doAssert a == {'e': @[2, 4, 6, 8, 12], 'o': @[1, 5, 7, 9, 11]}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L683)  
```
iterator keys[A, B](t: Table[A, B]): A
```
  Iterates over any key in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,Table%5BA,B%5D)
* [values iterator](#values.i,Table%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toTable
for k in a.keys:
  a[k].add(99)
doAssert a == {'e': @[2, 4, 6, 8, 99], 'o': @[1, 5, 7, 9, 99]}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L705) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L705)  
```
iterator values[A, B](t: Table[A, B]): B
```
  Iterates over any value in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,Table%5BA,B%5D)
* [keys iterator](#keys.i,Table%5BA,B%5D)
* [mvalues iterator](#mvalues.i,Table%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toTable
for v in a.values:
  doAssert v.len == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L726)  
```
iterator mvalues[A, B](t: var Table[A, B]): var B
```
  Iterates over any value in the table `t` (must be declared as `var`). The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,Table%5BA,B%5D)
* [values iterator](#values.i,Table%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toTable
for v in a.mvalues:
  v.add(99)
doAssert a == {'e': @[2, 4, 6, 8, 99], 'o': @[1, 5, 7, 9, 99]}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L747)  
```
iterator allValues[A, B](t: Table[A, B]; key: A): B {...}{.deprecated: "Deprecated since v1.4; tables with duplicated keys are deprecated".}
```
   **Deprecated:** Deprecated since v1.4; tables with duplicated keys are 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%5BA,B%5D,A,B)). 

 **Example:**

 
```
import sequtils, algorithm

var a = {'a': 3, 'b': 5}.toTable
for i in 1..3: a.add('z', 10*i)
doAssert toSeq(a.pairs).sorted == @[('a', 3), ('b', 5), ('z', 10), ('z', 20), ('z', 30)]
doAssert sorted(toSeq(a.allValues('z'))) == @[10, 20, 30]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L769)  
```
iterator pairs[A, B](t: TableRef[A, B]): (A, B)
```
  Iterates over any `(key, value)` pair in the table `t`.

 See also:

 * [mpairs iterator](#mpairs.i,TableRef%5BA,B%5D)
* [keys iterator](#keys.i,TableRef%5BA,B%5D)
* [values iterator](#values.i,TableRef%5BA,B%5D)

 **Examples:**

 
```
let a = {
  'o': [1, 5, 7, 9],
  'e': [2, 4, 6, 8]
  }.newTable

for k, v in a.pairs:
  echo "key: ", k
  echo "value: ", v

# key: e
# value: [2, 4, 6, 8]
# key: o
# value: [1, 5, 7, 9]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1097) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1097)  
```
iterator mpairs[A, B](t: TableRef[A, B]): (A, var B)
```
  Iterates over any `(key, value)` pair in the table `t`. The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,TableRef%5BA,B%5D)
* [mvalues iterator](#mvalues.i,TableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newTable
for k, v in a.mpairs:
  v.add(v[0] + 10)
doAssert a == {'e': @[2, 4, 6, 8, 12], 'o': @[1, 5, 7, 9, 11]}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1127)  
```
iterator keys[A, B](t: TableRef[A, B]): A
```
  Iterates over any key in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,TableRef%5BA,B%5D)
* [values iterator](#values.i,TableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newTable
for k in a.keys:
  a[k].add(99)
doAssert a == {'e': @[2, 4, 6, 8, 99], 'o': @[1, 5, 7, 9, 99]}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1149)  
```
iterator values[A, B](t: TableRef[A, B]): B
```
  Iterates over any value in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,TableRef%5BA,B%5D)
* [keys iterator](#keys.i,TableRef%5BA,B%5D)
* [mvalues iterator](#mvalues.i,TableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newTable
for v in a.values:
  doAssert v.len == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1170)  
```
iterator mvalues[A, B](t: TableRef[A, B]): var B
```
  Iterates over any value in the table `t`. The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,TableRef%5BA,B%5D)
* [values iterator](#values.i,TableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newTable
for v in a.mvalues:
  v.add(99)
doAssert a == {'e': @[2, 4, 6, 8, 99], 'o': @[1, 5, 7, 9, 99]}.newTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1191)  
```
iterator pairs[A, B](t: OrderedTable[A, B]): (A, B)
```
  Iterates over any `(key, value)` pair in the table `t` in insertion order.

 See also:

 * [mpairs iterator](#mpairs.i,OrderedTable%5BA,B%5D)
* [keys iterator](#keys.i,OrderedTable%5BA,B%5D)
* [values iterator](#values.i,OrderedTable%5BA,B%5D)

 **Examples:**

 
```
let a = {
  'o': [1, 5, 7, 9],
  'e': [2, 4, 6, 8]
  }.toOrderedTable

for k, v in a.pairs:
  echo "key: ", k
  echo "value: ", v

# key: o
# value: [1, 5, 7, 9]
# key: e
# value: [2, 4, 6, 8]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1672)  
```
iterator mpairs[A, B](t: var OrderedTable[A, B]): (A, var B)
```
  Iterates over any `(key, value)` pair in the table `t` (must be declared as `var`) in insertion order. The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,OrderedTable%5BA,B%5D)
* [mvalues iterator](#mvalues.i,OrderedTable%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toOrderedTable
for k, v in a.mpairs:
  v.add(v[0] + 10)
doAssert a == {'o': @[1, 5, 7, 9, 11],
               'e': @[2, 4, 6, 8, 12]}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1703)  
```
iterator keys[A, B](t: OrderedTable[A, B]): A
```
  Iterates over any key in the table `t` in insertion order.

 See also:

 * [pairs iterator](#pairs.i,OrderedTable%5BA,B%5D)
* [values iterator](#values.i,OrderedTable%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toOrderedTable
for k in a.keys:
  a[k].add(99)
doAssert a == {'o': @[1, 5, 7, 9, 99],
               'e': @[2, 4, 6, 8, 99]}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1725) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1725)  
```
iterator values[A, B](t: OrderedTable[A, B]): B
```
  Iterates over any value in the table `t` in insertion order.

 See also:

 * [pairs iterator](#pairs.i,OrderedTable%5BA,B%5D)
* [keys iterator](#keys.i,OrderedTable%5BA,B%5D)
* [mvalues iterator](#mvalues.i,OrderedTable%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toOrderedTable
for v in a.values:
  doAssert v.len == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1746)  
```
iterator mvalues[A, B](t: var OrderedTable[A, B]): var B
```
  Iterates over any value in the table `t` (must be declared as `var`) in insertion order. The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,OrderedTable%5BA,B%5D)
* [values iterator](#values.i,OrderedTable%5BA,B%5D)

 **Example:**

 
```
var a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.toOrderedTable
for v in a.mvalues:
  v.add(99)
doAssert a == {'o': @[1, 5, 7, 9, 99],
               'e': @[2, 4, 6, 8, 99]}.toOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L1766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L1766)  
```
iterator pairs[A, B](t: OrderedTableRef[A, B]): (A, B)
```
  Iterates over any `(key, value)` pair in the table `t` in insertion order.

 See also:

 * [mpairs iterator](#mpairs.i,OrderedTableRef%5BA,B%5D)
* [keys iterator](#keys.i,OrderedTableRef%5BA,B%5D)
* [values iterator](#values.i,OrderedTableRef%5BA,B%5D)

 **Examples:**

 
```
let a = {
  'o': [1, 5, 7, 9],
  'e': [2, 4, 6, 8]
  }.newOrderedTable

for k, v in a.pairs:
  echo "key: ", k
  echo "value: ", v

# key: o
# value: [1, 5, 7, 9]
# key: e
# value: [2, 4, 6, 8]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2080) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2080)  
```
iterator mpairs[A, B](t: OrderedTableRef[A, B]): (A, var B)
```
  Iterates over any `(key, value)` pair in the table `t` in insertion order. The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,OrderedTableRef%5BA,B%5D)
* [mvalues iterator](#mvalues.i,OrderedTableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newOrderedTable
for k, v in a.mpairs:
  v.add(v[0] + 10)
doAssert a == {'o': @[1, 5, 7, 9, 11],
               'e': @[2, 4, 6, 8, 12]}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2111)  
```
iterator keys[A, B](t: OrderedTableRef[A, B]): A
```
  Iterates over any key in the table `t` in insertion order.

 See also:

 * [pairs iterator](#pairs.i,OrderedTableRef%5BA,B%5D)
* [values iterator](#values.i,OrderedTableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newOrderedTable
for k in a.keys:
  a[k].add(99)
doAssert a == {'o': @[1, 5, 7, 9, 99], 'e': @[2, 4, 6, 8,
    99]}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2133)  
```
iterator values[A, B](t: OrderedTableRef[A, B]): B
```
  Iterates over any value in the table `t` in insertion order.

 See also:

 * [pairs iterator](#pairs.i,OrderedTableRef%5BA,B%5D)
* [keys iterator](#keys.i,OrderedTableRef%5BA,B%5D)
* [mvalues iterator](#mvalues.i,OrderedTableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newOrderedTable
for v in a.values:
  doAssert v.len == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2154)  
```
iterator mvalues[A, B](t: OrderedTableRef[A, B]): var B
```
  Iterates over any value in the table `t` in insertion order. The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,OrderedTableRef%5BA,B%5D)
* [values iterator](#values.i,OrderedTableRef%5BA,B%5D)

 **Example:**

 
```
let a = {
  'o': @[1, 5, 7, 9],
  'e': @[2, 4, 6, 8]
  }.newOrderedTable
for v in a.mvalues:
  v.add(99)
doAssert a == {'o': @[1, 5, 7, 9, 99],
               'e': @[2, 4, 6, 8, 99]}.newOrderedTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2174)  
```
iterator pairs[A](t: CountTable[A]): (A, int)
```
  Iterates over any `(key, value)` pair in the table `t`.

 See also:

 * [mpairs iterator](#mpairs.i,CountTable%5BA%5D)
* [keys iterator](#keys.i,CountTable%5BA%5D)
* [values iterator](#values.i,CountTable%5BA%5D)

 **Examples:**

 
```
let a = toCountTable("abracadabra")

for k, v in pairs(a):
  echo "key: ", k
  echo "value: ", v

# key: a
# value: 5
# key: b
# value: 2
# key: c
# value: 1
# key: d
# value: 1
# key: r
# value: 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2494)  
```
iterator mpairs[A](t: var CountTable[A]): (A, var int)
```
  Iterates over any `(key, value)` pair in the table `t` (must be declared as `var`). The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,CountTable%5BA%5D)
* [mvalues iterator](#mvalues.i,CountTable%5BA%5D)

 **Example:**

 
```
var a = toCountTable("abracadabra")
for k, v in mpairs(a):
  v = 2
doAssert a == toCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2527)  
```
iterator keys[A](t: CountTable[A]): A
```
  Iterates over any key in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,CountTable%5BA%5D)
* [values iterator](#values.i,CountTable%5BA%5D)

 **Example:**

 
```
var a = toCountTable("abracadabra")
for k in keys(a):
  a[k] = 2
doAssert a == toCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2546)  
```
iterator values[A](t: CountTable[A]): int
```
  Iterates over any value in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,CountTable%5BA%5D)
* [keys iterator](#keys.i,CountTable%5BA%5D)
* [mvalues iterator](#mvalues.i,CountTable%5BA%5D)

 **Example:**

 
```
let a = toCountTable("abracadabra")
for v in values(a):
  assert v < 10
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2564)  
```
iterator mvalues[A](t: var CountTable[A]): var int
```
  Iterates over any value in the table `t` (must be declared as `var`). The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,CountTable%5BA%5D)
* [values iterator](#values.i,CountTable%5BA%5D)

 **Example:**

 
```
var a = toCountTable("abracadabra")
for v in mvalues(a):
  v = 2
doAssert a == toCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2582)  
```
iterator pairs[A](t: CountTableRef[A]): (A, int)
```
  Iterates over any `(key, value)` pair in the table `t`.

 See also:

 * [mpairs iterator](#mpairs.i,CountTableRef%5BA%5D)
* [keys iterator](#keys.i,CountTableRef%5BA%5D)
* [values iterator](#values.i,CountTableRef%5BA%5D)

 **Examples:**

 
```
let a = newCountTable("abracadabra")

for k, v in pairs(a):
  echo "key: ", k
  echo "value: ", v

# key: a
# value: 5
# key: b
# value: 2
# key: c
# value: 1
# key: d
# value: 1
# key: r
# value: 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2770) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2770)  
```
iterator mpairs[A](t: CountTableRef[A]): (A, var int)
```
  Iterates over any `(key, value)` pair in the table `t`. The values can be modified.

 See also:

 * [pairs iterator](#pairs.i,CountTableRef%5BA%5D)
* [mvalues iterator](#mvalues.i,CountTableRef%5BA%5D)

 **Example:**

 
```
let a = newCountTable("abracadabra")
for k, v in mpairs(a):
  v = 2
doAssert a == newCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2803) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2803)  
```
iterator keys[A](t: CountTableRef[A]): A
```
  Iterates over any key in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,CountTable%5BA%5D)
* [values iterator](#values.i,CountTable%5BA%5D)

 **Example:**

 
```
let a = newCountTable("abracadabra")
for k in keys(a):
  a[k] = 2
doAssert a == newCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2822)  
```
iterator values[A](t: CountTableRef[A]): int
```
  Iterates over any value in the table `t`.

 See also:

 * [pairs iterator](#pairs.i,CountTableRef%5BA%5D)
* [keys iterator](#keys.i,CountTableRef%5BA%5D)
* [mvalues iterator](#mvalues.i,CountTableRef%5BA%5D)

 **Example:**

 
```
let a = newCountTable("abracadabra")
for v in values(a):
  assert v < 10
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2840) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2840)  
```
iterator mvalues[A](t: CountTableRef[A]): var int
```
  Iterates over any value in the table `t`. The values can be modified.

 See also:

 * [mpairs iterator](#mpairs.i,CountTableRef%5BA%5D)
* [values iterator](#values.i,CountTableRef%5BA%5D)

 **Example:**

 
```
var a = newCountTable("abracadabra")
for v in mvalues(a):
  v = 2
doAssert a == newCountTable("aabbccddrr")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L2858) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L2858)   Templates
---------

  
```
template withValue[A; B](t: var Table[A, B]; key: A; value, body: untyped)
```
  Retrieves the value at `t[key]`.

 `value` can be modified in the scope of the `withValue` call.

 
```
sharedTable.withValue(key, value) do:
  # block is executed only if ``key`` in ``t``
  value.name = "username"
  value.uid = 1000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L606)  
```
template withValue[A; B](t: var Table[A, B]; key: A;
                         value, body1, body2: untyped)
```
  Retrieves the value at `t[key]`.

 `value` can be modified in the scope of the `withValue` call.

 
```
table.withValue(key, value) do:
  # block is executed only if ``key`` in ``t``
  value.name = "username"
  value.uid = 1000
do:
  # block is executed when ``key`` not in ``t``
  raise newException(KeyError, "Key not found")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/tables.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/tables.nim#L626)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/tables.html>

cstrutils
=========

 This module supports helper routines for working with `cstring` without having to convert `cstring` to `string` in order to save allocations.

 Procs
-----

  
```
proc startsWith(s, prefix: cstring): bool {...}{.noSideEffect, gcsafe,
    extern: "csuStartsWith", raises: [], tags: [].}
```
  Returns true if `s` starts with `prefix`.

 If `prefix == ""` true is returned.

 JS backend uses native `String.prototype.startsWith`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cstrutils.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cstrutils.nim#L32)  
```
proc endsWith(s, suffix: cstring): bool {...}{.noSideEffect, gcsafe,
    extern: "csuEndsWith", raises: [], tags: [].}
```
  Returns true if `s` ends with `suffix`.

 If `suffix == ""` true is returned.

 JS backend uses native `String.prototype.endsWith`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cstrutils.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cstrutils.nim#L45)  
```
proc cmpIgnoreStyle(a, b: cstring): int {...}{.noSideEffect, gcsafe,
    extern: "csuCmpIgnoreStyle", raises: [], tags: [].}
```
  Semantically the same as `cmp(normalize($a), normalize($b))`. It is just optimized to not allocate temporary strings. This should NOT be used to compare Nim identifier names. use `macros.eqIdent` for that. Returns:0 if a == b  
< 0 if a < b  
> 0 if a > b  



Not supported for JS backend, use [strutils.cmpIgnoreStyle](strutils#cmpIgnoreStyle%2Cstring%2Cstring) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cstrutils.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cstrutils.nim#L60)  
```
proc cmpIgnoreCase(a, b: cstring): int {...}{.noSideEffect, gcsafe,
    extern: "csuCmpIgnoreCase", raises: [], tags: [].}
```
  Compares two strings in a case insensitive manner. Returns:0 if a == b  
< 0 if a < b  
> 0 if a > b  



Not supported for JS backend, use [strutils.cmpIgnoreCase](strutils#cmpIgnoreCase%2Cstring%2Cstring) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cstrutils.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cstrutils.nim#L85)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/cstrutils.html>

editdistance
============

 This module implements an algorithm to compute the edit distance between two Unicode strings.

 Imports
-------

  <unicode>  Procs
-----

  
```
proc editDistance(a, b: string): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns the **unicode-rune** edit distance between `a` and `b`.

 This uses the Levenshtein distance algorithm with only a linear memory overhead.

 **Example:**

 
```
static: doAssert editdistance("Kitten", "Bitten") == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/editdistance.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/editdistance.nim#L15)  
```
proc editDistanceAscii(a, b: string): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns the edit distance between `a` and `b`.

 This uses the Levenshtein distance algorithm with only a linear memory overhead.

 **Example:**

 
```
static: doAssert editDistanceAscii("Kitten", "Bitten") == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/editdistance.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/editdistance.nim#L180)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/editdistance.html>

encodings
=========

 Converts between different character encodings. On UNIX, this uses the iconv library, on Windows the Windows API.

 Imports
-------

  <os>  Types
-----

  
```
EncodingConverter = ptr ConverterObj
```
  can convert between two character sets [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L18)  
```
EncodingError = object of ValueError
```
  exception that is raised for encoding errors [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L27)   Procs
-----

  
```
proc getCurrentEncoding(uiApp = false): string {...}{.raises: [], tags: [].}
```
  retrieves the current encoding. On Unix, always "UTF-8" is returned. The `uiApp` parameter is Windows specific. If true, the UI's code-page is returned, if false, the Console's code-page is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L297)  
```
proc open(destEncoding = "UTF-8"; srcEncoding = "CP1252"): EncodingConverter {...}{.
    raises: [EncodingError], tags: [].}
```
  opens a converter that can convert from `srcEncoding` to `destEncoding`. Raises `IOError` if it cannot fulfill the request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L306)  
```
proc close(c: EncodingConverter) {...}{.raises: [], tags: [].}
```
  frees the resources the converter `c` holds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L325)  
```
proc convert(c: EncodingConverter; s: string): string {...}{.raises: [OSError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L426)  
```
proc convert(s: string; destEncoding = "UTF-8"; srcEncoding = "CP1252"): string {...}{.
    raises: [EncodingError, OSError], tags: [].}
```
  converts `s` to `destEncoding`. It assumed that `s` is in `srcEncoding`. This opens a converter, uses it and closes it again and is thus more convenient but also likely less efficient than re-using a converter. utf-16BE, utf-32 conversions not supported on windows [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/encodings.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/encodings.nim#L465)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/encodings.html>

parseutils
==========


This module contains helpers for parsing tokens, numbers, integers, floats, identifiers, etc.

 To unpack raw bytes look at the <streams> module.

 
```
let logs = @["2019-01-10: OK_", "2019-01-11: FAIL_", "2019-01: aaaa"]
var outp: seq[string]

for log in logs:
  var res: string
  if parseUntil(log, res, ':') == 10: # YYYY-MM-DD == 10
    outp.add(res & " - " & captureBetween(log, ' ', '_'))
doAssert outp == @["2019-01-10 - OK", "2019-01-11 - FAIL"]
```


```
from strutils import Digits, parseInt

let
  input1 = "2019 school start"
  input2 = "3 years back"
  startYear = input1[0 .. skipWhile(input1, Digits)-1] # 2019
  yearsBack = input2[0 .. skipWhile(input2, Digits)-1] # 3
  examYear = parseInt(startYear) + parseInt(yearsBack)
doAssert "Examination is in " & $examYear == "Examination is in 2022"
```

**See also:**

 * [strutils module](strutils) for combined and identical parsing proc's
* [json module](json) for a JSON parser
* [parsecfg module](parsecfg) for a configuration file parser
* [parsecsv module](parsecsv) for a simple CSV (comma separated value) parser
* [parseopt module](parseopt) for a command line parser
* [parsexml module](parsexml) for a XML / HTML parser
* [other parsers](lib#pure-libraries-parsers) for other parsers

 Types
-----

  
```
InterpolatedKind = enum
  ikStr,                    ## ``str`` part of the interpolated string
  ikDollar,                 ## escaped ``$`` part of the interpolated string
  ikVar,                    ## ``var`` part of the interpolated string
  ikExpr                     ## ``expr`` part of the interpolated string
```
  Describes for `interpolatedFragments` which part of the interpolated string is yielded; for example in "str$$$var${expr}" [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L586)   Procs
-----

  
```
proc parseBin[T: SomeInteger](s: string; number: var T; start = 0; maxLen = 0): int {...}{.
    noSideEffect.}
```
  Parses a binary number and stores its value in `number`.

 Returns the number of the parsed characters or 0 in case of an error. If error, the value of `number` is not changed.

 If `maxLen == 0`, the parsing continues until the first non-bin character or to the end of the string. Otherwise, no more than `maxLen` characters are parsed starting from the `start` position.

 It does not check for overflow. If the value represented by the string is too big to fit into `number`, only the value of last fitting characters will be stored in `number` without producing an error.

 **Example:**

 
```
var num: int
doAssert parseBin("0100_1110_0110_1001_1110_1101", num) == 29
doAssert num == 5138925
doAssert parseBin("3", num) == 0
var num8: int8
doAssert parseBin("0b_0100_1110_0110_1001_1110_1101", num8) == 32
doAssert num8 == 0b1110_1101'i8
doAssert parseBin("0b_0100_1110_0110_1001_1110_1101", num8, 3, 9) == 9
doAssert num8 == 0b0100_1110'i8
var num8u: uint8
doAssert parseBin("0b_0100_1110_0110_1001_1110_1101", num8u) == 32
doAssert num8u == 237
var num64: int64
doAssert parseBin("0100111001101001111011010100111001101001", num64) == 40
doAssert num64 == 336784608873
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L62)  
```
proc parseOct[T: SomeInteger](s: string; number: var T; start = 0; maxLen = 0): int {...}{.
    noSideEffect.}
```
  Parses an octal number and stores its value in `number`.

 Returns the number of the parsed characters or 0 in case of an error. If error, the value of `number` is not changed.

 If `maxLen == 0`, the parsing continues until the first non-oct character or to the end of the string. Otherwise, no more than `maxLen` characters are parsed starting from the `start` position.

 It does not check for overflow. If the value represented by the string is too big to fit into `number`, only the value of last fitting characters will be stored in `number` without producing an error.

 **Example:**

 
```
var num: int
doAssert parseOct("0o23464755", num) == 10
doAssert num == 5138925
doAssert parseOct("8", num) == 0
var num8: int8
doAssert parseOct("0o_1464_755", num8) == 11
doAssert num8 == -19
doAssert parseOct("0o_1464_755", num8, 3, 3) == 3
doAssert num8 == 102
var num8u: uint8
doAssert parseOct("1464755", num8u) == 7
doAssert num8u == 237
var num64: int64
doAssert parseOct("2346475523464755", num64) == 16
doAssert num64 == 86216859871725
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L109)  
```
proc parseHex[T: SomeInteger](s: string; number: var T; start = 0; maxLen = 0): int {...}{.
    noSideEffect.}
```
  Parses a hexadecimal number and stores its value in `number`.

 Returns the number of the parsed characters or 0 in case of an error. If error, the value of `number` is not changed.

 If `maxLen == 0`, the parsing continues until the first non-hex character or to the end of the string. Otherwise, no more than `maxLen` characters are parsed starting from the `start` position.

 It does not check for overflow. If the value represented by the string is too big to fit into `number`, only the value of last fitting characters will be stored in `number` without producing an error.

 **Example:**

 
```
var num: int
doAssert parseHex("4E_69_ED", num) == 8
doAssert num == 5138925
doAssert parseHex("X", num) == 0
doAssert parseHex("#ABC", num) == 4
var num8: int8
doAssert parseHex("0x_4E_69_ED", num8) == 11
doAssert num8 == 0xED'i8
doAssert parseHex("0x_4E_69_ED", num8, 3, 2) == 2
doAssert num8 == 0x4E'i8
var num8u: uint8
doAssert parseHex("0x_4E_69_ED", num8u) == 11
doAssert num8u == 237
var num64: int64
doAssert parseHex("4E69ED4E69ED", num64) == 12
doAssert num64 == 86216859871725
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L156)  
```
proc parseIdent(s: string; ident: var string; start = 0): int {...}{.raises: [],
    tags: [].}
```
  Parses an identifier and stores it in `ident`. Returns the number of the parsed characters or 0 in case of an error. **Example:**

 
```
var res: string
doAssert parseIdent("Hello World", res, 0) == 5
doAssert res == "Hello"
doAssert parseIdent("Hello World", res, 1) == 4
doAssert res == "ello"
doAssert parseIdent("Hello World", res, 6) == 5
doAssert res == "World"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L211)  
```
proc parseIdent(s: string; start = 0): string {...}{.raises: [], tags: [].}
```
  Parses an identifier and returns it or an empty string in case of an error. **Example:**

 
```
doAssert parseIdent("Hello World", 0) == "Hello"
doAssert parseIdent("Hello World", 1) == "ello"
doAssert parseIdent("Hello World", 5) == ""
doAssert parseIdent("Hello World", 6) == "World"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L229)  
```
proc skipWhitespace(s: string; start = 0): int {...}{.inline, raises: [], tags: [].}
```
  Skips the whitespace starting at `s[start]`. Returns the number of skipped characters. **Example:**

 
```
doAssert skipWhitespace("Hello World", 0) == 0
doAssert skipWhitespace(" Hello World", 0) == 1
doAssert skipWhitespace("Hello World", 5) == 1
doAssert skipWhitespace("Hello  World", 5) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L244)  
```
proc skip(s, token: string; start = 0): int {...}{.inline, raises: [], tags: [].}
```
  Skips the `token` starting at `s[start]`. Returns the length of `token` or 0 if there was no `token` at `s[start]`. **Example:**

 
```
doAssert skip("2019-01-22", "2019", 0) == 4
doAssert skip("2019-01-22", "19", 0) == 0
doAssert skip("2019-01-22", "19", 2) == 2
doAssert skip("CAPlow", "CAP", 0) == 3
doAssert skip("CAPlow", "cap", 0) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L255)  
```
proc skipIgnoreCase(s, token: string; start = 0): int {...}{.raises: [], tags: [].}
```
  Same as `skip` but case is ignored for token matching. **Example:**

 
```
doAssert skipIgnoreCase("CAPlow", "CAP", 0) == 3
doAssert skipIgnoreCase("CAPlow", "cap", 0) == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L270)  
```
proc skipUntil(s: string; until: set[char]; start = 0): int {...}{.inline,
    raises: [], tags: [].}
```
  Skips all characters until one char from the set `until` is found or the end is reached. Returns number of characters skipped. **Example:**

 
```
doAssert skipUntil("Hello World", {'W', 'e'}, 0) == 1
doAssert skipUntil("Hello World", {'W'}, 0) == 6
doAssert skipUntil("Hello World", {'W', 'd'}, 0) == 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L280)  
```
proc skipUntil(s: string; until: char; start = 0): int {...}{.inline, raises: [],
    tags: [].}
```
  Skips all characters until the char `until` is found or the end is reached. Returns number of characters skipped. **Example:**

 
```
doAssert skipUntil("Hello World", 'o', 0) == 4
doAssert skipUntil("Hello World", 'o', 4) == 0
doAssert skipUntil("Hello World", 'W', 0) == 6
doAssert skipUntil("Hello World", 'w', 0) == 11
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L291)  
```
proc skipWhile(s: string; toSkip: set[char]; start = 0): int {...}{.inline,
    raises: [], tags: [].}
```
  Skips all characters while one char from the set `token` is found. Returns number of characters skipped. **Example:**

 
```
doAssert skipWhile("Hello World", {'H', 'e'}) == 2
doAssert skipWhile("Hello World", {'e'}) == 0
doAssert skipWhile("Hello World", {'W', 'o', 'r'}, 6) == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L303)  
```
proc parseUntil(s: string; token: var string; until: set[char]; start = 0): int {...}{.
    inline, raises: [], tags: [].}
```
  Parses a token and stores it in `token`. Returns the number of the parsed characters or 0 in case of an error. A token consists of the characters notin `until`. **Example:**

 
```
var myToken: string
doAssert parseUntil("Hello World", myToken, {'W', 'o', 'r'}) == 4
doAssert myToken == "Hell"
doAssert parseUntil("Hello World", myToken, {'W', 'r'}) == 6
doAssert myToken == "Hello "
doAssert parseUntil("Hello World", myToken, {'W', 'r'}, 3) == 3
doAssert myToken == "lo "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L317)  
```
proc parseUntil(s: string; token: var string; until: char; start = 0): int {...}{.
    inline, raises: [], tags: [].}
```
  Parses a token and stores it in `token`. Returns the number of the parsed characters or 0 in case of an error. A token consists of any character that is not the `until` character. **Example:**

 
```
var myToken: string
doAssert parseUntil("Hello World", myToken, 'W') == 6
doAssert myToken == "Hello "
doAssert parseUntil("Hello World", myToken, 'o') == 4
doAssert myToken == "Hell"
doAssert parseUntil("Hello World", myToken, 'o', 2) == 2
doAssert myToken == "ll"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L336)  
```
proc parseUntil(s: string; token: var string; until: string; start = 0): int {...}{.
    inline, raises: [], tags: [].}
```
  Parses a token and stores it in `token`. Returns the number of the parsed characters or 0 in case of an error. A token consists of any character that comes before the `until` token. **Example:**

 
```
var myToken: string
doAssert parseUntil("Hello World", myToken, "Wor") == 6
doAssert myToken == "Hello "
doAssert parseUntil("Hello World", myToken, "Wor", 2) == 4
doAssert myToken == "llo "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L355)  
```
proc parseWhile(s: string; token: var string; validChars: set[char]; start = 0): int {...}{.
    inline, raises: [], tags: [].}
```
  Parses a token and stores it in `token`. Returns the number of the parsed characters or 0 in case of an error. A token consists of the characters in `validChars`. **Example:**

 
```
var myToken: string
doAssert parseWhile("Hello World", myToken, {'W', 'o', 'r'}, 0) == 0
doAssert myToken.len() == 0
doAssert parseWhile("Hello World", myToken, {'W', 'o', 'r'}, 6) == 3
doAssert myToken == "Wor"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L382)  
```
proc captureBetween(s: string; first: char; second = '\x00'; start = 0): string {...}{.
    raises: [], tags: [].}
```
  Finds the first occurrence of `first`, then returns everything from there up to `second` (if `second` is '0', then `first` is used). **Example:**

 
```
doAssert captureBetween("Hello World", 'e') == "llo World"
doAssert captureBetween("Hello World", 'e', 'r') == "llo Wo"
doAssert captureBetween("Hello World", 'l', start = 6) == "d"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L399)  
```
proc parseBiggestInt(s: string; number: var BiggestInt; start = 0): int {...}{.
    gcsafe, extern: "npuParseBiggestInt", noSideEffect, raises: [ValueError],
    tags: [].}
```
  Parses an integer starting at `start` and stores the value into `number`. Result is the number of processed chars or 0 if there is no integer. `ValueError` is raised if the parsed integer is out of the valid range. **Example:**

 
```
var res: BiggestInt
doAssert parseBiggestInt("9223372036854775807", res, 0) == 19
doAssert res == 9223372036854775807
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L445)  
```
proc parseInt(s: string; number: var int; start = 0): int {...}{.gcsafe,
    extern: "npuParseInt", noSideEffect, raises: [ValueError], tags: [].}
```
  Parses an integer starting at `start` and stores the value into `number`. Result is the number of processed chars or 0 if there is no integer. `ValueError` is raised if the parsed integer is out of the valid range. **Example:**

 
```
var res: int
doAssert parseInt("2019", res, 0) == 4
doAssert res == 2019
doAssert parseInt("2019", res, 2) == 2
doAssert res == 19
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L461)  
```
proc parseSaturatedNatural(s: string; b: var int; start = 0): int {...}{.raises: [],
    tags: [].}
```
  Parses a natural number into `b`. This cannot raise an overflow error. `high(int)` is returned for an overflow. The number of processed character is returned. This is usually what you really want to use instead of parseInt. **Example:**

 
```
var res = 0
discard parseSaturatedNatural("848", res)
doAssert res == 848
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L480)  
```
proc parseBiggestUInt(s: string; number: var BiggestUInt; start = 0): int {...}{.
    gcsafe, extern: "npuParseBiggestUInt", noSideEffect, raises: [ValueError],
    tags: [].}
```
  Parses an unsigned integer starting at `start` and stores the value into `number`. `ValueError` is raised if the parsed integer is out of the valid range. **Example:**

 
```
var res: BiggestUInt
doAssert parseBiggestUInt("12", res, 0) == 2
doAssert res == 12
doAssert parseBiggestUInt("1111111111111111111", res, 0) == 19
doAssert res == 1111111111111111111'u64
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L524)  
```
proc parseUInt(s: string; number: var uint; start = 0): int {...}{.gcsafe,
    extern: "npuParseUInt", noSideEffect, raises: [ValueError], tags: [].}
```
  Parses an unsigned integer starting at `start` and stores the value into `number`. `ValueError` is raised if the parsed integer is out of the valid range. **Example:**

 
```
var res: uint
doAssert parseUInt("3450", res) == 4
doAssert res == 3450
doAssert parseUInt("3450", res, 2) == 2
doAssert res == 50
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L542)  
```
proc parseBiggestFloat(s: string; number: var BiggestFloat; start = 0): int {...}{.
    magic: "ParseBiggestFloat", importc: "nimParseBiggestFloat", noSideEffect.}
```
  Parses a float starting at `start` and stores the value into `number`. Result is the number of processed chars or 0 if a parsing error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L561)  
```
proc parseFloat(s: string; number: var float; start = 0): int {...}{.gcsafe,
    extern: "npuParseFloat", noSideEffect, raises: [], tags: [].}
```
  Parses a float starting at `start` and stores the value into `number`. Result is the number of processed chars or 0 if there occurred a parsing error. **Example:**

 
```
var res: float
doAssert parseFloat("32", res, 0) == 2
doAssert res == 32.0
doAssert parseFloat("32.57", res, 0) == 5
doAssert res == 32.57
doAssert parseFloat("32.57", res, 3) == 2
doAssert res == 57.00
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L567)   Iterators
---------

  
```
iterator interpolatedFragments(s: string): tuple[kind: InterpolatedKind,
    value: string] {...}{.raises: [ValueError], tags: [].}
```
  Tokenizes the string `s` into substrings for interpolation purposes. **Example:**

 
```
var outp: seq[tuple[kind: InterpolatedKind, value: string]]
for k, v in interpolatedFragments("  $this is ${an  example}  $$"):
  outp.add (k, v)
doAssert outp == @[(ikStr, "  "),
                   (ikVar, "this"),
                   (ikStr, " is "),
                   (ikExpr, "an  example"),
                   (ikStr, "  "),
                   (ikDollar, "$")]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseutils.nim#L594) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseutils.nim#L594)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parseutils.html>

cpuinfo
=======

 This module implements procs to determine the number of CPUs / cores. 


**Example:**

 
```
block:
  doAssert countProcessors() > 0
```
 Imports
-------

  <posix>  Procs
-----

  
```
proc countProcessors(): int {...}{.gcsafe, extern: "ncpi$1", raises: [], tags: [].}
```
  returns the number of the processors/cores the machine has. Returns 0 if it cannot be detected. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/cpuinfo.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/cpuinfo.nim#L49)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/cpuinfo.html>

endians
=======


This module contains helpers that deal with different byte orders (endian).

 Unstable API.

 Procs
-----

  
```
proc swapEndian64(outp, inp: pointer) {...}{.inline, noSideEffect, raises: [],
                                        tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L58)  
```
proc swapEndian32(outp, inp: pointer) {...}{.inline, noSideEffect, raises: [],
                                        tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L61)  
```
proc swapEndian16(outp, inp: pointer) {...}{.inline, noSideEffect, raises: [],
                                        tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L64)  
```
proc littleEndian64(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L108)  
```
proc littleEndian32(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L109)  
```
proc littleEndian16(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L110)  
```
proc bigEndian64(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L111)  
```
proc bigEndian32(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L112)  
```
proc bigEndian16(outp, inp: pointer) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/endians.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/endians.nim#L113)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/endians.html>

lenientops
==========


This module offers implementations of common binary operations like `+`, `-`, `*`, `/` and comparison operations, which work for mixed float/int operands. All operations convert the integer operand into the type of the float operand. For numerical expressions, the return type is always the type of the float involved in the expression, i.e., there is no auto conversion from float32 to float64.

 Note: In general, auto-converting from int to float loses information, which is why these operators live in a separate module. Use with care.

 Regarding binary comparison, this module only provides unequal operators. The equality operator `==` is omitted, because depending on the use case either casting to float or rounding to int might be preferred, and users should make an explicit choice.

 Procs
-----

  
```
proc `+`[I: SomeInteger; F: SomeFloat](i: I; f: F): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L27)  
```
proc `+`[I: SomeInteger; F: SomeFloat](f: F; i: I): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L29)  
```
proc `-`[I: SomeInteger; F: SomeFloat](i: I; f: F): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L32)  
```
proc `-`[I: SomeInteger; F: SomeFloat](f: F; i: I): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L34)  
```
proc `*`[I: SomeInteger; F: SomeFloat](i: I; f: F): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L37)  
```
proc `*`[I: SomeInteger; F: SomeFloat](f: F; i: I): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L39)  
```
proc `/`[I: SomeInteger; F: SomeFloat](i: I; f: F): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L42)  
```
proc `/`[I: SomeInteger; F: SomeFloat](f: F; i: I): F {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L44)  
```
proc `<`[I: SomeInteger; F: SomeFloat](i: I; f: F): bool {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L47)  
```
proc `<`[I: SomeInteger; F: SomeFloat](f: F; i: I): bool {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L49)  
```
proc `<=`[I: SomeInteger; F: SomeFloat](i: I; f: F): bool {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L51)  
```
proc `<=`[I: SomeInteger; F: SomeFloat](f: F; i: I): bool {...}{.noSideEffect, inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lenientops.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lenientops.nim#L53)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/lenientops.html>

locks
=====

 This module contains Nim's support for locks and condition vars.

 Types
-----

  
```
Lock = SysLock
```
  Nim lock; whether this is re-entrant or not is unspecified! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L25)  
```
Cond = SysCond
```
  Nim condition variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L27)   Procs
-----

  
```
proc initLock(lock: var Lock) {...}{.inline, raises: [], tags: [].}
```
  Initializes the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L31)  
```
proc deinitLock(lock: var Lock) {...}{.inline, raises: [], tags: [].}
```
  Frees the resources associated with the lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L36)  
```
proc tryAcquire(lock: var Lock): bool {...}{.raises: [], tags: [].}
```
  Tries to acquire the given lock. Returns `true` on success. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L40)  
```
proc acquire(lock: var Lock) {...}{.raises: [], tags: [].}
```
  Acquires the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L44)  
```
proc release(lock: var Lock) {...}{.raises: [], tags: [].}
```
  Releases the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L49)  
```
proc initCond(cond: var Cond) {...}{.inline, raises: [], tags: [].}
```
  Initializes the given condition variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L55)  
```
proc deinitCond(cond: var Cond) {...}{.inline, raises: [], tags: [].}
```
  Frees the resources associated with the condition variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L59)  
```
proc wait(cond: var Cond; lock: var Lock) {...}{.inline, raises: [], tags: [].}
```
  waits on the condition variable `cond`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L63)  
```
proc signal(cond: var Cond) {...}{.inline, raises: [], tags: [].}
```
  sends a signal to the condition variable `cond`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L67)   Templates
---------

  
```
template withLock(a: Lock; body: untyped)
```
  Acquires the given lock, executes the statements in body and releases the lock after the statements finish executing. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/locks.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/locks.nim#L71)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/locks.html>

macros
======


This module contains the interface to the compiler's abstract syntax tree (AST). Macros operate on this tree.

 See also:

 * [macros tutorial](https://nim-lang.org/docs/tut3.html)
* [macros section in Nim manual](manual#macros)

 The AST in Nim
--------------


This section describes how the AST is modelled with Nim's type system. The AST consists of nodes (`NimNode`) with a variable number of children. Each node has a field named `kind` which describes what the node contains:

 
```
type
  NimNodeKind = enum     ## kind of a node; only explanatory
    nnkNone,             ## invalid node kind
    nnkEmpty,            ## empty node
    nnkIdent,            ## node contains an identifier
    nnkIntLit,           ## node contains an int literal (example: 10)
    nnkStrLit,           ## node contains a string literal (example: "abc")
    nnkNilLit,           ## node contains a nil literal (example: nil)
    nnkCaseStmt,         ## node represents a case statement
    ...                  ## many more
  
  NimNode = ref NimNodeObj
  NimNodeObj = object
    case kind: NimNodeKind           ## the node's kind
    of nnkNone, nnkEmpty, nnkNilLit:
      discard                        ## node contains no additional fields
    of nnkCharLit..nnkUInt64Lit:
      intVal: BiggestInt             ## the int literal
    of nnkFloatLit..nnkFloat64Lit:
      floatVal: BiggestFloat         ## the float literal
    of nnkStrLit..nnkTripleStrLit, nnkCommentStmt, nnkIdent, nnkSym:
      strVal: string                 ## the string literal
    else:
      sons: seq[NimNode]             ## the node's sons (or children)
```

For the `NimNode` type, the `[]` operator has been overloaded: `n[i]` is `n`'s `i`-th child.

 To specify the AST for the different Nim constructs, the notation `nodekind(son1, son2, ...)` or `nodekind(value)` or `nodekind(field=value)` is used.

 Some child may be missing. A missing child is a node of kind `nnkEmpty`; a child can never be nil.

 Leaf nodes/Atoms
----------------


A leaf of the AST often corresponds to a terminal symbol in the concrete syntax. Note that the default `float` in Nim maps to `float64` such that the default AST for a float is `nnkFloat64Lit` as below.

 

| Nim expression | Corresponding AST |
| --- | --- |
| `42` | `nnkIntLit(intVal = 42)` |
| `42'i8` | `nnkInt8Lit(intVal = 42)` |
| `42'i16` | `nnkInt16Lit(intVal = 42)` |
| `42'i32` | `nnkInt32Lit(intVal = 42)` |
| `42'i64` | `nnkInt64Lit(intVal = 42)` |
| `42'u8` | `nnkUInt8Lit(intVal = 42)` |
| `42'u16` | `nnkUInt16Lit(intVal = 42)` |
| `42'u32` | `nnkUInt32Lit(intVal = 42)` |
| `42'u64` | `nnkUInt64Lit(intVal = 42)` |
| `42.0` | `nnkFloat64Lit(floatVal = 42.0)` |
| `42.0'f32` | `nnkFloat32Lit(floatVal = 42.0)` |
| `42.0'f64` | `nnkFloat64Lit(floatVal = 42.0)` |
| `"abc"` | `nnkStrLit(strVal = "abc")` |
| `r"abc"` | `nnkRStrLit(strVal = "abc")` |
| `"""abc"""` | `nnkTripleStrLit(strVal = "abc")` |
| `' '` | `nnkCharLit(intVal = 32)` |
| `nil` | `nnkNilLit()` |
| `myIdentifier` | `nnkIdent(strVal = "myIdentifier")` |
| `myIdentifier` | after lookup pass: `nnkSym(strVal = "myIdentifier", ...)` |


Identifiers are `nnkIdent` nodes. After the name lookup pass these nodes get transferred into `nnkSym` nodes.

 Calls/expressions
-----------------

 ### Command call


Concrete syntax:

 
```
echo "abc", "xyz"
```

AST:

 
```
nnkCommand(
  nnkIdent("echo"),
  nnkStrLit("abc"),
  nnkStrLit("xyz")
)
```
 ### Call with `()`


Concrete syntax:

 
```
echo("abc", "xyz")
```

AST:

 
```
nnkCall(
  nnkIdent("echo"),
  nnkStrLit("abc"),
  nnkStrLit("xyz")
)
```
 ### Infix operator call


Concrete syntax:

 
```
"abc" & "xyz"
```

AST:

 
```
nnkInfix(
  nnkIdent("&"),
  nnkStrLit("abc"),
  nnkStrLit("xyz")
)
```

Note that with multiple infix operators, the command is parsed by operator precedence.

 Concrete syntax:

 
```
5 + 3 * 4
```

AST:

 
```
nnkInfix(
  nnkIdent("+"),
  nnkIntLit(5),
  nnkInfix(
    nnkIdent("*"),
    nnkIntLit(3),
    nnkIntLit(4)
  )
)
```

As a side note, if you choose to use infix operators in a prefix form, the AST behaves as a [parenthetical function call](#callsslashexpressions-call-with) with `nnkAccQuoted`, as follows:

 Concrete syntax:

 
```
`+`(3, 4)
```

AST:

 
```
nnkCall(
  nnkAccQuoted(
    nnkIdent("+")
  ),
  nnkIntLit(3),
  nnkIntLit(4)
)
```
 ### Prefix operator call


Concrete syntax:

 
```
? "xyz"
```

AST:

 
```
nnkPrefix(
  nnkIdent("?"),
  nnkStrLit("abc")
)
```
 ### Postfix operator call


**Note:** There are no postfix operators in Nim. However, the `nnkPostfix` node is used for the *asterisk export marker* `*`:

 Concrete syntax:

 
```
identifier*
```

AST:

 
```
nnkPostfix(
  nnkIdent("*"),
  nnkIdent("identifier")
)
```
 ### Call with named arguments


Concrete syntax:

 
```
writeLine(file=stdout, "hallo")
```

AST:

 
```
nnkCall(
  nnkIdent("writeLine"),
  nnkExprEqExpr(
    nnkIdent("file"),
    nnkIdent("stdout")
  ),
  nnkStrLit("hallo")
)
```
 ### Call with raw string literal


This is used, for example, in the `bindSym` examples [here](manual#macros-bindsym) and with `re"some regexp"` in the regular expression module.

 Concrete syntax:

 
```
echo"abc"
```

AST:

 
```
nnkCallStrLit(
  nnkIdent("echo"),
  nnkRStrLit("hello")
)
```
 ### Dereference operator `[]`


Concrete syntax:

 
```
x[]
```

AST:

 
```
nnkDerefExpr(nnkIdent("x"))
```
 ### Addr operator


Concrete syntax:

 
```
addr(x)
```

AST:

 
```
nnkAddr(nnkIdent("x"))
```
 ### Cast operator


Concrete syntax:

 
```
cast[T](x)
```

AST:

 
```
nnkCast(nnkIdent("T"), nnkIdent("x"))
```
 ### Object access operator `.`


Concrete syntax:

 
```
x.y
```

AST:

 
```
nnkDotExpr(nnkIdent("x"), nnkIdent("y"))
```

If you use Nim's flexible calling syntax (as in `x.len()`), the result is the same as above but wrapped in an `nnkCall`.

 ### Array access operator `[]`


Concrete syntax:

 
```
x[y]
```

AST:

 
```
nnkBracketExpr(nnkIdent("x"), nnkIdent("y"))
```
 ### Parentheses


Parentheses for affecting operator precedence or tuple construction are built with the `nnkPar` node.

 Concrete syntax:

 
```
(1, 2, (3))
```

AST:

 
```
nnkPar(nnkIntLit(1), nnkIntLit(2), nnkPar(nnkIntLit(3)))
```
 ### Curly braces


Curly braces are used as the set constructor.

 Concrete syntax:

 
```
{1, 2, 3}
```

AST:

 
```
nnkCurly(nnkIntLit(1), nnkIntLit(2), nnkIntLit(3))
```

When used as a table constructor, the syntax is different.

 Concrete syntax:

 
```
{a: 3, b: 5}
```

AST:

 
```
nnkTableConstr(
  nnkExprColonExpr(nnkIdent("a"), nnkIntLit(3)),
  nnkExprColonExpr(nnkIdent("b"), nnkIntLit(5))
)
```
 ### Brackets


Brackets are used as the array constructor.

 Concrete syntax:

 
```
[1, 2, 3]
```

AST:

 
```
nnkBracket(nnkIntLit(1), nnkIntLit(2), nnkIntLit(3))
```
 ### Ranges


Ranges occur in set constructors, case statement branches, or array slices. Internally, the node kind `nnkRange` is used, but when constructing the AST, construction with `..` as an infix operator should be used instead.

 Concrete syntax:

 
```
1..3
```

AST:

 
```
nnkInfix(
  nnkIdent(".."),
  nnkIntLit(1),
  nnkIntLit(3)
)
```

Example code:

 
```
macro genRepeatEcho(): stmt =
  result = newNimNode(nnkStmtList)
  
  var forStmt = newNimNode(nnkForStmt) # generate a for statement
  forStmt.add(ident("i")) # use the variable `i` for iteration
  
  var rangeDef = newNimNode(nnkInfix).add(
    ident("..")).add(
    newIntLitNode(3),newIntLitNode(5)) # iterate over the range 3..5
  
  forStmt.add(rangeDef)
  forStmt.add(newCall(ident("echo"), newIntLitNode(3))) # meat of the loop
  result.add(forStmt)

genRepeatEcho() # gives:
                # 3
                # 3
                # 3
```
 ### If expression


The representation of the `if` expression is subtle, but easy to traverse.

 Concrete syntax:

 
```
if cond1: expr1 elif cond2: expr2 else: expr3
```

AST:

 
```
nnkIfExpr(
  nnkElifExpr(cond1, expr1),
  nnkElifExpr(cond2, expr2),
  nnkElseExpr(expr3)
)
```
 ### Documentation Comments


Double-hash (`##`) comments in the code actually have their own format, using `strVal` to get and set the comment text. Single-hash (`#`) comments are ignored.

 Concrete syntax:

 
```
## This is a comment
## This is part of the first comment
stmt1
## Yet another
```

AST:

 
```
nnkCommentStmt() # only appears once for the first two lines!
stmt1
nnkCommentStmt() # another nnkCommentStmt because there is another comment
                 # (separate from the first)
```
 ### Pragmas


One of Nim's cool features is pragmas, which allow fine-tuning of various aspects of the language. They come in all types, such as adorning procs and objects, but the standalone `emit` pragma shows the basics with the AST.

 Concrete syntax:

 
```
{.emit: "#include <stdio.h>".}
```

AST:

 
```
nnkPragma(
  nnkExprColonExpr(
    nnkIdent("emit"),
    nnkStrLit("#include <stdio.h>") # the "argument"
  )
)
```

As many `nnkIdent` appear as there are pragmas between `{..}`. Note that the declaration of new pragmas is essentially the same:

 Concrete syntax:

 
```
{.pragma: cdeclRename, cdecl.}
```

AST:

 
```
nnkPragma(
  nnkExprColonExpr(
    nnkIdent("pragma"), # this is always first when declaring a new pragma
    nnkIdent("cdeclRename") # the name of the pragma
  ),
  nnkIdent("cdecl")
)
```
 Statements
----------

 ### If statement


The representation of the if statement is subtle, but easy to traverse. If there is no `else` branch, no `nnkElse` child exists.

 Concrete syntax:

 
```
if cond1:
  stmt1
elif cond2:
  stmt2
elif cond3:
  stmt3
else:
  stmt4
```

AST:

 
```
nnkIfStmt(
  nnkElifBranch(cond1, stmt1),
  nnkElifBranch(cond2, stmt2),
  nnkElifBranch(cond3, stmt3),
  nnkElse(stmt4)
)
```
 ### When statement


Like the `if` statement, but the root has the kind `nnkWhenStmt`.

 ### Assignment


Concrete syntax:

 
```
x = 42
```

AST:

 
```
nnkAsgn(nnkIdent("x"), nnkIntLit(42))
```

This is not the syntax for assignment when combined with `var`, `let`, or `const`.

 ### Statement list


Concrete syntax:

 
```
stmt1
stmt2
stmt3
```

AST:

 
```
nnkStmtList(stmt1, stmt2, stmt3)
```
 ### Case statement


Concrete syntax:

 
```
case expr1
of expr2, expr3..expr4:
  stmt1
of expr5:
  stmt2
elif cond1:
  stmt3
else:
  stmt4
```

AST:

 
```
nnkCaseStmt(
  expr1,
  nnkOfBranch(expr2, nnkRange(expr3, expr4), stmt1),
  nnkOfBranch(expr5, stmt2),
  nnkElifBranch(cond1, stmt3),
  nnkElse(stmt4)
)
```

The `nnkElifBranch` and `nnkElse` parts may be missing.

 ### While statement


Concrete syntax:

 
```
while expr1:
  stmt1
```

AST:

 
```
nnkWhileStmt(expr1, stmt1)
```
 ### For statement


Concrete syntax:

 
```
for ident1, ident2 in expr1:
  stmt1
```

AST:

 
```
nnkForStmt(ident1, ident2, expr1, stmt1)
```
 ### Try statement


Concrete syntax:

 
```
try:
  stmt1
except e1, e2:
  stmt2
except e3:
  stmt3
except:
  stmt4
finally:
  stmt5
```

AST:

 
```
nnkTryStmt(
  stmt1,
  nnkExceptBranch(e1, e2, stmt2),
  nnkExceptBranch(e3, stmt3),
  nnkExceptBranch(stmt4),
  nnkFinally(stmt5)
)
```
 ### Return statement


Concrete syntax:

 
```
return expr1
```

AST:

 
```
nnkReturnStmt(expr1)
```
 ### Yield statement


Like `return`, but with `nnkYieldStmt` kind.

 
```
nnkYieldStmt(expr1)
```
 ### Discard statement


Like `return`, but with `nnkDiscardStmt` kind.

 
```
nnkDiscardStmt(expr1)
```
 ### Continue statement


Concrete syntax:

 
```
continue
```

AST:

 
```
nnkContinueStmt()
```
 ### Break statement


Concrete syntax:

 
```
break otherLocation
```

AST:

 
```
nnkBreakStmt(nnkIdent("otherLocation"))
```

If `break` is used without a jump-to location, `nnkEmpty` replaces `nnkIdent`.

 ### Block statement


Concrete syntax:

 
```
block name:
```

AST:

 
```
nnkBlockStmt(nnkIdent("name"), nnkStmtList(...))
```

A `block` doesn't need an name, in which case `nnkEmpty` is used.

 ### Asm statement


Concrete syntax:

 
```
asm """
  some asm
"""
```

AST:

 
```
nnkAsmStmt(
  nnkEmpty(), # for pragmas
  nnkTripleStrLit("some asm"),
)
```
 ### Import section


Nim's `import` statement actually takes different variations depending on what keywords are present. Let's start with the simplest form.

 Concrete syntax:

 
```
import math
```

AST:

 
```
nnkImportStmt(nnkIdent("math"))
```

With `except`, we get `nnkImportExceptStmt`.

 Concrete syntax:

 
```
import math except pow
```

AST:

 
```
nnkImportExceptStmt(nnkIdent("math"),nnkIdent("pow"))
```

Note that `import math as m` does not use a different node; rather, we use `nnkImportStmt` with `as` as an infix operator.

 Concrete syntax:

 
```
import strutils as su
```

AST:

 
```
nnkImportStmt(
  nnkInfix(
    nnkIdent("as"),
    nnkIdent("strutils"),
    nnkIdent("su")
  )
)
```
 ### From statement


If we use `from ... import`, the result is different, too.

 Concrete syntax:

 
```
from math import pow
```

AST:

 
```
nnkFromStmt(nnkIdent("math"), nnkIdent("pow"))
```

Using `from math as m import pow` works identically to the `as` modifier with the `import` statement, but wrapped in `nnkFromStmt`.

 ### Export statement


When you are making an imported module accessible by modules that import yours, the `export` syntax is pretty straightforward.

 Concrete syntax:

 
```
export unsigned
```

AST:

 
```
nnkExportStmt(nnkIdent("unsigned"))
```

Similar to the `import` statement, the AST is different for `export ... except`.

 Concrete syntax:

 
```
export math except pow # we're going to implement our own exponentiation
```

AST:

 
```
nnkExportExceptStmt(nnkIdent("math"),nnkIdent("pow"))
```
 ### Include statement


Like a plain `import` statement but with `nnkIncludeStmt`.

 Concrete syntax:

 
```
include blocks
```

AST:

 
```
nnkIncludeStmt(nnkIdent("blocks"))
```
 ### Var section


Concrete syntax:

 
```
var a = 3
```

AST:

 
```
nnkVarSection(
  nnkIdentDefs(
    nnkIdent("a"),
    nnkEmpty(), # or nnkIdent(...) if the variable declares the type
    nnkIntLit(3),
  )
)
```

Note that either the second or third (or both) parameters above must exist, as the compiler needs to know the type somehow (which it can infer from the given assignment).

 This is not the same AST for all uses of `var`. See [Procedure declaration](macros#statements-procedure-declaration) for details.

 ### Let section


This is equivalent to `var`, but with `nnkLetSection` rather than `nnkVarSection`.

 Concrete syntax:

 
```
let a = 3
```

AST:

 
```
nnkLetSection(
  nnkIdentDefs(
    nnkIdent("a"),
    nnkEmpty(), # or nnkIdent(...) for the type
    nnkIntLit(3),
  )
)
```
 ### Const section


Concrete syntax:

 
```
const a = 3
```

AST:

 
```
nnkConstSection(
  nnkConstDef( # not nnkConstDefs!
    nnkIdent("a"),
    nnkEmpty(), # or nnkIdent(...) if the variable declares the type
    nnkIntLit(3), # required in a const declaration!
  )
)
```
 ### Type section


Starting with the simplest case, a `type` section appears much like `var` and `const`.

 Concrete syntax:

 
```
type A = int
```

AST:

 
```
nnkTypeSection(
  nnkTypeDef(
    nnkIdent("A"),
    nnkEmpty(),
    nnkIdent("int")
  )
)
```

Declaring `distinct` types is similar, with the last `nnkIdent` wrapped in `nnkDistinctTy`.

 Concrete syntax:

 
```
type MyInt = distinct int
```

AST:

 
```
# ...
nnkTypeDef(
  nnkIdent("MyInt"),
  nnkEmpty(),
  nnkDistinctTy(
    nnkIdent("int")
  )
)
```

If a type section uses generic parameters, they are treated here:

 Concrete syntax:

 
```
type A[T] = expr1
```

AST:

 
```
nnkTypeSection(
  nnkTypeDef(
    nnkIdent("A"),
    nnkGenericParams(
      nnkIdentDefs(
        nnkIdent("T"),
        nnkEmpty(), # if the type is declared with options, like
                    # ``[T: SomeInteger]``, they are given here
        nnkEmpty(),
      )
    )
    expr1,
  )
)
```

Note that not all `nnkTypeDef` utilize `nnkIdent` as their parameter. One of the most common uses of type declarations is to work with objects.

 Concrete syntax:

 
```
type IO = object of RootObj
```

AST:

 
```
# ...
nnkTypeDef(
  nnkIdent("IO"),
  nnkEmpty(),
  nnkObjectTy(
    nnkEmpty(), # no pragmas here
    nnkOfInherit(
      nnkIdent("RootObj") # inherits from RootObj
    )
    nnkEmpty()
  )
)
```

Nim's object syntax is rich. Let's take a look at an involved example in its entirety to see some of the complexities.

 Concrete syntax:

 
```
type Obj[T] = object {.inheritable.}
  name: string
  case isFat: bool
  of true:
    m: array[100_000, T]
  of false:
    m: array[10, T]
```

AST:

 
```
# ...
nnkObjectTy(
  nnkPragma(
    nnkIdent("inheritable")
  ),
  nnkEmpty(),
  nnkRecList( # list of object parameters
    nnkIdentDefs(
      nnkIdent("name"),
      nnkIdent("string"),
      nnkEmpty()
    ),
    nnkRecCase( # case statement within object (not nnkCaseStmt)
      nnkIdentDefs(
        nnkIdent("isFat"),
        nnkIdent("bool"),
        nnkEmpty()
      ),
      nnkOfBranch(
        nnkIdent("true"),
        nnkRecList( # again, a list of object parameters
          nnkIdentDefs(
            nnkIdent("m"),
            nnkBracketExpr(
              nnkIdent("array"),
              nnkIntLit(100000),
              nnkIdent("T")
            ),
            nnkEmpty()
        )
      ),
      nnkOfBranch(
        nnkIdent("false"),
        nnkRecList(
          nnkIdentDefs(
            nnkIdent("m"),
            nnkBracketExpr(
              nnkIdent("array"),
              nnkIntLit(10),
              nnkIdent("T")
            ),
            nnkEmpty()
          )
        )
      )
    )
  )
)
```

Using an `enum` is similar to using an `object`.

 Concrete syntax:

 
```
type X = enum
  First
```

AST:

 
```
# ...
nnkEnumTy(
  nnkEmpty(),
  nnkIdent("First") # you need at least one nnkIdent or the compiler complains
)
```

The usage of `concept` (experimental) is similar to objects.

 Concrete syntax:

 
```
type Con = concept x,y,z
  (x & y & z) is string
```

AST:

 
```
# ...
nnkTypeClassTy( # note this isn't nnkConceptTy!
  nnkArglist(
    # ... idents for x, y, z
  )
  # ...
)
```

Static types, like `static[int]`, use `nnkIdent` wrapped in `nnkStaticTy`.

 Concrete syntax:

 
```
type A[T: static[int]] = object
```

AST:

 
```
# ... within nnkGenericParams
nnkIdentDefs(
  nnkIdent("T"),
  nnkStaticTy(
    nnkIdent("int")
  ),
  nnkEmpty()
)
# ...
```

In general, declaring types mirrors this syntax (i.e., `nnkStaticTy` for `static`, etc.). Examples follow (exceptions marked by `*`):

 

| Nim type | Corresponding AST |
| --- | --- |
| `static` | `nnkStaticTy` |
| `tuple` | `nnkTupleTy` |
| `var` | `nnkVarTy` |
| `ptr` | `nnkPtrTy` |
| `ref` | `nnkRefTy` |
| `distinct` | `nnkDistinctTy` |
| `enum` | `nnkEnumTy` |
| `concept` | `nnkTypeClassTy`\* |
| `array` | `nnkBracketExpr(nnkIdent("array"),...`\* |
| `proc` | `nnkProcTy` |
| `iterator` | `nnkIteratorTy` |
| `object` | `nnkObjectTy` |


Take special care when declaring types as `proc`. The behavior is similar to `Procedure declaration`, below, but does not treat `nnkGenericParams`. Generic parameters are treated in the type, not the `proc` itself.

 Concrete syntax:

 
```
type MyProc[T] = proc(x: T)
```

AST:

 
```
# ...
nnkTypeDef(
  nnkIdent("MyProc"),
  nnkGenericParams( # here, not with the proc
    # ...
  )
  nnkProcTy( # behaves like a procedure declaration from here on
    nnkFormalParams(
      # ...
    )
  )
)
```

The same syntax applies to `iterator` (with `nnkIteratorTy`), but *does not* apply to `converter` or `template`.

 ### Mixin statement


Concrete syntax:

 
```
mixin x
```

AST:

 
```
nnkMixinStmt(nnkIdent("x"))
```
 ### Bind statement


Concrete syntax:

 
```
bind x
```

AST:

 
```
nnkBindStmt(nnkIdent("x"))
```
 ### Procedure declaration


Let's take a look at a procedure with a lot of interesting aspects to get a feel for how procedure calls are broken down.

 Concrete syntax:

 
```
proc hello*[T: SomeInteger](x: int = 3, y: float32): int {.inline.} = discard
```

AST:

 
```
nnkProcDef(
  nnkPostfix(nnkIdent("*"), nnkIdent("hello")), # the exported proc name
  nnkEmpty(), # patterns for term rewriting in templates and macros (not procs)
  nnkGenericParams( # generic type parameters, like with type declaration
    nnkIdentDefs(
      nnkIdent("T"),
      nnkIdent("SomeInteger"),
      nnkEmpty()
    )
  ),
  nnkFormalParams(
    nnkIdent("int"), # the first FormalParam is the return type. nnkEmpty() if there is none
    nnkIdentDefs(
      nnkIdent("x"),
      nnkIdent("int"), # type type (required for procs, not for templates)
      nnkIntLit(3) # a default value
    ),
    nnkIdentDefs(
      nnkIdent("y"),
      nnkIdent("float32"),
      nnkEmpty()
    )
  ),
  nnkPragma(nnkIdent("inline")),
  nnkEmpty(), # reserved slot for future use
  nnkStmtList(nnkDiscardStmt(nnkEmpty())) # the meat of the proc
)
```

There is another consideration. Nim has flexible type identification for its procs. Even though `proc(a: int, b: int)` and `proc(a, b: int)` are equivalent in the code, the AST is a little different for the latter.

 Concrete syntax:

 
```
proc(a, b: int)
```

AST:

 
```
# ...AST as above...
nnkFormalParams(
  nnkEmpty(), # no return here
  nnkIdentDefs(
    nnkIdent("a"), # the first parameter
    nnkIdent("b"), # directly to the second parameter
    nnkIdent("int"), # their shared type identifier
    nnkEmpty(), # default value would go here
  )
),
# ...
```

When a procedure uses the special `var` type return variable, the result is different from that of a var section.

 Concrete syntax:

 
```
proc hello(): var int
```

AST:

 
```
# ...
nnkFormalParams(
  nnkVarTy(
    nnkIdent("int")
  )
)
```
 ### Iterator declaration


The syntax for iterators is similar to procs, but with `nnkIteratorDef` replacing `nnkProcDef`.

 Concrete syntax:

 
```
iterator nonsense[T](x: seq[T]): float {.closure.} = ...
```

AST:

 
```
nnkIteratorDef(
  nnkIdent("nonsense"),
  nnkEmpty(),
  ...
)
```
 ### Converter declaration


A converter is similar to a proc.

 Concrete syntax:

 
```
converter toBool(x: float): bool
```

AST:

 
```
nnkConverterDef(
  nnkIdent("toBool"),
  # ...
)
```
 ### Template declaration


Templates (as well as macros, as we'll see) have a slightly expanded AST when compared to procs and iterators. The reason for this is [term-rewriting macros](manual.html#term-rewriting-macros). Notice the `nnkEmpty()` as the second argument to `nnkProcDef` and `nnkIteratorDef` above? That's where the term-rewriting macros go.

 Concrete syntax:

 
```
template optOpt{expr1}(a: int): int
```

AST:

 
```
nnkTemplateDef(
  nnkIdent("optOpt"),
  nnkStmtList( # instead of nnkEmpty()
    expr1
  ),
  # follows like a proc or iterator
)
```

If the template does not have types for its parameters, the type identifiers inside `nnkFormalParams` just becomes `nnkEmpty`.

 ### Macro declaration


Macros behave like templates, but `nnkTemplateDef` is replaced with `nnkMacroDef`.

 Special node kinds
------------------


There are several node kinds that are used for semantic checking or code generation. These are accessible from this module, but should not be used. Other node kinds are especially designed to make AST manipulations easier. These are explained here.

 To be written.

 Imports
-------

  <since>  Types
-----

  
```
NimNodeKind = enum
  nnkNone, nnkEmpty, nnkIdent, nnkSym, nnkType, nnkCharLit, nnkIntLit,
  nnkInt8Lit, nnkInt16Lit, nnkInt32Lit, nnkInt64Lit, nnkUIntLit, nnkUInt8Lit,
  nnkUInt16Lit, nnkUInt32Lit, nnkUInt64Lit, nnkFloatLit, nnkFloat32Lit,
  nnkFloat64Lit, nnkFloat128Lit, nnkStrLit, nnkRStrLit, nnkTripleStrLit,
  nnkNilLit, nnkComesFrom, nnkDotCall, nnkCommand, nnkCall, nnkCallStrLit,
  nnkInfix, nnkPrefix, nnkPostfix, nnkHiddenCallConv, nnkExprEqExpr,
  nnkExprColonExpr, nnkIdentDefs, nnkVarTuple, nnkPar, nnkObjConstr, nnkCurly,
  nnkCurlyExpr, nnkBracket, nnkBracketExpr, nnkPragmaExpr, nnkRange, nnkDotExpr,
  nnkCheckedFieldExpr, nnkDerefExpr, nnkIfExpr, nnkElifExpr, nnkElseExpr,
  nnkLambda, nnkDo, nnkAccQuoted, nnkTableConstr, nnkBind, nnkClosedSymChoice,
  nnkOpenSymChoice, nnkHiddenStdConv, nnkHiddenSubConv, nnkConv, nnkCast,
  nnkStaticExpr, nnkAddr, nnkHiddenAddr, nnkHiddenDeref, nnkObjDownConv,
  nnkObjUpConv, nnkChckRangeF, nnkChckRange64, nnkChckRange, nnkStringToCString,
  nnkCStringToString, nnkAsgn, nnkFastAsgn, nnkGenericParams, nnkFormalParams,
  nnkOfInherit, nnkImportAs, nnkProcDef, nnkMethodDef, nnkConverterDef,
  nnkMacroDef, nnkTemplateDef, nnkIteratorDef, nnkOfBranch, nnkElifBranch,
  nnkExceptBranch, nnkElse, nnkAsmStmt, nnkPragma, nnkPragmaBlock, nnkIfStmt,
  nnkWhenStmt, nnkForStmt, nnkParForStmt, nnkWhileStmt, nnkCaseStmt,
  nnkTypeSection, nnkVarSection, nnkLetSection, nnkConstSection, nnkConstDef,
  nnkTypeDef, nnkYieldStmt, nnkDefer, nnkTryStmt, nnkFinally, nnkRaiseStmt,
  nnkReturnStmt, nnkBreakStmt, nnkContinueStmt, nnkBlockStmt, nnkStaticStmt,
  nnkDiscardStmt, nnkStmtList, nnkImportStmt, nnkImportExceptStmt,
  nnkExportStmt, nnkExportExceptStmt, nnkFromStmt, nnkIncludeStmt, nnkBindStmt,
  nnkMixinStmt, nnkUsingStmt, nnkCommentStmt, nnkStmtListExpr, nnkBlockExpr,
  nnkStmtListType, nnkBlockType, nnkWith, nnkWithout, nnkTypeOfExpr,
  nnkObjectTy, nnkTupleTy, nnkTupleClassTy, nnkTypeClassTy, nnkStaticTy,
  nnkRecList, nnkRecCase, nnkRecWhen, nnkRefTy, nnkPtrTy, nnkVarTy, nnkConstTy,
  nnkMutableTy, nnkDistinctTy, nnkProcTy, nnkIteratorTy, nnkSharedTy, nnkEnumTy,
  nnkEnumFieldDef, nnkArglist, nnkPattern, nnkHiddenTryStmt, nnkClosure,
  nnkGotoState, nnkState, nnkBreakState, nnkFuncDef, nnkTupleConstr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L26)  
```
NimNodeKinds = set[NimNodeKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L90)  
```
NimTypeKind = enum
  ntyNone, ntyBool, ntyChar, ntyEmpty, ntyAlias, ntyNil, ntyExpr, ntyStmt,
  ntyTypeDesc, ntyGenericInvocation, ntyGenericBody, ntyGenericInst,
  ntyGenericParam, ntyDistinct, ntyEnum, ntyOrdinal, ntyArray, ntyObject,
  ntyTuple, ntySet, ntyRange, ntyPtr, ntyRef, ntyVar, ntySequence, ntyProc,
  ntyPointer, ntyOpenArray, ntyString, ntyCString, ntyForward, ntyInt, ntyInt8,
  ntyInt16, ntyInt32, ntyInt64, ntyFloat, ntyFloat32, ntyFloat64, ntyFloat128,
  ntyUInt, ntyUInt8, ntyUInt16, ntyUInt32, ntyUInt64, ntyUnused0, ntyUnused1,
  ntyUnused2, ntyVarargs, ntyUncheckedArray, ntyError, ntyBuiltinTypeClass,
  ntyUserTypeClass, ntyUserTypeClassInst, ntyCompositeTypeClass, ntyInferred,
  ntyAnd, ntyOr, ntyNot, ntyAnything, ntyStatic, ntyFromExpr, ntyOptDeprecated,
  ntyVoid
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L91)  
```
TNimTypeKinds {...}{.deprecated.} = set[NimTypeKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L111)  
```
NimSymKind = enum
  nskUnknown, nskConditional, nskDynLib, nskParam, nskGenericParam, nskTemp,
  nskModule, nskType, nskVar, nskLet, nskConst, nskResult, nskProc, nskFunc,
  nskMethod, nskIterator, nskConverter, nskMacro, nskTemplate, nskField,
  nskEnumField, nskForVar, nskLabel, nskStub
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L112)  
```
TNimSymKinds {...}{.deprecated.} = set[NimSymKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L121)  
```
NimIdent {...}{.deprecated.} = object of RootObj
```
  Represents a Nim identifier in the AST. **Note**: This is only rarely useful, for identifier construction from a string use `ident"abc"`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L124)  
```
NimSym {...}{.deprecated.} = ref NimSymObj
```
  Represents a Nim *symbol* in the compiler; a *symbol* is a looked-up *ident*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L130)  
```
BindSymRule = enum
  brClosed,                 ## only the symbols in current scope are bound
  brOpen,                   ## open wrt overloaded symbols, but may be a single
                             ## symbol if not ambiguous (the rules match that of
                             ## binding in generics)
  brForceOpen                ## same as brOpen, but it will always be open even
                             ## if not ambiguous (this cannot be achieved with
                             ## any other means in the language currently)
```
  specifies how `bindSym` behaves [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L465)  
```
LineInfo = object
  filename*: string
  line*, column*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L508)   Consts
------

  
```
nnkLiterals = {nnkCharLit..nnkNilLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L136)  
```
nnkCallKinds = {nnkCall, nnkInfix, nnkPrefix, nnkPostfix, nnkCommand,
                nnkCallStrLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L137)  
```
RoutineNodes = {nnkProcDef, nnkFuncDef, nnkMethodDef, nnkDo, nnkLambda,
                nnkIteratorDef, nnkTemplateDef, nnkConverterDef, nnkMacroDef}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1081) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1081)  
```
AtomicNodes = {nnkNone..nnkNilLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1083) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1083)  
```
CallNodes = {nnkCall, nnkInfix, nnkPrefix, nnkPostfix, nnkCommand,
             nnkCallStrLit, nnkHiddenCallConv}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1084) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1084)   Procs
-----

  
```
proc toNimIdent(s: string): NimIdent {...}{.magic: "StrToIdent", noSideEffect, deprecated: "Deprecated since version 0.18.0: Use \'ident\' or \'newIdentNode\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.0: Use 'ident' or 'newIdentNode' instead.  Constructs an identifier from the string `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L143)  
```
proc `==`(a, b: NimIdent): bool {...}{.magic: "EqIdent", noSideEffect, deprecated: "Deprecated since version 0.18.1; Use \'==\' on \'NimNode\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Use '==' on 'NimNode' instead.  Compares two Nim identifiers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L147)  
```
proc `==`(a, b: NimNode): bool {...}{.magic: "EqNimrodNode", noSideEffect.}
```
  Compare two Nim nodes. Return true if nodes are structurally equivalent. This means two independently created nodes can be equal. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L151)  
```
proc `==`(a, b: NimSym): bool {...}{.magic: "EqNimrodNode", noSideEffect, deprecated: "Deprecated since version 0.18.1; Use \'==(NimNode, NimNode)\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Use '==(NimNode, NimNode)' instead.  Compares two Nim symbols. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L155)  
```
proc sameType(a, b: NimNode): bool {...}{.magic: "SameNodeType", noSideEffect,
                                     raises: [], tags: [].}
```
  Compares two Nim nodes' types. Return true if the types are the same, e.g. true when comparing alias with original type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L161)  
```
proc len(n: NimNode): int {...}{.magic: "NLen", noSideEffect.}
```
  Returns the number of children of `n`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L166)  
```
proc `[]`(n: NimNode; i: int): NimNode {...}{.magic: "NChild", noSideEffect.}
```
  Get `n`'s `i`'th child. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L169)  
```
proc `[]`(n: NimNode; i: BackwardsIndex): NimNode {...}{.raises: [], tags: [].}
```
  Get `n`'s `i`'th child. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L172)  
```
proc `[]`[T, U](n: NimNode; x: HSlice[T, U]): seq[NimNode]
```
  Slice operation for NimNode. Returns a seq of child of `n` who inclusive range [n[x.a], n[x.b]]. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L178)  
```
proc `[]=`(n: NimNode; i: int; child: NimNode) {...}{.magic: "NSetChild",
    noSideEffect.}
```
  Set `n`'s `i`'th child to `child`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L187)  
```
proc `[]=`(n: NimNode; i: BackwardsIndex; child: NimNode) {...}{.raises: [], tags: [].}
```
  Set `n`'s `i`'th child to `child`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L191)  
```
proc add(father, child: NimNode): NimNode {...}{.magic: "NAdd", discardable,
    noSideEffect, locks: 0.}
```
  Adds the `child` to the `father` node. Returns the father node so that calls can be nested. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L210)  
```
proc add(father: NimNode; children: varargs[NimNode]): NimNode {...}{.
    magic: "NAddMultiple", discardable, noSideEffect, locks: 0.}
```
  Adds each child of `children` to the `father` node. Returns the `father` node so that calls can be nested. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L215)  
```
proc del(father: NimNode; idx = 0; n = 1) {...}{.magic: "NDel", noSideEffect.}
```
  Deletes `n` children of `father` starting at index `idx`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L220)  
```
proc kind(n: NimNode): NimNodeKind {...}{.magic: "NKind", noSideEffect.}
```
  Returns the `kind` of the node `n`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L223)  
```
proc intVal(n: NimNode): BiggestInt {...}{.magic: "NIntVal", noSideEffect.}
```
  Returns an integer value from any integer literal or enum field symbol. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L226)  
```
proc floatVal(n: NimNode): BiggestFloat {...}{.magic: "NFloatVal", noSideEffect.}
```
  Returns a float from any floating point literal. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L229)  
```
proc ident(n: NimNode): NimIdent {...}{.magic: "NIdent", noSideEffect, deprecated: "Deprecated since version 0.18.1; All functionality is defined on \'NimNode\'.".}
```
   **Deprecated:** Deprecated since version 0.18.1; All functionality is defined on 'NimNode'.  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L234)  
```
proc symbol(n: NimNode): NimSym {...}{.magic: "NSymbol", noSideEffect, deprecated: "Deprecated since version 0.18.1; All functionality is defined on \'NimNode\'.".}
```
   **Deprecated:** Deprecated since version 0.18.1; All functionality is defined on 'NimNode'.  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L237)  
```
proc getImpl(s: NimSym): NimNode {...}{.magic: "GetImpl", noSideEffect, deprecated: "use `getImpl: NimNode -> NimNode` instead".}
```
   **Deprecated:** use `getImpl: NimNode -> NimNode` instead  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L240)  
```
proc symKind(symbol: NimNode): NimSymKind {...}{.magic: "NSymKind", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L243)  
```
proc getImpl(symbol: NimNode): NimNode {...}{.magic: "GetImpl", noSideEffect.}
```
  Returns a copy of the declaration of a symbol or `nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L244)  
```
proc strVal(n: NimNode): string {...}{.magic: "NStrVal", noSideEffect.}
```
  Returns the string value of an identifier, symbol, comment, or string literal.

 See also:

 * [strVal= proc](#strVal=,NimNode,string) for setting the string value.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L246)  
```
proc `$`(i: NimIdent): string {...}{.magic: "NStrVal", noSideEffect, deprecated: "Deprecated since version 0.18.1; Use \'strVal\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Use 'strVal' instead.  Converts a Nim identifier to a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L252)  
```
proc `$`(s: NimSym): string {...}{.magic: "NStrVal", noSideEffect, deprecated: "Deprecated since version 0.18.1; Use \'strVal\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Use 'strVal' instead.  Converts a Nim symbol to a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L256)  
```
proc getImplTransformed(symbol: NimNode): NimNode {...}{.magic: "GetImplTransf",
    noSideEffect.}
```
  For a typed proc returns the AST after transformation pass; this is useful for debugging how the compiler transforms code (e.g.: `defer`, `for`) but note that code transformations are implementation dependent and subject to change. See an example in `tests/macros/tmacros_various.nim`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L281)  
```
proc owner(sym: NimNode): NimNode {...}{.magic: "SymOwner", noSideEffect.}
```
  Accepts a node of kind `nnkSym` and returns its owner's symbol. The meaning of 'owner' depends on `sym`'s `NimSymKind` and declaration context. For top level declarations this is an `nskModule` symbol, for proc local variables an `nskProc` symbol, for enum/object fields an `nskType` symbol, etc. For symbols without an owner, `nil` is returned.

 See also:

 * [symKind proc](#symKind,NimNode) to get the kind of a symbol
* [getImpl proc](#getImpl,NimNode) to get the declaration of a symbol

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L288)  
```
proc isInstantiationOf(instanceProcSym, genProcSym: NimNode): bool {...}{.
    magic: "SymIsInstantiationOf", noSideEffect.}
```
  Checks if a proc symbol is an instance of the generic proc symbol. Useful to check proc symbols against generic symbols returned by `bindSym`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L300)  
```
proc getType(n: NimNode): NimNode {...}{.magic: "NGetType", noSideEffect.}
```
  With 'getType' you can access the node's type. A Nim type is mapped to a Nim AST too, so it's slightly confusing but it means the same API can be used to traverse types. Recursive types are flattened for you so there is no danger of infinite recursions during traversal. To resolve recursive types, you have to call 'getType' again. To see what kind of type it is, call `typeKind` on getType's result. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L305)  
```
proc getType(n: typedesc): NimNode {...}{.magic: "NGetType", noSideEffect.}
```
  Version of `getType` which takes a `typedesc`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L313)  
```
proc typeKind(n: NimNode): NimTypeKind {...}{.magic: "NGetType", noSideEffect.}
```
  Returns the type kind of the node 'n' that should represent a type, that means the node should have been obtained via `getType`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L316)  
```
proc getTypeInst(n: NimNode): NimNode {...}{.magic: "NGetType", noSideEffect,
                                        raises: [], tags: [].}
```
  Returns the type of a node in a form matching the way the type instance was declared in the code. **Example:**

 
```
type
  Vec[N: static[int], T] = object
    arr: array[N, T]
  Vec4[T] = Vec[4, T]
  Vec4f = Vec4[float32]
var a: Vec4f
var b: Vec4[float32]
var c: Vec[4, float32]
macro dumpTypeInst(x: typed): untyped =
  newLit(x.getTypeInst.repr)
doAssert(dumpTypeInst(a) == "Vec4f")
doAssert(dumpTypeInst(b) == "Vec4[float32]")
doAssert(dumpTypeInst(c) == "Vec[4, float32]")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L320)  
```
proc getTypeInst(n: typedesc): NimNode {...}{.magic: "NGetType", noSideEffect.}
```
  Version of `getTypeInst` which takes a `typedesc`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L338)  
```
proc getTypeImpl(n: NimNode): NimNode {...}{.magic: "NGetType", noSideEffect,
                                        raises: [], tags: [].}
```
  Returns the type of a node in a form matching the implementation of the type. Any intermediate aliases are expanded to arrive at the final type implementation. You can instead use `getImpl` on a symbol if you want to find the intermediate aliases. **Example:**

 
```
type
  Vec[N: static[int], T] = object
    arr: array[N, T]
  Vec4[T] = Vec[4, T]
  Vec4f = Vec4[float32]
var a: Vec4f
var b: Vec4[float32]
var c: Vec[4, float32]
macro dumpTypeImpl(x: typed): untyped =
  newLit(x.getTypeImpl.repr)
let t = """
object
  arr: array[0 .. 3, float32]
"""
doAssert(dumpTypeImpl(a) == t)
doAssert(dumpTypeImpl(b) == t)
doAssert(dumpTypeImpl(c) == t)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L341)  
```
proc signatureHash(n: NimNode): string {...}{.magic: "NSigHash", noSideEffect.}
```
  Returns a stable identifier derived from the signature of a symbol. The signature combines many factors such as the type of the symbol, the owning module of the symbol and others. The same identifier is used in the back-end to produce the mangled symbol name. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L366)  
```
proc symBodyHash(s: NimNode): string {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns a stable digest for symbols derived not only from type signature and owning module, but also implementation body. All procs/variables used in the implementation of this symbol are hashed recursively as well, including magics from system module. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L372)  
```
proc getTypeImpl(n: typedesc): NimNode {...}{.magic: "NGetType", noSideEffect.}
```
  Version of `getTypeImpl` which takes a `typedesc`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L379)  
```
proc intVal=(n: NimNode; val: BiggestInt) {...}{.magic: "NSetIntVal", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L382)  
```
proc floatVal=(n: NimNode; val: BiggestFloat) {...}{.magic: "NSetFloatVal",
    noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L383)  
```
proc symbol=(n: NimNode; val: NimSym) {...}{.magic: "NSetSymbol", noSideEffect, deprecated: "Deprecated since version 0.18.1; Generate a new \'NimNode\' with \'genSym\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Generate a new 'NimNode' with 'genSym' instead.  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L387)  
```
proc ident=(n: NimNode; val: NimIdent) {...}{.magic: "NSetIdent", noSideEffect, deprecated: "Deprecated since version 0.18.1; Generate a new \'NimNode\' with \'ident(string)\' instead.".}
```
   **Deprecated:** Deprecated since version 0.18.1; Generate a new 'NimNode' with 'ident(string)' instead.  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L390)  
```
proc strVal=(n: NimNode; val: string) {...}{.magic: "NSetStrVal", noSideEffect.}
```
  Sets the string value of a string literal or comment. Setting `strVal` is disallowed for `nnkIdent` and `nnkSym` nodes; a new node must be created using `ident` or `bindSym` instead.

 See also:

 * [strVal proc](#strVal,NimNode) for getting the string value.
* [ident proc](#ident,string) for creating an identifier.
* [bindSym proc](#bindSym%2C%2CBindSymRule) for binding a symbol.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L395)  
```
proc newNimNode(kind: NimNodeKind; lineInfoFrom: NimNode = nil): NimNode {...}{.
    magic: "NNewNimNode", noSideEffect.}
```
  Creates a new AST node of the specified kind.

 The `lineInfoFrom` parameter is used for line information when the produced code crashes. You should ensure that it is set to a node that you are transforming.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L405)  
```
proc copyNimNode(n: NimNode): NimNode {...}{.magic: "NCopyNimNode", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L414)  
```
proc copyNimTree(n: NimNode): NimNode {...}{.magic: "NCopyNimTree", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L415)  
```
proc error(msg: string; n: NimNode = nil) {...}{.magic: "NError", gcsafe, locks: 0.}
```
  Writes an error message at compile time. The optional `n: NimNode` parameter is used as the source for file and line number information in the compilation error message. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L417)  
```
proc warning(msg: string; n: NimNode = nil) {...}{.magic: "NWarning", gcsafe,
    locks: 0.}
```
  Writes a warning message at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L422)  
```
proc hint(msg: string; n: NimNode = nil) {...}{.magic: "NHint", gcsafe, locks: 0.}
```
  Writes a hint message at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L425)  
```
proc newStrLitNode(s: string): NimNode {...}{.compileTime, noSideEffect, raises: [],
    tags: [].}
```
  Creates a string literal node from `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L428)  
```
proc newCommentStmtNode(s: string): NimNode {...}{.compileTime, noSideEffect,
    raises: [], tags: [].}
```
  Creates a comment statement node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L433)  
```
proc newIntLitNode(i: BiggestInt): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Creates an int literal node from `i`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L438)  
```
proc newFloatLitNode(f: BiggestFloat): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Creates a float literal node from `f`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L443)  
```
proc newIdentNode(i: NimIdent): NimNode {...}{.compileTime, deprecated, raises: [],
    tags: [].}
```
   **Deprecated**  Creates an identifier node from `i`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L450)  
```
proc newIdentNode(i: string): NimNode {...}{.magic: "StrToIdent", noSideEffect.}
```
  Creates an identifier node from `i`. It is simply an alias for `ident(string)`. Use that, it's shorter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L457)  
```
proc ident(name: string): NimNode {...}{.magic: "StrToIdent", noSideEffect.}
```
  Create a new ident node from a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L461)  
```
proc bindSym(ident: string | NimNode; rule: BindSymRule = brClosed): NimNode {...}{.
    magic: "NBindSym", noSideEffect.}
```
  Creates a node that binds `ident` to a symbol node. The bound symbol may be an overloaded symbol. if `ident` is a NimNode, it must have `nnkIdent` kind. If `rule == brClosed` either an `nnkClosedSymChoice` tree is returned or `nnkSym` if the symbol is not ambiguous. If `rule == brOpen` either an `nnkOpenSymChoice` tree is returned or `nnkSym` if the symbol is not ambiguous. If `rule == brForceOpen` always an `nnkOpenSymChoice` tree is returned even if the symbol is not ambiguous.

 Experimental feature: use {.experimental: "dynamicBindSym".} to activate it. If called from template / regular code, `ident` and `rule` must be constant expression / literal value. If called from macros / compile time procs / static blocks, `ident` and `rule` can be VM computed value.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L474)  
```
proc genSym(kind: NimSymKind = nskLet; ident = ""): NimNode {...}{.magic: "NGenSym",
    noSideEffect.}
```
  Generates a fresh symbol that is guaranteed to be unique. The symbol needs to occur in a declaration context. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L493)  
```
proc callsite(): NimNode {...}{.magic: "NCallSite", gcsafe, locks: 0, deprecated: "Deprecated since v0.18.1; use varargs[untyped] in the macro prototype instead".}
```
   **Deprecated:** Deprecated since v0.18.1; use varargs[untyped] in the macro prototype instead  Returns the AST of the invocation expression that invoked this macro. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L498)  
```
proc toStrLit(n: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Converts the AST `n` to the concrete Nim code and wraps that in a string literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L502)  
```
proc `$`(arg: LineInfo): string {...}{.raises: [], tags: [].}
```
  Return a string representation in the form `filepath(line, column)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L512)  
```
proc copyLineInfo(arg: NimNode; info: NimNode) {...}{.magic: "NLineInfo",
    noSideEffect.}
```
  Copy lineinfo from `info`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L525)  
```
proc lineInfoObj(n: NimNode): LineInfo {...}{.compileTime, raises: [], tags: [].}
```
  Returns `LineInfo` of `n`, using absolute path for `filename`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L528)  
```
proc lineInfo(arg: NimNode): string {...}{.compileTime, raises: [], tags: [].}
```
  Return line info in the form `filepath(line, column)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L532)  
```
proc internalErrorFlag(): string {...}{.magic: "NError", noSideEffect.}
```
  Some builtins set an error flag. This is then turned into a proper exception. **Note**: Ordinary application code should not call this. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L542)  
```
proc parseExpr(s: string): NimNode {...}{.noSideEffect, compileTime,
                                     raises: [ValueError], tags: [].}
```
  Compiles the passed string to its AST representation. Expects a single expression. Raises `ValueError` for parsing errors. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L546)  
```
proc parseStmt(s: string): NimNode {...}{.noSideEffect, compileTime,
                                     raises: [ValueError], tags: [].}
```
  Compiles the passed string to its AST representation. Expects one or more statements. Raises `ValueError` for parsing errors. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L553)  
```
proc getAst(macroOrTemplate: untyped): NimNode {...}{.magic: "ExpandToAst",
    noSideEffect.}
```
  Obtains the AST nodes returned from a macro or template invocation. Example:
```
macro FooMacro() =
  var ast = getAst(BarTemplate())
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L560)  
```
proc quote(bl: typed; op = "``"): NimNode {...}{.magic: "QuoteAst", noSideEffect.}
```
  Quasi-quoting operator. Accepts an expression or a block and returns the AST that represents it. Within the quoted AST, you are able to interpolate NimNode expressions from the surrounding scope. If no operator is given, quoting is done using backticks. Otherwise, the given operator must be used as a prefix operator for any interpolated expression.

 Example:

 
```
macro check(ex: untyped) =
  # this is a simplified version of the check macro from the
  # unittest module.
  
  # If there is a failed check, we want to make it easy for
  # the user to jump to the faulty line in the code, so we
  # get the line info here:
  var info = ex.lineinfo
  
  # We will also display the code string of the failed check:
  var expString = ex.toStrLit
  
  # Finally we compose the code to implement the check:
  result = quote do:
    if not `ex`:
      echo `info` & ": Check failed: " & `expString`
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L569)  
```
proc expectKind(n: NimNode; k: NimNodeKind) {...}{.compileTime, raises: [], tags: [].}
```
  Checks that `n` is of kind `k`. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check the AST that is passed to them. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L598)  
```
proc expectMinLen(n: NimNode; min: int) {...}{.compileTime, raises: [], tags: [].}
```
  Checks that `n` has at least `min` children. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check its number of arguments. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L604)  
```
proc expectLen(n: NimNode; len: int) {...}{.compileTime, raises: [], tags: [].}
```
  Checks that `n` has exactly `len` children. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check its number of arguments. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L610)  
```
proc expectLen(n: NimNode; min, max: int) {...}{.compileTime, raises: [], tags: [].}
```
  Checks that `n` has a number of children in the range `min..max`. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check its number of arguments. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L616)  
```
proc newTree(kind: NimNodeKind; children: varargs[NimNode]): NimNode {...}{.
    compileTime, raises: [], tags: [].}
```
  Produces a new node with children. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L623)  
```
proc newCall(theProc: NimNode; args: varargs[NimNode]): NimNode {...}{.compileTime,
    raises: [], tags: [].}
```
  Produces a new call node. `theProc` is the proc that is called with the arguments `args[0..]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L629) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L629)  
```
proc newCall(theProc: NimIdent; args: varargs[NimNode]): NimNode {...}{.compileTime, deprecated: "Deprecated since v0.18.1; use \'newCall(string, ...)\' or \'newCall(NimNode, ...)\' instead",
    raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v0.18.1; use 'newCall(string, ...)' or 'newCall(NimNode, ...)' instead  Produces a new call node. `theProc` is the proc that is called with the arguments `args[0..]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L639)  
```
proc newCall(theProc: string; args: varargs[NimNode]): NimNode {...}{.compileTime,
    raises: [], tags: [].}
```
  Produces a new call node. `theProc` is the proc that is called with the arguments `args[0..]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L649)  
```
proc newLit(c: char): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new character literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L657)  
```
proc newLit(i: int): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L662)  
```
proc newLit(i: int8): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L667)  
```
proc newLit(i: int16): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L672)  
```
proc newLit(i: int32): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L677)  
```
proc newLit(i: int64): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L682)  
```
proc newLit(i: uint): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new unsigned integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L687)  
```
proc newLit(i: uint8): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new unsigned integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L692) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L692)  
```
proc newLit(i: uint16): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new unsigned integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L697)  
```
proc newLit(i: uint32): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new unsigned integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L702)  
```
proc newLit(i: uint64): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new unsigned integer literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L707)  
```
proc newLit(b: bool): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new boolean literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L712)  
```
proc newLit(s: string): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new string literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L716)  
```
proc newLit(f: float32): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new float literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L728)  
```
proc newLit(f: float64): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Produces a new float literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L733) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L733)  
```
proc newLit(arg: enum): NimNode {...}{.compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L744)  
```
proc newLit(arg: object): NimNode {...}{.compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L755) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L755)  
```
proc newLit(arg: ref object): NimNode {...}{.compileTime.}
```
  produces a new ref type literal node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L760)  
```
proc newLit[N, T](arg: array[N, T]): NimNode {...}{.compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L766)  
```
proc newLit[T](arg: seq[T]): NimNode {...}{.compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L771) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L771)  
```
proc newLit[T](s: set[T]): NimNode {...}{.compileTime.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L784) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L784)  
```
proc newLit[T: tuple](arg: T): NimNode {...}{.compileTime.}
```
  use -d:nimHasWorkaround14720 to restore behavior prior to PR, forcing a named tuple even when `arg` is unnamed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L796)  
```
proc nestList(op: NimNode; pack: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Nests the list `pack` into a tree of call expressions: `[a, b, c]` is transformed into `op(a, op(c, d))`. This is also known as fold expression. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L807) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L807)  
```
proc nestList(op: NimNode; pack: NimNode; init: NimNode): NimNode {...}{.compileTime,
    raises: [], tags: [].}
```
  Nests the list `pack` into a tree of call expressions: `[a, b, c]` is transformed into `op(a, op(c, d))`. This is also known as fold expression. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L817) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L817)  
```
proc treeRepr(n: NimNode): string {...}{.compileTime, gcsafe, locks: 0, raises: [],
                                    tags: [].}
```
  Convert the AST `n` to a human-readable tree-like string.

 See also `repr`, `lispRepr`, and `astGenRepr`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L859)  
```
proc lispRepr(n: NimNode; indented = false): string {...}{.compileTime, gcsafe,
    locks: 0, raises: [], tags: [].}
```
  Convert the AST `n` to a human-readable lisp-like string.

 See also `repr`, `treeRepr`, and `astGenRepr`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L866)  
```
proc astGenRepr(n: NimNode): string {...}{.compileTime, gcsafe, locks: 0, raises: [],
                                      tags: [].}
```
  Convert the AST `n` to the code required to generate that AST.

 See also `repr`, `treeRepr`, and `lispRepr`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L873) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L873)  
```
proc newEmptyNode(): NimNode {...}{.compileTime, noSideEffect, raises: [], tags: [].}
```
  Create a new empty node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L992) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L992)  
```
proc newStmtList(stmts: varargs[NimNode]): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new statement list. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L996) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L996)  
```
proc newPar(exprs: varargs[NimNode]): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new parentheses-enclosed expression. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1000) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1000)  
```
proc newBlockStmt(label, body: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new block statement with label. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1004) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1004)  
```
proc newBlockStmt(body: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Create a new block: stmt. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1008)  
```
proc newVarStmt(name, value: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new var stmt. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1012) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1012)  
```
proc newLetStmt(name, value: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new let stmt. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1017)  
```
proc newConstStmt(name, value: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  Create a new const stmt. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1022) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1022)  
```
proc newAssignment(lhs, rhs: NimNode): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1027) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1027)  
```
proc newDotExpr(a, b: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Create new dot expression. a.dot(b) -> `a.b` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1030) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1030)  
```
proc newColonExpr(a, b: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Create new colon expression. newColonExpr(a, b) -> `a: b` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1035)  
```
proc newIdentDefs(name, kind: NimNode; default = newEmptyNode()): NimNode {...}{.
    compileTime, raises: [], tags: [].}
```
  Creates a new `nnkIdentDefs` node of a specific kind and value.

 `nnkIdentDefs` need to have at least three children, but they can have more: first comes a list of identifiers followed by a type and value nodes. This helper proc creates a three node subtree, the first subnode being a single identifier name. Both the `kind` node and `default` (value) nodes may be empty depending on where the `nnkIdentDefs` appears: tuple or object definitions will have an empty `default` node, `let` or `var` blocks may have an empty `kind` node if the identifier is being assigned a value. Example:

 
```
var varSection = newNimNode(nnkVarSection).add(
  newIdentDefs(ident("a"), ident("string")),
  newIdentDefs(ident("b"), newEmptyNode(), newLit(3)))
# --> var
#       a: string
#       b = 3
```

If you need to create multiple identifiers you need to use the lower level `newNimNode`:

 
```
result = newNimNode(nnkIdentDefs).add(
  ident("a"), ident("b"), ident("c"), ident("string"),
    newStrLitNode("Hello"))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1040) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1040)  
```
proc newNilLit(): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  New nil literal shortcut. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1072) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1072)  
```
proc last(node: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Return the last item in nodes children. Same as `node[^1]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1076) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1076)  
```
proc expectKind(n: NimNode; k: set[NimNodeKind]) {...}{.compileTime, raises: [],
    tags: [].}
```
  Checks that `n` is of kind `k`. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check the AST that is passed to them. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1087) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1087)  
```
proc newProc(name = newEmptyNode();
             params: openArray[NimNode] = [newEmptyNode()];
             body: NimNode = newStmtList(); procType = nnkProcDef;
             pragmas: NimNode = newEmptyNode()): NimNode {...}{.compileTime,
    raises: [], tags: [].}
```
  Shortcut for creating a new proc.

 The `params` array must start with the return type of the proc, followed by a list of IdentDefs which specify the params.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1093) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1093)  
```
proc newIfStmt(branches: varargs[tuple[cond, body: NimNode]]): NimNode {...}{.
    compileTime, raises: [], tags: [].}
```
  Constructor for `if` statements.
```
newIfStmt(
  (Ident, StmtList),
  ...
)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1114)  
```
proc newEnum(name: NimNode; fields: openArray[NimNode]; public, pure: bool): NimNode {...}{.
    compileTime, raises: [], tags: [].}
```
  Creates a new enum. `name` must be an ident. Fields are allowed to be either idents or EnumFieldDef
```
newEnum(
  name    = ident("Colors"),
  fields  = [ident("Blue"), ident("Red")],
  public  = true, pure = false)

# type Colors* = Blue Red
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1131)  
```
proc copyChildrenTo(src, dest: NimNode) {...}{.compileTime, raises: [], tags: [].}
```
  Copy all children from `src` to `dest`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1175)  
```
proc name(someProc: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1183)  
```
proc name=(someProc: NimNode; val: NimNode) {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1194)  
```
proc params(someProc: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1200)  
```
proc params=(someProc: NimNode; params: NimNode) {...}{.compileTime, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1203)  
```
proc pragma(someProc: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  Get the pragma of a proc type. These will be expanded. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1208)  
```
proc pragma=(someProc: NimNode; val: NimNode) {...}{.compileTime, raises: [],
    tags: [].}
```
  Set the pragma of a proc type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1216)  
```
proc addPragma(someProc, pragma: NimNode) {...}{.compileTime, raises: [], tags: [].}
```
  Adds pragma to routine definition. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1225)  
```
proc body(someProc: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1237)  
```
proc body=(someProc: NimNode; val: NimNode) {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1248)  
```
proc basename(a: NimNode): NimNode {...}{.raises: [], tags: [].}
```
  Pull an identifier from prefix/postfix expressions. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1259)  
```
proc `$`(node: NimNode): string {...}{.compileTime, raises: [], tags: [].}
```
  Get the string of an identifier node. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1269)  
```
proc insert(a: NimNode; pos: int; b: NimNode) {...}{.compileTime, raises: [],
    tags: [].}
```
  Insert node `b` into node `a` at `pos`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1312)  
```
proc basename=(a: NimNode; val: string) {...}{.compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1327)  
```
proc postfix(node: NimNode; op: string): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1338)  
```
proc prefix(node: NimNode; op: string): NimNode {...}{.compileTime, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1341)  
```
proc infix(a: NimNode; op: string; b: NimNode): NimNode {...}{.compileTime,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1344)  
```
proc unpackPostfix(node: NimNode): tuple[node: NimNode, op: string] {...}{.
    compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1348)  
```
proc unpackPrefix(node: NimNode): tuple[node: NimNode, op: string] {...}{.
    compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1353)  
```
proc unpackInfix(node: NimNode): tuple[left: NimNode, op: string, right: NimNode] {...}{.
    compileTime, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1358)  
```
proc copy(node: NimNode): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  An alias for [copyNimTree](#copyNimTree,NimNode). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1363)  
```
proc eqIdent(a: string; b: string): bool {...}{.magic: "EqIdent", noSideEffect.}
```
  Style insensitive comparison. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1368)  
```
proc eqIdent(a: NimNode; b: string): bool {...}{.magic: "EqIdent", noSideEffect.}
```
  Style insensitive comparison. `a` can be an identifier or a symbol. `a` may be wrapped in an export marker (`nnkPostfix`) or quoted with backticks (`nnkAccQuoted`), these nodes will be unwrapped. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1371)  
```
proc eqIdent(a: string; b: NimNode): bool {...}{.magic: "EqIdent", noSideEffect.}
```
  Style insensitive comparison. `b` can be an identifier or a symbol. `b` may be wrapped in an export marker (`nnkPostfix`) or quoted with backticks (`nnkAccQuoted`), these nodes will be unwrapped. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1377)  
```
proc eqIdent(a: NimNode; b: NimNode): bool {...}{.magic: "EqIdent", noSideEffect.}
```
  Style insensitive comparison. `a` and `b` can be an identifier or a symbol. Both may be wrapped in an export marker (`nnkPostfix`) or quoted with backticks (`nnkAccQuoted`), these nodes will be unwrapped. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1383)  
```
proc expectIdent(n: NimNode; name: string) {...}{.compileTime, raises: [], tags: [].}
```
  Check that `eqIdent(n,name)` holds true. If this is not the case, compilation aborts with an error message. This is useful for writing macros that check the AST that is passed to them. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1425)  
```
proc hasArgOfName(params: NimNode; name: string): bool {...}{.compileTime,
    raises: [], tags: [].}
```
  Search `nnkFormalParams` for an argument. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1432)  
```
proc addIdentIfAbsent(dest: NimNode; ident: string) {...}{.compileTime, raises: [],
    tags: [].}
```
  Add `ident` to `dest` if it is not present. This is intended for use with pragmas. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1440)  
```
proc boolVal(n: NimNode): bool {...}{.compileTime, noSideEffect, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1452)  
```
proc nodeID(n: NimNode): int {...}{.magic: "NodeId".}
```
  Returns the id of `n`, when the compiler has been compiled with the flag `-d:useNodeids`, otherwise returns `-1`. This proc is for the purpose to debug the compiler only. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1457)  
```
proc getProjectPath(): string {...}{.raises: [], tags: [].}
```
  Returns the path to the currently compiling project.

 This is not to be confused with [system.currentSourcePath](system#currentSourcePath.t) which returns the path of the source file containing that template call.

 For example, assume a `dir1/foo.nim` that imports a `dir2/bar.nim`, have the `bar.nim` print out both `getProjectPath` and `currentSourcePath` outputs.

 Now when `foo.nim` is compiled, the `getProjectPath` from `bar.nim` will return the `dir1/` path, while the `currentSourcePath` will return the path to the `bar.nim` source file.

 Now when `bar.nim` is compiled directly, the `getProjectPath` will now return the `dir2/` path, and the `currentSourcePath` will still return the same path, the path to the `bar.nim` source file.

 The path returned by this proc is set at compile time.

 See also:

 * [getCurrentDir proc](os#getCurrentDir)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1618)  
```
proc getSize(arg: NimNode): int {...}{.magic: "NSizeOf", noSideEffect, raises: [],
                                  tags: [].}
```
  Returns the same result as `system.sizeof` if the size is known by the Nim compiler. Returns a negative value if the Nim compiler does not know the size. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1644)  
```
proc getAlign(arg: NimNode): int {...}{.magic: "NSizeOf", noSideEffect, raises: [],
                                   tags: [].}
```
  Returns the same result as `system.alignof` if the alignment is known by the Nim compiler. It works on `NimNode` for use in macro context. Returns a negative value if the Nim compiler does not know the alignment. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1648)  
```
proc getOffset(arg: NimNode): int {...}{.magic: "NSizeOf", noSideEffect, raises: [],
                                    tags: [].}
```
  Returns the same result as `system.offsetof` if the offset is known by the Nim compiler. It expects a resolved symbol node from a field of a type. Therefore it only requires one argument instead of two. Returns a negative value if the Nim compiler does not know the offset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1653)  
```
proc isExported(n: NimNode): bool {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns whether the symbol is exported or not. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1660)  
```
proc extractDocCommentsAndRunnables(n: NimNode): NimNode {...}{.raises: [], tags: [].}
```
  returns a `nnkStmtList` containing the top-level doc comments and runnableExamples in `a`, stopping at the first child that is neither. Example:
```
import macros
macro transf(a): untyped =
  result = quote do:
    proc fun2*() = discard
  let header = extractDocCommentsAndRunnables(a.body)
  # correct usage: rest is appended
  result.body = header
  result.body.add quote do: discard # just an example
  # incorrect usage: nesting inside a nnkStmtList:
  # result.body = quote do: (`header`; discard)

proc fun*() {.transf.} =
  ## first comment
  runnableExamples: discard
  runnableExamples: discard
  ## last comment
  discard # first statement after doc comments + runnableExamples
  ## not docgen'd
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1663)   Iterators
---------

  
```
iterator items(n: NimNode): NimNode {...}{.inline, raises: [], tags: [].}
```
  Iterates over the children of the NimNode `n`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1283)  
```
iterator pairs(n: NimNode): (int, NimNode) {...}{.inline, raises: [], tags: [].}
```
  Iterates over the children of the NimNode `n` and its indices. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1288)  
```
iterator children(n: NimNode): NimNode {...}{.inline, raises: [], tags: [].}
```
  Iterates over the children of the NimNode `n`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1293)   Macros
------

  
```
macro dumpTree(s: untyped): untyped
```
  Accepts a block of nim code and prints the parsed abstract syntax tree using the `treeRepr` proc. Printing is done *at compile time*.

 You can use this as a tool to explore the Nim's abstract syntax tree and to discover what kind of nodes must be created to represent a certain expression/statement.

 For example:

 
```
dumpTree:
  echo "Hello, World!"
```

Outputs:

 
```
StmtList
  Command
    Ident "echo"
    StrLit "Hello, World!"
```

Also see `dumpAstGen` and `dumpLisp`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L919) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L919)  
```
macro dumpLisp(s: untyped): untyped
```
  Accepts a block of nim code and prints the parsed abstract syntax tree using the `lispRepr` proc. Printing is done *at compile time*.

 You can use this as a tool to explore the Nim's abstract syntax tree and to discover what kind of nodes must be created to represent a certain expression/statement.

 For example:

 
```
dumpLisp:
  echo "Hello, World!"
```

Outputs:

 
```
(StmtList
 (Command
  (Ident "echo")
  (StrLit "Hello, World!")))
```

Also see `dumpAstGen` and `dumpTree`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L943) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L943)  
```
macro dumpAstGen(s: untyped): untyped
```
  Accepts a block of nim code and prints the parsed abstract syntax tree using the `astGenRepr` proc. Printing is done *at compile time*.

 You can use this as a tool to write macros quicker by writing example outputs and then copying the snippets into the macro for modification.

 For example:

 
```
dumpAstGen:
  echo "Hello, World!"
```

Outputs:

 
```
nnkStmtList.newTree(
  nnkCommand.newTree(
    newIdentNode("echo"),
    newLit("Hello, World!")
  )
)
```

Also see `dumpTree` and `dumpLisp`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L967) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L967)  
```
macro expandMacros(body: typed): untyped
```
  Expands one level of macro - useful for debugging. Can be used to inspect what happens when a macro call is expanded, without altering its result.

 For instance,

 
```
import sugar, macros

let
  x = 10
  y = 20
expandMacros:
  dump(x + y)
```

will actually dump `x + y`, but at the same time will print at compile time the expansion of the `dump` macro, which in this case is `debugEcho ["x + y", " = ", x + y]`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1462)  
```
macro hasCustomPragma(n: typed; cp: typed{nkSym}): untyped
```
  Expands to `true` if expression `n` which is expected to be `nnkDotExpr` (if checking a field), a proc or a type has custom pragma `cp`.

 See also `getCustomPragmaVal`.

 
```
template myAttr() {.pragma.}
type
  MyObj = object
    myField {.myAttr.}: int

proc myProc() {.myAttr.} = discard

var o: MyObj
assert(o.myField.hasCustomPragma(myAttr))
assert(myProc.hasCustomPragma(myAttr))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1557)  
```
macro getCustomPragmaVal(n: typed; cp: typed{nkSym}): untyped
```
  Expands to value of custom pragma `cp` of expression `n` which is expected to be `nnkDotExpr`, a proc or a type.

 See also `hasCustomPragma`

 
```
template serializationKey(key: string) {.pragma.}
type
  MyObj {.serializationKey: "mo".} = object
    myField {.serializationKey: "mf".}: int
var o: MyObj
assert(o.myField.getCustomPragmaVal(serializationKey) == "mf")
assert(o.getCustomPragmaVal(serializationKey) == "mo")
assert(MyObj.getCustomPragmaVal(serializationKey) == "mo")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1581)  
```
macro unpackVarargs(callee: untyped; args: varargs[untyped]): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1613) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1613)   Templates
---------

  
```
template `or`(x, y: NimNode): NimNode
```
  Evaluate `x` and when it is not an empty node, return it. Otherwise evaluate to `y`. Can be used to chain several expressions to get the first expression that is not empty.
```
let node = mightBeEmpty() or mightAlsoBeEmpty() or fallbackNode
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L195)  
```
template findChild(n: NimNode; cond: untyped): NimNode {...}{.dirty.}
```
  Find the first child node matching condition (or nil).
```
var res = findChild(n, it.kind == nnkPostfix and
                       it.basename.ident == toNimIdent"foo")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/macros.nim#L1298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/macros.nim#L1298)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/macros.html>

rlocks
======

 This module contains Nim's support for reentrant locks.

 Types
-----

  
```
RLock = SysLock
```
  Nim lock, re-entrant [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L20)   Procs
-----

  
```
proc initRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}
```
  Initializes the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L22)  
```
proc deinitRLock(lock: var RLock) {...}{.inline, raises: [], tags: [].}
```
  Frees the resources associated with the lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L32)  
```
proc tryAcquire(lock: var RLock): bool {...}{.raises: [], tags: [].}
```
  Tries to acquire the given lock. Returns `true` on success. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L36)  
```
proc acquire(lock: var RLock) {...}{.raises: [], tags: [].}
```
  Acquires the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L40)  
```
proc release(lock: var RLock) {...}{.raises: [], tags: [].}
```
  Releases the given lock. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L44)   Templates
---------

  
```
template withRLock(lock: var RLock; code: untyped): untyped
```
  Acquires the given lock and then executes the code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/rlocks.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/rlocks.nim#L48)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rlocks.html>

typeinfo
========


This module implements an interface to Nim's runtime type information (RTTI). See the <marshal> module for an example of what this module allows you to do.

 Note that even though `Any` and its operations hide the nasty low level details from its clients, it remains inherently unsafe! Also, Nim's runtime type information will evolve and may eventually be deprecated. As an alternative approach to programmatically understanding and manipulating types, consider using the <macros> package to work with the types' AST representation at compile time. See, for example, the [getTypeImpl proc](macros#getTypeImpl,NimNode). As an alternative approach to storing arbitrary types at runtime, consider using generics.

 Types
-----

  
```
AnyKind = enum
  akNone = 0,               ## invalid any
  akBool = 1,               ## any represents a ``bool``
  akChar = 2,               ## any represents a ``char``
  akEnum = 14,              ## any represents an enum
  akArray = 16,             ## any represents an array
  akObject = 17,            ## any represents an object
  akTuple = 18,             ## any represents a tuple
  akSet = 19,               ## any represents a set
  akRange = 20,             ## any represents a range
  akPtr = 21,               ## any represents a ptr
  akRef = 22,               ## any represents a ref
  akSequence = 24,          ## any represents a sequence
  akProc = 25,              ## any represents a proc
  akPointer = 26,           ## any represents a pointer
  akString = 28,            ## any represents a string
  akCString = 29,           ## any represents a cstring
  akInt = 31,               ## any represents an int
  akInt8 = 32,              ## any represents an int8
  akInt16 = 33,             ## any represents an int16
  akInt32 = 34,             ## any represents an int32
  akInt64 = 35,             ## any represents an int64
  akFloat = 36,             ## any represents a float
  akFloat32 = 37,           ## any represents a float32
  akFloat64 = 38,           ## any represents a float64
  akFloat128 = 39,          ## any represents a float128
  akUInt = 40,              ## any represents an unsigned int
  akUInt8 = 41,             ## any represents an unsigned int8
  akUInt16 = 42,            ## any represents an unsigned in16
  akUInt32 = 43,            ## any represents an unsigned int32
  akUInt64 = 44              ## any represents an unsigned int64
```
  what kind of `any` it is [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L31)  
```
Any = object
  value: pointer
  when defined(js):
      rawType: PNimType

  else:
      rawTypePtr: pointer
```
  can represent any nim value; NOTE: the wrapped value can be modified with its wrapper! This means that `Any` keeps a non-traced pointer to its wrapped value and **must not** live longer than its wrapped value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L64)   Procs
-----

  
```
proc toAny[T](x: var T): Any {...}{.inline.}
```
  Constructs a `Any` object from `x`. This captures `x`'s address, so `x` can be modified with its `Any` wrapper! The client needs to ensure that the wrapper **does not** live longer than `x`! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L153)  
```
proc kind(x: Any): AnyKind {...}{.inline, raises: [], tags: [].}
```
  Gets the type kind. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L159)  
```
proc size(x: Any): int {...}{.inline, raises: [], tags: [].}
```
  Returns the size of `x`'s type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L163)  
```
proc baseTypeKind(x: Any): AnyKind {...}{.inline, raises: [], tags: [].}
```
  Gets the base type's kind; `akNone` is returned if `x` has no base type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L167)  
```
proc baseTypeSize(x: Any): int {...}{.inline, raises: [], tags: [].}
```
  Returns the size of `x`'s basetype. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L172)  
```
proc invokeNew(x: Any) {...}{.raises: [], tags: [].}
```
  Performs `new(x)`. `x` needs to represent a `ref`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L177)  
```
proc invokeNewSeq(x: Any; len: int) {...}{.raises: [], tags: [].}
```
  Performs `newSeq(x, len)`. `x` needs to represent a `seq`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L186)  
```
proc extendSeq(x: Any) {...}{.raises: [], tags: [].}
```
  Performs `setLen(x, x.len+1)`. `x` needs to represent a `seq`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L198)  
```
proc setObjectRuntimeType(x: Any) {...}{.raises: [], tags: [].}
```
  This needs to be called to set `x`'s runtime object type field. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L214)  
```
proc `[]`(x: Any; i: int): Any {...}{.raises: [ValueError], tags: [].}
```
  Accessor for an any `x` that represents an array or a sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L229)  
```
proc `[]=`(x: Any; i: int; y: Any) {...}{.raises: [ValueError], tags: [].}
```
  Accessor for an any `x` that represents an array or a sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L255)  
```
proc len(x: Any): int {...}{.raises: [], tags: [].}
```
  `len` for an any `x` that represents an array or a sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L284)  
```
proc base(x: Any): Any {...}{.raises: [], tags: [].}
```
  Returns base Any (useful for inherited object types). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L301)  
```
proc isNil(x: Any): bool {...}{.raises: [], tags: [].}
```
  `isNil` for an any `x` that represents a cstring, proc or some pointer type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L307)  
```
proc getPointer(x: Any): pointer {...}{.raises: [], tags: [].}
```
  Retrieves the pointer value out of `x`. `x` needs to be of kind `akString`, `akCString`, `akProc`, `akRef`, `akPtr`, `akPointer`, `akSequence`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L318)  
```
proc setPointer(x: Any; y: pointer) {...}{.raises: [], tags: [].}
```
  Sets the pointer value of `x`. `x` needs to be of kind `akString`, `akCString`, `akProc`, `akRef`, `akPtr`, `akPointer`, `akSequence`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L325)  
```
proc `[]=`(x: Any; fieldName: string; value: Any) {...}{.raises: [ValueError],
    tags: [].}
```
  Sets a field of `x`; `x` represents an object or a tuple. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L403)  
```
proc `[]`(x: Any; fieldName: string): Any {...}{.raises: [ValueError], tags: [].}
```
  Gets a field of `x`; `x` represents an object or a tuple. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L417)  
```
proc `[]`(x: Any): Any {...}{.raises: [], tags: [].}
```
  Dereference operation for the any `x` that represents a ptr or a ref. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L433)  
```
proc `[]=`(x, y: Any) {...}{.raises: [], tags: [].}
```
  Dereference operation for the any `x` that represents a ptr or a ref. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L439)  
```
proc getInt(x: Any): int {...}{.raises: [], tags: [].}
```
  Retrieves the int value out of `x`. `x` needs to represent an int. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L445)  
```
proc getInt8(x: Any): int8 {...}{.raises: [], tags: [].}
```
  Retrieves the int8 value out of `x`. `x` needs to represent an int8. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L450)  
```
proc getInt16(x: Any): int16 {...}{.raises: [], tags: [].}
```
  Retrieves the int16 value out of `x`. `x` needs to represent an int16. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L455)  
```
proc getInt32(x: Any): int32 {...}{.raises: [], tags: [].}
```
  Retrieves the int32 value out of `x`. `x` needs to represent an int32. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L460)  
```
proc getInt64(x: Any): int64 {...}{.raises: [], tags: [].}
```
  Retrieves the int64 value out of `x`. `x` needs to represent an int64. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L465)  
```
proc getBiggestInt(x: Any): BiggestInt {...}{.raises: [], tags: [].}
```
  Retrieves the integer value out of `x`. `x` needs to represent some integer, a bool, a char, an enum or a small enough bit set. The value might be sign-extended to `BiggestInt`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L470)  
```
proc setBiggestInt(x: Any; y: BiggestInt) {...}{.raises: [], tags: [].}
```
  Sets the integer value of `x`. `x` needs to represent some integer, a bool, a char, an enum or a small enough bit set. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L496)  
```
proc getUInt(x: Any): uint {...}{.raises: [], tags: [].}
```
  Retrieves the uint value out of `x`, `x` needs to represent an uint. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L521)  
```
proc getUInt8(x: Any): uint8 {...}{.raises: [], tags: [].}
```
  Retrieves the uint8 value out of `x`, `x` needs to represent an uint8. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L526)  
```
proc getUInt16(x: Any): uint16 {...}{.raises: [], tags: [].}
```
  Retrieves the uint16 value out of `x`, `x` needs to represent an uint16. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L532)  
```
proc getUInt32(x: Any): uint32 {...}{.raises: [], tags: [].}
```
  Retrieves the uint32 value out of `x`, `x` needs to represent an uint32. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L538)  
```
proc getUInt64(x: Any): uint64 {...}{.raises: [], tags: [].}
```
  Retrieves the uint64 value out of `x`, `x` needs to represent an uint64. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L544)  
```
proc getBiggestUint(x: Any): uint64 {...}{.raises: [], tags: [].}
```
  Retrieves the unsigned integer value out of `x`. `x` needs to represent an unsigned integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L550)  
```
proc setBiggestUint(x: Any; y: uint64) {...}{.raises: [], tags: [].}
```
  Sets the unsigned integer value of `c`. `c` needs to represent an unsigned integer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L562)  
```
proc getChar(x: Any): char {...}{.raises: [], tags: [].}
```
  Retrieves the char value out of `x`. `x` needs to represent a char. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L574)  
```
proc getBool(x: Any): bool {...}{.raises: [], tags: [].}
```
  Retrieves the bool value out of `x`. `x` needs to represent a bool. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L580)  
```
proc skipRange(x: Any): Any {...}{.raises: [], tags: [].}
```
  Skips the range information of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L586)  
```
proc getEnumOrdinal(x: Any; name: string): int {...}{.raises: [], tags: [].}
```
  Gets the enum field ordinal from `name`. `x` needs to represent an enum but is only used to access the type information. In case of an error `low(int)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L592)  
```
proc getEnumField(x: Any; ordinalValue: int): string {...}{.raises: [], tags: [].}
```
  Gets the enum field name as a string. `x` needs to represent an enum but is only used to access the type information. The field name of `ordinalValue` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L608)  
```
proc getEnumField(x: Any): string {...}{.raises: [], tags: [].}
```
  Gets the enum field name as a string. `x` needs to represent an enum. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L626)  
```
proc getFloat(x: Any): float {...}{.raises: [], tags: [].}
```
  Retrieves the float value out of `x`. `x` needs to represent an float. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L630)  
```
proc getFloat32(x: Any): float32 {...}{.raises: [], tags: [].}
```
  Retrieves the float32 value out of `x`. `x` needs to represent an float32. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L635)  
```
proc getFloat64(x: Any): float64 {...}{.raises: [], tags: [].}
```
  Retrieves the float64 value out of `x`. `x` needs to represent an float64. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L640)  
```
proc getBiggestFloat(x: Any): BiggestFloat {...}{.raises: [], tags: [].}
```
  Retrieves the float value out of `x`. `x` needs to represent some float. The value is extended to `BiggestFloat`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L645)  
```
proc setBiggestFloat(x: Any; y: BiggestFloat) {...}{.raises: [], tags: [].}
```
  Sets the float value of `x`. `x` needs to represent some float. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L654)  
```
proc getString(x: Any): string {...}{.raises: [], tags: [].}
```
  Retrieves the string value out of `x`. `x` needs to represent a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L663)  
```
proc setString(x: Any; y: string) {...}{.raises: [], tags: [].}
```
  Sets the string value of `x`. `x` needs to represent a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L672)  
```
proc getCString(x: Any): cstring {...}{.raises: [], tags: [].}
```
  Retrieves the cstring value out of `x`. `x` needs to represent a cstring. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L677)  
```
proc assign(x, y: Any) {...}{.raises: [], tags: [].}
```
  Copies the value of `y` to `x`. The assignment operator for `Any` does NOT do this; it performs a shallow copy instead! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L682)  
```
proc inclSetElement(x: Any; elem: int) {...}{.raises: [], tags: [].}
```
  Includes an element `elem` in `x`. `x` needs to represent a Nim bitset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L710)   Iterators
---------

  
```
iterator fields(x: Any): tuple[name: string, any: Any] {...}{.raises: [], tags: [].}
```
  Iterates over every active field of the any `x` that represents an object or a tuple. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L349)  
```
iterator elements(x: Any): int {...}{.raises: [], tags: [].}
```
  Iterates over every element of `x` that represents a Nim bitset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/core/typeinfo.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/core/typeinfo.nim#L688)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/typeinfo.html>

typetraits
==========


This module defines compile-time reflection procs for working with types.

 Unstable API.

 Imports
-------

  <since>, <macros>  Types
-----

  
```
StaticParam[value] = object
```
  used to wrap a static value in `genericParams` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L96)   Procs
-----

  
```
proc name(t: typedesc): string {...}{.magic: "TypeTrait".}
```
  Returns the name of the given type.

 Alias for system.`$`(t) since Nim v0.20.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L18)  
```
proc arity(t: typedesc): int {...}{.magic: "TypeTrait".}
```
  Returns the arity of the given type. This is the number of "type" components or the number of generic parameters a given type `t` has. **Example:**

 
```
assert arity(seq[string]) == 1
assert arity(array[3, int]) == 2
assert arity((int, int, float, string)) == 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L23)  
```
proc genericHead(t: typedesc): typedesc {...}{.magic: "TypeTrait".}
```
  Accepts an instantiated generic type and returns its uninstantiated form. A compile-time error will be produced if the supplied type is not generic.

 See also:

 * [stripGenericParams](#stripGenericParams,typedesc)

 **Example:**

 
```
type
  Foo[T] = object
  FooInst = Foo[int]
  Foo2 = genericHead(FooInst)
doAssert Foo2 is Foo and Foo is Foo2
doAssert genericHead(Foo[seq[string]]) is Foo
doAssert not compiles(genericHead(int))

type Generic = concept f
  type _ = genericHead(typeof(f))
proc bar(a: Generic): typeof(a) = a
doAssert bar(Foo[string].default) == Foo[string]()
doAssert not compiles bar(string.default)

when false: # these don't work yet
  doAssert genericHead(Foo[int])[float] is Foo[float]
  doAssert seq[int].genericHead is seq
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L31)  
```
proc stripGenericParams(t: typedesc): typedesc {...}{.magic: "TypeTrait".}
```
  This trait is similar to [genericHead](#genericHead,typedesc), but instead of producing error for non-generic types, it will just return them unmodified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L58)  
```
proc supportsCopyMem(t: typedesc): bool {...}{.magic: "TypeTrait".}
```
  This trait returns true if the type `t` is safe to use for copyMem.

 Other languages name a type like these blob.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L63)  
```
proc isNamedTuple(T: typedesc): bool {...}{.magic: "TypeTrait".}
```
  Return true for named tuples, false for any other type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L69)  
```
proc distinctBase(T: typedesc): typedesc {...}{.magic: "TypeTrait".}
```
  Returns base type for distinct types, works only for distinct types. compile time error otherwise [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L72)  
```
proc tupleLen(T: typedesc[tuple]): int {...}{.magic: "TypeTrait".}
```
  Return number of elements of `T` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L84)   Templates
---------

  
```
template distinctBase[T](a: T): untyped
```
  overload for values **Example:**

 
```
type MyInt = distinct int
doAssert 12.MyInt.distinctBase == 12
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L77)  
```
template tupleLen(t: tuple): int
```
  Return number of elements of `t` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L87)  
```
template get(T: typedesc[tuple]; i: static int): untyped
```
  Return `i`th element of `T` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L91)  
```
template elementType(a: untyped): typedesc
```
  return element type of `a`, which can be any iterable (over which you can iterate) **Example:**

 
```
iterator myiter(n: int): auto =
  for i in 0..<n: yield i
doAssert elementType(@[1,2]) is int
doAssert elementType("asdf") is char
doAssert elementType(myiter(3)) is int
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L100)  
```
template genericParams(T: typedesc): untyped
```
  return tuple of generic params for generic `T` **Example:**

 
```
type Foo[T1, T2] = object
doAssert genericParams(Foo[float, string]) is (float, string)
type Bar[N: static float, T] = object
doAssert genericParams(Bar[1.0, string]) is (StaticParam[1.0], string)
doAssert genericParams(Bar[1.0, string]).get(0).value == 1.0
doAssert genericParams(seq[Bar[2.0, string]]).get(0) is Bar[2.0, string]
var s: seq[Bar[3.0, string]]
doAssert genericParams(typeof(s)) is (Bar[3.0, string],)

# NOTE: For the builtin array type, the index generic param will
#       **always** become a range type after it's bound to a variable.
doAssert genericParams(array[10, int]) is (StaticParam[10], int)
var a: array[10, int]
doAssert genericParams(typeof(a)) is (range[0..9], int)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/typetraits.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/typetraits.nim#L168)   Exports
-------

  [$](dollars#%24,int), [$](dollars#%24,cstring), [$](dollars#%24,array%5BIDX,T%5D), [$](dollars#%24,seq%5BT%5D), [$](dollars#%24,char), [$](dollars#%24,int64), [$](dollars#%24,Enum), [$](dollars#%24,openArray%5BT%5D), [$](dollars#%24,set%5BT%5D), [$](dollars#%24,T), [$](dollars#%24,bool), [$](dollars#%24,typedesc), [$](dollars#%24,HSlice%5BT,U%5D), [$](dollars#%24,string), [$](dollars#%24,uint64), [$](dollars#%24,float), [$](widestrs#%24,WideCString,int,int), [$](widestrs#%24,WideCString) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/typetraits.html>

volatile
========

 This module contains code for generating volatile loads and stores, which are useful in embedded and systems programming.

 Templates
---------

  
```
template volatileLoad[T](src: ptr T): T
```
  Generates a volatile load of the value stored in the container `src`. Note that this only effects code generation on `C` like backends [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/volatile.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/volatile.nim#L13)  
```
template volatileStore[T](dest: ptr T; val: T)
```
  Generates a volatile store into the container `dest` of the value `val`. Note that this only effects code generation on `C` like backends [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/volatile.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/volatile.nim#L26)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/volatile.html>

pegs
====

 Simple PEG (Parsing expression grammar) matching. Uses no memorization, but uses superoperators and symbol inlining to improve performance. Note: Matching performance is hopefully competitive with optimized regular expression engines. 


PEG syntax and semantics
------------------------


A PEG (Parsing expression grammar) is a simple deterministic grammar, that can be directly used for parsing. The current implementation has been designed as a more powerful replacement for regular expressions. UTF-8 is supported.

 The notation used for a PEG is similar to that of EBNF:

 

| notation | meaning |
| --- | --- |
| `A / ... / Z` | Ordered choice: Apply expressions `A`, ..., `Z`, in this order, to the text ahead, until one of them succeeds and possibly consumes some text. Indicate success if one of expressions succeeded. Otherwise do not consume any text and indicate failure. |
| `A ... Z` | Sequence: Apply expressions `A`, ..., `Z`, in this order, to consume consecutive portions of the text ahead, as long as they succeed. Indicate success if all succeeded. Otherwise do not consume any text and indicate failure. The sequence's precedence is higher than that of ordered choice: `A B / C` means `(A B) / Z` and not `A (B / Z)`. |
| `(E)` | Grouping: Parenthesis can be used to change operator priority. |
| `{E}` | Capture: Apply expression `E` and store the substring that matched `E` into a *capture* that can be accessed after the matching process. |
| `$i` | Back reference to the `i`th capture. `i` counts from 1. |
| `$` | Anchor: Matches at the end of the input. No character is consumed. Same as `!.`. |
| `^` | Anchor: Matches at the start of the input. No character is consumed. |
| `&E` | And predicate: Indicate success if expression `E` matches the text ahead; otherwise indicate failure. Do not consume any text. |
| `!E` | Not predicate: Indicate failure if expression E matches the text ahead; otherwise indicate success. Do not consume any text. |
| `E+` | One or more: Apply expression `E` repeatedly to match the text ahead, as long as it succeeds. Consume the matched text (if any) and indicate success if there was at least one match. Otherwise indicate failure. |
| `E*` | Zero or more: Apply expression `E` repeatedly to match the text ahead, as long as it succeeds. Consume the matched text (if any). Always indicate success. |
| `E?` | Zero or one: If expression `E` matches the text ahead, consume it. Always indicate success. |
| `[s]` | Character class: If the character ahead appears in the string `s`, consume it and indicate success. Otherwise indicate failure. |
| `[a-b]` | Character range: If the character ahead is one from the range `a` through `b`, consume it and indicate success. Otherwise indicate failure. |
| `'s'` | String: If the text ahead is the string `s`, consume it and indicate success. Otherwise indicate failure. |
| `i's'` | String match ignoring case. |
| `y's'` | String match ignoring style. |
| `v's'` | Verbatim string match: Use this to override a global `\i` or `\y` modifier. |
| `i$j` | String match ignoring case for back reference. |
| `y$j` | String match ignoring style for back reference. |
| `v$j` | Verbatim string match for back reference. |
| `.` | Any character: If there is a character ahead, consume it and indicate success. Otherwise (that is, at the end of input) indicate failure. |
| `_` | Any Unicode character: If there is an UTF-8 character ahead, consume it and indicate success. Otherwise indicate failure. |
| `@E` | Search: Shorthand for `(!E .)* E`. (Search loop for the pattern `E`.) |
| `{@} E` | Captured Search: Shorthand for `{(!E .)*} E`. (Search loop for the pattern `E`.) Everything until and exluding `E` is captured. |
| `@@ E` | Same as `{@} E`. |
| `A <- E` | Rule: Bind the expression `E` to the *nonterminal symbol* `A`. **Left recursive rules are not possible and crash the matching engine.** |
| `\identifier` | Built-in macro for a longer expression. |
| `\ddd` | Character with decimal code *ddd*. |
| `\"`, etc | Literal `"`, etc. |

 ### Built-in macros




| macro | meaning |
| --- | --- |
| `\d` | any decimal digit: `[0-9]` |
| `\D` | any character that is not a decimal digit: `[^0-9]` |
| `\s` | any whitespace character: `[ \9-\13]` |
| `\S` | any character that is not a whitespace character: `[^ \9-\13]` |
| `\w` | any "word" character: `[a-zA-Z0-9_]` |
| `\W` | any "non-word" character: `[^a-zA-Z0-9_]` |
| `\a` | same as `[a-zA-Z]` |
| `\A` | same as `[^a-zA-Z]` |
| `\n` | any newline combination: `\10 / \13\10 / \13` |
| `\i` | ignore case for matching; use this at the start of the PEG |
| `\y` | ignore style for matching; use this at the start of the PEG |
| `\skip` pat | skip pattern *pat* before trying to match other tokens; this is useful for whitespace skipping, for example: `\skip(\s*) {\ident} ':' {\ident}` matches key value pairs ignoring whitespace around the `':'`. |
| `\ident` | a standard ASCII identifier: `[a-zA-Z_][a-zA-Z_0-9]*` |
| `\letter` | any Unicode letter |
| `\upper` | any Unicode uppercase letter |
| `\lower` | any Unicode lowercase letter |
| `\title` | any Unicode title letter |
| `\white` | any Unicode whitespace character |


A backslash followed by a letter is a built-in macro, otherwise it is used for ordinary escaping:

 

| notation | meaning |
| --- | --- |
| `\\` | a single backslash |
| `\*` | same as `'*'` |
| `\t` | not a tabulator, but an (unknown) built-in |

 ### Supported PEG grammar


The PEG parser implements this grammar (written in PEG syntax):



```
# Example grammar of PEG in PEG syntax.
# Comments start with '#'.
# First symbol is the start symbol.

grammar <- rule* / expr

identifier <- [A-Za-z][A-Za-z0-9_]*
charsetchar <- "\\" . / [^\]]
charset <- "[" "^"? (charsetchar ("-" charsetchar)?)+ "]"
stringlit <- identifier? ("\"" ("\\" . / [^"])* "\"" /
                          "'" ("\\" . / [^'])* "'")
builtin <- "\\" identifier / [^\13\10]

comment <- '#' @ \n
ig <- (\s / comment)* # things to ignore

rule <- identifier \s* "<-" expr ig
identNoArrow <- identifier !(\s* "<-")
prefixOpr <- ig '&' / ig '!' / ig '@' / ig '{@}' / ig '@@'
literal <- ig identifier? '$' [0-9]+ / '$' / '^' /
           ig identNoArrow /
           ig charset /
           ig stringlit /
           ig builtin /
           ig '.' /
           ig '_' /
           (ig "(" expr ig ")")
postfixOpr <- ig '?' / ig '*' / ig '+'
primary <- prefixOpr* (literal postfixOpr*)

# Concatenation has higher priority than choice:
# ``a b / c`` means ``(a b) / c``

seqExpr <- primary+
expr <- seqExpr (ig "/" expr)*
```
 **Note**: As a special syntactic extension if the whole PEG is only a single expression, identifiers are not interpreted as non-terminals, but are interpreted as verbatim string:

 
```
abc =~ peg"abc" # is true
```

So it is not necessary to write `peg" 'abc' "` in the above example.

 ### Examples


Check if `s` matches Nim's "while" keyword:

 
```
s =~ peg" y'while'"
```

Exchange (key, val)-pairs:

 
```
"key: val; key2: val2".replacef(peg"{\ident} \s* ':' \s* {\ident}", "$2: $1")
```

Determine the `#include`'ed files of a C file:

 
```
for line in lines("myfile.c"):
  if line =~ peg"""s <- ws '#include' ws '"' {[^"]+} '"' ws
                   comment <- '/*' @ '*/' / '//' .*
                   ws <- (comment / \s+)* """:
    echo matches[0]
```
 ### PEG vs regular expression


As a regular expression `\[.*\]` matches the longest possible text between `'['` and `']'`. As a PEG it never matches anything, because a PEG is deterministic: `.*` consumes the rest of the input, so `\]` never matches. As a PEG this needs to be written as: `\[ ( !\] . )* \]` (or `\[ @ \]`).

 Note that the regular expression does not behave as intended either: in the example `*` should not be greedy, so `\[.*?\]` should be used instead.

 ### PEG construction


There are two ways to construct a PEG in Nim code:

 1. Parsing a string into an AST which consists of `Peg` nodes with the `peg` proc.
2. Constructing the AST directly with proc calls. This method does not support constructing rules, only simple expressions and is not as convenient. Its only advantage is that it does not pull in the whole PEG parser into your executable.

 Imports
-------

  <strutils>, <macros>, <unicode>  Types
-----

  
```
PegKind = enum
  pkEmpty, pkAny,           ## any character (.)
  pkAnyRune,                ## any Unicode character (_)
  pkNewLine,                ## CR-LF, LF, CR
  pkLetter,                 ## Unicode letter
  pkLower,                  ## Unicode lower case letter
  pkUpper,                  ## Unicode upper case letter
  pkTitle,                  ## Unicode title character
  pkWhitespace,             ## Unicode whitespace character
  pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle, pkChar, ## single character to match
  pkCharChoice, pkNonTerminal, pkSequence, ## a b c ... --> Internal DSL: peg(a, b, c)
  pkOrderedChoice,          ## a / b / ... --> Internal DSL: a / b or /[a, b, c]
  pkGreedyRep,              ## a*     --> Internal DSL: *a
                             ## a+     --> (a a*)
  pkGreedyRepChar,          ## x* where x is a single character (superop)
  pkGreedyRepSet,           ## [set]* (superop)
  pkGreedyAny,              ## .* or _* (superop)
  pkOption,                 ## a?     --> Internal DSL: ?a
  pkAndPredicate,           ## &a     --> Internal DSL: &a
  pkNotPredicate,           ## !a     --> Internal DSL: !a
  pkCapture,                ## {a}    --> Internal DSL: capture(a)
  pkBackRef,                ## $i     --> Internal DSL: backref(i)
  pkBackRefIgnoreCase, pkBackRefIgnoreStyle, pkSearch, ## @a     --> Internal DSL: !*a
  pkCapturedSearch,         ## {@} a  --> Internal DSL: !*\a
  pkRule,                   ## a <- b
  pkList,                   ## a, b
  pkStartAnchor              ## ^      --> Internal DSL: startAnchor()
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L35)  
```
NonTerminalFlag = enum
  ntDeclared, ntUsed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L70)  
```
Peg {...}{.shallow.} = object
  case kind: PegKind
  of pkEmpty .. pkWhitespace:
    nil
  of pkTerminal, pkTerminalIgnoreCase, pkTerminalIgnoreStyle:
    term: string
  of pkChar, pkGreedyRepChar:
    ch: char
  of pkCharChoice, pkGreedyRepSet:
    charChoice: ref set[char]
  of pkNonTerminal:
    nt: NonTerminal
  of pkBackRef .. pkBackRefIgnoreStyle:
    index: range[0 .. MaxSubpatterns]
  else:
    sons: seq[Peg]
```
  type that represents a PEG [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L78)  
```
NonTerminal = ref NonTerminalObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L87)  
```
Captures = object
  matches: array[0 .. 20 - 1, tuple[first, last: int]]
  ml: int
  origStart: int
```
  contains the captured substrings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L529)  
```
EInvalidPeg = object of ValueError
```
  raised if an invalid PEG has been detected [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1794)   Consts
------

  
```
MaxSubpatterns = 20
```
  defines the maximum number of subpatterns that can be captured. More subpatterns cannot be captured! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L31)   Procs
-----

  
```
proc kind(p: Peg): PegKind {...}{.raises: [], tags: [].}
```
  Returns the *PegKind* of a given *Peg* object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L89)  
```
proc term(p: Peg): string {...}{.raises: [], tags: [].}
```
  Returns the *string* representation of a given *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L92)  
```
proc ch(p: Peg): char {...}{.raises: [], tags: [].}
```
  Returns the *char* representation of a given *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L96)  
```
proc charChoice(p: Peg): ref set[char] {...}{.raises: [], tags: [].}
```
  Returns the *charChoice* field of a given *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L100)  
```
proc nt(p: Peg): NonTerminal {...}{.raises: [], tags: [].}
```
  Returns the *NonTerminal* object of a given *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L104)  
```
proc index(p: Peg): range[0 .. MaxSubpatterns] {...}{.raises: [], tags: [].}
```
  Returns the back-reference index of a captured sub-pattern in the *Captures* object for a given *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L108)  
```
proc name(nt: NonTerminal): string {...}{.raises: [], tags: [].}
```
  Gets the name of the symbol represented by the parent *Peg* object variant of a given *NonTerminal*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L122)  
```
proc line(nt: NonTerminal): int {...}{.raises: [], tags: [].}
```
  Gets the line number of the definition of the parent *Peg* object variant of a given *NonTerminal*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L126)  
```
proc col(nt: NonTerminal): int {...}{.raises: [], tags: [].}
```
  Gets the column number of the definition of the parent *Peg* object variant of a given *NonTerminal*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L130)  
```
proc flags(nt: NonTerminal): set[NonTerminalFlag] {...}{.raises: [], tags: [].}
```
  Gets the *NonTerminalFlag*-typed flags field of the parent *Peg* variant object of a given *NonTerminal*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L134)  
```
proc rule(nt: NonTerminal): Peg {...}{.raises: [], tags: [].}
```
  Gets the *Peg* object representing the rule definition of the parent *Peg* object variant of a given *NonTerminal*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L138)  
```
proc term(t: string): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1Str",
                            raises: [], tags: [].}
```
  constructs a PEG from a terminal string [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L142)  
```
proc termIgnoreCase(t: string): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1",
                                      raises: [], tags: [].}
```
  constructs a PEG from a terminal string; ignore case for matching [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L149)  
```
proc termIgnoreStyle(t: string): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1",
                                       raises: [], tags: [].}
```
  constructs a PEG from a terminal string; ignore style for matching [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L154)  
```
proc term(t: char): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1Char",
                          raises: [], tags: [].}
```
  constructs a PEG from a terminal char [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L159)  
```
proc charSet(s: set[char]): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1",
                                  raises: [], tags: [].}
```
  constructs a PEG from a character set `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L164)  
```
proc `/`(a: varargs[Peg]): Peg {...}{.noSideEffect, gcsafe,
                                 extern: "npegsOrderedChoice", raises: [],
                                 tags: [].}
```
  constructs an ordered choice with the PEGs in `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L197)  
```
proc sequence(a: varargs[Peg]): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1",
                                      raises: [], tags: [].}
```
  constructs a sequence with all the PEGs from `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L214)  
```
proc `?`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsOptional",
                        raises: [], tags: [].}
```
  constructs an optional for the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L219)  
```
proc `*`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsGreedyRep",
                        raises: [], tags: [].}
```
  constructs a "greedy repetition" for the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L229)  
```
proc `!*`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsSearch",
                         raises: [], tags: [].}
```
  constructs a "search" for the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L244)  
```
proc `!*\`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npgegsCapturedSearch",
                          raises: [], tags: [].}
```
  constructs a "captured search" for the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L248)  
```
proc `+`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsGreedyPosRep",
                        raises: [], tags: [].}
```
  constructs a "greedy positive repetition" with the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L253)  
```
proc `&`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsAndPredicate",
                        raises: [], tags: [].}
```
  constructs an "and predicate" with the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L257)  
```
proc `!`(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsNotPredicate",
                        raises: [], tags: [].}
```
  constructs a "not predicate" with the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L261)  
```
proc any(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG any character (`.`) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L265)  
```
proc anyRune(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG any rune (`_`) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L269)  
```
proc newLine(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG newline (`\n`) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L273)  
```
proc unicodeLetter(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `\letter` which matches any Unicode letter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L277)  
```
proc unicodeLower(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `\lower` which matches any Unicode lowercase letter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L281)  
```
proc unicodeUpper(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `\upper` which matches any Unicode uppercase letter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L285)  
```
proc unicodeTitle(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `\title` which matches any Unicode title letter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L289)  
```
proc unicodeWhitespace(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `\white` which matches any Unicode whitespace character. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L293)  
```
proc startAnchor(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `^` which matches the start of the input. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L298)  
```
proc endAnchor(): Peg {...}{.inline, raises: [], tags: [].}
```
  constructs the PEG `$` which matches the end of the input. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L302)  
```
proc capture(a: Peg): Peg {...}{.noSideEffect, gcsafe, extern: "npegsCapture",
                            raises: [], tags: [].}
```
  constructs a capture with the PEG `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L306)  
```
proc backref(index: range[1 .. MaxSubpatterns]): Peg {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  constructs a back reference of the given `index`. `index` starts counting from 1. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L310)  
```
proc backrefIgnoreCase(index: range[1 .. MaxSubpatterns]): Peg {...}{.noSideEffect,
    gcsafe, extern: "npegs$1", raises: [], tags: [].}
```
  constructs a back reference of the given `index`. `index` starts counting from 1. Ignores case for matching. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L316)  
```
proc backrefIgnoreStyle(index: range[1 .. MaxSubpatterns]): Peg {...}{.noSideEffect,
    gcsafe, extern: "npegs$1", raises: [], tags: [].}
```
  constructs a back reference of the given `index`. `index` starts counting from 1. Ignores style for matching. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L322)  
```
proc nonterminal(n: NonTerminal): Peg {...}{.noSideEffect, gcsafe, extern: "npegs$1",
                                        raises: [], tags: [].}
```
  constructs a PEG that consists of the nonterminal symbol [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L343)  
```
proc newNonTerminal(name: string; line, column: int): NonTerminal {...}{.
    noSideEffect, gcsafe, extern: "npegs$1", raises: [], tags: [].}
```
  constructs a nonterminal symbol [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L353)  
```
proc `$`(r: Peg): string {...}{.noSideEffect, gcsafe, extern: "npegsToString",
                           raises: [], tags: [].}
```
  converts a PEG to its string representation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L521)  
```
proc bounds(c: Captures; i: range[0 .. 20 - 1]): tuple[first, last: int] {...}{.
    raises: [], tags: [].}
```
  returns the bounds `[first..last]` of the `i`'th capture. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L534)  
```
proc rawMatch(s: string; p: Peg; start: int; c: var Captures): int {...}{.
    noSideEffect, gcsafe, extern: "npegs$1", raises: [], tags: [].}
```
  low-level matching proc that implements the PEG interpreter. Use this for maximum efficiency (every other PEG operation ends up calling this proc). Returns -1 if it does not match, else the length of the match [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L853)  
```
proc matchLen(s: string; pattern: Peg; matches: var openArray[string]; start = 0): int {...}{.
    noSideEffect, gcsafe, extern: "npegs$1Capture", raises: [], tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, -1 is returned. Note that a match length of zero can happen. It's possible that a suffix of `s` remains that does not belong to the match. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1062) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1062)  
```
proc matchLen(s: string; pattern: Peg; start = 0): int {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, -1 is returned. Note that a match length of zero can happen. It's possible that a suffix of `s` remains that does not belong to the match. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1073) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1073)  
```
proc match(s: string; pattern: Peg; matches: var openArray[string]; start = 0): bool {...}{.
    noSideEffect, gcsafe, extern: "npegs$1Capture", raises: [], tags: [].}
```
  returns `true` if `s[start..]` matches the `pattern` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `false` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1083) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1083)  
```
proc match(s: string; pattern: Peg; start = 0): bool {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  returns `true` if `s` matches the `pattern` beginning from `start`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1091) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1091)  
```
proc find(s: string; pattern: Peg; matches: var openArray[string]; start = 0): int {...}{.
    noSideEffect, gcsafe, extern: "npegs$1Capture", raises: [], tags: [].}
```
  returns the starting position of `pattern` in `s` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and -1 is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1097) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1097)  
```
proc findBounds(s: string; pattern: Peg; matches: var openArray[string];
                start = 0): tuple[first, last: int] {...}{.noSideEffect, gcsafe,
    extern: "npegs$1Capture", raises: [], tags: [].}
```
  returns the starting position and end position of `pattern` in `s` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and (-1,0) is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1112)  
```
proc find(s: string; pattern: Peg; start = 0): int {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  returns the starting position of `pattern` in `s`. If it does not match, -1 is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1129)  
```
proc findAll(s: string; pattern: Peg; start = 0): seq[string] {...}{.noSideEffect,
    gcsafe, extern: "npegs$1", raises: [], tags: [].}
```
  returns all matching *substrings* of `s` that match `pattern`. If it does not match, @[] is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1153)  
```
proc contains(s: string; pattern: Peg; start = 0): bool {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  same as `find(s, pattern, start) >= 0` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1188)  
```
proc contains(s: string; pattern: Peg; matches: var openArray[string]; start = 0): bool {...}{.
    noSideEffect, gcsafe, extern: "npegs$1Capture", raises: [], tags: [].}
```
  same as `find(s, pattern, matches, start) >= 0` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1193)  
```
proc startsWith(s: string; prefix: Peg; start = 0): bool {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  returns true if `s` starts with the pattern `prefix` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1198)  
```
proc endsWith(s: string; suffix: Peg; start = 0): bool {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  returns true if `s` ends with the pattern `suffix` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1203)  
```
proc replacef(s: string; sub: Peg; by: string): string {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [ValueError], tags: [].}
```
  Replaces `sub` in `s` by the string `by`. Captures can be accessed in `by` with the notation `$i` and `$#` (see strutils.`%`). Examples:
```
"var1=key; var2=key2".replacef(peg"{\ident}'='{\ident}", "$1<-$2$2")
```

Results in:

 
```
"var1<-keykey; val2<-key2key2"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1211)  
```
proc replace(s: string; sub: Peg; by = ""): string {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  Replaces `sub` in `s` by the string `by`. Captures cannot be accessed in `by`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1240)  
```
proc parallelReplace(s: string; subs: varargs[tuple[pattern: Peg, repl: string]]): string {...}{.
    noSideEffect, gcsafe, extern: "npegs$1", raises: [ValueError], tags: [].}
```
  Returns a modified copy of `s` with the substitutions in `subs` applied in parallel. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1257)  
```
proc replace(s: string; sub: Peg;
             cb: proc (match: int; cnt: int; caps: openArray[string]): string): string {...}{.
    gcsafe, extern: "npegs$1cb", raises: [], tags: [].}
```
  Replaces `sub` in `s` by the resulting strings from the callback. The callback proc receives the index of the current match (starting with 0), the count of captures and an open array with the captures of each match. Examples:
```
proc handleMatches*(m: int, n: int, c: openArray[string]): string =
  result = ""
  if m > 0:
    result.add ", "
  result.add case n:
    of 2: c[0].toLower & ": '" & c[1] & "'"
    of 1: c[0].toLower & ": ''"
    else: ""

let s = "Var1=key1;var2=Key2;   VAR3"
echo s.replace(peg"{\ident}('='{\ident})* ';'* \s*", handleMatches)
```

Results in:

 
```
"var1: 'key1', var2: 'Key2', var3: ''"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1281)  
```
proc transformFile(infile, outfile: string;
                   subs: varargs[tuple[pattern: Peg, repl: string]]) {...}{.gcsafe,
    extern: "npegs$1", raises: [IOError, ValueError],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  reads in the file `infile`, performs a parallel replacement (calls `parallelReplace`) and writes back to `outfile`. Raises `IOError` if an error occurs. This is supposed to be used for quick scripting.

 **Note**: this proc does not exist while using the JS backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1326)  
```
proc split(s: string; sep: Peg): seq[string] {...}{.noSideEffect, gcsafe,
    extern: "npegs$1", raises: [], tags: [].}
```
  Splits the string `s` into substrings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1373)  
```
proc parsePeg(pattern: string; filename = "pattern"; line = 1; col = 0): Peg {...}{.
    raises: [ValueError, EInvalidPeg, Exception], tags: [RootEffect].}
```
  constructs a Peg object from `pattern`. `filename`, `line`, `col` are used for error messages, but they only provide start offsets. `parsePeg` keeps track of line and column numbers within `pattern`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L2017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L2017)  
```
proc peg(pattern: string): Peg {...}{.raises: [ValueError, EInvalidPeg, Exception],
                                 tags: [RootEffect].}
```
  constructs a Peg object from the `pattern`. The short name has been chosen to encourage its use as a raw string modifier:
```
peg"{\ident} \s* '=' \s* {.*}"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L2032) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L2032)  
```
proc escapePeg(s: string): string {...}{.raises: [], tags: [].}
```
  escapes `s` so that it is matched verbatim when used as a peg. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L2039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L2039)   Iterators
---------

  
```
iterator items(p: Peg): Peg {...}{.inline, raises: [], tags: [].}
```
  Yields the child nodes of a *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L112)  
```
iterator pairs(p: Peg): (int, Peg) {...}{.inline, raises: [], tags: [].}
```
  Yields the indices and child nodes of a *Peg* variant object where present. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L117)  
```
iterator findAll(s: string; pattern: Peg; start = 0): string {...}{.raises: [],
    tags: [].}
```
  yields all matching *substrings* of `s` that match `pattern`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1139)  
```
iterator split(s: string; sep: Peg): string {...}{.raises: [], tags: [].}
```
  Splits the string `s` into substrings.

 Substrings are separated by the PEG `sep`. Examples:

 
```
for word in split("00232this02939is39an22example111", peg"\d+"):
  writeLine(stdout, word)
```

Results in:

 
```
"this"
"is"
"an"
"example"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1338)   Templates
---------

  
```
template letters(): Peg
```
  expands to `charset({'A'..'Z', 'a'..'z'})` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L358)  
```
template digits(): Peg
```
  expands to `charset({'0'..'9'})` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L362)  
```
template whitespace(): Peg
```
  expands to `charset({' ', '\9'..'\13'})` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L366)  
```
template identChars(): Peg
```
  expands to `charset({'a'..'z', 'A'..'Z', '0'..'9', '_'})` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L370)  
```
template identStartChars(): Peg
```
  expands to `charset({'A'..'Z', 'a'..'z', '_'})` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L374)  
```
template ident(): Peg
```
  same as `[a-zA-Z_][a-zA-z_0-9]*`; standard identifier [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L378)  
```
template natural(): Peg
```
  same as `\d+` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L383)  
```
template eventParser(pegAst, handlers: untyped): (proc (s: string): int)
```
  Generates an interpreting event parser *proc* according to the specified PEG AST and handler code blocks. The *proc* can be called with a string to be parsed and will execute the handler code blocks whenever their associated grammar element is matched. It returns -1 if the string does not match, else the length of the total match. The following example code evaluates an arithmetic expression defined by a simple PEG:
```
import strutils, pegs

let
  pegAst = """
Expr    <- Sum
Sum     <- Product (('+' / '-')Product)*
Product <- Value (('*' / '/')Value)*
Value   <- [0-9]+ / '(' Expr ')'
  """.peg
  txt = "(5+3)/2-7*22"

var
  pStack: seq[string] = @[]
  valStack: seq[float] = @[]
  opStack = ""
let
  parseArithExpr = pegAst.eventParser:
    pkNonTerminal:
      enter:
        pStack.add p.nt.name
      leave:
        pStack.setLen pStack.high
        if length > 0:
          let matchStr = s.substr(start, start+length-1)
          case p.nt.name
          of "Value":
            try:
              valStack.add matchStr.parseFloat
              echo valStack
            except ValueError:
              discard
          of "Sum", "Product":
            try:
              let val = matchStr.parseFloat
            except ValueError:
              if valStack.len > 1 and opStack.len > 0:
                valStack[^2] = case opStack[^1]
                of '+': valStack[^2] + valStack[^1]
                of '-': valStack[^2] - valStack[^1]
                of '*': valStack[^2] * valStack[^1]
                else: valStack[^2] / valStack[^1]
                valStack.setLen valStack.high
                echo valStack
                opStack.setLen opStack.high
                echo opStack
    pkChar:
      leave:
        if length == 1 and "Value" != pStack[^1]:
          let matchChar = s[start]
          opStack.add matchChar
          echo opStack

let pLen = parseArithExpr(txt)
```

The *handlers* parameter consists of code blocks for *PegKinds*, which define the grammar elements of interest. Each block can contain handler code to be executed when the parser enters and leaves text matching the grammar element. An *enter* handler can access the specific PEG AST node being matched as *p*, the entire parsed string as *s* and the position of the matched text segment in *s* as *start*. A *leave* handler can access *p*, *s*, *start* and also the length of the matched text segment as *length*. For an unsuccessful match, the *enter* and *leave* handlers will be executed, with *length* set to -1.

 Symbols declared in an *enter* handler can be made visible in the corresponding *leave* handler by annotating them with an *inject* pragma.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L934) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L934)  
```
template `=~`(s: string; pattern: Peg): bool
```
  This calls `match` with an implicit declared `matches` array that can be used in the scope of the `=~` call:
```
if line =~ peg"\s* {\w+} \s* '=' \s* {\w+}":
  # matches a key=value pair:
  echo("Key: ", matches[0])
  echo("Value: ", matches[1])
elif line =~ peg"\s*{'#'.*}":
  # matches a comment
  # note that the implicit ``matches`` array is different from the
  # ``matches`` array of the first branch
  echo("comment: ", matches[0])
else:
  echo("syntax error")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pegs.nim#L1163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pegs.nim#L1163)   Exports
-------

  [==](unicode#==,Rune,Rune) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/pegs.html>

punycode
========

 Implements a representation of Unicode with the limited ASCII character subset. 


**Example:**

 
```
static:
  block:
    doAssert encode("") == ""
    doAssert encode("a") == "a-"
    doAssert encode("A") == "A-"
    doAssert encode("3") == "3-"
    doAssert encode("-") == "--"
    doAssert encode("--") == "---"
    doAssert encode("abc") == "abc-"
    doAssert encode("London") == "London-"
    doAssert encode("Lloyd-Atkinson") == "Lloyd-Atkinson-"
    doAssert encode("This has spaces") == "This has spaces-"
    doAssert encode("ü") == "tda"
    doAssert encode("München") == "Mnchen-3ya"
    doAssert encode("Mnchen-3ya") == "Mnchen-3ya-"
    doAssert encode("München-Ost") == "Mnchen-Ost-9db"
    doAssert encode("Bahnhof München-Ost") == "Bahnhof Mnchen-Ost-u6b"
  block:
    doAssert decode("") == ""
    doAssert decode("a-") ==  "a"
    doAssert decode("A-") == "A"
    doAssert decode("3-") == "3"
    doAssert decode("--") == "-"
    doAssert decode("---") == "--"
    doAssert decode("abc-") == "abc"
    doAssert decode("London-") == "London"
    doAssert decode("Lloyd-Atkinson-") == "Lloyd-Atkinson"
    doAssert decode("This has spaces-") == "This has spaces"
    doAssert decode("tda") == "ü"
    doAssert decode("Mnchen-3ya") == "München"
    doAssert decode("Mnchen-3ya-") == "Mnchen-3ya"
    doAssert decode("Mnchen-Ost-9db") == "München-Ost"
    doAssert decode("Bahnhof Mnchen-Ost-u6b") == "Bahnhof München-Ost"
```
 Imports
-------

  <strutils>, <unicode>  Types
-----

  
```
PunyError = object of ValueError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/punycode.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/punycode.nim#L29)   Procs
-----

  
```
proc encode(prefix, s: string): string {...}{.raises: [PunyError], tags: [].}
```
  Encode a string that may contain Unicode. Prepend `prefix` to the result [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/punycode.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/punycode.nim#L61)  
```
proc encode(s: string): string {...}{.raises: [PunyError], tags: [].}
```
  Encode a string that may contain Unicode. Prefix is empty. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/punycode.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/punycode.nim#L117)  
```
proc decode(encoded: string): string {...}{.raises: [PunyError], tags: [].}
```
  Decode a Punycode-encoded string [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/punycode.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/punycode.nim#L121)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/punycode.html>

ropes
=====

 This module contains support for a rope data type. Ropes can represent very long strings efficiently; especially concatenation is done in O(1) instead of O(n). They are essentially concatenation trees that are only flattened when converting to a native Nim string. The empty string is represented by `nil`. Ropes are immutable and subtrees can be shared without copying. Leaves can be cached for better memory efficiency at the cost of runtime efficiency.

 Imports
-------

  <streams>  Types
-----

  
```
Rope = ref RopeObj
```
  empty rope is represented by nil [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L32)   Procs
-----

  
```
proc len(a: Rope): int {...}{.gcsafe, extern: "nro$1", raises: [], tags: [].}
```
  The rope's length. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L46)  
```
proc rope(s: string = ""): Rope {...}{.gcsafe, extern: "nro$1Str", raises: [],
                                  tags: [].}
```
  Converts a string to a rope. **Example:**

 
```
var r = rope("I'm a rope")
doAssert $r == "I'm a rope"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L128)  
```
proc rope(i: BiggestInt): Rope {...}{.gcsafe, extern: "nro$1BiggestInt", raises: [],
                                 tags: [].}
```
  Converts an int to a rope. **Example:**

 
```
var r = rope(429)
doAssert $r == "429"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L146)  
```
proc rope(f: BiggestFloat): Rope {...}{.gcsafe, extern: "nro$1BiggestFloat",
                                   raises: [], tags: [].}
```
  Converts a float to a rope. **Example:**

 
```
var r = rope(4.29)
doAssert $r == "4.29"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L153)  
```
proc enableCache() {...}{.gcsafe, extern: "nro$1", raises: [], tags: [].}
```
  Enables the caching of leaves. This reduces the memory footprint at the cost of runtime efficiency. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L160)  
```
proc disableCache() {...}{.gcsafe, extern: "nro$1", raises: [], tags: [].}
```
  The cache is discarded and disabled. The GC will reuse its used memory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L165)  
```
proc `&`(a, b: Rope): Rope {...}{.gcsafe, extern: "nroConcRopeRope", raises: [],
                             tags: [].}
```
  The concatenation operator for ropes. **Example:**

 
```
var
  r1 = rope("Hello, ")
  r2 = rope("Nim!")

let r = r1 & r2
doAssert $r == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L170)  
```
proc `&`(a: Rope; b: string): Rope {...}{.gcsafe, extern: "nroConcRopeStr",
                                     raises: [], tags: [].}
```
  The concatenation operator for ropes. **Example:**

 
```
var
  r1 = rope("Hello, ")
  r2 = "Nim!"

let r = r1 & r2
doAssert $r == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L189)  
```
proc `&`(a: string; b: Rope): Rope {...}{.gcsafe, extern: "nroConcStrRope",
                                     raises: [], tags: [].}
```
  The concatenation operator for ropes. **Example:**

 
```
var
  r1 = "Hello, "
  r2 = rope("Nim!")

let r = r1 & r2
doAssert $r == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L200)  
```
proc `&`(a: openArray[Rope]): Rope {...}{.gcsafe, extern: "nroConcOpenArray",
                                     raises: [], tags: [].}
```
  The concatenation operator for an openarray of ropes. **Example:**

 
```
let s = @[rope("Hello, "), rope("Nim"), rope("!")]
let r = &s
doAssert $r == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L211)  
```
proc add(a: var Rope; b: Rope) {...}{.gcsafe, extern: "nro$1Rope", raises: [],
                                 tags: [].}
```
  Adds `b` to the rope `a`. **Example:**

 
```
var
  r1 = rope("Hello, ")
  r2 = rope("Nim!")

r1.add(r2)
doAssert $r1 == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L219)  
```
proc add(a: var Rope; b: string) {...}{.gcsafe, extern: "nro$1Str", raises: [],
                                   tags: [].}
```
  Adds `b` to the rope `a`. **Example:**

 
```
var
  r1 = rope("Hello, ")
  r2 = "Nim!"

r1.add(r2)
doAssert $r1 == "Hello, Nim!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L230)  
```
proc `[]`(r: Rope; i: int): char {...}{.gcsafe, extern: "nroCharAt", raises: [],
                                   tags: [].}
```
  Returns the character at position `i` in the rope `r`. This is quite expensive! Worst-case: O(n). If `i >= r.len`, `\0` is returned. **Example:**

 
```
let r1 = rope("Hello, Nim!")

doAssert r1[0] == 'H'
doAssert r1[7] == 'N'
doAssert r1[22] == '\0'

let r2 = rope("Hello") & rope(", Nim!")

doAssert r2[0] == 'H'
doAssert r2[7] == 'N'
doAssert r2[22] == '\0'
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L241)  
```
proc write(f: File; r: Rope) {...}{.gcsafe, extern: "nro$1", raises: [IOError],
                               tags: [WriteIOEffect].}
```
  Writes a rope to a file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L297)  
```
proc write(s: Stream; r: Rope) {...}{.gcsafe, extern: "nroWriteStream",
                                 raises: [IOError, OSError],
                                 tags: [WriteIOEffect].}
```
  Writes a rope to a stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L301)  
```
proc `$`(r: Rope): string {...}{.gcsafe, extern: "nroToString", raises: [], tags: [].}
```
  Converts a rope back to a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L305)  
```
proc `%`(frmt: string; args: openArray[Rope]): Rope {...}{.gcsafe,
    extern: "nroFormat", raises: [ValueError], tags: [].}
```
  `%` substitution operator for ropes. Does not support the `$identifier` nor `${identifier}` notations. **Example:**

 
```
let r1 = "$1 $2 $3" % [rope("Nim"), rope("is"), rope("a great language")]
doAssert $r1 == "Nim is a great language"

let r2 = "$# $# $#" % [rope("Nim"), rope("is"), rope("a great language")]
doAssert $r2 == "Nim is a great language"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L310)  
```
proc addf(c: var Rope; frmt: string; args: openArray[Rope]) {...}{.gcsafe,
    extern: "nro$1", raises: [ValueError], tags: [].}
```
  Shortcut for `add(c, frmt % args)`. **Example:**

 
```
var r = rope("Dash: ")
r.addf "$1 $2 $3", [rope("Nim"), rope("is"), rope("a great language")]
doAssert $r == "Dash: Nim is a great language"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L360)  
```
proc equalsFile(r: Rope; f: File): bool {...}{.gcsafe, extern: "nro$1File",
    raises: [IOError], tags: [ReadIOEffect].}
```
  Returns true if the contents of the file `f` equal `r`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L373)  
```
proc equalsFile(r: Rope; filename: string): bool {...}{.gcsafe, extern: "nro$1Str",
    raises: [IOError], tags: [ReadIOEffect].}
```
  Returns true if the contents of the file `f` equal `r`. If `f` does not exist, false is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L402)   Iterators
---------

  
```
iterator leaves(r: Rope): string {...}{.raises: [], tags: [].}
```
  Iterates over any leaf string in the rope `r`. **Example:**

 
```
let r = rope("Hello") & rope(", Nim!")
let s = ["Hello", ", Nim!"]
var index = 0
for leave in r.leaves:
  doAssert leave == s[index]
  inc index
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L271)  
```
iterator items(r: Rope): char {...}{.raises: [], tags: [].}
```
  Iterates over any character in the rope `r`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ropes.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ropes.nim#L292)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/ropes.html>

strformat
=========

 String interpolation / format inspired by Python's `f`-strings. 



`fmt` vs. `&`
--------------


You can use either `fmt` or the unary `&` operator for formatting. The difference between them is subtle but important.

 The `fmt"{expr}"` syntax is more aesthetically pleasing, but it hides a small gotcha. The string is a [generalized raw string literal](manual#lexical-analysis-generalized-raw-string-literals). This has some surprising effects:

 
```
import strformat
let msg = "hello"
doAssert fmt"{msg}\n" == "hello\\n"
```

Because the literal is a raw string literal, the `\n` is not interpreted as an escape sequence.

 There are multiple ways to get around this, including the use of the `&` operator:

 
```
import strformat
let msg = "hello"

doAssert &"{msg}\n" == "hello\n"

doAssert fmt"{msg}{'\n'}" == "hello\n"
doAssert fmt("{msg}\n") == "hello\n"
doAssert "{msg}\n".fmt == "hello\n"
```

The choice of style is up to you.

 Formatting strings
------------------



```
import strformat

doAssert &"""{"abc":>4}""" == " abc"
doAssert &"""{"abc":<4}""" == "abc "
```
 Formatting floats
-----------------



```
import strformat
doAssert fmt"{-12345:08}" == "-0012345"
doAssert fmt"{-1:3}" == " -1"
doAssert fmt"{-1:03}" == "-01"
doAssert fmt"{16:#X}" == "0x10"

doAssert fmt"{123.456}" == "123.456"
doAssert fmt"{123.456:>9.3f}" == "  123.456"
doAssert fmt"{123.456:9.3f}" == "  123.456"
doAssert fmt"{123.456:9.4f}" == " 123.4560"
doAssert fmt"{123.456:>9.0f}" == "     123."
doAssert fmt"{123.456:<9.4f}" == "123.4560 "

doAssert fmt"{123.456:e}" == "1.234560e+02"
doAssert fmt"{123.456:>13e}" == " 1.234560e+02"
doAssert fmt"{123.456:13e}" == " 1.234560e+02"
```
 Debugging strings
-----------------


`fmt"{expr=}"` expands to `fmt"expr={expr}"` namely the text of the expression, an equal sign and the results of evaluated expression.

 
```
import strformat
doAssert fmt"{123.456=}" == "123.456=123.456"
doAssert fmt"{123.456=:>9.3f}" == "123.456=  123.456"

let x = "hello"
doAssert fmt"{x=}" == "x=hello"
doAssert fmt"{x =}" == "x =hello"

let y = 3.1415926
doAssert fmt"{y=:.2f}" == fmt"y={y:.2f}"
doAssert fmt"{y=}" == fmt"y={y}"
doAssert fmt"{y = : <8}" == fmt"y = 3.14159 "

proc hello(a: string, b: float): int = 12
let a = "hello"
let b = 3.1415926
doAssert fmt"{hello(x, y) = }" == "hello(x, y) = 12"
doAssert fmt"{x.hello(y) = }" == "x.hello(y) = 12"
doAssert fmt"{hello x, y = }" == "hello x, y = 12"
```

Note that it is space sensitive:

 
```
import strformat
let x = "12"
doAssert fmt"{x=}" == "x=12"
doAssert fmt"{x =:}" == "x =12"
doAssert fmt"{x =}" == "x =12"
doAssert fmt"{x= :}" == "x= 12"
doAssert fmt"{x= }" == "x= 12"
doAssert fmt"{x = :}" == "x = 12"
doAssert fmt"{x = }" == "x = 12"
doAssert fmt"{x   =  :}" == "x   =  12"
doAssert fmt"{x   =  }" == "x   =  12"
```
 Implementation details
----------------------


An expression like `&"{key} is {value:arg} {{z}}"` is transformed into:

 
```
var temp = newStringOfCap(educatedCapGuess)
temp.formatValue key, ""
temp.add " is "
temp.formatValue value, arg
temp.add " {z}"
temp
```

Parts of the string that are enclosed in the curly braces are interpreted as Nim code, to escape an `{` or `}` double it.

 `&` delegates most of the work to an open overloaded set of `formatValue` procs. The required signature for a type `T` that supports formatting is usually `proc formatValue(result: var string; x: T; specifier: string)`.

 The subexpression after the colon (`arg` in `&"{key} is {value:arg} {{z}}"`) is optional. It will be passed as the last argument to `formatValue`. When the colon with the subexpression it is left out, an empty string will be taken instead.

 For strings and numeric types the optional argument is a so-called "standard format specifier".

 Standard format specifier for strings, integers and floats
----------------------------------------------------------


The general form of a standard format specifier is:



```
[[fill]align][sign][#][0][minimumwidth][.precision][type]
```
 The square brackets `[]` indicate an optional element.

 The optional align flag can be one of the following:

 
'<' Forces the field to be left-aligned within the available space. (This is the default for strings.) '>' Forces the field to be right-aligned within the available space. (This is the default for numbers.) '^' Forces the field to be centered within the available space.  Note that unless a minimum field width is defined, the field width will always be the same size as the data to fill it, so that the alignment option has no meaning in this case.

 The optional 'fill' character defines the character to be used to pad the field to the minimum width. The fill character, if present, must be followed by an alignment flag.

 The 'sign' option is only valid for numeric types, and can be one of the following:

 

| Sign | Meaning |
| --- | --- |
| `+` | Indicates that a sign should be used for both positive as well as negative numbers. |
| `-` | Indicates that a sign should be used only for negative numbers (this is the default behavior). |
| (space) | Indicates that a leading space should be used on positive numbers. |


If the '#' character is present, integers use the 'alternate form' for formatting. This means that binary, octal, and hexadecimal output will be prefixed with '0b', '0o', and '0x', respectively.

 'width' is a decimal integer defining the minimum field width. If not specified, then the field width will be determined by the content.

 If the width field is preceded by a zero ('0') character, this enables zero-padding.

 The 'precision' is a decimal number indicating how many digits should be displayed after the decimal point in a floating point conversion. For non-numeric types the field indicates the maximum field size - in other words, how many characters will be used from the field content. The precision is ignored for integer conversions.

 Finally, the 'type' determines how the data should be presented.

 The available integer presentation types are:

 

| Type | Result |
| --- | --- |
| `b` | Binary. Outputs the number in base 2. |
| `d` | Decimal Integer. Outputs the number in base 10. |
| `o` | Octal format. Outputs the number in base 8. |
| `x` | Hex format. Outputs the number in base 16, using lower-case letters for the digits above 9. |
| `X` | Hex format. Outputs the number in base 16, using uppercase letters for the digits above 9. |
| (None) | the same as 'd' |


The available floating point presentation types are:

 

| Type | Result |
| --- | --- |
| `e` | Exponent notation. Prints the number in scientific notation using the letter 'e' to indicate the exponent. |
| `E` | Exponent notation. Same as 'e' except it converts the number to uppercase. |
| `f` | Fixed point. Displays the number as a fixed-point number. |
| `F` | Fixed point. Same as 'f' except it converts the number to uppercase. |
| `g` | General format. This prints the number as a fixed-point number, unless the number is too large, in which case it switches to 'e' exponent notation. |
| `G` | General format. Same as 'g' except switches to 'E' if the number gets to large. |
| (None) | similar to 'g', except that it prints at least one digit after the decimal point. |

 Limitations
-----------


Because of the well defined order how templates and macros are expanded, strformat cannot expand template arguments:

 
```
template myTemplate(arg: untyped): untyped =
  echo "arg is: ", arg
  echo &"--- {arg} ---"

let x = "abc"
myTemplate(x)
```

First the template `myTemplate` is expanded, where every identifier `arg` is substituted with its argument. The `arg` inside the format string is not seen by this process, because it is part of a quoted string literal. It is not an identifier yet. Then the strformat macro creates the `arg` identifier from the string literal. An identifier that cannot be resolved anymore.

 The workaround for this is to bind the template argument to a new local variable.

 
```
template myTemplate(arg: untyped): untyped =
  block:
    let arg1 {.inject.} = arg
    echo "arg is: ", arg1
    echo &"--- {arg1} ---"
```

The use of `{.inject.}` here is necessary again because of template expansion order and hygienic templates. But since we generally want to keep the hygienicness of `myTemplate`, and we do not want `arg1` to be injected into the context where `myTemplate` is expanded, everything is wrapped in a `block`.

 Future directions
-----------------


A curly expression with commas in it like `{x, argA, argB}` could be transformed to `formatValue(result, x, argA, argB)` in order to support formatters that do not need to parse a custom language within a custom language but instead prefer to use Nim's existing syntax. This also helps in readability since there is only so much you can cram into single letter DSLs.

 Imports
-------

  <macros>, <parseutils>, <unicode>, <strutils>  Types
-----

  
```
StandardFormatSpecifier = object
  fill*, align*: char        ## Desired fill and alignment.
  sign*: char                ## Desired sign.
  alternateForm*: bool       ## Whether to prefix binary, octal and hex numbers
                             ## with ``0b``, ``0o``, ``0x``.
  padWithZero*: bool         ## Whether to pad with zeros rather than spaces.
  minimumWidth*, precision*: int ## Desired minimum width and precision.
  typ*: char                 ## Type like 'f', 'g' or 'd'.
  endPosition*: int          ## End position in the format specifier after
                             ## ``parseStandardFormatSpecifier`` returned.
```
  Type that describes "standard format specifiers". [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L342)   Procs
-----

  
```
proc alignString(s: string; minimumWidth: int; align = '\x00'; fill = ' '): string {...}{.
    raises: [], tags: [].}
```
  Aligns `s` using `fill` char. This is only of interest if you want to write a custom `format` proc that should support the standard format specifiers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L321)  
```
proc parseStandardFormatSpecifier(s: string; start = 0;
                                  ignoreUnknownSuffix = false): StandardFormatSpecifier {...}{.
    raises: [ValueError], tags: [].}
```
  An exported helper proc that parses the "standard format specifiers", as specified by the grammar:



```
[[fill]align][sign][#][0][minimumwidth][.precision][type]
```
 This is only of interest if you want to write a custom `format` proc that should support the standard format specifiers. If `ignoreUnknownSuffix` is true, an unknown suffix after the `type` field is not an error.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L413)  
```
proc formatValue[T: SomeInteger](result: var string; value: T; specifier: string)
```
  Standard format implementation for `SomeInteger`. It makes little sense to call this directly, but it is required to exist by the `&` macro. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L465)  
```
proc formatValue(result: var string; value: SomeFloat; specifier: string)
```
  Standard format implementation for `SomeFloat`. It makes little sense to call this directly, but it is required to exist by the `&` macro. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L486)  
```
proc formatValue(result: var string; value: string; specifier: string) {...}{.
    raises: [ValueError], tags: [].}
```
  Standard format implementation for `string`. It makes little sense to call this directly, but it is required to exist by the `&` macro. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L543)   Macros
------

  
```
macro `&`(pattern: string): untyped
```
  For a specification of the `&` macro, see the module level documentation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L649)  
```
macro fmt(pattern: string): untyped
```
  An alias for `&`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L652) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L652)  
```
macro fmt(pattern: string; openChar, closeChar: char): untyped
```
  Use `openChar` instead of '{' and `closeChar` instead of '}' **Example:**

 
```
let testInt = 123
doAssert "<testInt>".fmt('<', '>') == "123"
doAssert """(()"foo" & "bar"())""".fmt(')', '(') == "(foobar)"
doAssert """ ""{"123+123"}"" """.fmt('"', '"') == " \"{246}\" "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strformat.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strformat.nim#L655)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/strformat.html>

strmisc
=======

 This module contains various string utility routines that are uncommonly used in comparison to <strutils>.

 Imports
-------

  <strutils>  Procs
-----

  
```
proc expandTabs(s: string; tabSize: int = 8): string {...}{.noSideEffect, raises: [],
    tags: [].}
```
  Expand tab characters in `s` replacing them by spaces.

 The amount of inserted spaces for each tab character is the difference between the current column number and the next tab position. Tab positions occur every `tabSize` characters. The column number starts at 0 and is increased with every single character and inserted space, except for newline, which resets the column number back to 0.

 **Example:**

 
```
doAssert expandTabs("\t", 4) == "    "
doAssert expandTabs("\tfoo\t", 4) == "    foo "
doAssert expandTabs("\tfoo\tbar", 4) == "    foo bar"
doAssert expandTabs("\tfoo\tbar\t", 4) == "    foo bar "
doAssert expandTabs("ab\tcd\n\txy\t", 3) == "ab cd\n   xy "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strmisc.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strmisc.nim#L15)  
```
proc partition(s: string; sep: string; right: bool = false): (string, string,
    string) {...}{.noSideEffect, raises: [], tags: [].}
```
  Split the string at the first or last occurrence of `sep` into a 3-tuple

 Returns a 3 string tuple of (beforeSep, `sep`, afterSep) or (`s`, "", "") if `sep` is not found and `right` is false or ("", "", `s`) if `sep` is not found and `right` is true

 **Example:**

 
```
doAssert partition("foo:bar", ":") == ("foo", ":", "bar")
doAssert partition("foobarbar", "bar") == ("foo", "bar", "bar")
doAssert partition("foobarbar", "bank") == ("foobarbar", "", "")
doAssert partition("foobarbar", "foo") == ("", "foo", "barbar")
doAssert partition("foofoobar", "bar") == ("foofoo", "bar", "")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strmisc.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strmisc.nim#L53)  
```
proc rpartition(s: string; sep: string): (string, string, string) {...}{.
    noSideEffect, raises: [], tags: [].}
```
  Split the string at the last occurrence of `sep` into a 3-tuple

 Returns a 3 string tuple of (beforeSep, `sep`, afterSep) or ("", "", `s`) if `sep` is not found

 **Example:**

 
```
doAssert rpartition("foo:bar", ":") == ("foo", ":", "bar")
doAssert rpartition("foobarbar", "bar") == ("foobar", "bar", "")
doAssert rpartition("foobarbar", "bank") == ("", "", "foobarbar")
doAssert rpartition("foobarbar", "foo") == ("", "foo", "barbar")
doAssert rpartition("foofoobar", "bar") == ("foofoo", "bar", "")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strmisc.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strmisc.nim#L73)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/strmisc.html>

strscans
========

 This module contains a scanf macro that can be used for extracting substrings from an input string. This is often easier than regular expressions. Some examples as an appetizer:



```
# check if input string matches a triple of integers:
const input = "(1,2,4)"
var x, y, z: int
if scanf(input, "($i,$i,$i)", x, y, z):
  echo "matches and x is ", x, " y is ", y, " z is ", z

# check if input string matches an ISO date followed by an identifier followed
# by whitespace and a floating point number:
var year, month, day: int
var identifier: string
var myfloat: float
if scanf(input, "$i-$i-$i $w$s$f", year, month, day, identifier, myfloat):
  echo "yes, we have a match!"
```

As can be seen from the examples, strings are matched verbatim except for substrings starting with `$`. These constructions are available:

 

|  |  |
| --- | --- |
| `$b` | Matches a binary integer. This uses `parseutils.parseBin`. |
| `$o` | Matches an octal integer. This uses `parseutils.parseOct`. |
| `$i` | Matches a decimal integer. This uses `parseutils.parseInt`. |
| `$h` | Matches a hex integer. This uses `parseutils.parseHex`. |
| `$f` | Matches a floating pointer number. Uses `parseFloat`. |
| `$w` | Matches an ASCII identifier: `[A-Za-z_][A-Za-z_0-9]*`. |
| `$s` | Skips optional whitespace. |
| `$$` | Matches a single dollar sign. |
| `$.` | Matches if the end of the input string has been reached. |
| `$*` | Matches until the token following the `$*` was found. The match is allowed to be of 0 length. |
| `$+` | Matches until the token following the `$+` was found. The match must consist of at least one char. |
| `${foo}` | User defined matcher. Uses the proc `foo` to perform the match. See below for more details. |
| `$[foo]` | Call user defined proc `foo` to **skip** some optional parts in the input string. See below for more details. |


Even though `$*` and `$+` look similar to the regular expressions `.*` and `.+` they work quite differently, there is no non-deterministic state machine involved and the matches are non-greedy. `[$*]` matches `[xyz]` via `parseutils.parseUntil`.

 Furthermore no backtracking is performed, if parsing fails after a value has already been bound to a matched subexpression this value is not restored to its original value. This rarely causes problems in practice and if it does for you, it's easy enough to bind to a temporary variable first.

 Startswith vs full match
------------------------


`scanf` returns true if the input string **starts with** the specified pattern. If instead it should only return true if there is also nothing left in the input, append `$.` to your pattern.

 User definable matchers
-----------------------


One very nice advantage over regular expressions is that `scanf` is extensible with ordinary Nim procs. The proc is either enclosed in `${}` or in `$[]`. `${}` matches and binds the result to a variable (that was passed to the `scanf` macro) while `$[]` merely matches optional tokens without any result binding.

 In this example, we define a helper proc `someSep` that skips some separators which we then use in our scanf pattern to help us in the matching process:

 
```
proc someSep(input: string; start: int; seps: set[char] = {':','-','.'}): int =
  # Note: The parameters and return value must match to what ``scanf`` requires
  result = 0
  while start+result < input.len and input[start+result] in seps: inc result

if scanf(input, "$w$[someSep]$w", key, value):
  ...
```

It also possible to pass arguments to a user definable matcher:

 
```
proc ndigits(input: string; intVal: var int; start: int; n: int): int =
  # matches exactly ``n`` digits. Matchers need to return 0 if nothing
  # matched or otherwise the number of processed chars.
  var x = 0
  var i = 0
  while i < n and i+start < input.len and input[i+start] in {'0'..'9'}:
    x = x * 10 + input[i+start].ord - '0'.ord
    inc i
  # only overwrite if we had a match
  if i == n:
    result = n
    intVal = x

# match an ISO date extracting year, month, day at the same time.
# Also ensure the input ends after the ISO date:
var year, month, day: int
if scanf("2013-01-03", "${ndigits(4)}-${ndigits(2)}-${ndigits(2)}$.", year, month, day):
  ...
```
 The scanp macro
---------------


This module also implements a `scanp` macro, which syntax somewhat resembles an EBNF or PEG grammar, except that it uses Nim's expression syntax and so has to use prefix instead of postfix operators.

 

|  |  |
| --- | --- |
| `(E)` | Grouping |
| `*E` | Zero or more |
| `+E` | One or more |
| `?E` | Zero or One |
| `E{n,m}` | From `n` up to `m` times `E` |
| `~E` | Not predicate |
| `a ^* b` | Shortcut for `?(a *(b a))`. Usually used for separators. |
| `a ^+ b` | Shortcut for `?(a +(b a))`. Usually used for separators. |
| `'a'` | Matches a single character |
| `{'a'..'b'}` | Matches a character set |
| `"s"` | Matches a string |
| `E -> a` | Bind matching to some action |
| `$_` | Access the currently matched character |


Note that unordered or ordered choice operators (`/`, `|`) are not implemented.

 Simple example that parses the `/etc/passwd` file line by line:

 
```
const
  etc_passwd = """root:x:0:0:root:/root:/bin/bash
daemon:x:1:1:daemon:/usr/sbin:/bin/sh
bin:x:2:2:bin:/bin:/bin/sh
sys:x:3:3:sys:/dev:/bin/sh
nobody:x:65534:65534:nobody:/nonexistent:/bin/sh
messagebus:x:103:107::/var/run/dbus:/bin/false
"""

proc parsePasswd(content: string): seq[string] =
  result = @[]
  var idx = 0
  while true:
    var entry = ""
    if scanp(content, idx, +(~{'\L', '\0'} -> entry.add($_)), '\L'):
      result.add entry
    else:
      break
```

The `scanp` maps the grammar code into Nim code that performs the parsing. The parsing is performed with the help of 3 helper templates that that can be implemented for a custom type.

 These templates need to be named `atom` and `nxt`. `atom` should be overloaded to handle both single characters and sets of character.

 
```
import streams

template atom(input: Stream; idx: int; c: char): bool =
  ## Used in scanp for the matching of atoms (usually chars).
  peekChar(input) == c

template atom(input: Stream; idx: int; s: set[char]): bool =
  peekChar(input) in s

template nxt(input: Stream; idx, step: int = 1) =
  inc(idx, step)
  setPosition(input, idx)

if scanp(content, idx, +( ~{'\L', '\0'} -> entry.add(peekChar($input))), '\L'):
  result.add entry
```

Calling ordinary Nim procs inside the macro is possible:

 
```
proc digits(s: string; intVal: var int; start: int): int =
  var x = 0
  while result+start < s.len and s[result+start] in {'0'..'9'} and s[result+start] != ':':
    x = x * 10 + s[result+start].ord - '0'.ord
    inc result
  intVal = x

proc extractUsers(content: string): seq[string] =
  # Extracts the username and home directory
  # of each entry (with UID greater than 1000)
  const
    digits = {'0'..'9'}
  result = @[]
  var idx = 0
  while true:
    var login = ""
    var uid = 0
    var homedir = ""
    if scanp(content, idx, *(~ {':', '\0'}) -> login.add($_), ':', * ~ ':', ':',
            digits($input, uid, $index), ':', *`digits`, ':', * ~ ':', ':',
            *('/', * ~{':', '/'}) -> homedir.add($_), ':', *('/', * ~{'\L', '/'}), '\L'):
      if uid >= 1000:
        result.add login & " " & homedir
    else:
      break
```

When used for matching, keep in mind that likewise scanf, no backtracking is performed.

 
```
proc skipUntil(s: string; until: string; unless = '\0'; start: int): int =
  # Skips all characters until the string `until` is found. Returns 0
  # if the char `unless` is found first or the end is reached.
  var i = start
  var u = 0
  while true:
    if i >= s.len or s[i] == unless:
      return 0
    elif s[i] == until[0]:
      u = 1
      while i+u < s.len and u < until.len and s[i+u] == until[u]:
        inc u
      if u >= until.len: break
    inc(i)
  result = i+u-start

iterator collectLinks(s: string): string =
  const quote = {'\'', '"'}
  var idx, old = 0
  var res = ""
  while idx < s.len:
    old = idx
    if scanp(s, idx, "<a", skipUntil($input, "href=", '>', $index),
            `quote`, *( ~`quote`) -> res.add($_)):
      yield res
      res = ""
    idx = old + 1

for r in collectLinks(body):
  echo r
```

In this example both macros are combined seamlessly in order to maximise efficiency and perform different checks.

 
```
iterator parseIps*(soup: string): string =
  ## ipv4 only!
  const digits = {'0'..'9'}
  var a, b, c, d: int
  var buf = ""
  var idx = 0
  while idx < soup.len:
    if scanp(soup, idx, (`digits`{1,3}, '.', `digits`{1,3}, '.',
             `digits`{1,3}, '.', `digits`{1,3}) -> buf.add($_)):
      discard buf.scanf("$i.$i.$i.$i", a, b, c, d)
      if (a >= 0 and a <= 254) and
         (b >= 0 and b <= 254) and
         (c >= 0 and c <= 254) and
         (d >= 0 and d <= 254):
        yield buf
    buf.setLen(0) # need to clear `buf` each time, cause it might contain garbage
    idx.inc
```
 Imports
-------

  <macros>, <parseutils>  Macros
------

  
```
macro scanf(input: string; pattern: static[string]; results: varargs[typed]): bool
```
  See top level documentation of this module about how `scanf` works. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L310)  
```
macro scanp(input, idx: typed; pattern: varargs[untyped]): bool
```
  See top level documentation of this module about how `scanp` works. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L476)   Templates
---------

  
```
template atom(input: string; idx: int; c: char): bool
```
  Used in scanp for the matching of atoms (usually chars). EOF is matched as `'\0'`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L461)  
```
template atom(input: string; idx: int; s: set[char]): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L466)  
```
template hasNxt(input: string; idx: int): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L469)  
```
template success(x: int): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L472)  
```
template nxt(input: string; idx, step: int = 1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strscans.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strscans.nim#L474)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/strscans.html>

strtabs
=======

 The `strtabs` module implements an efficient hash table that is a mapping from strings to strings. Supports a case-sensitive, case-insensitive and style-insensitive mode. 


**Example:**

 
```
var t = newStringTable()
t["name"] = "John"
t["city"] = "Monaco"
doAssert t.len == 2
doAssert t.hasKey "name"
doAssert "name" in t
```
String tables can be created from a table constructor: **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
```
When using the style insensitive mode (`modeStyleInsensitive`), all letters are compared case insensitively within the ASCII range and underscores are ignored. **Example:**

 
```
var x = newStringTable(modeStyleInsensitive)
x["first_name"] = "John"
x["LastName"] = "Doe"

doAssert x["firstName"] == "John"
doAssert x["last_name"] == "Doe"
```
An efficient string substitution operator [%](#%25,string,StringTableRef,set%5BFormatFlag%5D) for the string table is also provided. **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert "${name} lives in ${city}" % t == "John lives in Monaco"
```

**See also:*** [tables module](tables) for general hash tables
* [sharedtables module](sharedtables) for shared hash table support
* [strutils module](strutils) for common string functions
* [json module](json) for table-like structure which allows heterogeneous members

 Imports
-------

  <since>, <hashes>, <strutils>, <os>  Types
-----

  
```
StringTableMode = enum
  modeCaseSensitive,        ## the table is case sensitive
  modeCaseInsensitive,      ## the table is case insensitive
  modeStyleInsensitive       ## the table is style insensitive
```
  Describes the tables operation mode. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L65)  
```
StringTableObj = object of RootObj
  counter: int
  data: KeyValuePairSeq
  mode: StringTableMode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L71)  
```
StringTableRef = ref StringTableObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L76)  
```
FormatFlag = enum
  useEnvironment,           ## Use environment variable if the ``$key``
                             ## is not found in the table.
                             ## Does nothing when using `js` target.
  useEmpty,                 ## Use the empty string as a default, thus it
                             ## won't throw an exception if ``$key`` is not
                             ## in the table.
  useKey                     ## Do not replace ``$key`` if it is not found
                             ## in the table (or in the environment).
```
  Flags for the `%` operator. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L78)   Procs
-----

  
```
proc mode(t: StringTableRef): StringTableMode {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L92)  
```
proc len(t: StringTableRef): int {...}{.gcsafe, extern: "nst$1", raises: [], tags: [].}
```
  Returns the number of keys in `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L147)  
```
proc `[]`(t: StringTableRef; key: string): var string {...}{.gcsafe,
    extern: "nstTake", raises: [KeyError], tags: [].}
```
  Retrieves the location at `t[key]`.

 If `key` is not in `t`, the `KeyError` exception is raised. One can check with [hasKey proc](#hasKey,StringTableRef,string) whether the key exists.

 See also:

 * [getOrDefault proc](#getOrDefault,StringTableRef,string,string)
* [[]= proc](#%5B%5D=,StringTableRef,string,string) for inserting a new (key, value) pair in the table
* [hasKey proc](#hasKey,StringTableRef,string) for checking if a key is in the table

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert t["name"] == "John"
doAssertRaises(KeyError):
  echo t["occupation"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L151)  
```
proc getOrDefault(t: StringTableRef; key: string; default: string = ""): string {...}{.
    raises: [], tags: [].}
```
  Retrieves the location at `t[key]`.

 If `key` is not in `t`, the default value is returned (if not specified, it is an empty string (`""`)).

 See also:

 * [[] proc](#%5B%5D,StringTableRef,string) for retrieving a value of a key
* [hasKey proc](#hasKey,StringTableRef,string) for checking if a key is in the table
* [[]= proc](#%5B%5D=,StringTableRef,string,string) for inserting a new (key, value) pair in the table

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert t.getOrDefault("name") == "John"
doAssert t.getOrDefault("occupation") == ""
doAssert t.getOrDefault("occupation", "teacher") == "teacher"
doAssert t.getOrDefault("name", "Paul") == "John"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L172)  
```
proc hasKey(t: StringTableRef; key: string): bool {...}{.gcsafe, extern: "nst$1",
    raises: [], tags: [].}
```
  Returns true if `key` is in the table `t`.

 See also:

 * [getOrDefault proc](#getOrDefault,StringTableRef,string,string)
* [contains proc](#contains,StringTableRef,string)

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert t.hasKey("name")
doAssert not t.hasKey("occupation")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L196)  
```
proc contains(t: StringTableRef; key: string): bool {...}{.raises: [], tags: [].}
```
  Alias of [hasKey proc](#hasKey,StringTableRef,string) for use with the `in` operator. **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert "name" in t
doAssert "occupation" notin t
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L209)  
```
proc `[]=`(t: StringTableRef; key, val: string) {...}{.gcsafe, extern: "nstPut",
    raises: [], tags: [].}
```
  Inserts a `(key, value)` pair into `t`.

 See also:

 * [[] proc](#%5B%5D,StringTableRef,string) for retrieving a value of a key
* [del proc](#del,StringTableRef,string) for removing a key from the table

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
t["occupation"] = "teacher"
doAssert t.hasKey("occupation")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L233)  
```
proc newStringTable(mode: StringTableMode): owned(StringTableRef) {...}{.gcsafe,
    extern: "nst$1", noSideEffect, raises: [], tags: [].}
```
  Creates a new empty string table.

 See also:

 * [newStringTable(keyValuePairs) proc](#newStringTable,varargs%5Btuple%5Bstring,string%5D%5D,StringTableMode)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L253)  
```
proc newStringTable(keyValuePairs: varargs[string]; mode: StringTableMode): owned(
    StringTableRef) {...}{.gcsafe, extern: "nst$1WithPairs", noSideEffect,
                      raises: [], tags: [].}
```
  Creates a new string table with given `key, value` string pairs.

 `StringTableMode` must be specified.

 **Example:**

 
```
var mytab = newStringTable("key1", "val1", "key2", "val2",
                           modeCaseInsensitive)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L265)  
```
proc newStringTable(keyValuePairs: varargs[tuple[key, val: string]];
                    mode: StringTableMode = modeCaseSensitive): owned(
    StringTableRef) {...}{.gcsafe, extern: "nst$1WithTableConstr", noSideEffect,
                      raises: [], tags: [].}
```
  Creates a new string table with given `(key, value)` tuple pairs.

 The default mode is case sensitive.

 **Example:**

 
```
var
  mytab1 = newStringTable({"key1": "val1", "key2": "val2"}, modeCaseInsensitive)
  mytab2 = newStringTable([("key3", "val3"), ("key4", "val4")])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L282)  
```
proc clear(s: StringTableRef; mode: StringTableMode) {...}{.gcsafe, extern: "nst$1",
    raises: [], tags: [].}
```
  Resets a string table to be empty again, perhaps altering the mode.

 See also:

 * [del proc](#del,StringTableRef,string) for removing a key from the table

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
clear(t, modeCaseSensitive)
doAssert len(t) == 0
doAssert "name" notin t
doAssert "city" notin t
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L313)  
```
proc clear(s: StringTableRef) {...}{.raises: [], tags: [].}
```
  Resets a string table to be empty again without changing the mode. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L331)  
```
proc del(t: StringTableRef; key: string) {...}{.raises: [], tags: [].}
```
  Removes `key` from `t`.

 See also:

 * [clear proc](#clear,StringTableRef,StringTableMode) for resetting a table to be empty
* [[]= proc](#%5B%5D=,StringTableRef,string,string) for inserting a new (key, value) pair in the table

 **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
t.del("name")
doAssert len(t) == 1
doAssert "name" notin t
doAssert "city" in t
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L335)  
```
proc `$`(t: StringTableRef): string {...}{.gcsafe, extern: "nstDollar", raises: [],
                                      tags: [].}
```
  The `$` operator for string tables. Used internally when calling `echo` on a table. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L376)  
```
proc `%`(f: string; t: StringTableRef; flags: set[FormatFlag] = {}): string {...}{.
    gcsafe, extern: "nstFormat", raises: [ValueError], tags: [ReadEnvEffect].}
```
  The `%` operator for string tables. **Example:**

 
```
var t = {"name": "John", "city": "Monaco"}.newStringTable
doAssert "${name} lives in ${city}" % t == "John lives in Monaco"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L390)   Iterators
---------

  
```
iterator pairs(t: StringTableRef): tuple[key, value: string] {...}{.raises: [],
    tags: [].}
```
  Iterates over every `(key, value)` pair in the table `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L94)  
```
iterator keys(t: StringTableRef): string {...}{.raises: [], tags: [].}
```
  Iterates over every key in the table `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L100)  
```
iterator values(t: StringTableRef): string {...}{.raises: [], tags: [].}
```
  Iterates over every value in the table `t`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strtabs.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strtabs.nim#L106)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/strtabs.html>

strutils
========

 The system module defines several common functions for working with strings, such as:


* `$` for converting other data-types to strings
* `&` for string concatenation
* `add` for adding a new character or a string to the existing one
* `in` (alias for `contains`) and `notin` for checking if a character is in a string

 This module builds upon that, providing additional functionality in form of procedures, iterators and templates for strings.

 
```
import strutils

let
  numbers = @[867, 5309]
  multiLineString = "first line\nsecond line\nthird line"

let jenny = numbers.join("-")
assert jenny == "867-5309"

assert splitLines(multiLineString) ==
       @["first line", "second line", "third line"]
assert split(multiLineString) == @["first", "line", "second",
                                   "line", "third", "line"]
assert indent(multiLineString, 4) ==
       "    first line\n    second line\n    third line"
assert 'z'.repeat(5) == "zzzzz"
```

The chaining of functions is possible thanks to the [method call syntax](manual#procedures-method-call-syntax):

 
```
import strutils
from sequtils import map

let jenny = "867-5309"
assert jenny.split('-').map(parseInt) == @[867, 5309]

assert "Beetlejuice".indent(1).repeat(3).strip ==
       "Beetlejuice Beetlejuice Beetlejuice"
```

This module is available for the [JavaScript target](backends#backends-the-javascript-target).

 

---

 **See also:**

 * [strformat module](strformat) for string interpolation and formatting
* [unicode module](unicode) for Unicode UTF-8 handling
* [sequtils module](sequtils) for operations on container types (including strings)
* [parsecsv module](parsecsv) for a high-performance CSV parser
* [parseutils module](parseutils) for lower-level parsing of tokens, numbers, identifiers, etc.
* [parseopt module](parseopt) for command-line parsing
* [pegs module](pegs) for PEG (Parsing Expression Grammar) support
* [strtabs module](strtabs) for efficient hash tables (dictionaries, in some programming languages) mapping from strings to strings
* [ropes module](ropes) for rope data type, which can represent very long strings efficiently
* [re module](re) for regular expression (regex) support
* <strscans> for `scanf` and `scanp` macros, which offer easier substring extraction than regular expressions

 Imports
-------

  <parseutils>, <math>, <algorithm>, <macros>, <unicode>, <since>  Types
-----

  
```
SkipTable = array[char, int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1897) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1897)  
```
FloatFormatMode = enum
  ffDefault,                ## use the shorter floating point notation
  ffDecimal,                ## use decimal floating point notation
  ffScientific               ## use scientific notation (using ``e`` character)
```
  the different modes of floating point formatting [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2410)  
```
BinaryPrefixMode = enum
  bpIEC, bpColloquial
```
  the different names for binary prefixes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2537)   Consts
------

  
```
Whitespace = {' ', '\t', '\v', '\c', '\n', '\f'}
```
  All the characters that count as whitespace (space, tab, vertical tab, carriage return, new line, form feed) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L89)  
```
Letters = {'A'..'Z', 'a'..'z'}
```
  the set of letters [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L93)  
```
Digits = {'0'..'9'}
```
  the set of digits [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L96)  
```
HexDigits = {'0'..'9', 'A'..'F', 'a'..'f'}
```
  the set of hexadecimal digits [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L99)  
```
IdentChars = {'a'..'z', 'A'..'Z', '0'..'9', '_'}
```
  the set of characters an identifier can consist of [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L102)  
```
IdentStartChars = {'a'..'z', 'A'..'Z', '_'}
```
  the set of characters an identifier can start with [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L105)  
```
Newlines = {'\c', '\n'}
```
  the set of characters a newline terminator can start with (carriage return, line feed) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L108)  
```
AllChars = {'\x00'..'\xFF'}
```
  A set with all the possible characters.

 Not very useful by its own, you can use it to create *inverted* sets to make the [find proc](#find,string,set%5Bchar%5D,Natural,int) find **invalid** characters in strings. Example:

 
```
let invalid = AllChars - Digits
doAssert "01234".find(invalid) == -1
doAssert "01A34".find(invalid) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L112)   Procs
-----

  
```
proc isAlphaAscii(c: char): bool {...}{.noSideEffect, gcsafe,
                                   extern: "nsuIsAlphaAsciiChar", raises: [],
                                   tags: [].}
```
  Checks whether or not character `c` is alphabetical.

 This checks a-z, A-Z ASCII characters only. Use [Unicode module](unicode) for UTF-8 support.

 **Example:**

 
```
doAssert isAlphaAscii('e') == true
doAssert isAlphaAscii('E') == true
doAssert isAlphaAscii('8') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L124)  
```
proc isAlphaNumeric(c: char): bool {...}{.noSideEffect, gcsafe,
                                     extern: "nsuIsAlphaNumericChar",
                                     raises: [], tags: [].}
```
  Checks whether or not `c` is alphanumeric.

 This checks a-z, A-Z, 0-9 ASCII characters only.

 **Example:**

 
```
doAssert isAlphaNumeric('n') == true
doAssert isAlphaNumeric('8') == true
doAssert isAlphaNumeric(' ') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L136)  
```
proc isDigit(c: char): bool {...}{.noSideEffect, gcsafe, extern: "nsuIsDigitChar",
                              raises: [], tags: [].}
```
  Checks whether or not `c` is a number.

 This checks 0-9 ASCII characters only.

 **Example:**

 
```
doAssert isDigit('n') == false
doAssert isDigit('8') == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L147)  
```
proc isSpaceAscii(c: char): bool {...}{.noSideEffect, gcsafe,
                                   extern: "nsuIsSpaceAsciiChar", raises: [],
                                   tags: [].}
```
  Checks whether or not `c` is a whitespace character. **Example:**

 
```
doAssert isSpaceAscii('n') == false
doAssert isSpaceAscii(' ') == true
doAssert isSpaceAscii('\t') == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L157)  
```
proc isLowerAscii(c: char): bool {...}{.noSideEffect, gcsafe,
                                   extern: "nsuIsLowerAsciiChar", raises: [],
                                   tags: [].}
```
  Checks whether or not `c` is a lower case character.

 This checks ASCII characters only. Use [Unicode module](unicode) for UTF-8 support.

 See also:

 * [toLowerAscii proc](#toLowerAscii,char)

 **Example:**

 
```
doAssert isLowerAscii('e') == true
doAssert isLowerAscii('E') == false
doAssert isLowerAscii('7') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L166)  
```
proc isUpperAscii(c: char): bool {...}{.noSideEffect, gcsafe,
                                   extern: "nsuIsUpperAsciiChar", raises: [],
                                   tags: [].}
```
  Checks whether or not `c` is an upper case character.

 This checks ASCII characters only. Use [Unicode module](unicode) for UTF-8 support.

 See also:

 * [toUpperAscii proc](#toUpperAscii,char)

 **Example:**

 
```
doAssert isUpperAscii('e') == false
doAssert isUpperAscii('E') == true
doAssert isUpperAscii('7') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L181)  
```
proc toLowerAscii(c: char): char {...}{.noSideEffect, gcsafe,
                                   extern: "nsuToLowerAsciiChar", raises: [],
                                   tags: [].}
```
  Returns the lower case version of character `c`.

 This works only for the letters `A-Z`. See [unicode.toLower](unicode#toLower,Rune) for a version that works for any Unicode character.

 See also:

 * [isLowerAscii proc](#isLowerAscii,char)
* [toLowerAscii proc](#toLowerAscii,string) for converting a string

 **Example:**

 
```
doAssert toLowerAscii('A') == 'a'
doAssert toLowerAscii('e') == 'e'
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L197)  
```
proc toLowerAscii(s: string): string {...}{.noSideEffect, gcsafe,
                                       extern: "nsuToLowerAsciiStr", raises: [],
                                       tags: [].}
```
  Converts string `s` into lower case.

 This works only for the letters `A-Z`. See [unicode.toLower](unicode#toLower,string) for a version that works for any Unicode character.

 See also:

 * [normalize proc](#normalize,string)

 **Example:**

 
```
doAssert toLowerAscii("FooBar!") == "foobar!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L221)  
```
proc toUpperAscii(c: char): char {...}{.noSideEffect, gcsafe,
                                   extern: "nsuToUpperAsciiChar", raises: [],
                                   tags: [].}
```
  Converts character `c` into upper case.

 This works only for the letters `A-Z`. See [unicode.toUpper](unicode#toUpper,Rune) for a version that works for any Unicode character.

 See also:

 * [isLowerAscii proc](#isLowerAscii,char)
* [toUpperAscii proc](#toUpperAscii,string) for converting a string
* [capitalizeAscii proc](#capitalizeAscii,string)

 **Example:**

 
```
doAssert toUpperAscii('a') == 'A'
doAssert toUpperAscii('E') == 'E'
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L235)  
```
proc toUpperAscii(s: string): string {...}{.noSideEffect, gcsafe,
                                       extern: "nsuToUpperAsciiStr", raises: [],
                                       tags: [].}
```
  Converts string `s` into upper case.

 This works only for the letters `A-Z`. See [unicode.toUpper](unicode#toUpper,string) for a version that works for any Unicode character.

 See also:

 * [capitalizeAscii proc](#capitalizeAscii,string)

 **Example:**

 
```
doAssert toUpperAscii("FooBar!") == "FOOBAR!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L255)  
```
proc capitalizeAscii(s: string): string {...}{.noSideEffect, gcsafe,
    extern: "nsuCapitalizeAscii", raises: [], tags: [].}
```
  Converts the first character of string `s` into upper case.

 This works only for the letters `A-Z`. Use [Unicode module](unicode) for UTF-8 support.

 See also:

 * [toUpperAscii proc](#toUpperAscii,char)

 **Example:**

 
```
doAssert capitalizeAscii("foo") == "Foo"
doAssert capitalizeAscii("-bar") == "-bar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L269)  
```
proc nimIdentNormalize(s: string): string {...}{.raises: [], tags: [].}
```
  Normalizes the string `s` as a Nim identifier.

 That means to convert to lower case and remove any '\_' on all characters except first one.

 **Example:**

 
```
doAssert nimIdentNormalize("Foo_bar") == "Foobar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L284)  
```
proc normalize(s: string): string {...}{.noSideEffect, gcsafe,
                                    extern: "nsuNormalize", raises: [], tags: [].}
```
  Normalizes the string `s`.

 That means to convert it to lower case and remove any '\_'. This should NOT be used to normalize Nim identifier names.

 See also:

 * [toLowerAscii proc](#toLowerAscii,string)

 **Example:**

 
```
doAssert normalize("Foo_bar") == "foobar"
doAssert normalize("Foo Bar") == "foo bar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L304)  
```
proc cmpIgnoreCase(a, b: string): int {...}{.noSideEffect, gcsafe,
                                        extern: "nsuCmpIgnoreCase", raises: [],
                                        tags: [].}
```
  Compares two strings in a case insensitive manner. Returns:0 if a == b  
< 0 if a < b  
> 0 if a > b  


 **Example:**

 
```
doAssert cmpIgnoreCase("FooBar", "foobar") == 0
doAssert cmpIgnoreCase("bar", "Foo") < 0
doAssert cmpIgnoreCase("Foo5", "foo4") > 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L327)  
```
proc cmpIgnoreStyle(a, b: string): int {...}{.noSideEffect, gcsafe,
    extern: "nsuCmpIgnoreStyle", raises: [], tags: [].}
```
  Semantically the same as `cmp(normalize(a), normalize(b))`. It is just optimized to not allocate temporary strings. This should NOT be used to compare Nim identifier names. Use [macros.eqIdent](macros#eqIdent,string,string) for that.

 Returns:

 0 if a == b  
< 0 if a < b  
> 0 if a > b  


 **Example:**

 
```
doAssert cmpIgnoreStyle("foo_bar", "FooBar") == 0
doAssert cmpIgnoreStyle("foo_bar_5", "FooBar4") > 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L349)  
```
proc split(s: string; sep: char; maxsplit: int = -1): seq[string] {...}{.
    noSideEffect, gcsafe, extern: "nsuSplitChar", raises: [], tags: [].}
```
  The same as the [split iterator](#split.i,string,char,int) (see its documentation), but is a proc that returns a sequence of substrings.

 See also:

 * [split iterator](#split.i,string,char,int)
* [rsplit proc](#rsplit,string,char,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 **Example:**

 
```
doAssert "a,b,c".split(',') == @["a", "b", "c"]
doAssert "".split(' ') == @[""]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L730) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L730)  
```
proc split(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): seq[
    string] {...}{.noSideEffect, gcsafe, extern: "nsuSplitCharSet", raises: [],
              tags: [].}
```
  The same as the [split iterator](#split.i,string,set%5Bchar%5D,int) (see its documentation), but is a proc that returns a sequence of substrings.

 See also:

 * [split iterator](#split.i,string,set%5Bchar%5D,int)
* [rsplit proc](#rsplit,string,set%5Bchar%5D,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 **Example:**

 
```
doAssert "a,b;c".split({',', ';'}) == @["a", "b", "c"]
doAssert "".split({' '}) == @[""]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L745)  
```
proc split(s: string; sep: string; maxsplit: int = -1): seq[string] {...}{.
    noSideEffect, gcsafe, extern: "nsuSplitString", raises: [], tags: [].}
```
  Splits the string `s` into substrings using a string separator.

 Substrings are separated by the string `sep`. This is a wrapper around the [split iterator](#split.i,string,string,int).

 See also:

 * [split iterator](#split.i,string,string,int)
* [rsplit proc](#rsplit,string,string,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 **Example:**

 
```
doAssert "a,b,c".split(",") == @["a", "b", "c"]
doAssert "a man a plan a canal panama".split("a ") == @["", "man ", "plan ", "canal panama"]
doAssert "".split("Elon Musk") == @[""]
doAssert "a  largely    spaced sentence".split(" ") == @["a", "", "largely",
    "", "", "", "spaced", "sentence"]
doAssert "a  largely    spaced sentence".split(" ", maxsplit = 1) == @["a", " largely    spaced sentence"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L760)  
```
proc rsplit(s: string; sep: char; maxsplit: int = -1): seq[string] {...}{.
    noSideEffect, gcsafe, extern: "nsuRSplitChar", raises: [], tags: [].}
```
  The same as the [rsplit iterator](#rsplit.i,string,char,int), but is a proc that returns a sequence of substrings.

 A possible common use case for `rsplit` is path manipulation, particularly on systems that don't use a common delimiter.

 For example, if a system had `#` as a delimiter, you could do the following to get the tail of the path:

 
```
var tailSplit = rsplit("Root#Object#Method#Index", '#', maxsplit=1)
```

Results in `tailSplit` containing:

 
```
@["Root#Object#Method", "Index"]
```

See also:

 * [rsplit iterator](#rsplit.i,string,char,int)
* [split proc](#split,string,char,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L783) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L783)  
```
proc rsplit(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): seq[
    string] {...}{.noSideEffect, gcsafe, extern: "nsuRSplitCharSet", raises: [],
              tags: [].}
```
  The same as the [rsplit iterator](#rsplit.i,string,set%5Bchar%5D,int), but is a proc that returns a sequence of substrings.

 A possible common use case for `rsplit` is path manipulation, particularly on systems that don't use a common delimiter.

 For example, if a system had `#` as a delimiter, you could do the following to get the tail of the path:

 
```
var tailSplit = rsplit("Root#Object#Method#Index", {'#'}, maxsplit=1)
```

Results in `tailSplit` containing:

 
```
@["Root#Object#Method", "Index"]
```

See also:

 * [rsplit iterator](#rsplit.i,string,set%5Bchar%5D,int)
* [split proc](#split,string,set%5Bchar%5D,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L810) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L810)  
```
proc rsplit(s: string; sep: string; maxsplit: int = -1): seq[string] {...}{.
    noSideEffect, gcsafe, extern: "nsuRSplitString", raises: [], tags: [].}
```
  The same as the [rsplit iterator](#rsplit.i,string,string,int,bool), but is a proc that returns a sequence of substrings.

 A possible common use case for `rsplit` is path manipulation, particularly on systems that don't use a common delimiter.

 For example, if a system had `#` as a delimiter, you could do the following to get the tail of the path:

 
```
var tailSplit = rsplit("Root#Object#Method#Index", "#", maxsplit=1)
```

Results in `tailSplit` containing:

 
```
@["Root#Object#Method", "Index"]
```

See also:

 * [rsplit iterator](#rsplit.i,string,string,int,bool)
* [split proc](#split,string,string,int)
* [splitLines proc](#splitLines,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 **Example:**

 
```
doAssert "a  largely    spaced sentence".rsplit(" ", maxsplit = 1) == @[
    "a  largely    spaced", "sentence"]
doAssert "a,b,c".rsplit(",") == @["a", "b", "c"]
doAssert "a man a plan a canal panama".rsplit("a ") == @["", "man ",
    "plan ", "canal panama"]
doAssert "".rsplit("Elon Musk") == @[""]
doAssert "a  largely    spaced sentence".rsplit(" ") == @["a", "",
    "largely", "", "", "", "spaced", "sentence"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L838) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L838)  
```
proc splitLines(s: string; keepEol = false): seq[string] {...}{.noSideEffect, gcsafe,
    extern: "nsuSplitLines", raises: [], tags: [].}
```
  The same as the [splitLines iterator](#splitLines.i,string) (see its documentation), but is a proc that returns a sequence of substrings.

 See also:

 * [splitLines iterator](#splitLines.i,string)
* [splitWhitespace proc](#splitWhitespace,string,int)
* [countLines proc](#countLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L874) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L874)  
```
proc splitWhitespace(s: string; maxsplit: int = -1): seq[string] {...}{.noSideEffect,
    gcsafe, extern: "nsuSplitWhitespace", raises: [], tags: [].}
```
  The same as the [splitWhitespace iterator](#splitWhitespace.i,string,int) (see its documentation), but is a proc that returns a sequence of substrings.

 See also:

 * [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [splitLines proc](#splitLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L885) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L885)  
```
proc toBin(x: BiggestInt; len: Positive): string {...}{.noSideEffect, gcsafe,
    extern: "nsuToBin", raises: [], tags: [].}
```
  Converts `x` into its binary representation.

 The resulting string is always `len` characters long. No leading `0b` prefix is generated.

 **Example:**

 
```
let
  a = 29
  b = 257
doAssert a.toBin(8) == "00011101"
doAssert b.toBin(8) == "00000001"
doAssert b.toBin(9) == "100000001"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L895) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L895)  
```
proc toOct(x: BiggestInt; len: Positive): string {...}{.noSideEffect, gcsafe,
    extern: "nsuToOct", raises: [], tags: [].}
```
  Converts `x` into its octal representation.

 The resulting string is always `len` characters long. No leading `0o` prefix is generated.

 Do not confuse it with [toOctal proc](#toOctal,char).

 **Example:**

 
```
let
  a = 62
  b = 513
doAssert a.toOct(3) == "076"
doAssert b.toOct(3) == "001"
doAssert b.toOct(5) == "01001"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L918)  
```
proc toHex[T: SomeInteger](x: T; len: Positive): string {...}{.noSideEffect.}
```
  Converts `x` to its hexadecimal representation.

 The resulting string will be exactly `len` characters long. No prefix like `0x` is generated. `x` is treated as an unsigned value.

 **Example:**

 
```
let
  a = 62'u64
  b = 4097'u64
doAssert a.toHex(3) == "03E"
doAssert b.toHex(3) == "001"
doAssert b.toHex(4) == "1001"
doAssert toHex(62, 3) == "03E"
doAssert toHex(-8, 6) == "FFFFF8"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L954) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L954)  
```
proc toHex[T: SomeInteger](x: T): string {...}{.noSideEffect.}
```
  Shortcut for `toHex(x, T.sizeof * 2)` **Example:**

 
```
doAssert toHex(1984'i64) == "00000000000007C0"
doAssert toHex(1984'i16) == "07C0"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L970) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L970)  
```
proc toHex(s: string): string {...}{.noSideEffect, gcsafe, raises: [], tags: [].}
```
  Converts a bytes string to its hexadecimal representation.

 The output is twice the input long. No prefix like `0x` is generated.

 See also:

 * [parseHexStr proc](#parseHexStr,string) for the reverse operation

 **Example:**

 
```
let
  a = "1"
  b = "A"
  c = "\0\255"
doAssert a.toHex() == "31"
doAssert b.toHex() == "41"
doAssert c.toHex() == "00FF"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L977) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L977)  
```
proc toOctal(c: char): string {...}{.noSideEffect, gcsafe, extern: "nsuToOctal",
                                raises: [], tags: [].}
```
  Converts a character `c` to its octal representation.

 The resulting string may not have a leading zero. Its length is always exactly 3.

 Do not confuse it with [toOct proc](#toOct,BiggestInt,Positive).

 **Example:**

 
```
doAssert toOctal('1') == "061"
doAssert toOctal('A') == "101"
doAssert toOctal('a') == "141"
doAssert toOctal('!') == "041"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1002) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1002)  
```
proc fromBin[T: SomeInteger](s: string): T
```
  Parses a binary integer value from a string `s`.

 If `s` is not a valid binary integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0b`, `0B`. Underscores within `s` are ignored.

 Does not check for overflow. If the value represented by `s` is too big to fit into a return type, only the value of the rightmost binary digits of `s` is returned without producing an error.

 **Example:**

 
```
let s = "0b_0100_1000_1000_1000_1110_1110_1001_1001"
doAssert fromBin[int](s) == 1216933529
doAssert fromBin[int8](s) == 0b1001_1001'i8
doAssert fromBin[int8](s) == -103'i8
doAssert fromBin[uint8](s) == 153
doAssert s.fromBin[:int16] == 0b1110_1110_1001_1001'i16
doAssert s.fromBin[:uint64] == 1216933529'u64
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1021)  
```
proc fromOct[T: SomeInteger](s: string): T
```
  Parses an octal integer value from a string `s`.

 If `s` is not a valid octal integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0o`, `0O`. Underscores within `s` are ignored.

 Does not check for overflow. If the value represented by `s` is too big to fit into a return type, only the value of the rightmost octal digits of `s` is returned without producing an error.

 **Example:**

 
```
let s = "0o_123_456_777"
doAssert fromOct[int](s) == 21913087
doAssert fromOct[int8](s) == 0o377'i8
doAssert fromOct[int8](s) == -1'i8
doAssert fromOct[uint8](s) == 255'u8
doAssert s.fromOct[:int16] == 24063'i16
doAssert s.fromOct[:uint64] == 21913087'u64
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1044) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1044)  
```
proc fromHex[T: SomeInteger](s: string): T
```
  Parses a hex integer value from a string `s`.

 If `s` is not a valid hex integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0x`, `0X`, `#`. Underscores within `s` are ignored.

 Does not check for overflow. If the value represented by `s` is too big to fit into a return type, only the value of the rightmost hex digits of `s` is returned without producing an error.

 **Example:**

 
```
let s = "0x_1235_8df6"
doAssert fromHex[int](s) == 305499638
doAssert fromHex[int8](s) == 0xf6'i8
doAssert fromHex[int8](s) == -10'i8
doAssert fromHex[uint8](s) == 246'u8
doAssert s.fromHex[:int16] == -29194'i16
doAssert s.fromHex[:uint64] == 305499638'u64
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1067) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1067)  
```
proc intToStr(x: int; minchars: Positive = 1): string {...}{.noSideEffect, gcsafe,
    extern: "nsuIntToStr", raises: [], tags: [].}
```
  Converts `x` to its decimal representation.

 The resulting string will be minimally `minchars` characters long. This is achieved by adding leading zeros.

 **Example:**

 
```
doAssert intToStr(1984) == "1984"
doAssert intToStr(1984, 6) == "001984"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1090) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1090)  
```
proc parseInt(s: string): int {...}{.noSideEffect, gcsafe, extern: "nsuParseInt",
                                raises: [ValueError], tags: [].}
```
  Parses a decimal integer value contained in `s`.

 If `s` is not a valid integer, `ValueError` is raised.

 **Example:**

 
```
doAssert parseInt("-0042") == -42
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1105)  
```
proc parseBiggestInt(s: string): BiggestInt {...}{.noSideEffect, gcsafe,
    extern: "nsuParseBiggestInt", raises: [ValueError], tags: [].}
```
  Parses a decimal integer value contained in `s`.

 If `s` is not a valid integer, `ValueError` is raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1117)  
```
proc parseUInt(s: string): uint {...}{.noSideEffect, gcsafe, extern: "nsuParseUInt",
                                  raises: [ValueError], tags: [].}
```
  Parses a decimal unsigned integer value contained in `s`.

 If `s` is not a valid integer, `ValueError` is raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1127)  
```
proc parseBiggestUInt(s: string): BiggestUInt {...}{.noSideEffect, gcsafe,
    extern: "nsuParseBiggestUInt", raises: [ValueError], tags: [].}
```
  Parses a decimal unsigned integer value contained in `s`.

 If `s` is not a valid integer, `ValueError` is raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1137)  
```
proc parseFloat(s: string): float {...}{.noSideEffect, gcsafe,
                                    extern: "nsuParseFloat",
                                    raises: [ValueError], tags: [].}
```
  Parses a decimal floating point value contained in `s`.

 If `s` is not a valid floating point number, `ValueError` is raised. `NAN`, `INF`, `-INF` are also supported (case insensitive comparison).

 **Example:**

 
```
doAssert parseFloat("3.14") == 3.14
doAssert parseFloat("inf") == 1.0/0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1147)  
```
proc parseBinInt(s: string): int {...}{.noSideEffect, gcsafe,
                                   extern: "nsuParseBinInt",
                                   raises: [ValueError], tags: [].}
```
  Parses a binary integer value contained in `s`.

 If `s` is not a valid binary integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0b`, `0B`. Underscores within `s` are ignored.

 **Example:**

 
```
let
  a = "0b11_0101"
  b = "111"
doAssert a.parseBinInt() == 53
doAssert b.parseBinInt() == 7
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1161)  
```
proc parseOctInt(s: string): int {...}{.noSideEffect, gcsafe,
                                   extern: "nsuParseOctInt",
                                   raises: [ValueError], tags: [].}
```
  Parses an octal integer value contained in `s`.

 If `s` is not a valid oct integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0o`, `0O`. Underscores within `s` are ignored.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1180)  
```
proc parseHexInt(s: string): int {...}{.noSideEffect, gcsafe,
                                   extern: "nsuParseHexInt",
                                   raises: [ValueError], tags: [].}
```
  Parses a hexadecimal integer value contained in `s`.

 If `s` is not a valid hex integer, `ValueError` is raised. `s` can have one of the following optional prefixes: `0x`, `0X`, `#`. Underscores within `s` are ignored.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1192)  
```
proc parseHexStr(s: string): string {...}{.noSideEffect, gcsafe,
                                      extern: "nsuParseHexStr",
                                      raises: [ValueError], tags: [].}
```
  Convert hex-encoded string to byte string, e.g.:

 Raises `ValueError` for an invalid hex values. The comparison is case-insensitive.

 See also:

 * [toHex proc](#toHex,string) for the reverse operation

 **Example:**

 
```
let
  a = "41"
  b = "3161"
  c = "00ff"
doAssert parseHexStr(a) == "A"
doAssert parseHexStr(b) == "1a"
doAssert parseHexStr(c) == "\0\255"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1219)  
```
proc parseBool(s: string): bool {...}{.raises: [ValueError], tags: [].}
```
  Parses a value into a `bool`.

 If `s` is one of the following values: `y, yes, true, 1, on`, then returns `true`. If `s` is one of the following values: `n, no, false, 0, off`, then returns `false`. If `s` is something else a `ValueError` exception is raised.

 **Example:**

 
```
let a = "n"
doAssert parseBool(a) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1251)  
```
proc parseEnum[T: enum](s: string): T
```
  Parses an enum `T`. This errors at compile time, if the given enum type contains multiple fields with the same string value.

 Raises `ValueError` for an invalid value in `s`. The comparison is done in a style insensitive way.

 **Example:**

 
```
type
  MyEnum = enum
    first = "1st",
    second,
    third = "3rd"

doAssert parseEnum[MyEnum]("1_st") == first
doAssert parseEnum[MyEnum]("second") == second
doAssertRaises(ValueError):
  echo parseEnum[MyEnum]("third")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1322)  
```
proc parseEnum[T: enum](s: string; default: T): T
```
  Parses an enum `T`. This errors at compile time, if the given enum type contains multiple fields with the same string value.

 Uses `default` for an invalid value in `s`. The comparison is done in a style insensitive way.

 **Example:**

 
```
type
  MyEnum = enum
    first = "1st",
    second,
    third = "3rd"

doAssert parseEnum[MyEnum]("1_st") == first
doAssert parseEnum[MyEnum]("second") == second
doAssert parseEnum[MyEnum]("last", third) == third
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1342)  
```
proc repeat(c: char; count: Natural): string {...}{.noSideEffect, gcsafe,
    extern: "nsuRepeatChar", raises: [], tags: [].}
```
  Returns a string of length `count` consisting only of the character `c`. **Example:**

 
```
let a = 'z'
doAssert a.repeat(5) == "zzzzz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1361) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1361)  
```
proc repeat(s: string; n: Natural): string {...}{.noSideEffect, gcsafe,
    extern: "nsuRepeatStr", raises: [], tags: [].}
```
  Returns string `s` concatenated `n` times. **Example:**

 
```
doAssert "+ foo +".repeat(3) == "+ foo ++ foo ++ foo +"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1371)  
```
proc spaces(n: Natural): string {...}{.inline, raises: [], tags: [].}
```
  Returns a string with `n` space characters. You can use this proc to left align strings.

 See also:

 * [align proc](#align,string,Natural,char)
* [alignLeft proc](#alignLeft,string,Natural,char)
* [indent proc](#indent,string,Natural,string)
* [center proc](#center,string,int,char)

 **Example:**

 
```
let
  width = 15
  text1 = "Hello user!"
  text2 = "This is a very long string"
doAssert text1 & spaces(max(0, width - text1.len)) & "|" ==
         "Hello user!    |"
doAssert text2 & spaces(max(0, width - text2.len)) & "|" ==
         "This is a very long string|"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1380)  
```
proc align(s: string; count: Natural; padding = ' '): string {...}{.noSideEffect,
    gcsafe, extern: "nsuAlignString", raises: [], tags: [].}
```
  Aligns a string `s` with `padding`, so that it is of length `count`.

 `padding` characters (by default spaces) are added before `s` resulting in right alignment. If `s.len >= count`, no spaces are added and `s` is returned unchanged. If you need to left align a string use the [alignLeft proc](#alignLeft,string,Natural,char).

 See also:

 * [alignLeft proc](#alignLeft,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [indent proc](#indent,string,Natural,string)
* [center proc](#center,string,int,char)

 **Example:**

 
```
assert align("abc", 4) == " abc"
assert align("a", 0) == "a"
assert align("1232", 6) == "  1232"
assert align("1232", 6, '#') == "##1232"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1400)  
```
proc alignLeft(s: string; count: Natural; padding = ' '): string {...}{.noSideEffect,
    raises: [], tags: [].}
```
  Left-Aligns a string `s` with `padding`, so that it is of length `count`.

 `padding` characters (by default spaces) are added after `s` resulting in left alignment. If `s.len >= count`, no spaces are added and `s` is returned unchanged. If you need to right align a string use the [align proc](#align,string,Natural,char).

 See also:

 * [align proc](#align,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [indent proc](#indent,string,Natural,string)
* [center proc](#center,string,int,char)

 **Example:**

 
```
assert alignLeft("abc", 4) == "abc "
assert alignLeft("a", 0) == "a"
assert alignLeft("1232", 6) == "1232  "
assert alignLeft("1232", 6, '#') == "1232##"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1427)  
```
proc center(s: string; width: int; fillChar: char = ' '): string {...}{.noSideEffect,
    gcsafe, extern: "nsuCenterString", raises: [], tags: [].}
```
  Return the contents of `s` centered in a string `width` long using `fillChar` (default: space) as padding.

 The original string is returned if `width` is less than or equal to `s.len`.

 See also:

 * [align proc](#align,string,Natural,char)
* [alignLeft proc](#alignLeft,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [indent proc](#indent,string,Natural,string)

 **Example:**

 
```
let a = "foo"
doAssert a.center(2) == "foo"
doAssert a.center(5) == " foo "
doAssert a.center(6) == " foo  "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1455)  
```
proc indent(s: string; count: Natural; padding: string = " "): string {...}{.
    noSideEffect, gcsafe, extern: "nsuIndent", raises: [], tags: [].}
```
  Indents each line in `s` by `count` amount of `padding`.

 **Note:** This does not preserve the new line characters used in `s`.

 See also:

 * [align proc](#align,string,Natural,char)
* [alignLeft proc](#alignLeft,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [unindent proc](#unindent,string,Natural,string)
* [dedent proc](#dedent,string,Natural)

 **Example:**

 
```
doAssert indent("First line\c\l and second line.", 2) ==
         "  First line\l   and second line."
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1490)  
```
proc unindent(s: string; count: Natural = int.high; padding: string = " "): string {...}{.
    noSideEffect, gcsafe, extern: "nsuUnindent", raises: [], tags: [].}
```
  Unindents each line in `s` by `count` amount of `padding`.

 **Note:** This does not preserve the new line characters used in `s`.

 See also:

 * [dedent proc](#dedent,string,Natural)
* [align proc](#align,string,Natural,char)
* [alignLeft proc](#alignLeft,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [indent proc](#indent,string,Natural,string)

 **Example:**

 
```
let x = """
      Hello
        There
    """.unindent()

doAssert x == "Hello\nThere\n"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1515)  
```
proc indentation(s: string): Natural {...}{.raises: [], tags: [].}
```
  Returns the amount of indentation all lines of `s` have in common, ignoring lines that consist only of whitespace. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1548)  
```
proc dedent(s: string; count: Natural = indentation(s)): string {...}{.noSideEffect,
    gcsafe, extern: "nsuDedent", raises: [], tags: [].}
```
  Unindents each line in `s` by `count` amount of `padding`. The only difference between this and the [unindent proc](#unindent,string,Natural,string) is that this by default only cuts off the amount of indentation that all lines of `s` share as opposed to all indentation. It only supports spaces as padding.

 **Note:** This does not preserve the new line characters used in `s`.

 See also:

 * [unindent proc](#unindent,string,Natural,string)
* [align proc](#align,string,Natural,char)
* [alignLeft proc](#alignLeft,string,Natural,char)
* [spaces proc](#spaces,Natural)
* [indent proc](#indent,string,Natural,string)

 **Example:**

 
```
let x = """
      Hello
        There
    """.dedent()

doAssert x == "Hello\n  There\n"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1561)  
```
proc delete(s: var string; first, last: int) {...}{.noSideEffect, gcsafe,
    extern: "nsuDelete", raises: [], tags: [].}
```
  Deletes in `s` (must be declared as `var`) the characters at positions `first ..last` (both ends included).

 This modifies `s` itself, it does not return a copy.

 **Example:**

 
```
var a = "abracadabra"

a.delete(4, 5)
doAssert a == "abradabra"

a.delete(1, 6)
doAssert a == "ara"

a.delete(2, 999)
doAssert a == "ar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1586)  
```
proc startsWith(s: string; prefix: char): bool {...}{.noSideEffect, inline,
    raises: [], tags: [].}
```
  Returns true if `s` starts with character `prefix`.

 See also:

 * [endsWith proc](#endsWith,string,char)
* [continuesWith proc](#continuesWith,string,string,Natural)
* [removePrefix proc](#removePrefix,string,char)

 **Example:**

 
```
let a = "abracadabra"
doAssert a.startsWith('a') == true
doAssert a.startsWith('b') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1614) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1614)  
```
proc startsWith(s, prefix: string): bool {...}{.noSideEffect, gcsafe,
    extern: "nsuStartsWith", raises: [], tags: [].}
```
  Returns true if `s` starts with string `prefix`.

 If `prefix == ""` true is returned.

 See also:

 * [endsWith proc](#endsWith,string,string)
* [continuesWith proc](#continuesWith,string,string,Natural)
* [removePrefix proc](#removePrefix,string,string)

 **Example:**

 
```
let a = "abracadabra"
doAssert a.startsWith("abra") == true
doAssert a.startsWith("bra") == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1627)  
```
proc endsWith(s: string; suffix: char): bool {...}{.noSideEffect, inline, raises: [],
    tags: [].}
```
  Returns true if `s` ends with `suffix`.

 See also:

 * [startsWith proc](#startsWith,string,char)
* [continuesWith proc](#continuesWith,string,string,Natural)
* [removeSuffix proc](#removeSuffix,string,char)

 **Example:**

 
```
let a = "abracadabra"
doAssert a.endsWith('a') == true
doAssert a.endsWith('b') == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1647) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1647)  
```
proc endsWith(s, suffix: string): bool {...}{.noSideEffect, gcsafe,
    extern: "nsuEndsWith", raises: [], tags: [].}
```
  Returns true if `s` ends with `suffix`.

 If `suffix == ""` true is returned.

 See also:

 * [startsWith proc](#startsWith,string,string)
* [continuesWith proc](#continuesWith,string,string,Natural)
* [removeSuffix proc](#removeSuffix,string,string)

 **Example:**

 
```
let a = "abracadabra"
doAssert a.endsWith("abra") == true
doAssert a.endsWith("dab") == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1660)  
```
proc continuesWith(s, substr: string; start: Natural): bool {...}{.noSideEffect,
    gcsafe, extern: "nsuContinuesWith", raises: [], tags: [].}
```
  Returns true if `s` continues with `substr` at position `start`.

 If `substr == ""` true is returned.

 See also:

 * [startsWith proc](#startsWith,string,string)
* [endsWith proc](#endsWith,string,string)

 **Example:**

 
```
let a = "abracadabra"
doAssert a.continuesWith("ca", 4) == true
doAssert a.continuesWith("ca", 5) == false
doAssert a.continuesWith("dab", 6) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1681)  
```
proc removePrefix(s: var string; chars: set[char] = Newlines) {...}{.gcsafe,
    extern: "nsuRemovePrefixCharSet", raises: [], tags: [].}
```
  Removes all characters from `chars` from the start of the string `s` (in-place).

 See also:

 * [removeSuffix proc](#removeSuffix,string,set%5Bchar%5D)

 **Example:**

 
```
var userInput = "\r\n*~Hello World!"
userInput.removePrefix
doAssert userInput == "*~Hello World!"
userInput.removePrefix({'~', '*'})
doAssert userInput == "Hello World!"

var otherInput = "?!?Hello!?!"
otherInput.removePrefix({'!', '?'})
doAssert otherInput == "Hello!?!"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1702)  
```
proc removePrefix(s: var string; c: char) {...}{.gcsafe,
    extern: "nsuRemovePrefixChar", raises: [], tags: [].}
```
  Removes all occurrences of a single character (in-place) from the start of a string.

 See also:

 * [removeSuffix proc](#removeSuffix,string,char)
* [startsWith proc](#startsWith,string,char)

 **Example:**

 
```
var ident = "pControl"
ident.removePrefix('p')
doAssert ident == "Control"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1724)  
```
proc removePrefix(s: var string; prefix: string) {...}{.gcsafe,
    extern: "nsuRemovePrefixString", raises: [], tags: [].}
```
  Remove the first matching prefix (in-place) from a string.

 See also:

 * [removeSuffix proc](#removeSuffix,string,string)
* [startsWith proc](#startsWith,string,string)

 **Example:**

 
```
var answers = "yesyes"
answers.removePrefix("yes")
doAssert answers == "yes"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1738) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1738)  
```
proc removeSuffix(s: var string; chars: set[char] = Newlines) {...}{.gcsafe,
    extern: "nsuRemoveSuffixCharSet", raises: [], tags: [].}
```
  Removes all characters from `chars` from the end of the string `s` (in-place).

 See also:

 * [removePrefix proc](#removePrefix,string,set%5Bchar%5D)

 **Example:**

 
```
var userInput = "Hello World!*~\r\n"
userInput.removeSuffix
doAssert userInput == "Hello World!*~"
userInput.removeSuffix({'~', '*'})
doAssert userInput == "Hello World!"

var otherInput = "Hello!?!"
otherInput.removeSuffix({'!', '?'})
doAssert otherInput == "Hello"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1752) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1752)  
```
proc removeSuffix(s: var string; c: char) {...}{.gcsafe,
    extern: "nsuRemoveSuffixChar", raises: [], tags: [].}
```
  Removes all occurrences of a single character (in-place) from the end of a string.

 See also:

 * [removePrefix proc](#removePrefix,string,char)
* [endsWith proc](#endsWith,string,char)

 **Example:**

 
```
var table = "users"
table.removeSuffix('s')
doAssert table == "user"

var dots = "Trailing dots......."
dots.removeSuffix('.')
doAssert dots == "Trailing dots"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1775) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1775)  
```
proc removeSuffix(s: var string; suffix: string) {...}{.gcsafe,
    extern: "nsuRemoveSuffixString", raises: [], tags: [].}
```
  Remove the first matching suffix (in-place) from a string.

 See also:

 * [removePrefix proc](#removePrefix,string,string)
* [endsWith proc](#endsWith,string,string)

 **Example:**

 
```
var answers = "yeses"
answers.removeSuffix("es")
doAssert answers == "yes"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1794)  
```
proc addSep(dest: var string; sep = ", "; startLen: Natural = 0) {...}{.noSideEffect,
    inline, raises: [], tags: [].}
```
  Adds a separator to `dest` only if its length is bigger than `startLen`.

 A shorthand for:

 
```
if dest.len > startLen: add(dest, sep)
```

This is often useful for generating some code where the items need to be *separated* by `sep`. `sep` is only added if `dest` is longer than `startLen`. The following example creates a string describing an array of integers.

 **Example:**

 
```
var arr = "["
for x in items([2, 3, 5, 7, 11]):
  addSep(arr, startLen = len("["))
  add(arr, $x)
add(arr, "]")
doAssert arr == "[2, 3, 5, 7, 11]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1811)  
```
proc allCharsInSet(s: string; theSet: set[char]): bool {...}{.raises: [], tags: [].}
```
  Returns true if every character of `s` is in the set `theSet`. **Example:**

 
```
doAssert allCharsInSet("aeea", {'a', 'e'}) == true
doAssert allCharsInSet("", {'a', 'e'}) == true
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1834)  
```
proc abbrev(s: string; possibilities: openArray[string]): int {...}{.raises: [],
    tags: [].}
```
  Returns the index of the first item in `possibilities` which starts with `s`, if not ambiguous.

 Returns -1 if no item has been found and -2 if multiple items match.

 **Example:**

 
```
doAssert abbrev("fac", ["college", "faculty", "industry"]) == 1
doAssert abbrev("foo", ["college", "faculty", "industry"]) == -1 # Not found
doAssert abbrev("fac", ["college", "faculty", "faculties"]) == -2 # Ambiguous
doAssert abbrev("college", ["college", "colleges", "industry"]) == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1844) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1844)  
```
proc join(a: openArray[string]; sep: string = ""): string {...}{.noSideEffect,
    gcsafe, extern: "nsuJoinSep", raises: [], tags: [].}
```
  Concatenates all strings in the container `a`, separating them with `sep`. **Example:**

 
```
doAssert join(["A", "B", "Conclusion"], " -> ") == "A -> B -> Conclusion"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1866)  
```
proc join[T: not string](a: openArray[T]; sep: string = ""): string {...}{.
    noSideEffect, gcsafe.}
```
  Converts all elements in the container `a` to strings using `$`, and concatenates them with `sep`. **Example:**

 
```
doAssert join([1, 2, 3], " -> ") == "1 -> 2 -> 3"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1883) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1883)  
```
proc initSkipTable(a: var SkipTable; sub: string) {...}{.noSideEffect, gcsafe,
    extern: "nsuInitSkipTable", raises: [], tags: [].}
```
  Preprocess table `a` for `sub`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1899) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1899)  
```
proc find(a: SkipTable; s, sub: string; start: Natural = 0; last = 0): int {...}{.
    noSideEffect, gcsafe, extern: "nsuFindStrA", raises: [], tags: [].}
```
  Searches for `sub` in `s` inside range `start..last` using preprocessed table `a`. If `last` is unspecified, it defaults to `s.high` (the last element).

 Searching is case-sensitive. If `sub` is not in `s`, -1 is returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1918)  
```
proc find(s: string; sub: char; start: Natural = 0; last = 0): int {...}{.
    noSideEffect, gcsafe, extern: "nsuFindChar", raises: [], tags: [].}
```
  Searches for `sub` in `s` inside range `start..last` (both ends included). If `last` is unspecified, it defaults to `s.high` (the last element).

 Searching is case-sensitive. If `sub` is not in `s`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].rfind` for a `start`-origin index.

 See also:

 * [rfind proc](#rfind,string,char,Natural)
* [replace proc](#replace,string,char,char)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1954) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1954)  
```
proc find(s: string; chars: set[char]; start: Natural = 0; last = 0): int {...}{.
    noSideEffect, gcsafe, extern: "nsuFindCharSet", raises: [], tags: [].}
```
  Searches for `chars` in `s` inside range `start..last` (both ends included). If `last` is unspecified, it defaults to `s.high` (the last element).

 If `s` contains none of the characters in `chars`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].find` for a `start`-origin index.

 See also:

 * [rfind proc](#rfind,string,set%5Bchar%5D,Natural)
* [multiReplace proc](#multiReplace,string,varargs%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1982) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1982)  
```
proc find(s, sub: string; start: Natural = 0; last = 0): int {...}{.noSideEffect,
    gcsafe, extern: "nsuFindStr", raises: [], tags: [].}
```
  Searches for `sub` in `s` inside range `start..last` (both ends included). If `last` is unspecified, it defaults to `s.high` (the last element).

 Searching is case-sensitive. If `sub` is not in `s`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].find` for a `start`-origin index.

 See also:

 * [rfind proc](#rfind,string,string,Natural)
* [replace proc](#replace,string,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L1999) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L1999)  
```
proc rfind(s: string; sub: char; start: Natural = 0; last = -1): int {...}{.
    noSideEffect, gcsafe, extern: "nsuRFindChar", raises: [], tags: [].}
```
  Searches for `sub` in `s` inside range `start..last` (both ends included) in reverse -- starting at high indexes and moving lower to the first character or `start`. If `last` is unspecified, it defaults to `s.high` (the last element).

 Searching is case-sensitive. If `sub` is not in `s`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].find` for a `start`-origin index.

 See also:

 * [find proc](#find,string,char,Natural,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2017)  
```
proc rfind(s: string; chars: set[char]; start: Natural = 0; last = -1): int {...}{.
    noSideEffect, gcsafe, extern: "nsuRFindCharSet", raises: [], tags: [].}
```
  Searches for `chars` in `s` inside range `start..last` (both ends included) in reverse -- starting at high indexes and moving lower to the first character or `start`. If `last` is unspecified, it defaults to `s.high` (the last element).

 If `s` contains none of the characters in `chars`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].rfind` for a `start`-origin index.

 See also:

 * [find proc](#find,string,set%5Bchar%5D,Natural,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2035) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2035)  
```
proc rfind(s, sub: string; start: Natural = 0; last = -1): int {...}{.noSideEffect,
    gcsafe, extern: "nsuRFindStr", raises: [], tags: [].}
```
  Searches for `sub` in `s` inside range `start..last` (both ends included) included) in reverse -- starting at high indexes and moving lower to the first character or `start`. If `last` is unspecified, it defaults to `s.high` (the last element).

 Searching is case-sensitive. If `sub` is not in `s`, -1 is returned. Otherwise the index returned is relative to `s[0]`, not `start`. Use `s[start..last].rfind` for a `start`-origin index.

 See also:

 * [find proc](#find,string,string,Natural,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2053) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2053)  
```
proc count(s: string; sub: char): int {...}{.noSideEffect, gcsafe,
                                        extern: "nsuCountChar", raises: [],
                                        tags: [].}
```
  Count the occurrences of the character `sub` in the string `s`.

 See also:

 * [countLines proc](#countLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2080) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2080)  
```
proc count(s: string; subs: set[char]): int {...}{.noSideEffect, gcsafe,
    extern: "nsuCountCharSet", raises: [], tags: [].}
```
  Count the occurrences of the group of character `subs` in the string `s`.

 See also:

 * [countLines proc](#countLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2090) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2090)  
```
proc count(s: string; sub: string; overlapping: bool = false): int {...}{.
    noSideEffect, gcsafe, extern: "nsuCountString", raises: [], tags: [].}
```
  Count the occurrences of a substring `sub` in the string `s`. Overlapping occurrences of `sub` only count when `overlapping` is set to true (default: false).

 See also:

 * [countLines proc](#countLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2101)  
```
proc countLines(s: string): int {...}{.noSideEffect, gcsafe, extern: "nsuCountLines",
                                  raises: [], tags: [].}
```
  Returns the number of lines in the string `s`.

 This is the same as `len(splitLines(s))`, but much more efficient because it doesn't modify the string creating temporal objects. Every [character literal](manual#lexical-analysis-character-literals) newline combination (CR, LF, CR-LF) is supported.

 In this context, a line is any string separated by a newline combination. A line can be an empty string.

 See also:

 * [splitLines proc](#splitLines,string)

 **Example:**

 
```
doAssert countLines("First line\l and second line.") == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2119)  
```
proc contains(s, sub: string): bool {...}{.noSideEffect, raises: [], tags: [].}
```
  Same as `find(s, sub) >= 0`.

 See also:

 * [find proc](#find,string,string,Natural,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2147)  
```
proc contains(s: string; chars: set[char]): bool {...}{.noSideEffect, raises: [],
    tags: [].}
```
  Same as `find(s, chars) >= 0`.

 See also:

 * [find proc](#find,string,set%5Bchar%5D,Natural,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2154)  
```
proc replace(s, sub: string; by = ""): string {...}{.noSideEffect, gcsafe,
    extern: "nsuReplaceStr", raises: [], tags: [].}
```
  Replaces `sub` in `s` by the string `by`.

 See also:

 * [find proc](#find,string,string,Natural,int)
* [replace proc](#replace,string,char,char) for replacing single characters
* [replaceWord proc](#replaceWord,string,string,string)
* [multiReplace proc](#multiReplace,string,varargs%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2161)  
```
proc replace(s: string; sub, by: char): string {...}{.noSideEffect, gcsafe,
    extern: "nsuReplaceChar", raises: [], tags: [].}
```
  Replaces `sub` in `s` by the character `by`.

 Optimized version of [replace](#replace,string,string,string) for characters.

 See also:

 * [find proc](#find,string,char,Natural,int)
* [replaceWord proc](#replaceWord,string,string,string)
* [multiReplace proc](#multiReplace,string,varargs%5B%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2203)  
```
proc replaceWord(s, sub: string; by = ""): string {...}{.noSideEffect, gcsafe,
    extern: "nsuReplaceWord", raises: [], tags: [].}
```
  Replaces `sub` in `s` by the string `by`.

 Each occurrence of `sub` has to be surrounded by word boundaries (comparable to `\b` in regular expressions), otherwise it is not replaced.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2221)  
```
proc multiReplace(s: string; replacements: varargs[(string, string)]): string {...}{.
    noSideEffect, raises: [], tags: [].}
```
  Same as replace, but specialized for doing multiple replacements in a single pass through the input string.

 `multiReplace` performs all replacements in a single pass, this means it can be used to swap the occurrences of "a" and "b", for instance.

 If the resulting string is not longer than the original input string, only a single memory allocation is required.

 The order of the replacements does matter. Earlier replacements are preferred over later replacements in the argument list.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2252)  
```
proc insertSep(s: string; sep = '_'; digits = 3): string {...}{.noSideEffect, gcsafe,
    extern: "nsuInsertSep", raises: [], tags: [].}
```
  Inserts the separator `sep` after `digits` characters (default: 3) from right to left.

 Even though the algorithm works with any string `s`, it is only useful if `s` contains a number.

 **Example:**

 
```
doAssert insertSep("1000000") == "1_000_000"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2288)  
```
proc escape(s: string; prefix = "\""; suffix = "\""): string {...}{.noSideEffect,
    gcsafe, extern: "nsuEscape", raises: [], tags: [].}
```
  Escapes a string `s`. See [system.addEscapedChar](system#addEscapedChar,string,char) for the escaping scheme.

 The resulting string is prefixed with `prefix` and suffixed with `suffix`. Both may be empty strings.

 See also:

 * [unescape proc](#unescape,string,string,string) for the opposite

 operation

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2322)  
```
proc unescape(s: string; prefix = "\""; suffix = "\""): string {...}{.noSideEffect,
    gcsafe, extern: "nsuUnescape", raises: [ValueError], tags: [].}
```
  Unescapes a string `s`.

 This complements [escape proc](#escape,string,string,string) as it performs the opposite operations.

 If `s` does not begin with `prefix` and end with `suffix` a ValueError exception will be raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2346)  
```
proc validIdentifier(s: string): bool {...}{.noSideEffect, gcsafe,
                                        extern: "nsuValidIdentifier",
                                        raises: [], tags: [].}
```
  Returns true if `s` is a valid identifier.

 A valid identifier starts with a character of the set `IdentStartChars` and is followed by any number of characters of the set `IdentChars`.

 **Example:**

 
```
doAssert "abc_def08".validIdentifier
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2389)  
```
proc formatBiggestFloat(f: BiggestFloat; format: FloatFormatMode = ffDefault;
                        precision: range[-1 .. 32] = 16; decimalSep = '.'): string {...}{.
    noSideEffect, gcsafe, extern: "nsu$1", raises: [], tags: [].}
```
  Converts a floating point value `f` to a string.

 If `format == ffDecimal` then precision is the number of digits to be printed after the decimal point. If `format == ffScientific` then precision is the maximum number of significant digits to be printed. `precision`'s default value is the maximum number of meaningful digits after the decimal point for Nim's `biggestFloat` type.

 If `precision == -1`, it tries to format it nicely.

 **Example:**

 
```
let x = 123.456
doAssert x.formatBiggestFloat() == "123.4560000000000"
doAssert x.formatBiggestFloat(ffDecimal, 4) == "123.4560"
doAssert x.formatBiggestFloat(ffScientific, 2) == "1.23e+02"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2416)  
```
proc formatFloat(f: float; format: FloatFormatMode = ffDefault;
                 precision: range[-1 .. 32] = 16; decimalSep = '.'): string {...}{.
    noSideEffect, gcsafe, extern: "nsu$1", raises: [], tags: [].}
```
  Converts a floating point value `f` to a string.

 If `format == ffDecimal` then precision is the number of digits to be printed after the decimal point. If `format == ffScientific` then precision is the maximum number of significant digits to be printed. `precision`'s default value is the maximum number of meaningful digits after the decimal point for Nim's `float` type.

 If `precision == -1`, it tries to format it nicely.

 **Example:**

 
```
let x = 123.456
doAssert x.formatFloat() == "123.4560000000000"
doAssert x.formatFloat(ffDecimal, 4) == "123.4560"
doAssert x.formatFloat(ffScientific, 2) == "1.23e+02"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2496)  
```
proc trimZeros(x: var string; decimalSep = '.') {...}{.noSideEffect, raises: [],
    tags: [].}
```
  Trim trailing zeros from a formatted floating point value `x` (must be declared as `var`).

 This modifies `x` itself, it does not return a copy.

 **Example:**

 
```
var x = "123.456000000"
x.trimZeros()
doAssert x == "123.456"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2517)  
```
proc formatSize(bytes: int64; decimalSep = '.'; prefix = bpIEC;
                includeSpace = false): string {...}{.noSideEffect, raises: [],
    tags: [].}
```
  Rounds and formats `bytes`.

 By default, uses the IEC/ISO standard binary prefixes, so 1024 will be formatted as 1KiB. Set prefix to `bpColloquial` to use the colloquial names from the SI standard (e.g. k for 1000 being reused as 1024).

 `includeSpace` can be set to true to include the (SI preferred) space between the number and the unit (e.g. 1 KiB).

 See also:

 * [strformat module](strformat) for string interpolation and formatting

 **Example:**

 
```
doAssert formatSize((1'i64 shl 31) + (300'i64 shl 20)) == "2.293GiB"
doAssert formatSize((2.234*1024*1024).int) == "2.234MiB"
doAssert formatSize(4096, includeSpace = true) == "4 KiB"
doAssert formatSize(4096, prefix = bpColloquial, includeSpace = true) == "4 kB"
doAssert formatSize(4096) == "4KiB"
doAssert formatSize(5_378_934, prefix = bpColloquial, decimalSep = ',') == "5,13MB"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2541)  
```
proc formatEng(f: BiggestFloat; precision: range[0 .. 32] = 10;
               trim: bool = true; siPrefix: bool = false; unit: string = "";
               decimalSep = '.'; useUnitSpace = false): string {...}{.noSideEffect,
    raises: [], tags: [].}
```
  Converts a floating point value `f` to a string using engineering notation.

 Numbers in of the range -1000.0<f<1000.0 will be formatted without an exponent. Numbers outside of this range will be formatted as a significand in the range -1000.0<f<1000.0 and an exponent that will always be an integer multiple of 3, corresponding with the SI prefix scale k, M, G, T etc for numbers with an absolute value greater than 1 and m, μ, n, p etc for numbers with an absolute value less than 1.

 The default configuration (`trim=true` and `precision=10`) shows the **shortest** form that precisely (up to a maximum of 10 decimal places) displays the value. For example, 4.100000 will be displayed as 4.1 (which is mathematically identical) whereas 4.1000003 will be displayed as 4.1000003.

 If `trim` is set to true, trailing zeros will be removed; if false, the number of digits specified by `precision` will always be shown.

 `precision` can be used to set the number of digits to be shown after the decimal point or (if `trim` is true) the maximum number of digits to be shown.

 
```
formatEng(0, 2, trim=false) == "0.00"
formatEng(0, 2) == "0"
formatEng(0.053, 0) == "53e-3"
formatEng(52731234, 2) == "52.73e6"
formatEng(-52731234, 2) == "-52.73e6"
```

If `siPrefix` is set to true, the number will be displayed with the SI prefix corresponding to the exponent. For example 4100 will be displayed as "4.1 k" instead of "4.1e3". Note that `u` is used for micro- in place of the greek letter mu (μ) as per ISO 2955. Numbers with an absolute value outside of the range 1e-18<f<1000e18 (1a<f<1000E) will be displayed with an exponent rather than an SI prefix, regardless of whether `siPrefix` is true.

 If `useUnitSpace` is true, the provided unit will be appended to the string (with a space as required by the SI standard). This behaviour is slightly different to appending the unit to the result as the location of the space is altered depending on whether there is an exponent.

 
```
formatEng(4100, siPrefix=true, unit="V") == "4.1 kV"
formatEng(4.1, siPrefix=true, unit="V") == "4.1 V"
formatEng(4.1, siPrefix=true) == "4.1" # Note lack of space
formatEng(4100, siPrefix=true) == "4.1 k"
formatEng(4.1, siPrefix=true, unit="") == "4.1 " # Space with unit=""
formatEng(4100, siPrefix=true, unit="") == "4.1 k"
formatEng(4100) == "4.1e3"
formatEng(4100, unit="V") == "4.1e3 V"
formatEng(4100, unit="", useUnitSpace=true) == "4.1e3 " # Space with useUnitSpace=true
```

`decimalSep` is used as the decimal separator.

 See also:

 * [strformat module](strformat) for string interpolation and formatting

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2597)  
```
proc addf(s: var string; formatstr: string; a: varargs[string, `$`]) {...}{.
    noSideEffect, gcsafe, extern: "nsuAddf", raises: [ValueError], tags: [].}
```
  The same as `add(s, formatstr % a)`, but more efficient. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2748) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2748)  
```
proc `%`(formatstr: string; a: openArray[string]): string {...}{.noSideEffect,
    gcsafe, extern: "nsuFormatOpenArray", raises: [ValueError], tags: [].}
```
  Interpolates a format string with the values from `a`.

 The substitution operator performs string substitutions in `formatstr` and returns a modified `formatstr`. This is often called string interpolation.

 This is best explained by an example:

 
```
"$1 eats $2." % ["The cat", "fish"]
```

Results in:

 
```
"The cat eats fish."
```

The substitution variables (the thing after the `$`) are enumerated from 1 to `a.len`. To produce a verbatim `$`, use `$$`. The notation `$#` can be used to refer to the next substitution variable:

 
```
"$# eats $#." % ["The cat", "fish"]
```

Substitution variables can also be words (that is `[A-Za-z_]+[A-Za-z0-9_]*`) in which case the arguments in `a` with even indices are keys and with odd indices are the corresponding values. An example:

 
```
"$animal eats $food." % ["animal", "The cat", "food", "fish"]
```

Results in:

 
```
"The cat eats fish."
```

The variables are compared with `cmpIgnoreStyle`. `ValueError` is raised if an ill-formed format string has been passed to the `%` operator.

 See also:

 * [strformat module](strformat) for string interpolation and formatting

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2811)  
```
proc `%`(formatstr, a: string): string {...}{.noSideEffect, gcsafe,
    extern: "nsuFormatSingleElem", raises: [ValueError], tags: [].}
```
  This is the same as `formatstr % [a]` (see [% proc](#%25,string,openArray%5Bstring%5D)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2859)  
```
proc format(formatstr: string; a: varargs[string, `$`]): string {...}{.noSideEffect,
    gcsafe, extern: "nsuFormatVarargs", raises: [ValueError], tags: [].}
```
  This is the same as `formatstr % a` (see [% proc](#%25,string,openArray%5Bstring%5D)) except that it supports auto stringification.

 See also:

 * [strformat module](strformat) for string interpolation and formatting

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2866)  
```
proc strip(s: string; leading = true; trailing = true;
           chars: set[char] = Whitespace): string {...}{.noSideEffect, gcsafe,
    extern: "nsuStrip", raises: [], tags: [].}
```
  Strips leading or trailing `chars` (default: whitespace characters) from `s` and returns the resulting string.

 If `leading` is true (default), leading `chars` are stripped. If `trailing` is true (default), trailing `chars` are stripped. If both are false, the string is returned unchanged.

 See also:

 * [stripLineEnd proc](#stripLineEnd,string)

 **Example:**

 
```
let a = "  vhellov   "
let b = strip(a)
doAssert b == "vhellov"

doAssert a.strip(leading = false) == "  vhellov"
doAssert a.strip(trailing = false) == "vhellov   "

doAssert b.strip(chars = {'v'}) == "hello"
doAssert b.strip(leading = false, chars = {'v'}) == "vhello"

let c = "blaXbla"
doAssert c.strip(chars = {'b', 'a'}) == "laXbl"
doAssert c.strip(chars = {'b', 'a', 'l'}) == "X"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2878) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2878)  
```
proc stripLineEnd(s: var string) {...}{.raises: [], tags: [].}
```
  Returns `s` stripped from one of these suffixes: `\r, \n, \r\n, \f, \v` (at most once instance). For example, can be useful in conjunction with `osproc.execCmdEx`. aka: chomp **Example:**

 
```
var s = "foo\n\n"
s.stripLineEnd
doAssert s == "foo\n"
s = "foo\r\n"
s.stripLineEnd
doAssert s == "foo"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2914) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2914)  
```
proc isEmptyOrWhitespace(s: string): bool {...}{.noSideEffect, gcsafe,
    extern: "nsuIsEmptyOrWhitespace", raises: [], tags: [].}
```
  Checks if `s` is empty or consists entirely of whitespace characters. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2974) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2974)   Iterators
---------

  
```
iterator split(s: string; sep: char; maxsplit: int = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the string `s` into substrings using a single separator.

 Substrings are separated by the character `sep`. The code:

 
```
for word in split(";;this;is;an;;example;;;", ';'):
  writeLine(stdout, word)
```

Results in:

 
```
""
""
"this"
"is"
"an"
""
"example"
""
""
""
```

See also:

 * [rsplit iterator](#rsplit.i,string,char,int)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [split proc](#split,string,char,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L437)  
```
iterator split(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): string {...}{.
    raises: [], tags: [].}
```
  Splits the string `s` into substrings using a group of separators.

 Substrings are separated by a substring containing only `seps`.

 
```
for word in split("this\lis an\texample"):
  writeLine(stdout, word)
```

...generates this output:

 
```
"this"
"is"
"an"
"example"
```

And the following code:

 
```
for word in split("this:is;an$example", {';', ':', '$'}):
  writeLine(stdout, word)
```

...produces the same output as the first example. The code:

 
```
let date = "2012-11-20T22:08:08.398990"
let separators = {' ', '-', ':', 'T'}
for number in split(date, separators):
  writeLine(stdout, number)
```

...results in:

 
```
"2012"
"11"
"20"
"22"
"08"
"08.398990"
```

See also:

 * [rsplit iterator](#rsplit.i,string,set%5Bchar%5D,int)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [split proc](#split,string,set%5Bchar%5D,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L468)  
```
iterator split(s: string; sep: string; maxsplit: int = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the string `s` into substrings using a string separator.

 Substrings are separated by the string `sep`. The code:

 
```
for word in split("thisDATAisDATAcorrupted", "DATA"):
  writeLine(stdout, word)
```

Results in:

 
```
"this"
"is"
"corrupted"
```

See also:

 * [rsplit iterator](#rsplit.i,string,string,int,bool)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [split proc](#split,string,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L517)  
```
iterator rsplit(s: string; sep: char; maxsplit: int = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the string `s` into substrings from the right using a string separator. Works exactly the same as [split iterator](#split.i,string,char,int) except in reverse order.
```
for piece in "foo:bar".rsplit(':'):
  echo piece
```

Results in:

 
```
"bar"
"foo"
```

Substrings are separated from the right by the char `sep`.

 See also:

 * [split iterator](#split.i,string,char,int)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [rsplit proc](#rsplit,string,char,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L566)  
```
iterator rsplit(s: string; seps: set[char] = Whitespace; maxsplit: int = -1): string {...}{.
    raises: [], tags: [].}
```
  Splits the string `s` into substrings from the right using a string separator. Works exactly the same as [split iterator](#split.i,string,char,int) except in reverse order.
```
for piece in "foo bar".rsplit(WhiteSpace):
  echo piece
```

Results in:

 
```
"bar"
"foo"
```

Substrings are separated from the right by the set of chars `seps`

 See also:

 * [split iterator](#split.i,string,set%5Bchar%5D,int)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [rsplit proc](#rsplit,string,set%5Bchar%5D,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L591)  
```
iterator rsplit(s: string; sep: string; maxsplit: int = -1;
                keepSeparators: bool = false): string {...}{.raises: [], tags: [].}
```
  Splits the string `s` into substrings from the right using a string separator. Works exactly the same as [split iterator](#split.i,string,string,int) except in reverse order.
```
for piece in "foothebar".rsplit("the"):
  echo piece
```

Results in:

 
```
"bar"
"foo"
```

Substrings are separated from the right by the string `sep`

 See also:

 * [split iterator](#split.i,string,string,int)
* [splitLines iterator](#splitLines.i,string)
* [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [rsplit proc](#rsplit,string,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L616)  
```
iterator splitLines(s: string; keepEol = false): string {...}{.raises: [], tags: [].}
```
  Splits the string `s` into its containing lines.

 Every [character literal](manual#lexical-analysis-character-literals) newline combination (CR, LF, CR-LF) is supported. The result strings contain no trailing end of line characters unless parameter `keepEol` is set to `true`.

 Example:

 
```
for line in splitLines("\nthis\nis\nan\n\nexample\n"):
  writeLine(stdout, line)
```

Results in:

 
```
""
"this"
"is"
"an"
""
"example"
""
```

See also:

 * [splitWhitespace iterator](#splitWhitespace.i,string,int)
* [splitLines proc](#splitLines,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L641)  
```
iterator splitWhitespace(s: string; maxsplit: int = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the string `s` at whitespace stripping leading and trailing whitespace if necessary. If `maxsplit` is specified and is positive, no more than `maxsplit` splits is made.

 The following code:

 
```
let s = "  foo \t bar  baz  "
for ms in [-1, 1, 2, 3]:
  echo "------ maxsplit = ", ms, ":"
  for item in s.splitWhitespace(maxsplit=ms):
    echo '"', item, '"'
```

...results in:

 
```
------ maxsplit = -1:
"foo"
"bar"
"baz"
------ maxsplit = 1:
"foo"
"bar  baz  "
------ maxsplit = 2:
"foo"
"bar"
"baz  "
------ maxsplit = 3:
"foo"
"bar"
"baz"
```

See also:

 * [splitLines iterator](#splitLines.i,string)
* [splitWhitespace proc](#splitWhitespace,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L690)  
```
iterator tokenize(s: string; seps: set[char] = Whitespace): tuple[token: string,
    isSep: bool] {...}{.raises: [], tags: [].}
```
  Tokenizes the string `s` into substrings.

 Substrings are separated by a substring containing only `seps`. Example:

 
```
for word in tokenize("  this is an  example  "):
  writeLine(stdout, word)
```

Results in:

 
```
("  ", true)
("this", false)
(" ", true)
("is", false)
(" ", true)
("an", false)
("  ", true)
("example", false)
("  ", true)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/strutils.nim#L2940) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/strutils.nim#L2940)   Exports
-------

  [toLower](unicode#toLower,string), [toLower](unicode#toLower,Rune), [toUpper](unicode#toUpper,Rune), [toUpper](unicode#toUpper,string) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/strutils.html>

unicode
=======


This module provides support to handle the Unicode UTF-8 encoding.

 There are no specialized `insert`, `delete`, `add` and `contains` procedures for `seq[Rune]` in this module because the generic variants of these procedures in the system module already work with it.

 The current version is compatible with Unicode v12.0.0.

 **See also:**

 * [strutils module](strutils)
* [unidecode module](unidecode)
* [encodings module](encodings)

 Types
-----

  
```
Rune = distinct RuneImpl
```
   Type that can hold a single Unicode code point.

 A Rune may be composed with other Runes to a character on the screen. `RuneImpl` is the underlying type used to store Runes, currently `int32`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L27)   Procs
-----

  
```
proc runeLen(s: string): int {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns the number of runes of the string `s`. **Example:**

 
```
let a = "añyóng"
doAssert a.runeLen == 6
## note: a.len == 8
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L35)  
```
proc runeLenAt(s: string; i: Natural): int {...}{.raises: [], tags: [].}
```
  Returns the number of bytes the rune starting at `s[i]` takes.

 See also:

 * [fastRuneAt template](#fastRuneAt.t,string,int,untyped)

 **Example:**

 
```
let a = "añyóng"
doAssert a.runeLenAt(0) == 1
doAssert a.runeLenAt(1) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L54)  
```
proc runeAt(s: string; i: Natural): Rune {...}{.raises: [], tags: [].}
```
  Returns the rune in `s` at **byte index** `i`.

 See also:

 * [runeAtPos proc](#runeAtPos,string,int)
* [runeStrAtPos proc](#runeStrAtPos,string,Natural)
* [fastRuneAt template](#fastRuneAt.t,string,int,untyped)

 **Example:**

 
```
let a = "añyóng"
doAssert a.runeAt(1) == "ñ".runeAt(0)
doAssert a.runeAt(2) == "ñ".runeAt(1)
doAssert a.runeAt(3) == "y".runeAt(0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L152)  
```
proc validateUtf8(s: string): int {...}{.raises: [], tags: [].}
```
  Returns the position of the invalid byte in `s` if the string `s` does not hold valid UTF-8 data. Otherwise `-1` is returned.

 See also:

 * [toUTF8 proc](#toUTF8,Rune)
* [$ proc](#%24,Rune) alias for `toUTF8`
* [fastToUTF8Copy template](#fastToUTF8Copy.t,Rune,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L166)  
```
proc toUTF8(c: Rune): string {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Converts a rune into its UTF-8 representation.

 See also:

 * [validateUtf8 proc](#validateUtf8,string)
* [$ proc](#%24,Rune) alias for `toUTF8`
* [utf8 iterator](#utf8.i,string)
* [fastToUTF8Copy template](#fastToUTF8Copy.t,Rune,string,int)

 **Example:**

 
```
let a = "añyóng"
doAssert a.runeAt(1).toUTF8 == "ñ"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L254)  
```
proc add(s: var string; c: Rune) {...}{.raises: [], tags: [].}
```
  Adds a rune `c` to a string `s`. **Example:**

 
```
var s = "abc"
let c = "ä".runeAt(0)
s.add(c)
doAssert s == "abcä"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L269)  
```
proc `$`(rune: Rune): string {...}{.raises: [], tags: [].}
```
  An alias for [toUTF8](#toUTF8,Rune).

 See also:

 * [validateUtf8 proc](#validateUtf8,string)
* [fastToUTF8Copy template](#fastToUTF8Copy.t,Rune,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L280)  
```
proc `$`(runes: seq[Rune]): string {...}{.raises: [], tags: [].}
```
  Converts a sequence of Runes to a string.

 See also:

 * [toRunes](#toRunes,string) for a reverse operation

 **Example:**

 
```
let
  someString = "öÑ"
  someRunes = toRunes(someString)
doAssert $someRunes == someString
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L288)  
```
proc runeOffset(s: string; pos: Natural; start: Natural = 0): int {...}{.raises: [],
    tags: [].}
```
  Returns the byte position of rune at position `pos` in `s` with an optional start byte position. Returns the special value -1 if it runs out of the string.

 **Beware:** This can lead to unoptimized code and slow execution! Most problems can be solved more efficiently by using an iterator or conversion to a seq of Rune.

 See also:

 * [runeReverseOffset proc](#runeReverseOffset,string,Positive)

 **Example:**

 
```
let a = "añyóng"
doAssert a.runeOffset(1) == 1
doAssert a.runeOffset(3) == 4
doAssert a.runeOffset(4) == 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L303)  
```
proc runeReverseOffset(s: string; rev: Positive): (int, int) {...}{.raises: [],
    tags: [].}
```
  Returns a tuple with the byte offset of the rune at position `rev` in `s`, counting from the end (starting with 1) and the total number of runes in the string.

 Returns a negative value for offset if there are to few runes in the string to satisfy the request.

 **Beware:** This can lead to unoptimized code and slow execution! Most problems can be solved more efficiently by using an iterator or conversion to a seq of Rune.

 See also:

 * [runeOffset proc](#runeOffset,string,Natural,Natural)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L330)  
```
proc runeAtPos(s: string; pos: int): Rune {...}{.raises: [], tags: [].}
```
  Returns the rune at position `pos`.

 **Beware:** This can lead to unoptimized code and slow execution! Most problems can be solved more efficiently by using an iterator or conversion to a seq of Rune.

 See also:

 * [runeAt proc](#runeAt,string,Natural)
* [runeStrAtPos proc](#runeStrAtPos,string,Natural)
* [fastRuneAt template](#fastRuneAt.t,string,int,untyped)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L360)  
```
proc runeStrAtPos(s: string; pos: Natural): string {...}{.raises: [], tags: [].}
```
  Returns the rune at position `pos` as UTF8 String.

 **Beware:** This can lead to unoptimized code and slow execution! Most problems can be solved more efficiently by using an iterator or conversion to a seq of Rune.

 See also:

 * [runeAt proc](#runeAt,string,Natural)
* [runeAtPos proc](#runeAtPos,string,int)
* [fastRuneAt template](#fastRuneAt.t,string,int,untyped)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L373)  
```
proc runeSubStr(s: string; pos: int; len: int = int.high): string {...}{.raises: [],
    tags: [].}
```
  Returns the UTF-8 substring starting at code point `pos` with `len` code points.

 If `pos` or `len` is negative they count from the end of the string. If `len` is not given it means the longest possible string.

 **Example:**

 
```
let s = "Hänsel  ««: 10,00€"
doAssert(runeSubStr(s, 0, 2) == "Hä")
doAssert(runeSubStr(s, 10, 1) == ":")
doAssert(runeSubStr(s, -6) == "10,00€")
doAssert(runeSubStr(s, 10) == ": 10,00€")
doAssert(runeSubStr(s, 12, 5) == "10,00")
doAssert(runeSubStr(s, -6, 3) == "10,")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L387)  
```
proc `<=%`(a, b: Rune): bool {...}{.raises: [], tags: [].}
```
  Checks if code point of `a` is smaller or equal to code point of `b`. **Example:**

 
```
let
  a = "ú".runeAt(0)
  b = "ü".runeAt(0)
doAssert a <=% b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L434)  
```
proc `<%`(a, b: Rune): bool {...}{.raises: [], tags: [].}
```
  Checks if code point of `a` is smaller than code point of `b`. **Example:**

 
```
let
  a = "ú".runeAt(0)
  b = "ü".runeAt(0)
doAssert a <% b
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L443)  
```
proc `==`(a, b: Rune): bool {...}{.raises: [], tags: [].}
```
  Checks if two runes are equal. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L452)  
```
proc toLower(c: Rune): Rune {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Converts `c` into lower case. This works for any rune.

 If possible, prefer `toLower` over `toUpper`.

 See also:

 * [toUpper proc](#toUpper,Rune)
* [toTitle proc](#toTitle,Rune)
* [isLower proc](#isLower,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L474)  
```
proc toUpper(c: Rune): Rune {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Converts `c` into upper case. This works for any rune.

 If possible, prefer `toLower` over `toUpper`.

 See also:

 * [toLower proc](#toLower,Rune)
* [toTitle proc](#toTitle,Rune)
* [isUpper proc](#isUpper,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L492)  
```
proc toTitle(c: Rune): Rune {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Converts `c` to title case.

 See also:

 * [toLower proc](#toLower,Rune)
* [toUpper proc](#toUpper,Rune)
* [isTitle proc](#isTitle,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L510)  
```
proc isLower(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is a lower case rune.

 If possible, prefer `isLower` over `isUpper`.

 See also:

 * [toLower proc](#toLower,Rune)
* [isUpper proc](#isUpper,Rune)
* [isTitle proc](#isTitle,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L523)  
```
proc isUpper(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is a upper case rune.

 If possible, prefer `isLower` over `isUpper`.

 See also:

 * [toUpper proc](#toUpper,Rune)
* [isLower proc](#isLower,Rune)
* [isTitle proc](#isTitle,Rune)
* [isAlpha proc](#isAlpha,Rune)
* [isWhiteSpace proc](#isWhiteSpace,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L541)  
```
proc isAlpha(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is an *alpha* rune (i.e., a letter).

 See also:

 * [isLower proc](#isLower,Rune)
* [isTitle proc](#isTitle,Rune)
* [isAlpha proc](#isAlpha,Rune)
* [isWhiteSpace proc](#isWhiteSpace,Rune)
* [isCombining proc](#isCombining,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L561)  
```
proc isTitle(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is a Unicode titlecase code point.

 See also:

 * [toTitle proc](#toTitle,Rune)
* [isLower proc](#isLower,Rune)
* [isUpper proc](#isUpper,Rune)
* [isAlpha proc](#isAlpha,Rune)
* [isWhiteSpace proc](#isWhiteSpace,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L580)  
```
proc isWhiteSpace(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is a Unicode whitespace code point.

 See also:

 * [isLower proc](#isLower,Rune)
* [isUpper proc](#isUpper,Rune)
* [isTitle proc](#isTitle,Rune)
* [isAlpha proc](#isAlpha,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L591)  
```
proc isCombining(c: Rune): bool {...}{.gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Returns true if `c` is a Unicode combining code unit.

 See also:

 * [isLower proc](#isLower,Rune)
* [isUpper proc](#isUpper,Rune)
* [isTitle proc](#isTitle,Rune)
* [isAlpha proc](#isAlpha,Rune)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L604)  
```
proc isAlpha(s: string): bool {...}{.noSideEffect, gcsafe, extern: "nuc$1Str",
                                raises: [], tags: [].}
```
  Returns true if `s` contains all alphabetic runes. **Example:**

 
```
let a = "añyóng"
doAssert a.isAlpha
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L631)  
```
proc isSpace(s: string): bool {...}{.noSideEffect, gcsafe, extern: "nuc$1Str",
                                raises: [], tags: [].}
```
  Returns true if `s` contains all whitespace runes. **Example:**

 
```
let a = "\t\l \v\r\f"
doAssert a.isSpace
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L639)  
```
proc toUpper(s: string): string {...}{.noSideEffect, gcsafe, extern: "nuc$1Str",
                                  raises: [], tags: [].}
```
  Converts `s` into upper-case runes. **Example:**

 
```
doAssert toUpper("abγ") == "ABΓ"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L660)  
```
proc toLower(s: string): string {...}{.noSideEffect, gcsafe, extern: "nuc$1Str",
                                  raises: [], tags: [].}
```
  Converts `s` into lower-case runes. **Example:**

 
```
doAssert toLower("ABΓ") == "abγ"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L667)  
```
proc swapCase(s: string): string {...}{.noSideEffect, gcsafe, extern: "nuc$1",
                                   raises: [], tags: [].}
```
  Swaps the case of runes in `s`.

 Returns a new string such that the cases of all runes are swapped if possible.

 **Example:**

 
```
doAssert swapCase("Αlpha Βeta Γamma") == "αLPHA βETA γAMMA"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L674)  
```
proc capitalize(s: string): string {...}{.noSideEffect, gcsafe, extern: "nuc$1",
                                     raises: [], tags: [].}
```
  Converts the first character of `s` into an upper-case rune. **Example:**

 
```
doAssert capitalize("βeta") == "Βeta"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L696)  
```
proc translate(s: string; replacements: proc (key: string): string): string {...}{.
    gcsafe, extern: "nuc$1", raises: [], tags: [].}
```
  Translates words in a string using the `replacements` proc to substitute words inside `s` with their replacements.

 `replacements` is any proc that takes a word and returns a new word to fill it's place.

 **Example:**

 
```
proc wordToNumber(s: string): string =
  case s
  of "one": "1"
  of "two": "2"
  else: s
let a = "one two three four"
doAssert a.translate(wordToNumber) == "1 2 three four"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L710)  
```
proc title(s: string): string {...}{.noSideEffect, gcsafe, extern: "nuc$1",
                                raises: [], tags: [].}
```
  Converts `s` to a unicode title.

 Returns a new string such that the first character in each word inside `s` is capitalized.

 **Example:**

 
```
doAssert title("αlpha βeta γamma") == "Αlpha Βeta Γamma"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L763) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L763)  
```
proc toRunes(s: string): seq[Rune] {...}{.raises: [], tags: [].}
```
  Obtains a sequence containing the Runes in `s`.

 See also:

 * [$ proc](#%24,seq%5BT%5D%5BRune%5D) for a reverse operation

 **Example:**

 
```
let a = toRunes("aáä")
doAssert a == @["a".runeAt(0), "á".runeAt(0), "ä".runeAt(0)]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L812) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L812)  
```
proc cmpRunesIgnoreCase(a, b: string): int {...}{.gcsafe, extern: "nuc$1",
    raises: [], tags: [].}
```
  Compares two UTF-8 strings and ignores the case. Returns:0 if a == b  
< 0 if a < b  
> 0 if a > b  


 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L825) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L825)  
```
proc reversed(s: string): string {...}{.raises: [], tags: [].}
```
  Returns the reverse of `s`, interpreting it as runes.

 Unicode combining characters are correctly interpreted as well.

 **Example:**

 
```
assert reversed("Reverse this!") == "!siht esreveR"
assert reversed("先秦兩漢") == "漢兩秦先"
assert reversed("as⃝df̅") == "f̅ds⃝a"
assert reversed("a⃞b⃞c⃞") == "c⃞b⃞a⃞"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L842) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L842)  
```
proc graphemeLen(s: string; i: Natural): Natural {...}{.raises: [], tags: [].}
```
  The number of bytes belonging to byte index `s[i]`, including following combining code unit. **Example:**

 
```
let a = "añyóng"
doAssert a.graphemeLen(1) == 2 ## ñ
doAssert a.graphemeLen(2) == 1
doAssert a.graphemeLen(4) == 2 ## ó
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L877) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L877)  
```
proc lastRune(s: string; last: int): (Rune, int) {...}{.raises: [], tags: [].}
```
  Length of the last rune in `s[0..last]`. Returns the rune and its length in bytes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L896) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L896)  
```
proc size(r: Rune): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns the number of bytes the rune `r` takes. **Example:**

 
```
let a = toRunes "aá"
doAssert size(a[0]) == 1
doAssert size(a[1]) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L908) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L908)  
```
proc splitWhitespace(s: string): seq[string] {...}{.noSideEffect, gcsafe,
    extern: "ncuSplitWhitespace", raises: [], tags: [].}
```
  The same as the [splitWhitespace](#splitWhitespace.i,string) iterator, but is a proc that returns a sequence of substrings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1005) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1005)  
```
proc split(s: string; seps: openArray[Rune] = unicodeSpaces; maxsplit: int = -1): seq[
    string] {...}{.noSideEffect, gcsafe, extern: "nucSplitRunes", raises: [],
              tags: [].}
```
  The same as the [split iterator](#split.i,string,openArray%5BRune%5D,int), but is a proc that returns a sequence of substrings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1037) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1037)  
```
proc split(s: string; sep: Rune; maxsplit: int = -1): seq[string] {...}{.
    noSideEffect, gcsafe, extern: "nucSplitRune", raises: [], tags: [].}
```
  The same as the [split iterator](#split.i,string,Rune,int), but is a proc that returns a sequence of substrings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1043) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1043)  
```
proc strip(s: string; leading = true; trailing = true;
           runes: openArray[Rune] = unicodeSpaces): string {...}{.noSideEffect,
    gcsafe, extern: "nucStrip", raises: [], tags: [].}
```
  Strips leading or trailing `runes` from `s` and returns the resulting string.

 If `leading` is true (default), leading `runes` are stripped. If `trailing` is true (default), trailing `runes` are stripped. If both are false, the string is returned unchanged.

 **Example:**

 
```
let a = "\táñyóng   "
doAssert a.strip == "áñyóng"
doAssert a.strip(leading = false) == "\táñyóng"
doAssert a.strip(trailing = false) == "áñyóng   "
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1049) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1049)  
```
proc repeat(c: Rune; count: Natural): string {...}{.noSideEffect, gcsafe,
    extern: "nucRepeatRune", raises: [], tags: [].}
```
  Returns a string of `count` Runes `c`.

 The returned string will have a rune-length of `count`.

 **Example:**

 
```
let a = "ñ".runeAt(0)
doAssert a.repeat(5) == "ñññññ"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1106)  
```
proc align(s: string; count: Natural; padding = ' '.Rune): string {...}{.
    noSideEffect, gcsafe, extern: "nucAlignString", raises: [], tags: [].}
```
  Aligns a unicode string `s` with `padding`, so that it has a rune-length of `count`.

 `padding` characters (by default spaces) are added before `s` resulting in right alignment. If `s.runelen >= count`, no spaces are added and `s` is returned unchanged. If you need to left align a string use the [alignLeft proc](#alignLeft,string,Natural).

 **Example:**

 
```
assert align("abc", 4) == " abc"
assert align("a", 0) == "a"
assert align("1232", 6) == "  1232"
assert align("1232", 6, '#'.Rune) == "##1232"
assert align("Åge", 5) == "  Åge"
assert align("×", 4, '_'.Rune) == "___×"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1120)  
```
proc alignLeft(s: string; count: Natural; padding = ' '.Rune): string {...}{.
    noSideEffect, raises: [], tags: [].}
```
  Left-aligns a unicode string `s` with `padding`, so that it has a rune-length of `count`.

 `padding` characters (by default spaces) are added after `s` resulting in left alignment. If `s.runelen >= count`, no spaces are added and `s` is returned unchanged. If you need to right align a string use the [align proc](#align,string,Natural).

 **Example:**

 
```
assert alignLeft("abc", 4) == "abc "
assert alignLeft("a", 0) == "a"
assert alignLeft("1232", 6) == "1232  "
assert alignLeft("1232", 6, '#'.Rune) == "1232##"
assert alignLeft("Åge", 5) == "Åge  "
assert alignLeft("×", 4, '_'.Rune) == "×___"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1147)   Iterators
---------

  
```
iterator runes(s: string): Rune {...}{.raises: [], tags: [].}
```
  Iterates over any rune of the string `s` returning runes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L789) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L789)  
```
iterator utf8(s: string): string {...}{.raises: [], tags: [].}
```
  Iterates over any rune of the string `s` returning utf8 values.

 See also:

 * [validateUtf8 proc](#validateUtf8,string)
* [toUTF8 proc](#toUTF8,Rune)
* [$ proc](#%24,Rune) alias for `toUTF8`
* [fastToUTF8Copy template](#fastToUTF8Copy.t,Rune,string,int)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L798) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L798)  
```
iterator split(s: string; seps: openArray[Rune] = unicodeSpaces;
               maxsplit: int = -1): string {...}{.raises: [], tags: [].}
```
  Splits the unicode string `s` into substrings using a group of separators.

 Substrings are separated by a substring containing only `seps`.

 
```
for word in split("this\lis an\texample"):
  writeLine(stdout, word)
```

...generates this output:

 
```
"this"
"is"
"an"
"example"
```

And the following code:

 
```
for word in split("this:is;an$example", {';', ':', '$'}):
  writeLine(stdout, word)
```

...produces the same output as the first example. The code:

 
```
let date = "2012-11-20T22:08:08.398990"
let separators = {' ', '-', ':', 'T'}
for number in split(date, separators):
  writeLine(stdout, number)
```

...results in:

 
```
"2012"
"11"
"20"
"22"
"08"
"08.398990"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L953) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L953)  
```
iterator splitWhitespace(s: string): string {...}{.raises: [], tags: [].}
```
  Splits a unicode string at whitespace runes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L997) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L997)  
```
iterator split(s: string; sep: Rune; maxsplit: int = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the unicode string `s` into substrings using a single separator.

 Substrings are separated by the rune `sep`. The code:

 
```
for word in split(";;this;is;an;;example;;;", ';'):
  writeLine(stdout, word)
```

Results in:

 
```
""
""
"this"
"is"
"an"
""
"example"
""
""
""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L1011) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L1011)   Templates
---------

  
```
template fastRuneAt(s: string; i: int; result: untyped; doInc = true)
```
  Returns the rune `s[i]` in `result`.

 If `doInc == true` (default), `i` is incremented by the number of bytes that have been processed.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L74)  
```
template fastToUTF8Copy(c: Rune; s: var string; pos: int; doInc = true)
```
  Copies UTF-8 representation of `c` into the preallocated string `s` starting at position `pos`.

 If `doInc == true` (default), `pos` is incremented by the number of bytes that have been processed.

 To be the most efficient, make sure `s` is preallocated with an additional amount equal to the byte length of `c`.

 See also:

 * [validateUtf8 proc](#validateUtf8,string)
* [toUTF8 proc](#toUTF8,Rune)
* [$ proc](#%24,Rune) alias for `toUTF8`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unicode.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unicode.nim#L197)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/unicode.html>

unidecode
=========


This module is based on Python's Unidecode module by Tomaz Solc, which in turn is based on the `Text::Unidecode` Perl module by Sean M. Burke (<http://search.cpan.org/~sburke/Text-Unidecode-0.04/lib/Text/Unidecode.pm> ).

 It provides a single proc that does Unicode to ASCII transliterations: It finds the sequence of ASCII characters that is the closest approximation to the Unicode string.

 For example, the closest to string "Äußerst" in ASCII is "Ausserst". Some information is lost in this transformation, of course, since several Unicode strings can be transformed in the same ASCII representation. So this is a strictly one-way transformation. However a human reader will probably still be able to guess what original string was meant from the context.

 This module needs the data file "unidecode.dat" to work: This file is embedded as a resource into your application by default. But you an also define the symbol `--define:noUnidecodeTable` during compile time and use the `loadUnidecodeTable` proc to initialize this module.

 Imports
-------

  <unicode>, <strutils>  Procs
-----

  
```
proc loadUnidecodeTable(datafile = "unidecode.dat") {...}{.raises: [], tags: [].}
```
  loads the datafile that `unidecode` to work. This is only required if the module was compiled with the `--define:noUnidecodeTable` switch. This needs to be called by the main thread before any thread can make a call to `unidecode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unidecode/unidecode.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unidecode/unidecode.nim#L40)  
```
proc unidecode(s: string): string {...}{.raises: [], tags: [].}
```
  Finds the sequence of ASCII characters that is the closest approximation to the UTF-8 string `s`.

 Example:

 
> unidecode("北京")
> 
> 

 Results in: "Bei Jing" 

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unidecode/unidecode.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unidecode/unidecode.nim#L52)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/unidecode.html>

wordwrap
========

 This module contains an algorithm to wordwrap a Unicode string.

 Imports
-------

  <strutils>, <unicode>  Procs
-----

  
```
proc wrapWords(s: string; maxLineWidth = 80; splitLongWords = true;
               seps: set[char] = Whitespace; newLine = "\n"): string {...}{.
    noSideEffect, raises: [], tags: [].}
```
  Word wraps `s`. **Example:**

 
```
doAssert "12345678901234567890".wrapWords() == "12345678901234567890"
doAssert "123456789012345678901234567890".wrapWords(20) == "12345678901234567890\n1234567890"
doAssert "Hello Bob. Hello John.".wrapWords(13, false) == "Hello Bob.\nHello John."
doAssert "Hello Bob. Hello John.".wrapWords(13, true, {';'}) == "Hello Bob. He\nllo John."
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/wordwrap.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/wordwrap.nim#L22)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/wordwrap.html>

monotimes
=========

 The `std/monotimes` module implements monotonic timestamps. A monotonic timestamp represents the time that has passed since some system defined point in time. The monotonic timestamps are guaranteed to always increase, meaning that that the following is guaranteed to work:



```
let a = getMonoTime()
# ... do some work
let b = getMonoTime()
assert a <= b
```

This is not guaranteed for the `times.Time` type! This means that the `MonoTime` should be used when measuring durations of time with high precision.

 However, since `MonoTime` represents the time that has passed since some unknown time origin, it cannot be converted to a human readable timestamp. If this is required, the `times.Time` type should be used instead.

 The `MonoTime` type stores the timestamp in nanosecond resolution, but note that the actual supported time resolution differs for different systems.

 See also
--------


* [times module](times)

 Imports
-------

  <times>, <posix>  Types
-----

  
```
MonoTime = object
  ticks: int64
```
  Represents a monotonic timestamp. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L41)   Procs
-----

  
```
proc getMonoTime(): MonoTime {...}{.tags: [TimeEffect], raises: [].}
```
  Get the current `MonoTime` timestamp.

 When compiled with the JS backend and executed in a browser, this proc calls `window.performance.now()`, which is not supported by older browsers. See [MDN](https://developer.mozilla.org/en-US/docs/Web/API/Performance/now) for more information.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L86)  
```
proc ticks(t: MonoTime): int64 {...}{.raises: [], tags: [].}
```
  Returns the raw ticks value from a `MonoTime`. This value always uses nanosecond time resolution. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L116)  
```
proc `$`(t: MonoTime): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L121)  
```
proc `-`(a, b: MonoTime): Duration {...}{.raises: [], tags: [].}
```
  Returns the difference between two `MonoTime` timestamps as a `Duration`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L124)  
```
proc `+`(a: MonoTime; b: Duration): MonoTime {...}{.raises: [], tags: [].}
```
  Increases `a` by `b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L128)  
```
proc `-`(a: MonoTime; b: Duration): MonoTime {...}{.raises: [], tags: [].}
```
  Reduces `a` by `b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L132)  
```
proc `<`(a, b: MonoTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` happened before `b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L136)  
```
proc `<=`(a, b: MonoTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` happened before `b` or if they happened simultaneous. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L140)  
```
proc `==`(a, b: MonoTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` and `b` happened simultaneous. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L144)  
```
proc high(typ: typedesc[MonoTime]): MonoTime
```
  Returns the highest representable `MonoTime`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L148)  
```
proc low(typ: typedesc[MonoTime]): MonoTime
```
  Returns the lowest representable `MonoTime`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/monotimes.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/monotimes.nim#L152)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/monotimes.html>

times
=====


The `times` module contains routines and types for dealing with time using the [proleptic Gregorian calendar](https://en.wikipedia.org/wiki/Proleptic_Gregorian_calendar). It's also available for the [JavaScript target](backends#backends-the-javascript-target).

 Although the `times` module supports nanosecond time resolution, the resolution used by `getTime()` depends on the platform and backend (JS is limited to millisecond precision).

 Examples
--------



```
import times, os
# Simple benchmarking
let time = cpuTime()
sleep(100) # Replace this with something to be timed
echo "Time taken: ", cpuTime() - time

# Current date & time
let now1 = now()     # Current timestamp as a DateTime in local time
let now2 = now().utc # Current timestamp as a DateTime in UTC
let now3 = getTime() # Current timestamp as a Time

# Arithmetic using Duration
echo "One hour from now      : ", now() + initDuration(hours = 1)
# Arithmetic using TimeInterval
echo "One year from now      : ", now() + 1.years
echo "One month from now     : ", now() + 1.months
```
 Parsing and Formatting Dates
----------------------------


The `DateTime` type can be parsed and formatted using the different `parse` and `format` procedures.

 
```
let dt = parse("2000-01-01", "yyyy-MM-dd")
echo dt.format("yyyy-MM-dd")
```

The different format patterns that are supported are documented below.

 

| Pattern | Description | Example |
| --- | --- | --- |
| `d` | Numeric value representing the day of the month, it will be either one or two digits long. | `1/04/2012 -> 1``21/04/2012 -> 21` |
| `dd` | Same as above, but is always two digits.  | `1/04/2012 -> 01``21/04/2012 -> 21` |
| `ddd` | Three letter string which indicates the day of the week.  | `Saturday -> Sat``Monday -> Mon` |
| `dddd` | Full string for the day of the week.  | `Saturday -> Saturday``Monday -> Monday` |
| `h` | The hours in one digit if possible. Ranging from 1-12.  | `5pm -> 5``2am -> 2` |
| `hh` | The hours in two digits always. If the hour is one digit, 0 is prepended.  | `5pm -> 05``11am -> 11` |
| `H` | The hours in one digit if possible, ranging from 0-23.  | `5pm -> 17``2am -> 2` |
| `HH` | The hours in two digits always. 0 is prepended if the hour is one digit.  | `5pm -> 17``2am -> 02` |
| `m` | The minutes in one digit if possible.  | `5:30 -> 30``2:01 -> 1` |
| `mm` | Same as above but always two digits, 0 is prepended if the minute is one digit.  | `5:30 -> 30``2:01 -> 01` |
| `M` | The month in one digit if possible.  | `September -> 9``December -> 12` |
| `MM` | The month in two digits always. 0 is prepended if the month value is one digit.  | `September -> 09``December -> 12` |
| `MMM` | Abbreviated three-letter form of the month.  | `September -> Sep``December -> Dec` |
| `MMMM` | Full month string, properly capitalized. | `September -> September` |
| `s` | Seconds as one digit if possible. | `00:00:06 -> 6` |
| `ss` | Same as above but always two digits. 0 is prepended if the second is one digit. | `00:00:06 -> 06` |
| `t` | `A` when time is in the AM. `P` when time is in the PM.  | `5pm -> P``2am -> A` |
| `tt` | Same as above, but `AM` and `PM` instead of `A` and `P` respectively.  | `5pm -> PM``2am -> AM` |
| `yy` | The last two digits of the year. When parsing, the current century is assumed. | `2012 AD -> 12` |
| `yyyy` | The year, padded to at least four digits. Is always positive, even when the year is BC. When the year is more than four digits, '+' is prepended.  | `2012 AD -> 2012``24 AD -> 0024``24 BC -> 00024``12345 AD -> +12345` |
| `YYYY` | The year without any padding. Is always positive, even when the year is BC. | `2012 AD -> 2012``24 AD -> 24``24 BC -> 24``12345 AD -> 12345` |
| `uuuu` | The year, padded to at least four digits. Will be negative when the year is BC. When the year is more than four digits, '+' is prepended unless the year is BC. | `2012 AD -> 2012``24 AD -> 0024``24 BC -> -0023``12345 AD -> +12345` |
| `UUUU` | The year without any padding. Will be negative when the year is BC. | `2012 AD -> 2012``24 AD -> 24``24 BC -> -23``12345 AD -> 12345` |
| `z` | Displays the timezone offset from UTC.  | `UTC+7 -> +7``UTC-5 -> -5` |
| `zz` | Same as above but with leading 0.  | `UTC+7 -> +07``UTC-5 -> -05` |
| `zzz` | Same as above but with `:mm` where *mm* represents minutes.  | `UTC+7 -> +07:00``UTC-5 -> -05:00` |
| `zzzz` | Same as above but with `:ss` where *ss* represents seconds.  | `UTC+7 -> +07:00:00``UTC-5 -> -05:00:00` |
| `g` | Era: AD or BC  | `300 AD -> AD``300 BC -> BC` |
| `fff` | Milliseconds display | `1000000 nanoseconds -> 1` |
| `ffffff` | Microseconds display | `1000000 nanoseconds -> 1000` |
| `fffffffff` | Nanoseconds display | `1000000 nanoseconds -> 1000000` |


Other strings can be inserted by putting them in `''`. For example `hh'->'mm` will give `01->56`. The following characters can be inserted without quoting them: `:` `-` `(` `)` `/` `[` `]` `,`. A literal `'` can be specified with `''`.

 However you don't need to necessarily separate format patterns, as an unambiguous format string like `yyyyMMddhhmmss` is also valid (although only for years in the range 1..9999).

 Duration vs TimeInterval
------------------------


The `times` module exports two similar types that are both used to represent some amount of time: [Duration](#Duration) and [TimeInterval](#TimeInterval). This section explains how they differ and when one should be preferred over the other (short answer: use `Duration` unless support for months and years is needed).

 ### Duration


A `Duration` represents a duration of time stored as seconds and nanoseconds. A `Duration` is always fully normalized, so `initDuration(hours = 1)` and `initDuration(minutes = 60)` are equivalent.

 Arithmetic with a `Duration` is very fast, especially when used with the `Time` type, since it only involves basic arithmetic. Because `Duration` is more performant and easier to understand it should generally preferred.

 ### TimeInterval


A `TimeInterval` represents an amount of time expressed in calendar units, for example "1 year and 2 days". Since some units cannot be normalized (the length of a year is different for leap years for example), the `TimeInterval` type uses separate fields for every unit. The `TimeInterval`'s returned from this module generally don't normalize **anything**, so even units that could be normalized (like seconds, milliseconds and so on) are left untouched.

 Arithmetic with a `TimeInterval` can be very slow, because it requires timezone information.

 Since it's slower and more complex, the `TimeInterval` type should be avoided unless the program explicitly needs the features it offers that `Duration` doesn't have.

 ### How long is a day?


It should be especially noted that the handling of days differs between `TimeInterval` and `Duration`. The `Duration` type always treats a day as exactly 86400 seconds. For `TimeInterval`, it's more complex.

 As an example, consider the amount of time between these two timestamps, both in the same timezone:

 
> 
> * 2018-03-25T12:00+02:00
> * 2018-03-26T12:00+01:00
> 
>  

 If only the date & time is considered, it appears that exactly one day has passed. However, the UTC offsets are different, which means that the UTC offset was changed somewhere in between. This happens twice each year for timezones that use daylight savings time. Because of this change, the amount of time that has passed is actually 25 hours.

 The `TimeInterval` type uses calendar units, and will say that exactly one day has passed. The `Duration` type on the other hand normalizes everything to seconds, and will therefore say that 90000 seconds has passed, which is the same as 25 hours.

 See also
--------


* [monotimes module](monotimes)

 Imports
-------

  <strutils>, <math>, <options>, <since>, <posix>  Types
-----

  
```
Month = enum
  mJan = (1, "January"), mFeb = "February", mMar = "March", mApr = "April",
  mMay = "May", mJun = "June", mJul = "July", mAug = "August",
  mSep = "September", mOct = "October", mNov = "November", mDec = "December"
```
  Represents a month. Note that the enum starts at `1`, so `ord(month)` will give the month number in the range `1..12`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L252)  
```
WeekDay = enum
  dMon = "Monday", dTue = "Tuesday", dWed = "Wednesday", dThu = "Thursday",
  dFri = "Friday", dSat = "Saturday", dSun = "Sunday"
```
  Represents a weekday. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L268)  
```
MonthdayRange = range[1 .. 31]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L278)  
```
HourRange = range[0 .. 23]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L279)  
```
MinuteRange = range[0 .. 59]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L280)  
```
SecondRange = range[0 .. 60]
```
  Includes the value 60 to allow for a leap second. Note however that the `second` of a `DateTime` will never be a leap second. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L281)  
```
YeardayRange = range[0 .. 365]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L284)  
```
NanosecondRange = range[0 .. 999999999]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L285)  
```
Time = object
  seconds: int64
  nanosecond: NanosecondRange
```
  Represents a point in time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L287)  
```
DateTime = object of RootObj
  nanosecond: NanosecondRange
  second: SecondRange
  minute: MinuteRange
  hour: HourRange
  monthdayZero: int
  monthZero: int
  year: int
  weekday: WeekDay
  yearday: YeardayRange
  isDst: bool
  timezone: Timezone
  utcOffset: int
```
  Represents a time in different parts. Although this type can represent leap seconds, they are generally not supported in this module. They are not ignored, but the `DateTime`'s returned by procedures in this module will never have a leap second. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L291)  
```
Duration = object
  seconds: int64
  nanosecond: NanosecondRange
```
  Represents a fixed duration of time, meaning a duration that has constant length independent of the context.

 To create a new `Duration`, use [initDuration proc](#initDuration,int64,int64,int64,int64,int64,int64,int64,int64).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L309)  
```
TimeUnit = enum
  Nanoseconds, Microseconds, Milliseconds, Seconds, Minutes, Hours, Days, Weeks,
  Months, Years
```
  Different units of time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L317)  
```
FixedTimeUnit = range[Nanoseconds .. Weeks]
```
  Subrange of `TimeUnit` that only includes units of fixed duration. These are the units that can be represented by a `Duration`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L321)  
```
TimeInterval = object
  nanoseconds*: int          ## The number of nanoseconds
  microseconds*: int         ## The number of microseconds
  milliseconds*: int         ## The number of milliseconds
  seconds*: int              ## The number of seconds
  minutes*: int              ## The number of minutes
  hours*: int                ## The number of hours
  days*: int                 ## The number of days
  weeks*: int                ## The number of weeks
  months*: int               ## The number of months
  years*: int                ## The number of years
```
   Represents a non-fixed duration of time. Can be used to add and subtract non-fixed time units from a [DateTime](#DateTime) or [Time](#Time).

 Create a new `TimeInterval` with [initTimeInterval proc](#initTimeInterval,int,int,int,int,int,int,int,int,int,int).

 Note that `TimeInterval` doesn't represent a fixed duration of time, since the duration of some units depend on the context (e.g a year can be either 365 or 366 days long). The non-fixed time units are years, months, days and week.

 Note that `TimeInterval`'s returned from the `times` module are never normalized. If you want to normalize a time unit, [Duration](#Duration) should be used instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L325)  
```
Timezone = ref object
  zonedTimeFromTimeImpl: proc (x: Time): ZonedTime {...}{.tags: [], raises: [],
      gcsafe, locks: 0.}
  zonedTimeFromAdjTimeImpl: proc (x: Time): ZonedTime {...}{.tags: [], raises: [],
      gcsafe, locks: 0.}
  name: string
```
  Timezone interface for supporting [DateTime](#DateTime)s of arbitrary timezones. The `times` module only supplies implementations for the systems local time and UTC. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L352)  
```
ZonedTime = object
  time*: Time                ## The point in time being represented.
  utcOffset*: int            ## The offset in seconds west of UTC,
                             ## including any offset due to DST.
  isDst*: bool               ## Determines whether DST is in effect.
```
  Represents a point in time with an associated UTC offset and DST flag. This type is only used for implementing timezones. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L362)  
```
DurationParts = array[FixedTimeUnit, int64]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L370)  
```
TimeIntervalParts = array[TimeUnit, int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L371)  
```
DateTimeLocale = object
  MMM*: array[mJan .. mDec, string]
  MMMM*: array[mJan .. mDec, string]
  ddd*: array[dMon .. dSun, string]
  dddd*: array[dMon .. dSun, string]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1426)  
```
TimeFormat = object
  patterns: seq[byte] ## \
                      ## Contains the patterns encoded as bytes.
                      ## Literal values are encoded in a special way.
                      ## They start with ``Lit.byte``, then the length of the literal, then the
                      ## raw char values of the literal. For example, the literal `foo` would
                      ## be encoded as ``@[Lit.byte, 3.byte, 'f'.byte, 'o'.byte, 'o'.byte]``.
  formatStr: string
```
  Represents a format for parsing and printing time types.

 To create a new `TimeFormat` use [initTimeFormat proc](#initTimeFormat,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1478)  
```
TimeParseError = object of ValueError
```
  Raised when parsing input using a `TimeFormat` fails. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1491)  
```
TimeFormatParseError = object of ValueError
```
  Raised when parsing a `TimeFormat` string fails. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1494)   Consts
------

  
```
DurationZero = (seconds: 0, nanosecond: 0)
```
  Zero value for durations. Useful for comparisons.
```
doAssert initDuration(seconds = 1) > DurationZero
doAssert initDuration(seconds = 0) == DurationZero
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L571)  
```
DefaultLocale = (MMM: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
                       "Sep", "Oct", "Nov", "Dec"], MMMM: ["January",
    "February", "March", "April", "May", "June", "July", "August", "September",
    "October", "November", "December"],
                 ddd: ["Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"], dddd: [
    "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1498)   Procs
-----

  
```
proc convert[T: SomeInteger](unitFrom, unitTo: FixedTimeUnit; quantity: T): T {...}{.
    inline.}
```
  Convert a quantity of some duration unit to another duration unit. This proc only deals with integers, so the result might be truncated. **Example:**

 
```
doAssert convert(Days, Hours, 2) == 48
doAssert convert(Days, Weeks, 13) == 1 # Truncated
doAssert convert(Seconds, Milliseconds, -1) == -1000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L399)  
```
proc isLeapYear(year: int): bool {...}{.raises: [], tags: [].}
```
  Returns true if `year` is a leap year. **Example:**

 
```
doAssert isLeapYear(2000)
doAssert not isLeapYear(1900)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L423)  
```
proc getDaysInMonth(month: Month; year: int): int {...}{.raises: [], tags: [].}
```
  Get the number of days in `month` of `year`. **Example:**

 
```
doAssert getDaysInMonth(mFeb, 2000) == 29
doAssert getDaysInMonth(mFeb, 2001) == 28
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L430) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L430)  
```
proc getDayOfYear(monthday: MonthdayRange; month: Month; year: int): YeardayRange {...}{.
    tags: [], raises: [], gcsafe, locks: 0.}
```
  Returns the day of the year. Equivalent with `initDateTime(monthday, month, year, 0, 0, 0).yearday`. **Example:**

 
```
doAssert getDayOfYear(1, mJan, 2000) == 0
doAssert getDayOfYear(10, mJan, 2000) == 9
doAssert getDayOfYear(10, mFeb, 2000) == 40
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L481)  
```
proc getDayOfWeek(monthday: MonthdayRange; month: Month; year: int): WeekDay {...}{.
    tags: [], raises: [], gcsafe, locks: 0.}
```
  Returns the day of the week enum from day, month and year. Equivalent with `initDateTime(monthday, month, year, 0, 0, 0).weekday`. **Example:**

 
```
doAssert getDayOfWeek(13, mJun, 1990) == dWed
doAssert $getDayOfWeek(13, mJun, 1990) == "Wednesday"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L501)  
```
proc getDaysInYear(year: int): int {...}{.raises: [], tags: [].}
```
  Get the number of days in a `year` **Example:**

 
```
doAssert getDaysInYear(2000) == 366
doAssert getDaysInYear(2001) == 365
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L518)  
```
proc initDuration(nanoseconds, microseconds, milliseconds, seconds, minutes,
                  hours, days, weeks: int64 = 0): Duration {...}{.raises: [],
    tags: [].}
```
  Create a new [Duration](#Duration). **Example:**

 
```
let dur = initDuration(seconds = 1, milliseconds = 1)
doAssert dur.inMilliseconds == 1001
doAssert dur.inSeconds == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L579)  
```
proc inWeeks(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole weeks. **Example:**

 
```
let dur = initDuration(days = 8)
doAssert dur.inWeeks == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L620)  
```
proc inDays(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole days. **Example:**

 
```
let dur = initDuration(hours = -50)
doAssert dur.inDays == -2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L627)  
```
proc inHours(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole hours. **Example:**

 
```
let dur = initDuration(minutes = 60, days = 2)
doAssert dur.inHours == 49
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L634)  
```
proc inMinutes(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole minutes. **Example:**

 
```
let dur = initDuration(hours = 2, seconds = 10)
doAssert dur.inMinutes == 120
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L641)  
```
proc inSeconds(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole seconds. **Example:**

 
```
let dur = initDuration(hours = 2, milliseconds = 10)
doAssert dur.inSeconds == 2 * 60 * 60
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L648)  
```
proc inMilliseconds(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole milliseconds. **Example:**

 
```
let dur = initDuration(seconds = -2)
doAssert dur.inMilliseconds == -2000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L655)  
```
proc inMicroseconds(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole microseconds. **Example:**

 
```
let dur = initDuration(seconds = -2)
doAssert dur.inMicroseconds == -2000000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L662)  
```
proc inNanoseconds(dur: Duration): int64 {...}{.raises: [], tags: [].}
```
  Convert the duration to the number of whole nanoseconds. **Example:**

 
```
let dur = initDuration(seconds = -2)
doAssert dur.inNanoseconds == -2000000000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L669)  
```
proc toParts(dur: Duration): DurationParts {...}{.raises: [], tags: [].}
```
  Converts a duration into an array consisting of fixed time units.

 Each value in the array gives information about a specific unit of time, for example `result[Days]` gives a count of days.

 This procedure is useful for converting `Duration` values to strings.

 **Example:**

 
```
var dp = toParts(initDuration(weeks = 2, days = 1))
doAssert dp[Days] == 1
doAssert dp[Weeks] == 2
doAssert dp[Minutes] == 0
dp = toParts(initDuration(days = -1))
doAssert dp[Days] == -1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L676)  
```
proc `$`(dur: Duration): string {...}{.raises: [], tags: [].}
```
  Human friendly string representation of a `Duration`. **Example:**

 
```
doAssert $initDuration(seconds = 2) == "2 seconds"
doAssert $initDuration(weeks = 1, days = 2) == "1 week and 2 days"
doAssert $initDuration(hours = 1, minutes = 2, seconds = 3) ==
  "1 hour, 2 minutes, and 3 seconds"
doAssert $initDuration(milliseconds = -1500) ==
  "-1 second and -500 milliseconds"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L711)  
```
proc `+`(a, b: Duration): Duration {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                     extern: "ntAddDuration", raises: [],
                                     tags: [].}
```
  Add two durations together. **Example:**

 
```
doAssert initDuration(seconds = 1) + initDuration(days = 1) ==
  initDuration(seconds = 1, days = 1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L730) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L730)  
```
proc `-`(a, b: Duration): Duration {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                     extern: "ntSubDuration", raises: [],
                                     tags: [].}
```
  Subtract a duration from another. **Example:**

 
```
doAssert initDuration(seconds = 1, days = 1) - initDuration(seconds = 1) ==
  initDuration(days = 1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L737)  
```
proc `-`(a: Duration): Duration {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                  extern: "ntReverseDuration", raises: [],
                                  tags: [].}
```
  Reverse a duration. **Example:**

 
```
doAssert -initDuration(seconds = 1) == initDuration(seconds = -1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L744)  
```
proc `<`(a, b: Duration): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                 extern: "ntLtDuration", raises: [], tags: [].}
```
  Note that a duration can be negative, so even if `a < b` is true `a` might represent a larger absolute duration. Use `abs(a) < abs(b)` to compare the absolute duration. **Example:**

 
```
doAssert initDuration(seconds = 1) < initDuration(seconds = 2)
doAssert initDuration(seconds = -2) < initDuration(seconds = 1)
doAssert initDuration(seconds = -2).abs < initDuration(seconds = 1).abs == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L750)  
```
proc `<=`(a, b: Duration): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                  extern: "ntLeDuration", raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L762) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L762)  
```
proc `==`(a, b: Duration): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                  extern: "ntEqDuration", raises: [], tags: [].}
```
  **Example:**

 
```
let
  d1 = initDuration(weeks = 1)
  d2 = initDuration(days = 7)
doAssert d1 == d2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L765) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L765)  
```
proc `*`(a: int64; b: Duration): Duration {...}{.gcsafe, noSideEffect, gcsafe,
    locks: 0, extern: "ntMulInt64Duration", raises: [], tags: [].}
```
  Multiply a duration by some scalar. **Example:**

 
```
doAssert 5 * initDuration(seconds = 1) == initDuration(seconds = 5)
doAssert 3 * initDuration(minutes = 45) == initDuration(hours = 2, minutes = 15)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L773) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L773)  
```
proc `*`(a: Duration; b: int64): Duration {...}{.gcsafe, noSideEffect, gcsafe,
    locks: 0, extern: "ntMulDuration", raises: [], tags: [].}
```
  Multiply a duration by some scalar. **Example:**

 
```
doAssert initDuration(seconds = 1) * 5 == initDuration(seconds = 5)
doAssert initDuration(minutes = 45) * 3 == initDuration(hours = 2, minutes = 15)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L781) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L781)  
```
proc `+=`(d1: var Duration; d2: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L789) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L789)  
```
proc `-=`(dt: var Duration; ti: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L792)  
```
proc `*=`(a: var Duration; b: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L795) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L795)  
```
proc `div`(a: Duration; b: int64): Duration {...}{.gcsafe, noSideEffect, gcsafe,
    locks: 0, extern: "ntDivDuration", raises: [], tags: [].}
```
  Integer division for durations. **Example:**

 
```
doAssert initDuration(seconds = 3) div 2 ==
  initDuration(milliseconds = 1500)
doAssert initDuration(minutes = 45) div 30 ==
  initDuration(minutes = 1, seconds = 30)
doAssert initDuration(nanoseconds = 3) div 2 ==
  initDuration(nanoseconds = 1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L798) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L798)  
```
proc high(typ: typedesc[Duration]): Duration
```
  Get the longest representable duration. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L811)  
```
proc low(typ: typedesc[Duration]): Duration
```
  Get the longest representable duration of negative direction. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L815) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L815)  
```
proc abs(a: Duration): Duration {...}{.raises: [], tags: [].}
```
  **Example:**

 
```
doAssert initDuration(milliseconds = -1500).abs ==
  initDuration(milliseconds = 1500)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L819) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L819)  
```
proc initTime(unix: int64; nanosecond: NanosecondRange): Time {...}{.raises: [],
    tags: [].}
```
  Create a [Time](#Time) from a unix timestamp and a nanosecond part. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L829)  
```
proc nanosecond(time: Time): NanosecondRange {...}{.raises: [], tags: [].}
```
  Get the fractional part of a `Time` as the number of nanoseconds of the second. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L834)  
```
proc fromUnix(unix: int64): Time {...}{.gcsafe, locks: 0, tags: [], raises: [],
                                   noSideEffect.}
```
  Convert a unix timestamp (seconds since `1970-01-01T00:00:00Z`) to a `Time`. **Example:**

 
```
doAssert $fromUnix(0).utc == "1970-01-01T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L839)  
```
proc toUnix(t: Time): int64 {...}{.gcsafe, locks: 0, tags: [], raises: [],
                              noSideEffect.}
```
  Convert `t` to a unix timestamp (seconds since `1970-01-01T00:00:00Z`). See also `toUnixFloat` for subsecond resolution. **Example:**

 
```
doAssert fromUnix(0).toUnix() == 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L847) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L847)  
```
proc fromUnixFloat(seconds: float): Time {...}{.gcsafe, locks: 0, tags: [],
    raises: [], noSideEffect.}
```
  Convert a unix timestamp in seconds to a `Time`; same as `fromUnix` but with subsecond resolution. **Example:**

 
```
doAssert fromUnixFloat(123456.0) == fromUnixFloat(123456)
doAssert fromUnixFloat(-123456.0) == fromUnixFloat(-123456)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L854) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L854)  
```
proc toUnixFloat(t: Time): float {...}{.gcsafe, locks: 0, tags: [], raises: [].}
```
  Same as `toUnix` but using subsecond resolution. **Example:**

 
```
let t = getTime()
# `<` because of rounding errors
doAssert abs(t.toUnixFloat().fromUnixFloat - t) < initDuration(nanoseconds = 1000)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L864)  
```
proc fromWinTime(win: int64): Time {...}{.raises: [], tags: [].}
```
  Convert a Windows file time (100-nanosecond intervals since `1601-01-01T00:00:00Z`) to a `Time`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L876) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L876)  
```
proc toWinTime(t: Time): int64 {...}{.raises: [], tags: [].}
```
  Convert `t` to a Windows file time (100-nanosecond intervals since `1601-01-01T00:00:00Z`). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L884) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L884)  
```
proc getTime(): Time {...}{.tags: [TimeEffect], gcsafe, locks: 0, raises: [].}
```
  Gets the current time as a `Time` with up to nanosecond resolution. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L889) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L889)  
```
proc `-`(a, b: Time): Duration {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                 extern: "ntDiffTime", raises: [], tags: [].}
```
  Computes the duration between two points in time. **Example:**

 
```
doAssert initTime(1000, 100) - initTime(500, 20) ==
  initDuration(minutes = 8, seconds = 20, nanoseconds = 80)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L911)  
```
proc `+`(a: Time; b: Duration): Time {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                       extern: "ntAddTime", raises: [], tags: [].}
```
  Add a duration of time to a `Time`. **Example:**

 
```
doAssert (fromUnix(0) + initDuration(seconds = 1)) == fromUnix(1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L918)  
```
proc `-`(a: Time; b: Duration): Time {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                                       extern: "ntSubTime", raises: [], tags: [].}
```
  Subtracts a duration of time from a `Time`. **Example:**

 
```
doAssert (fromUnix(0) - initDuration(seconds = 1)) == fromUnix(-1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L924)  
```
proc `<`(a, b: Time): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                             extern: "ntLtTime", raises: [], tags: [].}
```
  Returns true if `a < b`, that is if `a` happened before `b`. **Example:**

 
```
doAssert initTime(50, 0) < initTime(99, 0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L930) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L930)  
```
proc `<=`(a, b: Time): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                              extern: "ntLeTime", raises: [], tags: [].}
```
  Returns true if `a <= b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L936) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L936)  
```
proc `==`(a, b: Time): bool {...}{.gcsafe, noSideEffect, gcsafe, locks: 0,
                              extern: "ntEqTime", raises: [], tags: [].}
```
  Returns true if `a == b`, that is if both times represent the same point in time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L940) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L940)  
```
proc `+=`(t: var Time; b: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L944) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L944)  
```
proc `-=`(t: var Time; b: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L947) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L947)  
```
proc high(typ: typedesc[Time]): Time
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L950)  
```
proc low(typ: typedesc[Time]): Time
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L953) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L953)  
```
proc nanosecond(dt: DateTime): NanosecondRange {...}{.inline, raises: [], tags: [].}
```
  The number of nanoseconds after the second, in the range 0 to 999\_999\_999. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L963) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L963)  
```
proc second(dt: DateTime): SecondRange {...}{.inline, raises: [], tags: [].}
```
  The number of seconds after the minute, in the range 0 to 59. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L969) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L969)  
```
proc minute(dt: DateTime): MinuteRange {...}{.inline, raises: [], tags: [].}
```
  The number of minutes after the hour, in the range 0 to 59. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L975) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L975)  
```
proc hour(dt: DateTime): HourRange {...}{.inline, raises: [], tags: [].}
```
  The number of hours past midnight, in the range 0 to 23. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L981) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L981)  
```
proc monthday(dt: DateTime): MonthdayRange {...}{.inline, raises: [], tags: [].}
```
  The day of the month, in the range 1 to 31. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L987) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L987)  
```
proc month(dt: DateTime): Month {...}{.raises: [], tags: [].}
```
  The month as an enum, the ordinal value is in the range 1 to 12. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L993) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L993)  
```
proc year(dt: DateTime): int {...}{.inline, raises: [], tags: [].}
```
  The year, using astronomical year numbering (meaning that before year 1 is year 0, then year -1 and so on). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1000) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1000)  
```
proc weekday(dt: DateTime): WeekDay {...}{.inline, raises: [], tags: [].}
```
  The day of the week as an enum, the ordinal value is in the range 0 (monday) to 6 (sunday). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1007) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1007)  
```
proc yearday(dt: DateTime): YeardayRange {...}{.inline, raises: [], tags: [].}
```
  The number of days since January 1, in the range 0 to 365. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1013)  
```
proc isDst(dt: DateTime): bool {...}{.inline, raises: [], tags: [].}
```
  Determines whether DST is in effect. Always false for the JavaScript backend. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1019) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1019)  
```
proc timezone(dt: DateTime): Timezone {...}{.inline, raises: [], tags: [].}
```
  The timezone represented as an implementation of `Timezone`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1025) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1025)  
```
proc utcOffset(dt: DateTime): int {...}{.inline, raises: [], tags: [].}
```
  The offset in seconds west of UTC, including any offset due to DST. Note that the sign of this number is the opposite of the one in a formatted offset string like `+01:00` (which would be equivalent to the UTC offset `-3600`). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1031) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1031)  
```
proc isInitialized(dt: DateTime): bool {...}{.raises: [], tags: [].}
```
  **Example:**

 
```
doAssert now().isInitialized
doAssert not default(DateTime).isInitialized
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1041) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1041)  
```
proc isLeapDay(dt: DateTime): bool {...}{.raises: [], tags: [].}
```
  Returns whether `t` is a leap day, i.e. Feb 29 in a leap year. This matters as it affects time offset calculations. **Example:**

 
```
let dt = initDateTime(29, mFeb, 2020, 00, 00, 00, utc())
doAssert dt.isLeapDay
doAssert dt+1.years-1.years != dt
let dt2 = initDateTime(28, mFeb, 2020, 00, 00, 00, utc())
doAssert not dt2.isLeapDay
doAssert dt2+1.years-1.years == dt2
doAssertRaises(Exception): discard initDateTime(29, mFeb, 2021, 00, 00, 00, utc())
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1051) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1051)  
```
proc toTime(dt: DateTime): Time {...}{.tags: [], raises: [], gcsafe, locks: 0.}
```
  Converts a `DateTime` to a `Time` representing the same point in time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1065) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1065)  
```
proc newTimezone(name: string; zonedTimeFromTimeImpl: proc (time: Time): ZonedTime {...}{.
    tags: [], raises: [], gcsafe, locks: 0.}; zonedTimeFromAdjTimeImpl: proc (
    adjTime: Time): ZonedTime {...}{.tags: [], raises: [], gcsafe, locks: 0.}): owned
    Timezone {...}{.raises: [], tags: [].}
```
  Create a new `Timezone`.

 `zonedTimeFromTimeImpl` and `zonedTimeFromAdjTimeImpl` is used as the underlying implementations for `zonedTimeFromTime` and `zonedTimeFromAdjTime`.

 If possible, the name parameter should match the name used in the tz database. If the timezone doesn't exist in the tz database, or if the timezone name is unknown, then any string that describes the timezone unambiguously can be used. Note that the timezones name is used for checking equality!

 **Example:**

 
```
proc utcTzInfo(time: Time): ZonedTime =
  ZonedTime(utcOffset: 0, isDst: false, time: time)
let utc = newTimezone("Etc/UTC", utcTzInfo, utcTzInfo)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1105)  
```
proc name(zone: Timezone): string {...}{.raises: [], tags: [].}
```
  The name of the timezone.

 If possible, the name will be the name used in the tz database. If the timezone doesn't exist in the tz database, or if the timezone name is unknown, then any string that describes the timezone unambiguously might be used. For example, the string "LOCAL" is used for the systems local timezone.

 See also: <https://en.wikipedia.org/wiki/Tz_database>

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1133)  
```
proc zonedTimeFromTime(zone: Timezone; time: Time): ZonedTime {...}{.raises: [],
    tags: [].}
```
  Returns the `ZonedTime` for some point in time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1145)  
```
proc zonedTimeFromAdjTime(zone: Timezone; adjTime: Time): ZonedTime {...}{.
    raises: [], tags: [].}
```
  Returns the `ZonedTime` for some local time.

 Note that the `Time` argument does not represent a point in time, it represent a local time! E.g if `adjTime` is `fromUnix(0)`, it should be interpreted as 1970-01-01T00:00:00 in the `zone` timezone, not in UTC.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1149)  
```
proc `$`(zone: Timezone): string {...}{.raises: [], tags: [].}
```
  Returns the name of the timezone. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1157)  
```
proc `==`(zone1, zone2: Timezone): bool {...}{.raises: [], tags: [].}
```
  Two `Timezone`'s are considered equal if their name is equal. **Example:**

 
```
doAssert local() == local()
doAssert local() != utc()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1161)  
```
proc inZone(time: Time; zone: Timezone): DateTime {...}{.tags: [], raises: [],
    gcsafe, locks: 0.}
```
  Convert `time` into a `DateTime` using `zone` as the timezone. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1172)  
```
proc inZone(dt: DateTime; zone: Timezone): DateTime {...}{.tags: [], raises: [],
    gcsafe, locks: 0.}
```
  Returns a `DateTime` representing the same point in time as `dt` but using `zone` as the timezone. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1177)  
```
proc utc(): Timezone {...}{.raises: [], tags: [].}
```
  Get the `Timezone` implementation for the UTC timezone. **Example:**

 
```
doAssert now().utc.timezone == utc()
doAssert utc().name == "Etc/UTC"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1285)  
```
proc local(): Timezone {...}{.raises: [], tags: [].}
```
  Get the `Timezone` implementation for the local timezone. **Example:**

 
```
doAssert now().timezone == local()
doAssert local().name == "LOCAL"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1294)  
```
proc utc(dt: DateTime): DateTime {...}{.raises: [], tags: [].}
```
  Shorthand for `dt.inZone(utc())`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1304)  
```
proc local(dt: DateTime): DateTime {...}{.raises: [], tags: [].}
```
  Shorthand for `dt.inZone(local())`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1308)  
```
proc utc(t: Time): DateTime {...}{.raises: [], tags: [].}
```
  Shorthand for `t.inZone(utc())`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1312)  
```
proc local(t: Time): DateTime {...}{.raises: [], tags: [].}
```
  Shorthand for `t.inZone(local())`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1316)  
```
proc now(): DateTime {...}{.tags: [TimeEffect], gcsafe, locks: 0, raises: [].}
```
  Get the current time as a `DateTime` in the local timezone.

 Shorthand for `getTime().local`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1320)  
```
proc initDateTime(monthday: MonthdayRange; month: Month; year: int;
                  hour: HourRange; minute: MinuteRange; second: SecondRange;
                  nanosecond: NanosecondRange; zone: Timezone = local()): DateTime {...}{.
    raises: [], tags: [].}
```
  Create a new [DateTime](#DateTime) in the specified timezone. **Example:**

 
```
let dt1 = initDateTime(30, mMar, 2017, 00, 00, 00, 00, utc())
doAssert $dt1 == "2017-03-30T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1326)  
```
proc initDateTime(monthday: MonthdayRange; month: Month; year: int;
                  hour: HourRange; minute: MinuteRange; second: SecondRange;
                  zone: Timezone = local()): DateTime {...}{.raises: [], tags: [].}
```
  Create a new [DateTime](#DateTime) in the specified timezone. **Example:**

 
```
let dt1 = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
doAssert $dt1 == "2017-03-30T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1347)  
```
proc `+`(dt: DateTime; dur: Duration): DateTime {...}{.raises: [], tags: [].}
```
  **Example:**

 
```
let dt = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
let dur = initDuration(hours = 5)
doAssert $(dt + dur) == "2017-03-30T05:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1356)  
```
proc `-`(dt: DateTime; dur: Duration): DateTime {...}{.raises: [], tags: [].}
```
  **Example:**

 
```
let dt = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
let dur = initDuration(days = 5)
doAssert $(dt - dur) == "2017-03-25T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1364)  
```
proc `-`(dt1, dt2: DateTime): Duration {...}{.raises: [], tags: [].}
```
  Compute the duration between `dt1` and `dt2`. **Example:**

 
```
let dt1 = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
let dt2 = initDateTime(25, mMar, 2017, 00, 00, 00, utc())

doAssert dt1 - dt2 == initDuration(days = 5)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1372)  
```
proc `<`(a, b: DateTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` happened before `b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1382)  
```
proc `<=`(a, b: DateTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` happened before or at the same time as `b`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1386)  
```
proc `==`(a, b: DateTime): bool {...}{.raises: [], tags: [].}
```
  Returns true if `a` and `b` represent the same point in time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1390)  
```
proc `+=`(a: var DateTime; b: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1396)  
```
proc `-=`(a: var DateTime; b: Duration) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1399)  
```
proc getDateStr(dt = now()): string {...}{.gcsafe, extern: "nt$1",
                                      tags: [TimeEffect], raises: [].}
```
  Gets the current local date as a string of the format `YYYY-MM-DD`. **Example:**

 
```
echo getDateStr(now() - 1.months)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1402)  
```
proc getClockStr(dt = now()): string {...}{.gcsafe, extern: "nt$1",
                                       tags: [TimeEffect], raises: [].}
```
  Gets the current local clock time as a string of the format `HH:mm:ss`. **Example:**

 
```
echo getClockStr(now() - 1.hours)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1410)  
```
proc `$`(f: TimeFormat): string {...}{.raises: [], tags: [].}
```
  Returns the format string that was used to construct `f`. **Example:**

 
```
let f = initTimeFormat("yyyy-MM-dd")
doAssert $f == "yyyy-MM-dd"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1510)  
```
proc initTimeFormat(format: string): TimeFormat {...}{.
    raises: [TimeFormatParseError], tags: [].}
```
  Construct a new time format for parsing & formatting time types.

 See [Parsing and formatting dates](#parsing-and-formatting-dates) for documentation of the `format` argument.

 **Example:**

 
```
let f = initTimeFormat("yyyy-MM-dd")
doAssert "2000-01-01" == "2000-01-01".parse(f).format(f)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1628)  
```
proc format(dt: DateTime; f: TimeFormat; loc: DateTimeLocale = DefaultLocale): string {...}{.
    raises: [], tags: [].}
```
  Format `dt` using the format specified by `f`. **Example:**

 
```
let f = initTimeFormat("yyyy-MM-dd")
let dt = initDateTime(01, mJan, 2000, 00, 00, 00, utc())
doAssert "2000-01-01" == dt.format(f)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L1982) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L1982)  
```
proc format(dt: DateTime; f: string; loc: DateTimeLocale = DefaultLocale): string {...}{.
    raises: [TimeFormatParseError], tags: [].}
```
  Shorthand for constructing a `TimeFormat` and using it to format `dt`.

 See [Parsing and formatting dates](#parsing-and-formatting-dates) for documentation of the `format` argument.

 **Example:**

 
```
let dt = initDateTime(01, mJan, 2000, 00, 00, 00, utc())
doAssert "2000-01-01" == format(dt, "yyyy-MM-dd")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2005) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2005)  
```
proc format(dt: DateTime; f: static[string]): string {...}{.raises: [].}
```
  Overload that validates `format` at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2017)  
```
proc formatValue(result: var string; value: DateTime; specifier: string) {...}{.
    raises: [TimeFormatParseError], tags: [].}
```
  adapter for strformat. Not intended to be called directly. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2022) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2022)  
```
proc format(time: Time; f: string; zone: Timezone = local()): string {...}{.
    raises: [TimeFormatParseError], tags: [].}
```
  Shorthand for constructing a `TimeFormat` and using it to format `time`. Will use the timezone specified by `zone`.

 See [Parsing and formatting dates](#parsing-and-formatting-dates) for documentation of the `f` argument.

 **Example:**

 
```
var dt = initDateTime(01, mJan, 1970, 00, 00, 00, utc())
var tm = dt.toTime()
doAssert format(tm, "yyyy-MM-dd'T'HH:mm:ss", utc()) == "1970-01-01T00:00:00"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2027) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2027)  
```
proc format(time: Time; f: static[string]; zone: Timezone = local()): string {...}{.
    raises: [].}
```
  Overload that validates `f` at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2040) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2040)  
```
proc parse(input: string; f: TimeFormat; zone: Timezone = local();
           loc: DateTimeLocale = DefaultLocale): DateTime {...}{.
    raises: [TimeParseError, Defect], tags: [TimeEffect].}
```
  Parses `input` as a `DateTime` using the format specified by `f`. If no UTC offset was parsed, then `input` is assumed to be specified in the `zone` timezone. If a UTC offset was parsed, the result will be converted to the `zone` timezone.

 Month and day names from the passed in `loc` are used.

 **Example:**

 
```
let f = initTimeFormat("yyyy-MM-dd")
let dt = initDateTime(01, mJan, 2000, 00, 00, 00, utc())
doAssert dt == "2000-01-01".parse(f, utc())
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2050)  
```
proc parse(input, f: string; tz: Timezone = local();
           loc: DateTimeLocale = DefaultLocale): DateTime {...}{.
    raises: [TimeParseError, TimeFormatParseError, Defect], tags: [TimeEffect].}
```
  Shorthand for constructing a `TimeFormat` and using it to parse `input` as a `DateTime`.

 See [Parsing and formatting dates](#parsing-and-formatting-dates) for documentation of the `f` argument.

 **Example:**

 
```
let dt = initDateTime(01, mJan, 2000, 00, 00, 00, utc())
doAssert dt == parse("2000-01-01", "yyyy-MM-dd", utc())
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2094) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2094)  
```
proc parse(input: string; f: static[string]; zone: Timezone = local();
           loc: DateTimeLocale = DefaultLocale): DateTime {...}{.
    raises: [TimeParseError, Defect].}
```
  Overload that validates `f` at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2108)  
```
proc parseTime(input, f: string; zone: Timezone): Time {...}{.
    raises: [TimeParseError, TimeFormatParseError, Defect], tags: [TimeEffect].}
```
  Shorthand for constructing a `TimeFormat` and using it to parse `input` as a `DateTime`, then converting it a `Time`.

 See [Parsing and formatting dates](#parsing-and-formatting-dates) for documentation of the `format` argument.

 **Example:**

 
```
let tStr = "1970-01-01T00:00:00+00:00"
doAssert parseTime(tStr, "yyyy-MM-dd'T'HH:mm:sszzz", utc()) == fromUnix(0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2115)  
```
proc parseTime(input: string; f: static[string]; zone: Timezone): Time {...}{.
    raises: [TimeParseError, Defect].}
```
  Overload that validates `format` at compile time. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2127)  
```
proc `$`(dt: DateTime): string {...}{.tags: [], raises: [], gcsafe, locks: 0.}
```
  Converts a `DateTime` object to a string representation. It uses the format `yyyy-MM-dd'T'HH:mm:sszzz`. **Example:**

 
```
let dt = initDateTime(01, mJan, 2000, 12, 00, 00, utc())
doAssert $dt == "2000-01-01T12:00:00Z"
doAssert $default(DateTime) == "Uninitialized DateTime"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2133)  
```
proc `$`(time: Time): string {...}{.tags: [], raises: [], gcsafe, locks: 0.}
```
  Converts a `Time` value to a string representation. It will use the local time zone and use the format `yyyy-MM-dd'T'HH:mm:sszzz`. **Example:**

 
```
let dt = initDateTime(01, mJan, 1970, 00, 00, 00, local())
let tm = dt.toTime()
doAssert $tm == "1970-01-01T00:00:00" & format(dt, "zzz")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2145)  
```
proc initTimeInterval(nanoseconds, microseconds, milliseconds, seconds, minutes,
                      hours, days, weeks, months, years: int = 0): TimeInterval {...}{.
    raises: [], tags: [].}
```
  Creates a new [TimeInterval](#TimeInterval).

 This proc doesn't perform any normalization! For example, `initTimeInterval(hours = 24)` and `initTimeInterval(days = 1)` are not equal.

 You can also use the convenience procedures called `milliseconds`, `seconds`, `minutes`, `hours`, `days`, `months`, and `years`.

 **Example:**

 
```
let day = initTimeInterval(hours = 24)
let dt = initDateTime(01, mJan, 2000, 12, 00, 00, utc())
doAssert $(dt + day) == "2000-01-02T12:00:00Z"
doAssert initTimeInterval(hours = 24) != initTimeInterval(days = 1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2158)  
```
proc `+`(ti1, ti2: TimeInterval): TimeInterval {...}{.raises: [], tags: [].}
```
  Adds two `TimeInterval` objects together. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2185)  
```
proc `-`(ti: TimeInterval): TimeInterval {...}{.raises: [], tags: [].}
```
  Reverses a time interval **Example:**

 
```
let day = -initTimeInterval(hours = 24)
doAssert day.hours == -24
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2198)  
```
proc `-`(ti1, ti2: TimeInterval): TimeInterval {...}{.raises: [], tags: [].}
```
  Subtracts TimeInterval `ti1` from `ti2`.

 Time components are subtracted one-by-one, see output:

 **Example:**

 
```
let ti1 = initTimeInterval(hours = 24)
let ti2 = initTimeInterval(hours = 4)
doAssert (ti1 - ti2) == initTimeInterval(hours = 20)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2217)  
```
proc `+=`(a: var TimeInterval; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2228)  
```
proc `-=`(a: var TimeInterval; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2231)  
```
proc between(startDt, endDt: DateTime): TimeInterval {...}{.raises: [], tags: [].}
```
  Gives the difference between `startDt` and `endDt` as a `TimeInterval`. The following guarantees about the result is given:* All fields will have the same sign.
* If `startDt.timezone == endDt.timezone`, it is guaranteed that `startDt + between(startDt, endDt) == endDt`.
* If `startDt.timezone != endDt.timezone`, then the result will be equivalent to `between(startDt.utc, endDt.utc)`.

 **Example:**

 
```
var a = initDateTime(25, mMar, 2015, 12, 0, 0, utc())
var b = initDateTime(1, mApr, 2017, 15, 0, 15, utc())
var ti = initTimeInterval(years = 2, weeks = 1, hours = 3, seconds = 15)
doAssert between(a, b) == ti
doAssert between(a, b) == -between(b, a)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2247)  
```
proc toParts(ti: TimeInterval): TimeIntervalParts {...}{.raises: [], tags: [].}
```
  Converts a `TimeInterval` into an array consisting of its time units, starting with nanoseconds and ending with years.

 This procedure is useful for converting `TimeInterval` values to strings. E.g. then you need to implement custom interval printing

 **Example:**

 
```
var tp = toParts(initTimeInterval(years = 1, nanoseconds = 123))
doAssert tp[Years] == 1
doAssert tp[Nanoseconds] == 123
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2352)  
```
proc `$`(ti: TimeInterval): string {...}{.raises: [], tags: [].}
```
  Get string representation of `TimeInterval`. **Example:**

 
```
doAssert $initTimeInterval(years = 1, nanoseconds = 123) ==
  "1 year and 123 nanoseconds"
doAssert $initTimeInterval() == "0 nanoseconds"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2368)  
```
proc nanoseconds(nanos: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `nanos` nanoseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2383)  
```
proc microseconds(micros: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `micros` microseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2387)  
```
proc milliseconds(ms: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `ms` milliseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2391)  
```
proc seconds(s: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `s` seconds.

 `echo getTime() + 5.seconds`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2395)  
```
proc minutes(m: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `m` minutes.

 `echo getTime() + 5.minutes`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2401)  
```
proc hours(h: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `h` hours.

 `echo getTime() + 2.hours`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2407)  
```
proc days(d: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `d` days.

 `echo getTime() + 2.days`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2413)  
```
proc weeks(w: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `w` weeks.

 `echo getTime() + 2.weeks`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2419)  
```
proc months(m: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `m` months.

 `echo getTime() + 2.months`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2425)  
```
proc years(y: int): TimeInterval {...}{.inline, raises: [], tags: [].}
```
  TimeInterval of `y` years.

 `echo getTime() + 2.years`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2431)  
```
proc `+`(dt: DateTime; interval: TimeInterval): DateTime {...}{.raises: [], tags: [].}
```
  Adds `interval` to `dt`. Components from `interval` are added in the order of their size, i.e. first the `years` component, then the `months` component and so on. The returned `DateTime` will have the same timezone as the input.

 Note that when adding months, monthday overflow is allowed. This means that if the resulting month doesn't have enough days it, the month will be incremented and the monthday will be set to the number of days overflowed. So adding one month to `31 October` will result in `31 November`, which will overflow and result in `1 December`.

 **Example:**

 
```
let dt = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
doAssert $(dt + 1.months) == "2017-04-30T00:00:00Z"
# This is correct and happens due to monthday overflow.
doAssert $(dt - 1.months) == "2017-03-02T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2478)  
```
proc `-`(dt: DateTime; interval: TimeInterval): DateTime {...}{.raises: [], tags: [].}
```
  Subtract `interval` from `dt`. Components from `interval` are subtracted in the order of their size, i.e. first the `years` component, then the `months` component and so on. The returned `DateTime` will have the same timezone as the input. **Example:**

 
```
let dt = initDateTime(30, mMar, 2017, 00, 00, 00, utc())
doAssert $(dt - 5.days) == "2017-03-25T00:00:00Z"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2507)  
```
proc `+`(time: Time; interval: TimeInterval): Time {...}{.raises: [], tags: [].}
```
  Adds `interval` to `time`. If `interval` contains any years, months, weeks or days the operation is performed in the local timezone. **Example:**

 
```
let tm = fromUnix(0)
doAssert tm + 5.seconds == fromUnix(5)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2518)  
```
proc `-`(time: Time; interval: TimeInterval): Time {...}{.raises: [], tags: [].}
```
  Subtracts `interval` from Time `time`. If `interval` contains any years, months, weeks or days the operation is performed in the local timezone. **Example:**

 
```
let tm = fromUnix(5)
doAssert tm - 5.seconds == fromUnix(0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2531)  
```
proc `+=`(a: var DateTime; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2544)  
```
proc `-=`(a: var DateTime; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2547)  
```
proc `+=`(t: var Time; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2550)  
```
proc `-=`(t: var Time; b: TimeInterval) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2553)  
```
proc epochTime(): float {...}{.tags: [TimeEffect], raises: [].}
```
  Gets time after the UNIX epoch (1970) in seconds. It is a float because sub-second resolution is likely to be supported (depending on the hardware/OS).

 `getTime` should generally be preferred over this proc.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2560)  
```
proc cpuTime(): float {...}{.tags: [TimeEffect], raises: [].}
```
  Gets time spent that the CPU spent to run the current process in seconds. This may be more useful for benchmarking than `epochTime`. However, it may measure the real time instead (depending on the OS). The value of the result has no meaning. To generate useful timing values, take the difference between the results of two `cpuTime` calls: **Example:**

 
```
var t0 = cpuTime()
# some useless work here (calculate fibonacci)
var fib = @[0, 1, 1]
for i in 1..10:
  fib.add(fib[^1] + fib[^2])
echo "CPU time [s] ", cpuTime() - t0
echo "Fib is [s] ", fib
```
When the flag `--benchmarkVM` is passed to the compiler, this proc is also available at compile time [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2598)  
```
proc nanosecond=(dt: var DateTime; value: NanosecondRange) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2630)  
```
proc second=(dt: var DateTime; value: SecondRange) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2633)  
```
proc minute=(dt: var DateTime; value: MinuteRange) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2636)  
```
proc hour=(dt: var DateTime; value: HourRange) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2639)  
```
proc monthdayZero=(dt: var DateTime; value: int) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2642) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2642)  
```
proc monthZero=(dt: var DateTime; value: int) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2645)  
```
proc year=(dt: var DateTime; value: int) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2648)  
```
proc weekday=(dt: var DateTime; value: WeekDay) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2651)  
```
proc yearday=(dt: var DateTime; value: YeardayRange) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2654)  
```
proc isDst=(dt: var DateTime; value: bool) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2657)  
```
proc timezone=(dt: var DateTime; value: Timezone) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2660)  
```
proc utcOffset=(dt: var DateTime; value: int) {...}{.
    deprecated: "Deprecated since v1.3.1", raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.3.1  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2663)   Templates
---------

  
```
template formatValue(result: var string; value: Time; specifier: string)
```
  adapter for `strformat`. Not intended to be called directly. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/times.nim#L2046) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/times.nim#L2046)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/times.html>

distros
=======


This module implements the basics for Linux distribution ("distro") detection and the OS's native package manager. Its primary purpose is to produce output for Nimble packages like:



```
To complete the installation, run:

sudo apt-get install libblas-dev
sudo apt-get install libvoodoo
```
 The above output could be the result of a code snippet like:

 
```
if detectOs(Ubuntu):
  foreignDep "lbiblas-dev"
  foreignDep "libvoodoo"
```

See <packaging> for hints on distributing Nim using OS packages.

 Imports
-------

  <strutils>, <osproc>, <os>  Types
-----

  
```
Distribution {...}{.pure.} = enum
  Windows,                  ## some version of Windows
  Posix,                    ## some Posix system
  MacOSX,                   ## some version of OSX
  Linux,                    ## some version of Linux
  Ubuntu, Debian, Gentoo, Fedora, RedHat, OpenSUSE, Manjaro, Elementary, Zorin,
  CentOS, Deepin, ArchLinux, Antergos, PCLinuxOS, Mageia, LXLE, Solus, Lite,
  Slackware, Androidx86, Puppy, Peppermint, Tails, AntiX, Kali, SparkyLinux,
  Apricity, BlackLab, Bodhi, TrueOS, ArchBang, KaOS, WattOS, Korora, Simplicity,
  RemixOS, OpenMandriva, Netrunner, Alpine, BlackArch, Ultimate, Gecko, Parrot,
  KNOPPIX, GhostBSD, Sabayon, Salix, Q4OS, ClearOS, Container, ROSA, Zenwalk,
  Parabola, ChaletOS, BackBox, MXLinux, Vector, Maui, Qubes, RancherOS, Oracle,
  TinyCore, Robolinux, Trisquel, Voyager, Clonezilla, SteamOS, Absolute, NixOS, ## NixOS or a Nix build environment
  AUSTRUMI, Arya, Porteus, AVLinux, Elive, Bluestar, SliTaz, Solaris, Chakra,
  Wifislax, Scientific, ExTiX, Rockstor, GoboLinux, BSD, FreeBSD, OpenBSD,
  DragonFlyBSD, Haiku
```
  the list of known distributions [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L37)   Consts
------

  
```
LacksDevPackages = {Distribution.Gentoo, Distribution.Slackware,
                    Distribution.ArchLinux}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L136)   Procs
-----

  
```
proc foreignCmd(cmd: string; requiresSudo = false) {...}{.raises: [], tags: [].}
```
  Registers a foreign command to the intern list of commands that can be queried later. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L211)  
```
proc foreignDepInstallCmd(foreignPackageName: string): (string, bool) {...}{.
    raises: [Exception, IOError, OSError],
    tags: [ExecIOEffect, ReadIOEffect, RootEffect, ReadEnvEffect].}
```
  Returns the distro's native command line to install 'foreignPackageName' and whether it requires root/admin rights. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L220)  
```
proc foreignDep(foreignPackageName: string) {...}{.
    raises: [Exception, IOError, OSError],
    tags: [ExecIOEffect, ReadIOEffect, RootEffect, ReadEnvEffect].}
```
  Registers 'foreignPackageName' to the internal list of foreign deps. It is your job to ensure the package name [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L263)  
```
proc echoForeignDeps() {...}{.raises: [], tags: [].}
```
  Writes the list of registered foreign deps to stdout. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L269)   Templates
---------

  
```
template detectOs(d: untyped): bool
```
  Distro/OS detection. For convenience the required `Distribution.` qualifier is added to the enum value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/distros.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/distros.nim#L202)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/distros.html>

Packaging Nim
=============

 This page provide hints on distributing Nim using OS packages.

 See <distros> for tools to detect Linux distribution at runtime.

 Supported architectures
-----------------------


Nim runs on a wide variety of platforms. Support on amd64 and i386 is tested regularly, while less popular platforms are tested by the community.

 * amd64
* arm64 (aka aarch64)
* armel
* armhf
* i386
* m68k
* mips64el
* mipsel
* powerpc
* ppc64
* ppc64el (aka ppc64le)
* riscv64

 The following platforms are seldomly tested:

 * alpha
* hppa
* ia64
* mips
* s390x
* sparc64

 Packaging for Linux
-------------------


See <https://github.com/nim-lang/Nim/labels/Installation> for installation-related bugs.

 Build Nim from the released tarball at <https://nim-lang.org/install_unix.html> It is different from the GitHub sources as it contains Nimble, C sources & other tools.

 The Debian package ships bash and ksh completion and manpages that can be reused.

 Hints on the build process:

 
```
# build from C sources and then using koch
./build.sh --os $os_type --cpu $cpu_arch
./bin/nim c koch
./koch boot -d:release

# optionally generate docs into doc/html
./koch docs

./koch tools -d:release

# extract files to be really installed
./install.sh <tempdir>

# also include the tools
for fn in nimble nimsuggest nimgrep; do cp ./bin/$fn <tempdir>/nim/bin/; done
```
 What to install:

 * The expected stdlib location is /usr/lib/nim
* Global configuration files under /etc/nim
* Optionally: manpages, documentation, shell completion
* When installing documentation, .idx files are not required
* The "compiler" directory contains compiler sources and should not be part of the compiler binary package

 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/packaging.html>

dynlib
======

 This module implements the ability to access symbols from shared libraries. On POSIX this uses the `dlsym` mechanism, on Windows `LoadLibrary`. 


Examples
--------

 ### Loading a simple C function


The following example demonstrates loading a function called 'greet' from a library that is determined at runtime based upon a language choice. If the library fails to load or the function 'greet' is not found, it quits with a failure error code.

 
```
import dynlib

type
  greetFunction = proc(): cstring {.gcsafe, stdcall.}

let lang = stdin.readLine()

let lib = case lang
of "french":
  loadLib("french.dll")
else:
  loadLib("english.dll")

if lib == nil:
  echo "Error loading library"
  quit(QuitFailure)

let greet = cast[greetFunction](lib.symAddr("greet"))

if greet == nil:
  echo "Error loading 'greet' function from library"
  quit(QuitFailure)

let greeting = greet()

echo greeting

unloadLib(lib)
```
 Imports
-------

  <strutils>, <posix>  Types
-----

  
```
LibHandle = pointer
```
  a handle to a dynamically loaded library [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L60)   Procs
-----

  
```
proc raiseInvalidLibrary(name: cstring) {...}{.noinline, noreturn,
    raises: [LibraryError], tags: [].}
```
  raises an `EInvalidLibrary` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L73)  
```
proc checkedSymAddr(lib: LibHandle; name: cstring): pointer {...}{.
    raises: [Exception, LibraryError], tags: [RootEffect].}
```
  retrieves the address of a procedure/variable from `lib`. Raises `EInvalidLibrary` if the symbol could not be found. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L81)  
```
proc libCandidates(s: string; dest: var seq[string]) {...}{.raises: [], tags: [].}
```
  given a library name pattern `s` write possible library names to `dest`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L87)  
```
proc loadLibPattern(pattern: string; globalSymbols = false): LibHandle {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  loads a library with name matching `pattern`, similar to what `dynlib` pragma does. Returns nil if the library could not be loaded. Warning: this proc uses the GC and so cannot be used to load the GC. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L99)  
```
proc loadLib(path: string; globalSymbols = false): LibHandle {...}{.gcsafe,
    raises: [], tags: [].}
```
  loads a library from `path`. Returns nil if the library could not be loaded. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L120)  
```
proc loadLib(): LibHandle {...}{.gcsafe, raises: [], tags: [].}
```
  gets the handle from the current executable. Returns nil if the library could not be loaded. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L127)  
```
proc unloadLib(lib: LibHandle) {...}{.gcsafe, raises: [], tags: [].}
```
  unloads the library `lib` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L128)  
```
proc symAddr(lib: LibHandle; name: cstring): pointer {...}{.gcsafe, raises: [],
    tags: [].}
```
  retrieves the address of a procedure/variable from `lib`. Returns nil if the symbol could not be found. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/dynlib.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/dynlib.nim#L129)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/dynlib.html>

marshal
=======


This module contains procs for serialization and deserialization of arbitrary Nim data structures. The serialization format uses JSON.

 **Restriction**: For objects their type is **not** serialized. This means essentially that it does not work if the object has some other runtime type than its compiletime type.

 Basic usage
-----------



```
type
  A = object of RootObj
  B = object of A
    f: int

var
  a: ref A
  b: ref B

new(b)
a = b
echo($$a[]) # produces "{}", not "{f: 0}"

# unmarshal
let c = to[B]("""{"f": 2}""")
assert typeof(c) is B
assert c.f == 2

# marshal
let s = $$c
assert s == """{"f": 2}"""
```

**Note**: The `to` and `$$` operations are available at compile-time!

 See also
--------


* [streams module](streams)
* [json module](json)

 Imports
-------

  <streams>, <typeinfo>, <json>, <intsets>, <tables>, <unicode>  Procs
-----

  
```
proc load[T](s: Stream; data: var T)
```
  Loads `data` from the stream `s`. Raises `IOError` in case of an error. **Example:**

 
```
import marshal, streams
var s = newStringStream("[1, 3, 5]")
var a: array[3, int]
load(s, a)
assert a == [1, 3, 5]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/marshal.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/marshal.nim#L279)  
```
proc store[T](s: Stream; data: T)
```
  Stores `data` into the stream `s`. Raises `IOError` in case of an error. **Example:**

 
```
import marshal, streams
var s = newStringStream("")
var a = [1, 3, 5]
store(s, a)
s.setPosition(0)
assert s.readAll() == "[1, 3, 5]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/marshal.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/marshal.nim#L291)  
```
proc `$$`[T](x: T): string
```
  Returns a string representation of `x` (serialization, marshalling).

 **Note:** to serialize `x` to JSON use `$(%x)` from the `json` module.

 **Example:**

 
```
type
  Foo = object
    id: int
    bar: string
let x = Foo(id: 1, bar: "baz")
## serialize:
let y = $$x
assert y == """{"id": 1, "bar": "baz"}"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/marshal.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/marshal.nim#L306)  
```
proc to[T](data: string): T
```
  Reads data and transforms it to a type `T` (deserialization, unmarshalling). **Example:**

 
```
type
  Foo = object
    id: int
    bar: string
let y = """{"id": 1, "bar": "baz"}"""
assert typeof(y) is string
## deserialize to type 'Foo':
let z = y.to[:Foo]
assert typeof(z) is Foo
assert z.id == 1
assert z.bar == "baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/marshal.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/marshal.nim#L327)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/marshal.html>

memfiles
========


This module provides support for memory mapped files (Posix's mmap) on the different operating systems.

 It also provides some fast iterators over lines in text files (or other "line-like", variable length, delimited records).

 Imports
-------

  <posix>, <os>, <streams>  Types
-----

  
```
MemFile = object
  mem*: pointer              ## a pointer to the memory mapped file. The pointer
                             ## 
                             ## can be used directly to change the contents of the
                             ## 
                             ## file, if it was opened with write access.
  size*: int                 ## size of the memory mapped file
  when defined(windows):
      fHandle*: Handle ## **Caution**: Windows specific public field to allow
                       ## even more low level trickery.
      mapHandle*: Handle     ## **Caution**: Windows specific public field.
      wasOpened*: bool       ## **Caution**: Windows specific public field.
    
  else:
      handle*: cint          ## **Caution**: Posix specific public field.
      flags: cint            ## **Caution**: Platform specific private field.
```
  represents a memory mapped file [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L32)  
```
MemSlice = object
  data*: pointer
  size*: int
```
  represent slice of a MemFile for iteration over delimited lines/records [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L366)  
```
MemMapFileStream = ref MemMapFileStreamObj
```
  a stream that encapsulates a `MemFile` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L468)  
```
MemMapFileStreamObj = object of Stream
  mf: MemFile
  mode: FileMode
  pos: ByteAddress
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L469)   Procs
-----

  
```
proc mapMem(m: var MemFile; mode: FileMode = fmRead; mappedSize = -1;
            offset = 0; mapFlags = cint(-1)): pointer {...}{.
    raises: [IOError, OSError], tags: [].}
```
  returns a pointer to a mapped portion of MemFile `m`

 `mappedSize` of `-1` maps to the whole file, and `offset` must be multiples of the PAGE SIZE of your OS

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L47)  
```
proc unmapMem(f: var MemFile; p: pointer; size: int) {...}{.raises: [OSError],
    tags: [].}
```
  unmaps the memory region `(p, <p+size)` of the mapped file `f`. All changes are written back to the file system, if `f` was opened with write access.

 `size` must be of exactly the size that was requested via `mapMem`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L85)  
```
proc open(filename: string; mode: FileMode = fmRead; mappedSize = -1;
          offset = 0; newFileSize = -1; allowRemap = false; mapFlags = cint(-1)): MemFile {...}{.
    raises: [IOError, OSError], tags: [].}
```
  opens a memory mapped file. If this fails, `OSError` is raised.

 `newFileSize` can only be set if the file does not exist and is opened with write access (e.g., with fmReadWrite).

 `mappedSize` and `offset` can be used to map only a slice of the file.

 `offset` must be multiples of the PAGE SIZE of your OS (usually 4K or 8K but is unique to your OS)

 `allowRemap` only needs to be true if you want to call `mapMem` on the resulting MemFile; else file handles are not kept open.

 `mapFlags` allows callers to override default choices for memory mapping flags with a bitwise mask of a variety of likely platform-specific flags which may be ignored or even cause `open` to fail if misspecified.

 Example:

 
```
var
  mm, mm_full, mm_half: MemFile

mm = memfiles.open("/tmp/test.mmap", mode = fmWrite, newFileSize = 1024)    # Create a new file
mm.close()

# Read the whole file, would fail if newFileSize was set
mm_full = memfiles.open("/tmp/test.mmap", mode = fmReadWrite, mappedSize = -1)

# Read the first 512 bytes
mm_half = memfiles.open("/tmp/test.mmap", mode = fmReadWrite, mappedSize = 512)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L98)  
```
proc flush(f: var MemFile; attempts: Natural = 3) {...}{.raises: [OSError], tags: [].}
```
  Flushes `f`'s buffer for the number of attempts equal to `attempts`. If were errors an exception `OSError` will be raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L280)  
```
proc resize(f: var MemFile; newFileSize: int) {...}{.raises: [IOError, OSError],
    tags: [].}
```
  resize and re-map the file underlying an `allowRemap MemFile`. **Note**: this assumes the entire file is mapped read-write at offset zero. Also, the value of `.mem` will probably change. **Note**: This is not (yet) available on Windows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L303)  
```
proc close(f: var MemFile) {...}{.raises: [OSError], tags: [].}
```
  closes the memory mapped file `f`. All changes are written back to the file system, if `f` was opened with write access. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L331)  
```
proc `==`(x, y: MemSlice): bool {...}{.raises: [], tags: [].}
```
  Compare a pair of MemSlice for strict equality. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L370)  
```
proc `$`(ms: MemSlice): string {...}{.inline, raises: [], tags: [].}
```
  Return a Nim string built from a MemSlice. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L374)  
```
proc newMemMapFileStream(filename: string; mode: FileMode = fmRead;
                         fileSize: int = -1): MemMapFileStream {...}{.
    raises: [IOError, OSError], tags: [].}
```
  creates a new stream from the file named `filename` with the mode `mode`. Raises ## `OSError` if the file cannot be opened. See the <system> module for a list of available FileMode enums. `fileSize` can only be set if the file does not exist and is opened with write access (e.g., with fmReadWrite). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L512)   Iterators
---------

  
```
iterator memSlices(mfile: MemFile; delim = '\n'; eat = '\c'): MemSlice {...}{.inline,
    raises: [], tags: [].}
```
  Iterates over [optional `eat`] `delim`-delimited slices in MemFile `mfile`.

 Default parameters parse lines ending in either Unix(\l) or Windows(\r\l) style on on a line-by-line basis. I.e., not every line needs the same ending. Unlike readLine(File) & lines(File), archaic MacOS9 \r-delimited lines are not supported as a third option for each line. Such archaic MacOS9 files can be handled by passing delim='\r', eat='\0', though.

 Delimiters are not part of the returned slice. A final, unterminated line or record is returned just like any other.

 Non-default delimiters can be passed to allow iteration over other sorts of "line-like" variable length records. Pass eat='\0' to be strictly `delim`-delimited. (Eating an optional prefix equal to '\0' is not supported.)

 This zero copy, memchr-limited interface is probably the fastest way to iterate over line-like records in a file. However, returned (data,size) objects are not Nim strings, bounds checked Nim arrays, or even terminated C strings. So, care is required to access the data (e.g., think C mem\* functions, not str\* functions).

 Example:

 
```
var count = 0
for slice in memSlices(memfiles.open("foo")):
  if slice.size > 0 and cast[cstring](slice.data)[0] != '#':
    inc(count)
echo count
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L379)  
```
iterator lines(mfile: MemFile; buf: var TaintedString; delim = '\n'; eat = '\c'): TaintedString {...}{.
    inline, raises: [], tags: [].}
```
  Replace contents of passed buffer with each new line, like [readLine(File)](io#readLine,File,TaintedString). `delim`, `eat`, and delimiting logic is exactly as for [memSlices](#memSlices.i,MemFile,char,char), but Nim strings are returned.

 Example:

 
```
var buffer: TaintedString = ""
for line in lines(memfiles.open("foo"), buffer):
  echo line
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L431)  
```
iterator lines(mfile: MemFile; delim = '\n'; eat = '\c'): TaintedString {...}{.
    inline, raises: [], tags: [].}
```
  Return each line in a file as a Nim string, like [lines(File)](io#lines.i,File). `delim`, `eat`, and delimiting logic is exactly as for [memSlices](#memSlices.i,MemFile,char,char), but Nim strings are returned.

 Example:

 
```
for line in lines(memfiles.open("foo")):
  echo line
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/memfiles.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/memfiles.nim#L451)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/memfiles.html>

os
==

 This module contains basic operating system facilities like retrieving environment variables, reading command line arguments, working with directories, running shell commands, etc.



```
import os

let myFile = "/path/to/my/file.nim"

let pathSplit = splitPath(myFile)
assert pathSplit.head == "/path/to/my"
assert pathSplit.tail == "file.nim"

assert parentDir(myFile) == "/path/to/my"

let fileSplit = splitFile(myFile)
assert fileSplit.dir == "/path/to/my"
assert fileSplit.name == "file"
assert fileSplit.ext == ".nim"

assert myFile.changeFileExt("c") == "/path/to/my/file.c"
```


> 
> **See also:**
> 
> 
> * [osproc module](osproc) for process communication beyond [execShellCmd proc](#execShellCmd,string)
> * [parseopt module](parseopt) for command-line parser beyond [parseCmdLine proc](#parseCmdLine,string)
> * [uri module](uri)
> * [distros module](distros)
> * [dynlib module](dynlib)
> * [streams module](streams)
> 
>  

 Imports
-------

  <since>, <strutils>, <pathnorm>, <posix>, <times>  Types
-----

  
```
ReadEnvEffect = object of ReadIOEffect
```
  Effect that denotes a read from an environment variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L94)  
```
WriteEnvEffect = object of WriteIOEffect
```
  Effect that denotes a write to an environment variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L96)  
```
ReadDirEffect = object of ReadIOEffect
```
  Effect that denotes a read operation from the directory structure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L99)  
```
WriteDirEffect = object of WriteIOEffect
```
  Effect that denotes a write operation to the directory structure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L102)  
```
OSErrorCode = distinct int32
```
  Specifies an OS Error Code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L106)  
```
FilePermission = enum
  fpUserExec,               ## execute access for the file owner
  fpUserWrite,              ## write access for the file owner
  fpUserRead,               ## read access for the file owner
  fpGroupExec,              ## execute access for the group
  fpGroupWrite,             ## write access for the group
  fpGroupRead,              ## read access for the group
  fpOthersExec,             ## execute access for others
  fpOthersWrite,            ## write access for others
  fpOthersRead               ## read access for others
```
  File access permission, modelled after UNIX.

 See also:

 * [getFilePermissions](#getFilePermissions,string)
* [setFilePermissions](#setFilePermissions,string,set%5BFilePermission%5D)
* [FileInfo object](#FileInfo)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1590)  
```
PathComponent = enum
  pcFile,                   ## path refers to a file
  pcLinkToFile,             ## path refers to a symbolic link to a file
  pcDir,                    ## path refers to a directory
  pcLinkToDir                ## path refers to a symbolic link to a directory
```
  Enumeration specifying a path component.

 See also:

 * [walkDirRec iterator](#walkDirRec.i,string)
* [FileInfo object](#FileInfo)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2046) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2046)  
```
DeviceId = Dev
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3060) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3060)  
```
FileId = Ino
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3061) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3061)  
```
FileInfo = object
  id*: tuple[device: DeviceId, file: FileId] ## Device and file id.
  kind*: PathComponent       ## Kind of file object - directory, symlink, etc.
  size*: BiggestInt          ## Size of file.
  permissions*: set[FilePermission] ## File permissions
  linkCount*: BiggestInt     ## Number of hard links the file object has.
  lastAccessTime*: times.Time ## Time file was last accessed.
  lastWriteTime*: times.Time ## Time file was last modified/written to.
  creationTime*: times.Time  ## Time file was created. Not supported on all systems!
```
  Contains information associated with a file object.

 See also:

 * [getFileInfo(handle) proc](#getFileInfo,FileHandle)
* [getFileInfo(file) proc](#getFileInfo,File)
* [getFileInfo(path) proc](#getFileInfo,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3064) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3064)   Consts
------

  
```
invalidFilenameChars = {'/', '\\', ':', '*', '?', '\"', '<', '>', '|', '^',
                        '\x00'}
```
  Characters that may produce invalid filenames across Linux, Windows, Mac, etc. You can check if your filename contains these char and strip them for safety. Mac bans `':'`, Linux bans `'/'`, Windows bans all others. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L54)  
```
invalidFilenames = ["CON", "PRN", "AUX", "NUL", "COM0", "COM1", "COM2", "COM3",
                    "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT0",
                    "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7",
                    "LPT8", "LPT9"]
```
  Filenames that may be invalid across Linux, Windows, Mac, etc. You can check if your filename match these and rename it for safety (Currently all invalid filenames are from Windows only). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L58)  
```
doslikeFileSystem = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L7) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L7)  
```
CurDir = '.'
```
  The constant character used by the operating system to refer to the current directory.

 For example: `'.'` for POSIX or `':'` for the classic Macintosh.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L10)  
```
ParDir = ".."
```
  The constant string used by the operating system to refer to the parent directory.

 For example: `".."` for POSIX or `"::"` for the classic Macintosh.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L19)  
```
DirSep = '/'
```
  The character used by the operating system to separate pathname components, for example: `'/'` for POSIX, `':'` for the classic Macintosh, and `'\'` on Windows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L27)  
```
AltSep = '/'
```
  An alternative character used by the operating system to separate pathname components, or the same as [DirSep](#DirSep) if only one separator character exists. This is set to `'/'` on Windows systems where [DirSep](#DirSep) is a backslash (`'\'`). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L36)  
```
PathSep = ':'
```
  The character conventionally used by the operating system to separate search patch components (as in PATH), such as `':'` for POSIX or `';'` for Windows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L44)  
```
FileSystemCaseSensitive = true
```
  True if the file system is case sensitive, false otherwise. Used by [cmpPaths proc](#cmpPaths,string,string) to compare filenames properly. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L53)  
```
ExeExt = ""
```
  The file extension of native executables. For example: `""` for POSIX, `"exe"` on Windows (without a dot). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L60)  
```
ScriptExt = ""
```
  The file extension of a script file. For example: `""` for POSIX, `"bat"` on Windows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L70)  
```
DynlibFormat = "lib$1.so"
```
  The format string to turn a filename into a DLL file (also called shared object on some operating systems). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L76)  
```
ExtSep = '.'
```
  The character which separates the base filename from the extension; for example, the `'.'` in `os.nim`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osseps.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osseps.nim#L89)  
```
ExeExts = [""]
```
  Platform specific file extension for executables. On Windows `["exe", "cmd", "bat"]`, on Posix `[""]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1178)   Procs
-----

  
```
proc normalizePathEnd(path: var string; trailingSep = false) {...}{.raises: [],
    tags: [].}
```
  Ensures `path` has exactly 0 or 1 trailing `DirSep`, depending on `trailingSep`, and taking care of edge cases: it preservers whether a path is absolute or relative, and makes sure trailing sep is `DirSep`, not `AltSep`. Trailing `/.` are compressed, see examples. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L112)  
```
proc normalizePathEnd(path: string; trailingSep = false): string {...}{.raises: [],
    tags: [].}
```
  outplace overload **Example:**

 
```
when defined(posix):
  assert normalizePathEnd("/lib//.//", trailingSep = true) == "/lib/"
  assert normalizePathEnd("lib/./.", trailingSep = false) == "lib"
  assert normalizePathEnd(".//./.", trailingSep = false) == "."
  assert normalizePathEnd("", trailingSep = true) == "" # not / !
  assert normalizePathEnd("/", trailingSep = false) == "/" # not "" !
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L135)  
```
proc joinPath(head, tail: string): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Joins two directory names to one.

 returns normalized path concatenation of `head` and `tail`, preserving whether or not `tail` has a trailing slash (or, if tail if empty, whether head has one).

 See also:

 * [joinPath(varargs) proc](#joinPath,varargs%5Bstring%5D)
* [/ proc](#/,string,string)
* [splitPath proc](#splitPath,string)
* [uri.combine proc](uri#combine,Uri,Uri)
* [uri./ proc](uri#/,Uri,string)

 **Example:**

 
```
when defined(posix):
  assert joinPath("usr", "lib") == "usr/lib"
  assert joinPath("usr", "lib/") == "usr/lib/"
  assert joinPath("usr", "") == "usr"
  assert joinPath("usr/", "") == "usr/"
  assert joinPath("", "") == ""
  assert joinPath("", "lib") == "lib"
  assert joinPath("", "/lib") == "/lib"
  assert joinPath("usr/", "/lib") == "usr/lib"
  assert joinPath("usr/lib", "../bin") == "usr/bin"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L159)  
```
proc joinPath(parts: varargs[string]): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1OpenArray", raises: [], tags: [].}
```
  The same as [joinPath(head, tail) proc](#joinPath,string,string), but works with any number of directory parts.

 You need to pass at least one element or the proc will assert in debug builds and crash on release builds.

 See also:

 * [joinPath(head, tail) proc](#joinPath,string,string)
* [/ proc](#/,string,string)
* [/../ proc](#/../,string,string)
* [splitPath proc](#splitPath,string)

 **Example:**

 
```
when defined(posix):
  assert joinPath("a") == "a"
  assert joinPath("a", "b", "c") == "a/b/c"
  assert joinPath("usr/lib", "../../var", "log") == "var/log"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L203)  
```
proc `/`(head, tail: string): string {...}{.noSideEffect, raises: [], tags: [].}
```
  The same as [joinPath(head, tail) proc](#joinPath,string,string).

 See also:

 * [/../ proc](#/../,string,string)
* [joinPath(head, tail) proc](#joinPath,string,string)
* [joinPath(varargs) proc](#joinPath,varargs%5Bstring%5D)
* [splitPath proc](#splitPath,string)
* [uri.combine proc](uri#combine,Uri,Uri)
* [uri./ proc](uri#/,Uri,string)

 **Example:**

 
```
when defined(posix):
  assert "usr" / "" == "usr"
  assert "" / "lib" == "lib"
  assert "" / "/lib" == "/lib"
  assert "usr/" / "/lib/" == "usr/lib/"
  assert "usr" / "lib" / "../bin" == "usr/bin"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L229)  
```
proc splitPath(path: string): tuple[head, tail: string] {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Splits a directory into `(head, tail)` tuple, so that `head / tail == path` (except for edge cases like "/usr").

 See also:

 * [joinPath(head, tail) proc](#joinPath,string,string)
* [joinPath(varargs) proc](#joinPath,varargs%5Bstring%5D)
* [/ proc](#/,string,string)
* [/../ proc](#/../,string,string)
* [relativePath proc](#relativePath,string,string)

 **Example:**

 
```
assert splitPath("usr/local/bin") == ("usr/local", "bin")
assert splitPath("usr/local/bin/") == ("usr/local/bin", "")
assert splitPath("/bin/") == ("/bin", "")
when (NimMajor, NimMinor) <= (1, 0):
  assert splitPath("/bin") == ("", "bin")
else:
  assert splitPath("/bin") == ("/", "bin")
assert splitPath("bin") == ("", "bin")
assert splitPath("") == ("", "")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L249)  
```
proc isAbsolute(path: string): bool {...}{.gcsafe, noSideEffect, extern: "nos$1",
                                      raises: [], tags: [].}
```
  Checks whether a given `path` is absolute.

 On Windows, network paths are considered absolute too.

 **Example:**

 
```
assert not "".isAbsolute
assert not ".".isAbsolute
when defined(posix):
  assert "/".isAbsolute
  assert not "a/".isAbsolute
  assert "/a/".isAbsolute
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L288)  
```
proc relativePath(path, base: string; sep = DirSep): string {...}{.gcsafe,
    extern: "nos$1", raises: [Exception], tags: [RootEffect].}
```
  Converts `path` to a path relative to `base`.

 The `sep` (default: [DirSep](#DirSep)) is used for the path normalizations, this can be useful to ensure the relative path only contains `'/'` so that it can be used for URL constructions.

 On windows, if a root of `path` and a root of `base` are different, returns `path` as is because it is impossible to make a relative path. That means an absolute path can be returned.

 See also:

 * [splitPath proc](#splitPath,string)
* [parentDir proc](#parentDir,string)
* [tailDir proc](#tailDir,string)

 **Example:**

 
```
assert relativePath("/Users/me/bar/z.nim", "/Users/other/bad", '/') == "../../me/bar/z.nim"
assert relativePath("/Users/me/bar/z.nim", "/Users/other", '/') == "../me/bar/z.nim"
assert relativePath("/Users///me/bar//z.nim", "//Users/", '/') == "me/bar/z.nim"
assert relativePath("/Users/me/bar/z.nim", "/Users/me", '/') == "bar/z.nim"
assert relativePath("", "/users/moo", '/') == ""
assert relativePath("foo", ".", '/') == "foo"
assert relativePath("foo", "foo", '/') == "."
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L378)  
```
proc isRelativeTo(path: string; base: string): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Returns true if `path` is relative to `base`. **Example:**

 
```
doAssert isRelativeTo("./foo//bar", "foo")
doAssert isRelativeTo("foo/bar", ".")
doAssert isRelativeTo("/foo/bar.nim", "/foo/bar.nim")
doAssert not isRelativeTo("foo/bar.nims", "foo/bar.nim")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L467)  
```
proc parentDir(path: string): string {...}{.noSideEffect, gcsafe, extern: "nos$1",
                                       raises: [], tags: [].}
```
  Returns the parent directory of `path`.

 This is similar to `splitPath(path).head` when `path` doesn't end in a dir separator, but also takes care of path normalizations. The remainder can be obtained with [lastPathPart(path) proc](#lastPathPart,string).

 See also:

 * [relativePath proc](#relativePath,string,string)
* [splitPath proc](#splitPath,string)
* [tailDir proc](#tailDir,string)
* [parentDirs iterator](#parentDirs.i,string)

 **Example:**

 
```
assert parentDir("") == ""
when defined(posix):
  assert parentDir("/usr/local/bin") == "/usr/local"
  assert parentDir("foo/bar//") == "foo"
  assert parentDir("//foo//bar//.") == "/foo"
  assert parentDir("./foo") == "."
  assert parentDir("/./foo//./") == "/"
  assert parentDir("a//./") == "."
  assert parentDir("a/b/c/..") == "a"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L486)  
```
proc tailDir(path: string): string {...}{.noSideEffect, gcsafe, extern: "nos$1",
                                     raises: [], tags: [].}
```
  Returns the tail part of `path`.

 See also:

 * [relativePath proc](#relativePath,string,string)
* [splitPath proc](#splitPath,string)
* [parentDir proc](#parentDir,string)

 **Example:**

 
```
assert tailDir("/bin") == "bin"
assert tailDir("bin") == ""
assert tailDir("bin/") == ""
assert tailDir("/usr/local/bin") == "usr/local/bin"
assert tailDir("//usr//local//bin//") == "usr//local//bin//"
assert tailDir("./usr/local/bin") == "usr/local/bin"
assert tailDir("usr/local/bin") == "local/bin"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L522)  
```
proc isRootDir(path: string): bool {...}{.noSideEffect, gcsafe, extern: "nos$1",
                                     raises: [], tags: [].}
```
  Checks whether a given `path` is a root directory. **Example:**

 
```
assert isRootDir("")
assert isRootDir(".")
assert isRootDir("/")
assert isRootDir("a")
assert not isRootDir("/a")
assert not isRootDir("a/b/c")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L547)  
```
proc `/../`(head, tail: string): string {...}{.noSideEffect, raises: [], tags: [].}
```
  The same as `parentDir(head) / tail`, unless there is no parent directory. Then `head / tail` is performed instead.

 See also:

 * [/ proc](#/,string,string)
* [parentDir proc](#parentDir,string)

 **Example:**

 
```
when defined(posix):
  assert "a/b/c" /../ "d/e" == "a/b/d/e"
  assert "a" /../ "d/e" == "a/d/e"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L612)  
```
proc searchExtPos(path: string): int {...}{.raises: [], tags: [].}
```
  Returns index of the `'.'` char in `path` if it signifies the beginning of extension. Returns -1 otherwise.

 See also:

 * [splitFile proc](#splitFile,string)
* [extractFilename proc](#extractFilename,string)
* [lastPathPart proc](#lastPathPart,string)
* [changeFileExt proc](#changeFileExt,string,string)
* [addFileExt proc](#addFileExt,string,string)

 **Example:**

 
```
assert searchExtPos("a/b/c") == -1
assert searchExtPos("c.nim") == 1
assert searchExtPos("a/b/c.nim") == 5
assert searchExtPos("a.b.c.nim") == 5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L634)  
```
proc splitFile(path: string): tuple[dir, name, ext: string] {...}{.noSideEffect,
    gcsafe, extern: "nos$1", raises: [], tags: [].}
```
  Splits a filename into `(dir, name, extension)` tuple.

 `dir` does not end in [DirSep](#DirSep) unless it's `/`. `extension` includes the leading dot.

 If `path` has no extension, `ext` is the empty string. If `path` has no directory component, `dir` is the empty string. If `path` has no filename component, `name` and `ext` are empty strings.

 See also:

 * [searchExtPos proc](#searchExtPos,string)
* [extractFilename proc](#extractFilename,string)
* [lastPathPart proc](#lastPathPart,string)
* [changeFileExt proc](#changeFileExt,string,string)
* [addFileExt proc](#addFileExt,string,string)

 **Example:**

 
```
var (dir, name, ext) = splitFile("usr/local/nimc.html")
assert dir == "usr/local"
assert name == "nimc"
assert ext == ".html"
(dir, name, ext) = splitFile("/usr/local/os")
assert dir == "/usr/local"
assert name == "os"
assert ext == ""
(dir, name, ext) = splitFile("/usr/local/")
assert dir == "/usr/local"
assert name == ""
assert ext == ""
(dir, name, ext) = splitFile("/tmp.txt")
assert dir == "/"
assert name == "tmp"
assert ext == ".txt"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L659)  
```
proc extractFilename(path: string): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Extracts the filename of a given `path`.

 This is the same as `name & ext` from [splitFile(path) proc](#splitFile,string).

 See also:

 * [searchExtPos proc](#searchExtPos,string)
* [splitFile proc](#splitFile,string)
* [lastPathPart proc](#lastPathPart,string)
* [changeFileExt proc](#changeFileExt,string,string)
* [addFileExt proc](#addFileExt,string,string)

 **Example:**

 
```
assert extractFilename("foo/bar/") == ""
assert extractFilename("foo/bar") == "bar"
assert extractFilename("foo/bar.baz") == "bar.baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L712)  
```
proc lastPathPart(path: string): string {...}{.noSideEffect, gcsafe, extern: "nos$1",
    raises: [], tags: [].}
```
  Like [extractFilename proc](#extractFilename,string), but ignores trailing dir separator; aka: baseName in some other languages.

 See also:

 * [searchExtPos proc](#searchExtPos,string)
* [splitFile proc](#splitFile,string)
* [extractFilename proc](#extractFilename,string)
* [changeFileExt proc](#changeFileExt,string,string)
* [addFileExt proc](#addFileExt,string,string)

 **Example:**

 
```
assert lastPathPart("foo/bar/") == "bar"
assert lastPathPart("foo/bar") == "bar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L735)  
```
proc changeFileExt(filename, ext: string): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Changes the file extension to `ext`.

 If the `filename` has no extension, `ext` will be added. If `ext` == "" then any extension is removed.

 `Ext` should be given without the leading `'.'`, because some filesystems may use a different character. (Although I know of none such beast.)

 See also:

 * [searchExtPos proc](#searchExtPos,string)
* [splitFile proc](#splitFile,string)
* [extractFilename proc](#extractFilename,string)
* [lastPathPart proc](#lastPathPart,string)
* [addFileExt proc](#addFileExt,string,string)

 **Example:**

 
```
assert changeFileExt("foo.bar", "baz") == "foo.baz"
assert changeFileExt("foo.bar", "") == "foo"
assert changeFileExt("foo", "baz") == "foo.baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L753) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L753)  
```
proc addFileExt(filename, ext: string): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Adds the file extension `ext` to `filename`, unless `filename` already has an extension.

 `Ext` should be given without the leading `'.'`, because some filesystems may use a different character. (Although I know of none such beast.)

 See also:

 * [searchExtPos proc](#searchExtPos,string)
* [splitFile proc](#splitFile,string)
* [extractFilename proc](#extractFilename,string)
* [lastPathPart proc](#lastPathPart,string)
* [changeFileExt proc](#changeFileExt,string,string)

 **Example:**

 
```
assert addFileExt("foo.bar", "baz") == "foo.bar"
assert addFileExt("foo.bar", "") == "foo.bar"
assert addFileExt("foo", "baz") == "foo.baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L779)  
```
proc cmpPaths(pathA, pathB: string): int {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Compares two paths.

 On a case-sensitive filesystem this is done case-sensitively otherwise case-insensitively. Returns:

 0 if pathA == pathB  
< 0 if pathA < pathB  
> 0 if pathA > pathB  


 **Example:**

 
```
when defined(macosx):
  assert cmpPaths("foo", "Foo") == 0
elif defined(posix):
  assert cmpPaths("foo", "Foo") > 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L803) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L803)  
```
proc unixToNativePath(path: string; drive = ""): string {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Converts an UNIX-like path to a native one.

 On an UNIX system this does nothing. Else it converts `'/'`, `'.'`, `'..'` to the appropriate things.

 On systems with a concept of "drives", `drive` is used to determine which drive label to use during absolute path conversion. `drive` defaults to the drive of the current working directory, and is ignored on systems that do not have a concept of "drives".

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L830)  
```
proc `==`(err1, err2: OSErrorCode): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L15)  
```
proc `$`(err: OSErrorCode): string {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L16)  
```
proc osErrorMsg(errorCode: OSErrorCode): string {...}{.raises: [], tags: [].}
```
  Converts an OS error code into a human readable string.

 The error code can be retrieved using the [osLastError proc](#osLastError).

 If conversion fails, or `errorCode` is `0` then `""` will be returned.

 On Windows, the `-d:useWinAnsi` compilation flag can be used to make this procedure use the non-unicode Win API calls to retrieve the message.

 See also:

 * [raiseOSError proc](#raiseOSError,OSErrorCode,string)
* [osLastError proc](#osLastError)

 **Example:**

 
```
when defined(linux):
  assert osErrorMsg(OSErrorCode(0)) == ""
  assert osErrorMsg(OSErrorCode(1)) == "Operation not permitted"
  assert osErrorMsg(OSErrorCode(2)) == "No such file or directory"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L18)  
```
proc newOSError(errorCode: OSErrorCode; additionalInfo = ""): owned(ref OSError) {...}{.
    noinline, raises: [], tags: [].}
```
  Creates a new [OSError exception](system#OSError).

 The `errorCode` will determine the message, [osErrorMsg proc](#osErrorMsg,OSErrorCode) will be used to get this message.

 The error code can be retrieved using the [osLastError proc](#osLastError).

 If the error code is `0` or an error message could not be retrieved, the message `unknown OS error` will be used.

 See also:

 * [osErrorMsg proc](#osErrorMsg,OSErrorCode)
* [osLastError proc](#osLastError)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L60)  
```
proc raiseOSError(errorCode: OSErrorCode; additionalInfo = "") {...}{.noinline,
    raises: [OSError], tags: [].}
```
  Raises an [OSError exception](system#OSError).

 Read the description of the [newOSError proc](#newOSError,OSErrorCode,string) to learn how the exception object is created.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L89)  
```
proc osLastError(): OSErrorCode {...}{.sideEffect, raises: [], tags: [].}
```
  Retrieves the last operating system error code.

 This procedure is useful in the event when an OS call fails. In that case this procedure will return the error code describing the reason why the OS call failed. The `OSErrorMsg` procedure can then be used to convert this code into a string.

 **Warning**: The behaviour of this procedure varies between Windows and POSIX systems. On Windows some OS calls can reset the error code to `0` causing this procedure to return `0`. It is therefore advised to call this procedure immediately after an OS call fails. On POSIX systems this is not a problem.

 See also:

 * [osErrorMsg proc](#osErrorMsg,OSErrorCode)
* [raiseOSError proc](#raiseOSError,OSErrorCode,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/oserr.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/oserr.nim#L97)  
```
proc getEnv(key: string; default = ""): TaintedString {...}{.tags: [ReadEnvEffect],
    raises: [].}
```
  Returns the value of the environment variable named `key`.

 If the variable does not exist, `""` is returned. To distinguish whether a variable exists or it's value is just `""`, call [existsEnv(key) proc](#existsEnv,string).

 See also:

 * [existsEnv proc](#existsEnv,string)
* [putEnv proc](#putEnv,string,string)
* [delEnv proc](#delEnv,string)
* [envPairs iterator](#envPairs.i)

 **Example:**

 
```
assert getEnv("unknownEnv") == ""
assert getEnv("unknownEnv", "doesn't exist") == "doesn't exist"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osenv.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osenv.nim#L111)  
```
proc existsEnv(key: string): bool {...}{.tags: [ReadEnvEffect], raises: [].}
```
  Checks whether the environment variable named `key` exists. Returns true if it exists, false otherwise.

 See also:

 * [getEnv proc](#getEnv,string,string)
* [putEnv proc](#putEnv,string,string)
* [delEnv proc](#delEnv,string)
* [envPairs iterator](#envPairs.i)

 **Example:**

 
```
assert not existsEnv("unknownEnv")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osenv.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osenv.nim#L138)  
```
proc putEnv(key, val: string) {...}{.tags: [WriteEnvEffect], raises: [OSError].}
```
  Sets the value of the environment variable named `key` to `val`. If an error occurs, `OSError` is raised.

 See also:

 * [getEnv proc](#getEnv,string,string)
* [existsEnv proc](#existsEnv,string)
* [delEnv proc](#delEnv,string)
* [envPairs iterator](#envPairs.i)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osenv.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osenv.nim#L156)  
```
proc delEnv(key: string) {...}{.tags: [WriteEnvEffect], raises: [OSError].}
```
  Deletes the environment variable named `key`. If an error occurs, `OSError` is raised.

 See also:ven

 * [getEnv proc](#getEnv,string,string)
* [existsEnv proc](#existsEnv,string)
* [putEnv proc](#putEnv,string,string)
* [envPairs iterator](#envPairs.i)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osenv.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osenv.nim#L190)  
```
proc getHomeDir(): string {...}{.gcsafe, extern: "nos$1",
                            tags: [ReadEnvEffect, ReadIOEffect], raises: [].}
```
  Returns the home directory of the current user.

 This proc is wrapped by the [expandTilde proc](#expandTilde,string) for the convenience of processing paths coming from user configuration files.

 See also:

 * [getConfigDir proc](#getConfigDir)
* [getTempDir proc](#getTempDir)
* [expandTilde proc](#expandTilde,string)
* [getCurrentDir proc](#getCurrentDir)
* [setCurrentDir proc](#setCurrentDir,string)

 **Example:**

 
```
assert getHomeDir() == expandTilde("~")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L890)  
```
proc getConfigDir(): string {...}{.gcsafe, extern: "nos$1",
                              tags: [ReadEnvEffect, ReadIOEffect], raises: [].}
```
  Returns the config directory of the current user for applications.

 On non-Windows OSs, this proc conforms to the XDG Base Directory spec. Thus, this proc returns the value of the `XDG_CONFIG_HOME` environment variable if it is set, otherwise it returns the default configuration directory ("~/.config/").

 An OS-dependent trailing slash is always present at the end of the returned string: `\` on Windows and `/` on all other OSs.

 See also:

 * [getHomeDir proc](#getHomeDir)
* [getTempDir proc](#getTempDir)
* [expandTilde proc](#expandTilde,string)
* [getCurrentDir proc](#getCurrentDir)
* [setCurrentDir proc](#setCurrentDir,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L909) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L909)  
```
proc getTempDir(): string {...}{.gcsafe, extern: "nos$1",
                            tags: [ReadEnvEffect, ReadIOEffect], raises: [].}
```
  Returns the temporary directory of the current user for applications to save temporary files in.

 **Please do not use this**: On Android, it currently returns `getHomeDir()`, and on other Unix based systems it can cause security problems too. That said, you can override this implementation by adding `-d:tempDir=mytempname` to your compiler invocation.

 See also:

 * [getHomeDir proc](#getHomeDir)
* [getConfigDir proc](#getConfigDir)
* [expandTilde proc](#expandTilde,string)
* [getCurrentDir proc](#getCurrentDir)
* [setCurrentDir proc](#setCurrentDir,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L933)  
```
proc expandTilde(path: string): string {...}{.tags: [ReadEnvEffect, ReadIOEffect],
    raises: [].}
```
  Expands `~` or a path starting with `~/` to a full path, replacing `~` with [getHomeDir()](#getHomeDir) (otherwise returns `path` unmodified).

 Windows: this is still supported despite Windows platform not having this convention; also, both `~/` and `~\` are handled.

 **Warning**: `~bob` and `~bob/` are not yet handled correctly.

 See also:

 * [getHomeDir proc](#getHomeDir)
* [getConfigDir proc](#getConfigDir)
* [getTempDir proc](#getTempDir)
* [getCurrentDir proc](#getCurrentDir)
* [setCurrentDir proc](#setCurrentDir,string)

 **Example:**

 
```
assert expandTilde("~" / "appname.cfg") == getHomeDir() / "appname.cfg"
assert expandTilde("~/foo/bar") == getHomeDir() / "foo/bar"
assert expandTilde("/foo/bar") == "/foo/bar"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L960)  
```
proc quoteShellWindows(s: string): string {...}{.noSideEffect, gcsafe,
    extern: "nosp$1", raises: [], tags: [].}
```
  Quote `s`, so it can be safely passed to Windows API.

 Based on Python's `subprocess.list2cmdline`. See [this link](http://msdn.microsoft.com/en-us/library/17w5ykft.aspx) for more details.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L993) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L993)  
```
proc quoteShellPosix(s: string): string {...}{.noSideEffect, gcsafe,
    extern: "nosp$1", raises: [], tags: [].}
```
  Quote `s`, so it can be safely passed to POSIX shell. Based on Python's `pipes.quote`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1023) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1023)  
```
proc quoteShell(s: string): string {...}{.noSideEffect, gcsafe, extern: "nosp$1",
                                     raises: [], tags: [].}
```
  Quote `s`, so it can be safely passed to shell.

 When on Windows, it calls [quoteShellWindows proc](#quoteShellWindows,string). Otherwise, calls [quoteShellPosix proc](#quoteShellPosix,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1039)  
```
proc quoteShellCommand(args: openArray[string]): string {...}{.raises: [], tags: [].}
```
  Concatenates and quotes shell arguments `args`. **Example:**

 
```
when defined(posix):
  assert quoteShellCommand(["aaa", "", "c d"]) == "aaa '' 'c d'"
when defined(windows):
  assert quoteShellCommand(["aaa", "", "c d"]) == "aaa \"\" \"c d\""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1050)  
```
proc fileExists(filename: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], raises: [].}
```
  Returns true if `filename` exists and is a regular file or symlink.

 Directories, device files, named pipes and sockets return false.

 See also:

 * [dirExists proc](#dirExists,string)
* [symlinkExists proc](#symlinkExists,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1102)  
```
proc dirExists(dir: string): bool {...}{.gcsafe, extern: "nos$1",
                                    tags: [ReadDirEffect], raises: [].}
```
  Returns true if the directory `dir` exists. If `dir` is a file, false is returned. Follows symlinks.

 See also:

 * [fileExists proc](#fileExists,string)
* [symlinkExists proc](#symlinkExists,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1122)  
```
proc symlinkExists(link: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], raises: [].}
```
  Returns true if the symlink `link` exists. Will return true regardless of whether the link points to a directory or file.

 See also:

 * [fileExists proc](#fileExists,string)
* [dirExists proc](#dirExists,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1141)  
```
proc findExe(exe: string; followSymlinks: bool = true;
             extensions: openArray[string] = ExeExts): string {...}{.
    tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect], raises: [OSError].}
```
  Searches for `exe` in the current working directory and then in directories listed in the `PATH` environment variable.

 Returns `""` if the `exe` cannot be found. `exe` is added the [ExeExts](#ExeExts) file extensions if it has none.

 If the system supports symlinks it also resolves them until it meets the actual file. This behavior can be disabled if desired by setting `followSymlinks = false`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1182)  
```
proc getLastModificationTime(file: string): times.Time {...}{.gcsafe,
    extern: "nos$1", raises: [OSError], tags: [].}
```
  Returns the `file`'s last modification time.

 See also:

 * [getLastAccessTime proc](#getLastAccessTime,string)
* [getCreationTime proc](#getCreationTime,string)
* [fileNewer proc](#fileNewer,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1240)  
```
proc getLastAccessTime(file: string): times.Time {...}{.gcsafe, extern: "nos$1",
    raises: [OSError], tags: [].}
```
  Returns the `file`'s last read or write access time.

 See also:

 * [getLastModificationTime proc](#getLastModificationTime,string)
* [getCreationTime proc](#getCreationTime,string)
* [fileNewer proc](#fileNewer,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1258)  
```
proc getCreationTime(file: string): times.Time {...}{.gcsafe, extern: "nos$1",
    raises: [OSError], tags: [].}
```
  Returns the `file`'s creation time.

 **Note:** Under POSIX OS's, the returned time may actually be the time at which the file's attribute's were last modified. See [here](https://github.com/nim-lang/Nim/issues/1058) for details.

 See also:

 * [getLastModificationTime proc](#getLastModificationTime,string)
* [getLastAccessTime proc](#getLastAccessTime,string)
* [fileNewer proc](#fileNewer,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1276)  
```
proc fileNewer(a, b: string): bool {...}{.gcsafe, extern: "nos$1", raises: [OSError],
                                     tags: [].}
```
  Returns true if the file `a` is newer than file `b`, i.e. if `a`'s modification time is later than `b`'s.

 See also:

 * [getLastModificationTime proc](#getLastModificationTime,string)
* [getLastAccessTime proc](#getLastAccessTime,string)
* [getCreationTime proc](#getCreationTime,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1298)  
```
proc getCurrentDir(): string {...}{.gcsafe, extern: "nos$1", tags: [],
                               raises: [OSError].}
```
  Returns the current working directory i.e. where the built binary is run.

 So the path returned by this proc is determined at run time.

 See also:

 * [getHomeDir proc](#getHomeDir)
* [getConfigDir proc](#getConfigDir)
* [getTempDir proc](#getTempDir)
* [setCurrentDir proc](#setCurrentDir,string)
* [currentSourcePath template](system#currentSourcePath.t)
* [getProjectPath proc](macros#getProjectPath)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1316)  
```
proc setCurrentDir(newDir: string) {...}{.inline, tags: [], raises: [OSError].}
```
  Sets the current working directory; `OSError` is raised if `newDir` cannot been set.

 See also:

 * [getHomeDir proc](#getHomeDir)
* [getConfigDir proc](#getConfigDir)
* [getTempDir proc](#getTempDir)
* [getCurrentDir proc](#getCurrentDir)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1377)  
```
proc absolutePath(path: string; root = getCurrentDir()): string {...}{.
    raises: [ValueError], tags: [].}
```
  Returns the absolute path of `path`, rooted at `root` (which must be absolute; default: current directory). If `path` is absolute, return it, ignoring `root`.

 See also:

 * [normalizedPath proc](#normalizedPath,string)
* [normalizePath proc](#normalizePath,string)

 **Example:**

 
```
assert absolutePath("a") == getCurrentDir() / "a"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1396)  
```
proc normalizeExe(file: var string) {...}{.raises: [], tags: [].}
```
  on posix, prepends `./` if `file` doesn't contain `/` and is not `"", ".", ".."`. **Example:**

 
```
import sugar
when defined(posix):
  doAssert "foo".dup(normalizeExe) == "./foo"
  doAssert "foo/../bar".dup(normalizeExe) == "foo/../bar"
doAssert "".dup(normalizeExe) == ""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1416)  
```
proc normalizePath(path: var string) {...}{.gcsafe, extern: "nos$1", tags: [],
                                       raises: [].}
```
  Normalize a path.

 Consecutive directory separators are collapsed, including an initial double slash.

 On relative paths, double dot (`..`) sequences are collapsed if possible. On absolute paths they are always collapsed.

 Warning: URL-encoded and Unicode attempts at directory traversal are not detected. Triple dot is not handled.

 See also:

 * [absolutePath proc](#absolutePath,string)
* [normalizedPath proc](#normalizedPath,string) for outplace version
* [normalizeExe proc](#normalizeExe,string)

 **Example:**

 
```
when defined(posix):
  var a = "a///b//..//c///d"
  a.normalizePath()
  assert a == "a/c/d"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1428)  
```
proc normalizedPath(path: string): string {...}{.gcsafe, extern: "nos$1", tags: [],
    raises: [].}
```
  Returns a normalized path for the current OS.

 See also:

 * [absolutePath proc](#absolutePath,string)
* [normalizePath proc](#normalizePath,string) for the in-place version

 **Example:**

 
```
when defined(posix):
  assert normalizedPath("a///b//..//c///d") == "a/c/d"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1479)  
```
proc sameFile(path1, path2: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], raises: [OSError].}
```
  Returns true if both pathname arguments refer to the same physical file or directory.

 Raises `OSError` if any of the files does not exist or information about it can not be obtained.

 This proc will return true if given two alternative hard-linked or sym-linked paths to the same file or directory.

 See also:

 * [sameFileContent proc](#sameFileContent,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1510)  
```
proc sameFileContent(path1, path2: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [ReadIOEffect], raises: [IOError].}
```
  Returns true if both pathname arguments refer to files with identical binary content.

 See also:

 * [sameFile proc](#sameFile,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1555)  
```
proc getFilePermissions(filename: string): set[FilePermission] {...}{.gcsafe,
    extern: "nos$1", tags: [ReadDirEffect], raises: [OSError].}
```
  Retrieves file permissions for `filename`.

 `OSError` is raised in case of an error. On Windows, only the `readonly` flag is checked, every other permission is available in any case.

 See also:

 * [setFilePermissions proc](#setFilePermissions,string,set%5BFilePermission%5D)
* [FilePermission enum](#FilePermission)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1606)  
```
proc setFilePermissions(filename: string; permissions: set[FilePermission]) {...}{.
    gcsafe, extern: "nos$1", tags: [WriteDirEffect], raises: [OSError].}
```
  Sets the file permissions for `filename`.

 `OSError` is raised in case of an error. On Windows, only the `readonly` flag is changed, depending on `fpUserWrite` permission.

 See also:

 * [getFilePermissions](#getFilePermissions,string)
* [FilePermission enum](#FilePermission)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1644)  
```
proc copyFile(source, dest: string) {...}{.gcsafe, extern: "nos$1",
                                      tags: [ReadIOEffect, WriteIOEffect],
                                      raises: [OSError, IOError].}
```
  Copies a file from `source` to `dest`, where `dest.parentDir` must exist.

 If this fails, `OSError` is raised.

 On the Windows platform this proc will copy the source file's attributes into dest.

 On other platforms you need to use [getFilePermissions](#getFilePermissions,string) and [setFilePermissions](#setFilePermissions,string,set%5BFilePermission%5D) procs to copy them by hand (or use the convenience [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)), otherwise `dest` will inherit the default permissions of a newly created file for the user.

 If `dest` already exists, the file attributes will be preserved and the content overwritten.

 See also:

 * [copyDir proc](#copyDir,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [tryRemoveFile proc](#tryRemoveFile,string)
* [removeFile proc](#removeFile,string)
* [moveFile proc](#moveFile,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1686)  
```
proc copyFileToDir(source, dir: string) {...}{.
    raises: [ValueError, OSError, IOError], tags: [ReadIOEffect, WriteIOEffect].}
```
  Copies a file `source` into directory `dir`, which must exist. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1744)  
```
proc tryRemoveFile(file: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [WriteDirEffect], raises: [].}
```
  Removes the `file`.

 If this fails, returns `false`. This does not fail if the file never existed in the first place.

 On Windows, ignores the read-only attribute.

 See also:

 * [copyFile proc](#copyFile,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [removeFile proc](#removeFile,string)
* [moveFile proc](#moveFile,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1769)  
```
proc removeFile(file: string) {...}{.gcsafe, extern: "nos$1", tags: [WriteDirEffect],
                                raises: [OSError].}
```
  Removes the `file`.

 If this fails, `OSError` is raised. This does not fail if the file never existed in the first place.

 On Windows, ignores the read-only attribute.

 See also:

 * [removeDir proc](#removeDir,string)
* [copyFile proc](#copyFile,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [tryRemoveFile proc](#tryRemoveFile,string)
* [moveFile proc](#moveFile,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1801) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1801)  
```
proc moveFile(source, dest: string) {...}{.gcsafe, extern: "nos$1",
                                      tags: [ReadIOEffect, WriteIOEffect],
                                      raises: [OSError, IOError, Exception].}
```
  Moves a file from `source` to `dest`.

 If this fails, `OSError` is raised. If `dest` already exists, it will be overwritten.

 Can be used to rename files.

 See also:

 * [moveDir proc](#moveDir,string,string)
* [copyFile proc](#copyFile,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [removeFile proc](#removeFile,string)
* [tryRemoveFile proc](#tryRemoveFile,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1841)  
```
proc exitStatusLikeShell(status: cint): cint {...}{.raises: [], tags: [].}
```
  Converts exit code from `c_system` into a shell exit code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1867)  
```
proc execShellCmd(command: string): int {...}{.gcsafe, extern: "nos$1",
    tags: [ExecIOEffect], raises: [].}
```
  Executes a shell command.

 Command has the form 'program args' where args are the command line arguments given to program. The proc returns the error code of the shell when it has finished (zero if there is no error). The proc does not return until the process has finished.

 To execute a program without having a shell involved, use [osproc.execProcess proc](osproc#execProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D).

 **Examples:**

 
```
discard execShellCmd("ls -la")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1878) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1878)  
```
proc expandFilename(filename: string): string {...}{.gcsafe, extern: "nos$1",
    tags: [ReadDirEffect], raises: [OSError].}
```
  Returns the full (absolute) path of an existing file `filename`.

 Raises `OSError` in case of an error. Follows symlinks.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1995) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1995)  
```
proc getCurrentCompilerExe(): string {...}{.compileTime, raises: [], tags: [].}
```
  This is [getAppFilename()](#getAppFilename) at compile time.

 Can be used to retrieve the currently executing Nim compiler from a Nim or nimscript program, or the nimble binary inside a nimble program (likewise with other binaries built from compiler API).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2056) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2056)  
```
proc removeDir(dir: string; checkDir = false) {...}{.gcsafe, extern: "nos$1",
    tags: [WriteDirEffect, ReadDirEffect], gcsafe, locks: 0, raises: [OSError].}
```
  Removes the directory `dir` including all subdirectories and files in `dir` (recursively).

 If this fails, `OSError` is raised. This does not fail if the directory never existed in the first place, unless `checkDir` = true

 See also:

 * [tryRemoveFile proc](#tryRemoveFile,string)
* [removeFile proc](#removeFile,string)
* [existsOrCreateDir proc](#existsOrCreateDir,string)
* [createDir proc](#createDir,string)
* [copyDir proc](#copyDir,string,string)
* [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)
* [moveDir proc](#moveDir,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2243)  
```
proc existsOrCreateDir(dir: string): bool {...}{.gcsafe, extern: "nos$1",
    tags: [WriteDirEffect, ReadDirEffect], raises: [OSError, IOError].}
```
  Check if a directory `dir` exists, and create it otherwise.

 Does not create parent directories (fails if parent does not exist). Returns `true` if the directory already exists, and `false` otherwise.

 See also:

 * [removeDir proc](#removeDir,string)
* [createDir proc](#createDir,string)
* [copyDir proc](#copyDir,string,string)
* [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)
* [moveDir proc](#moveDir,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2312)  
```
proc createDir(dir: string) {...}{.gcsafe, extern: "nos$1",
                              tags: [WriteDirEffect, ReadDirEffect],
                              raises: [OSError, IOError].}
```
  Creates the directory `dir`.

 The directory may contain several subdirectories that do not exist yet. The full path is created. If this fails, `OSError` is raised.

 It does **not** fail if the directory already exists because for most usages this does not indicate an error.

 See also:

 * [removeDir proc](#removeDir,string)
* [existsOrCreateDir proc](#existsOrCreateDir,string)
* [copyDir proc](#copyDir,string,string)
* [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)
* [moveDir proc](#moveDir,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2332)  
```
proc copyDir(source, dest: string) {...}{.gcsafe, extern: "nos$1",
                                     tags: [WriteIOEffect, ReadIOEffect],
                                     gcsafe, locks: 0,
                                     raises: [OSError, IOError].}
```
  Copies a directory from `source` to `dest`.

 If this fails, `OSError` is raised.

 On the Windows platform this proc will copy the attributes from `source` into `dest`.

 On other platforms created files and directories will inherit the default permissions of a newly created file/directory for the user. Use [copyDirWithPermissions proc](#copyDirWithPermissions,string,string) to preserve attributes recursively on these platforms.

 See also:

 * [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)
* [copyFile proc](#copyFile,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [removeDir proc](#removeDir,string)
* [existsOrCreateDir proc](#existsOrCreateDir,string)
* [createDir proc](#createDir,string)
* [moveDir proc](#moveDir,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2363)  
```
proc moveDir(source, dest: string) {...}{.tags: [ReadIOEffect, WriteIOEffect],
                                     raises: [OSError, IOError].}
```
  Moves a directory from `source` to `dest`.

 If this fails, `OSError` is raised.

 See also:

 * [moveFile proc](#moveFile,string,string)
* [copyDir proc](#copyDir,string,string)
* [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)
* [removeDir proc](#removeDir,string)
* [existsOrCreateDir proc](#existsOrCreateDir,string)
* [createDir proc](#createDir,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2395)  
```
proc createSymlink(src, dest: string) {...}{.raises: [OSError], tags: [].}
```
  Create a symbolic link at `dest` which points to the item specified by `src`. On most operating systems, will fail if a link already exists.

 **Warning**: Some OS's (such as Microsoft Windows) restrict the creation of symlinks to root users (administrators).

 See also:

 * [createHardlink proc](#createHardlink,string,string)
* [expandSymlink proc](#expandSymlink,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2413)  
```
proc createHardlink(src, dest: string) {...}{.raises: [OSError], tags: [].}
```
  Create a hard link at `dest` which points to the item specified by `src`.

 **Warning**: Some OS's restrict the creation of hard links to root users (administrators).

 See also:

 * [createSymlink proc](#createSymlink,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2441)  
```
proc copyFileWithPermissions(source, dest: string; ignorePermissionErrors = true) {...}{.
    raises: [OSError, IOError, Exception],
    tags: [ReadIOEffect, WriteIOEffect, WriteDirEffect, ReadDirEffect].}
```
  Copies a file from `source` to `dest` preserving file permissions.

 This is a wrapper proc around [copyFile](#copyFile,string,string), [getFilePermissions](#getFilePermissions,string) and [setFilePermissions](#setFilePermissions,string,set%5BFilePermission%5D) procs on non-Windows platforms.

 On Windows this proc is just a wrapper for [copyFile proc](#copyFile,string,string) since that proc already copies attributes.

 On non-Windows systems permissions are copied after the file itself has been copied, which won't happen atomically and could lead to a race condition. If `ignorePermissionErrors` is true (default), errors while reading/setting file attributes will be ignored, otherwise will raise `OSError`.

 See also:

 * [copyFile proc](#copyFile,string,string)
* [copyDir proc](#copyDir,string,string)
* [tryRemoveFile proc](#tryRemoveFile,string)
* [removeFile proc](#removeFile,string)
* [moveFile proc](#moveFile,string,string)
* [copyDirWithPermissions proc](#copyDirWithPermissions,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2463)  
```
proc copyDirWithPermissions(source, dest: string; ignorePermissionErrors = true) {...}{.
    gcsafe, extern: "nos$1", tags: [WriteIOEffect, ReadIOEffect], gcsafe,
    locks: 0, raises: [OSError, IOError, Exception].}
```
  Copies a directory from `source` to `dest` preserving file permissions.

 If this fails, `OSError` is raised. This is a wrapper proc around [copyDir](#copyDir,string,string) and [copyFileWithPermissions](#copyFileWithPermissions,string,string) procs on non-Windows platforms.

 On Windows this proc is just a wrapper for [copyDir proc](#copyDir,string,string) since that proc already copies attributes.

 On non-Windows systems permissions are copied after the file or directory itself has been copied, which won't happen atomically and could lead to a race condition. If `ignorePermissionErrors` is true (default), errors while reading/setting file attributes will be ignored, otherwise will raise `OSError`.

 See also:

 * [copyDir proc](#copyDir,string,string)
* [copyFile proc](#copyFile,string,string)
* [copyFileWithPermissions proc](#copyFileWithPermissions,string,string)
* [removeDir proc](#removeDir,string)
* [moveDir proc](#moveDir,string,string)
* [existsOrCreateDir proc](#existsOrCreateDir,string)
* [createDir proc](#createDir,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2496)  
```
proc inclFilePermissions(filename: string; permissions: set[FilePermission]) {...}{.
    gcsafe, extern: "nos$1", tags: [ReadDirEffect, WriteDirEffect],
    raises: [OSError].}
```
  A convenience proc for:
```
setFilePermissions(filename, getFilePermissions(filename)+permissions)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2539)  
```
proc exclFilePermissions(filename: string; permissions: set[FilePermission]) {...}{.
    gcsafe, extern: "nos$1", tags: [ReadDirEffect, WriteDirEffect],
    raises: [OSError].}
```
  A convenience proc for:
```
setFilePermissions(filename, getFilePermissions(filename)-permissions)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2548)  
```
proc expandSymlink(symlinkPath: string): string {...}{.raises: [OSError], tags: [].}
```
  Returns a string representing the path to which the symbolic link points.

 On Windows this is a noop, `symlinkPath` is simply returned.

 See also:

 * [createSymlink proc](#createSymlink,string,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2557)  
```
proc parseCmdLine(c: string): seq[string] {...}{.noSideEffect, gcsafe,
    extern: "nos$1", raises: [], tags: [].}
```
  Splits a command line into several components.

 **Note**: This proc is only occasionally useful, better use the [parseopt module](parseopt).

 On Windows, it uses the [following parsing rules](http://msdn.microsoft.com/en-us/library/17w5ykft.aspx):

 * Arguments are delimited by white space, which is either a space or a tab.
* The caret character (^) is not recognized as an escape character or delimiter. The character is handled completely by the command-line parser in the operating system before being passed to the argv array in the program.
* A string surrounded by double quotation marks ("string") is interpreted as a single argument, regardless of white space contained within. A quoted string can be embedded in an argument.
* A double quotation mark preceded by a backslash (") is interpreted as a literal double quotation mark character (").
* Backslashes are interpreted literally, unless they immediately precede a double quotation mark.
* If an even number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is interpreted as a string delimiter.
* If an odd number of backslashes is followed by a double quotation mark, one backslash is placed in the argv array for every pair of backslashes, and the double quotation mark is "escaped" by the remaining backslash, causing a literal double quotation mark (") to be placed in argv.

 On Posix systems, it uses the following parsing rules: Components are separated by whitespace unless the whitespace occurs within `"` or `'` quotes.

 See also:

 * [parseopt module](parseopt)
* [paramCount proc](#paramCount)
* [paramStr proc](#paramStr,int)
* [commandLineParams proc](#commandLineParams)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2576)  
```
proc paramCount(): int {...}{.tags: [ReadIOEffect], raises: [].}
```
  Returns the number of command line arguments given to the application.

 Unlike argc in C, if your binary was called without parameters this will return zero. You can query each individual parameter with [paramStr proc](#paramStr,int) or retrieve all of them in one go with [commandLineParams proc](#commandLineParams).

 **Availability**: When generating a dynamic library (see `--app:lib`) on Posix this proc is not defined. Test for availability using [declared()](system#declared,untyped).

 See also:

 * [parseopt module](parseopt)
* [parseCmdLine proc](#parseCmdLine,string)
* [paramStr proc](#paramStr,int)
* [commandLineParams proc](#commandLineParams)

 **Examples:**

 
```
when declared(paramCount):
  # Use paramCount() here
else:
  # Do something else!
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2675)  
```
proc paramStr(i: int): TaintedString {...}{.tags: [ReadIOEffect], raises: [].}
```
  Returns the `i`-th command line argument given to the application.

 `i` should be in the range `1..paramCount()`, the `IndexDefect` exception will be raised for invalid values. Instead of iterating over [paramCount()](#paramCount) with this proc you can call the convenience [commandLineParams()](#commandLineParams).

 Similarly to argv in C, it is possible to call `paramStr(0)` but this will return OS specific contents (usually the name of the invoked executable). You should avoid this and call [getAppFilename()](#getAppFilename) instead.

 **Availability**: When generating a dynamic library (see `--app:lib`) on Posix this proc is not defined. Test for availability using [declared()](system#declared,untyped).

 See also:

 * [parseopt module](parseopt)
* [parseCmdLine proc](#parseCmdLine,string)
* [paramCount proc](#paramCount)
* [commandLineParams proc](#commandLineParams)
* [getAppFilename proc](#getAppFilename)

 **Examples:**

 
```
when declared(paramStr):
  # Use paramStr() here
else:
  # Do something else!
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2703)  
```
proc commandLineParams(): seq[TaintedString] {...}{.raises: [], tags: [ReadIOEffect].}
```
  Convenience proc which returns the command line parameters.

 This returns **only** the parameters. If you want to get the application executable filename, call [getAppFilename()](#getAppFilename).

 **Availability**: On Posix there is no portable way to get the command line from a DLL and thus the proc isn't defined in this environment. You can test for its availability with [declared()](system#declared,untyped).

 See also:

 * [parseopt module](parseopt)
* [parseCmdLine proc](#parseCmdLine,string)
* [paramCount proc](#paramCount)
* [paramStr proc](#paramStr,int)
* [getAppFilename proc](#getAppFilename)

 **Examples:**

 
```
when declared(commandLineParams):
  # Use commandLineParams() here
else:
  # Do something else!
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2793) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2793)  
```
proc getAppFilename(): string {...}{.gcsafe, extern: "nos$1", tags: [ReadIOEffect],
                                raises: [].}
```
  Returns the filename of the application's executable. This proc will resolve symlinks.

 See also:

 * [getAppDir proc](#getAppDir)
* [getCurrentCompilerExe proc](#getCurrentCompilerExe)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2954) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2954)  
```
proc getAppDir(): string {...}{.gcsafe, extern: "nos$1", tags: [ReadIOEffect],
                           raises: [].}
```
  Returns the directory of the application's executable.

 See also:

 * [getAppFilename proc](#getAppFilename)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3020) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3020)  
```
proc sleep(milsecs: int) {...}{.gcsafe, extern: "nos$1", tags: [TimeEffect],
                           raises: [].}
```
  Sleeps `milsecs` milliseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3027) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3027)  
```
proc getFileSize(file: string): BiggestInt {...}{.gcsafe, extern: "nos$1",
    tags: [ReadIOEffect], raises: [IOError, OSError].}
```
  Returns the file size of `file` (in bytes). `OSError` is raised in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3037) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3037)  
```
proc getFileInfo(handle: FileHandle): FileInfo {...}{.raises: [OSError], tags: [].}
```
  Retrieves file information for the file object represented by the given handle.

 If the information cannot be retrieved, such as when the file handle is invalid, `OSError` is raised.

 See also:

 * [getFileInfo(file) proc](#getFileInfo,File)
* [getFileInfo(path) proc](#getFileInfo,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3148)  
```
proc getFileInfo(file: File): FileInfo {...}{.raises: [IOError, OSError], tags: [].}
```
  Retrieves file information for the file object.

 See also:

 * [getFileInfo(handle) proc](#getFileInfo,FileHandle)
* [getFileInfo(path) proc](#getFileInfo,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3174)  
```
proc getFileInfo(path: string; followSymlink = true): FileInfo {...}{.
    raises: [OSError], tags: [].}
```
  Retrieves file information for the file object pointed to by `path`.

 Due to intrinsic differences between operating systems, the information contained by the returned [FileInfo object](#FileInfo) will be slightly different across platforms, and in some cases, incomplete or inaccurate.

 When `followSymlink` is true (default), symlinks are followed and the information retrieved is information related to the symlink's target. Otherwise, information on the symlink itself is retrieved.

 If the information cannot be retrieved, such as when the path doesn't exist, or when permission restrictions prevent the program from retrieving file information, `OSError` is raised.

 See also:

 * [getFileInfo(handle) proc](#getFileInfo,FileHandle)
* [getFileInfo(file) proc](#getFileInfo,File)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3184)  
```
proc isHidden(path: string): bool {...}{.raises: [], tags: [].}
```
  Determines whether `path` is hidden or not, using [this reference](https://en.wikipedia.org/wiki/Hidden_file_and_hidden_directory).

 On Windows: returns true if it exists and its "hidden" attribute is set.

 On posix: returns true if `lastPathPart(path)` starts with `.` and is not `.` or `..`.

 **Note**: paths are not normalized to determine `isHidden`.

 **Example:**

 
```
when defined(posix):
  assert ".foo".isHidden
  assert not ".foo/bar".isHidden
  assert not ".".isHidden
  assert not "..".isHidden
  assert not "".isHidden
  assert ".foo/".isHidden
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3222)  
```
proc getCurrentProcessId(): int {...}{.raises: [], tags: [].}
```
  Return current process ID.

 See also:

 * [osproc.processID(p: Process)](osproc#processID,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3252)  
```
proc setLastModificationTime(file: string; t: times.Time) {...}{.raises: [OSError],
    tags: [].}
```
  Sets the `file`'s last modification time. `OSError` is raised in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3264)   Funcs
-----

  
```
func isValidFilename(filename: string; maxLen = 259.Positive): bool {...}{.
    raises: [], tags: [].}
```
  Returns true if `filename` is valid for crossplatform use.

 This is useful if you want to copy or save files across Windows, Linux, Mac, etc. You can pass full paths as argument too, but func only checks filenames. It uses `invalidFilenameChars`, `invalidFilenames` and `maxLen` to verify the specified `filename`.

 
```
assert not isValidFilename(" foo")    ## Leading white space
assert not isValidFilename("foo ")    ## Trailing white space
assert not isValidFilename("foo.")    ## Ends with Dot
assert not isValidFilename("con.txt") ## "CON" is invalid (Windows)
assert not isValidFilename("OwO:UwU") ## ":" is invalid (Mac)
assert not isValidFilename("aux.bat") ## "AUX" is invalid (Windows)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L3281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L3281)   Iterators
---------

  
```
iterator parentDirs(path: string; fromRoot = false; inclusive = true): string {...}{.
    raises: [], tags: [].}
```
  Walks over all parent directories of a given `path`.

 If `fromRoot` is true (default: false), the traversal will start from the file system root directory. If `inclusive` is true (default), the original argument will be included in the traversal.

 Relative paths won't be expanded by this iterator. Instead, it will traverse only the directories appearing in the relative path.

 See also:

 * [parentDir proc](#parentDir,string)

 **Examples:**

 
```
let g = "a/b/c"

for p in g.parentDirs:
  echo p
# a/b/c
# a/b
# a

for p in g.parentDirs(fromRoot=true):
  echo p
# a/
# a/b/
# a/b/c

for p in g.parentDirs(inclusive=false):
  echo p
# a/b
# a
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L560)  
```
iterator envPairs(): tuple[key, value: TaintedString] {...}{.tags: [ReadEnvEffect],
    raises: [].}
```
  Iterate over all environments variables.

 In the first component of the tuple is the name of the current variable stored, in the second its value.

 See also:

 * [getEnv proc](#getEnv,string,string)
* [existsEnv proc](#existsEnv,string)
* [putEnv proc](#putEnv,string,string)
* [delEnv proc](#delEnv,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/includes/osenv.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/includes/osenv.nim#L215)  
```
iterator walkPattern(pattern: string): string {...}{.tags: [ReadDirEffect],
    raises: [].}
```
  Iterate over all the files and directories that match the `pattern`.

 On POSIX this uses the glob call. `pattern` is OS dependent, but at least the `"*.ext"` notation is supported.

 See also:

 * [walkFiles iterator](#walkFiles.i,string)
* [walkDirs iterator](#walkDirs.i,string)
* [walkDir iterator](#walkDir.i,string)
* [walkDirRec iterator](#walkDirRec.i,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1953) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1953)  
```
iterator walkFiles(pattern: string): string {...}{.tags: [ReadDirEffect], raises: [].}
```
  Iterate over all the files that match the `pattern`.

 On POSIX this uses the glob call. `pattern` is OS dependent, but at least the `"*.ext"` notation is supported.

 See also:

 * [walkPattern iterator](#walkPattern.i,string)
* [walkDirs iterator](#walkDirs.i,string)
* [walkDir iterator](#walkDir.i,string)
* [walkDirRec iterator](#walkDirRec.i,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1967) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1967)  
```
iterator walkDirs(pattern: string): string {...}{.tags: [ReadDirEffect], raises: [].}
```
  Iterate over all the directories that match the `pattern`.

 On POSIX this uses the glob call. `pattern` is OS dependent, but at least the `"*.ext"` notation is supported.

 See also:

 * [walkPattern iterator](#walkPattern.i,string)
* [walkFiles iterator](#walkFiles.i,string)
* [walkDir iterator](#walkDir.i,string)
* [walkDirRec iterator](#walkDirRec.i,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1981) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1981)  
```
iterator walkDir(dir: string; relative = false; checkDir = false): tuple[
    kind: PathComponent, path: string] {...}{.tags: [ReadDirEffect],
    raises: [OSError].}
```
  Walks over the directory `dir` and yields for each directory or file in `dir`. The component type and full path for each item are returned.

 Walking is not recursive. If `relative` is true (default: false) the resulting path is shortened to be relative to `dir`. Example: This directory structure:



```
dirA / dirB / fileB1.txt
     / dirC
     / fileA1.txt
     / fileA2.txt
```
 and this code:

 
```
for kind, path in walkDir("dirA"):
  echo(path)
```

produce this output (but not necessarily in this order!):



```
dirA/dirB
dirA/dirC
dirA/fileA1.txt
dirA/fileA2.txt
```
 See also:

 * [walkPattern iterator](#walkPattern.i,string)
* [walkFiles iterator](#walkFiles.i,string)
* [walkDirs iterator](#walkDirs.i,string)
* [walkDirRec iterator](#walkDirRec.i,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2078) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2078)  
```
iterator walkDirRec(dir: string; yieldFilter = {pcFile}; followFilter = {pcDir};
                    relative = false; checkDir = false): string {...}{.
    tags: [ReadDirEffect], raises: [OSError].}
```
  Recursively walks over the directory `dir` and yields for each file or directory in `dir`.

 If `relative` is true (default: false) the resulting path is shortened to be relative to `dir`, otherwise the full path is returned.

 **Warning**: Modifying the directory structure while the iterator is traversing may result in undefined behavior!

 Walking is recursive. `followFilter` controls the behaviour of the iterator:

 

| yieldFilter | meaning |
| --- | --- |
| `pcFile` | yield real files (default) |
| `pcLinkToFile` | yield symbolic links to files |
| `pcDir` | yield real directories |
| `pcLinkToDir` | yield symbolic links to directories |




| followFilter | meaning |
| --- | --- |
| `pcDir` | follow real directories (default) |
| `pcLinkToDir` | follow symbolic links to directories |


See also:

 * [walkPattern iterator](#walkPattern.i,string)
* [walkFiles iterator](#walkFiles.i,string)
* [walkDirs iterator](#walkDirs.i,string)
* [walkDir iterator](#walkDir.i,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L2176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L2176)   Templates
---------

  
```
template existsFile(args: varargs[untyped]): untyped {...}{.
    deprecated: "use fileExists".}
```
   **Deprecated:** use fileExists  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1164)  
```
template existsDir(args: varargs[untyped]): untyped {...}{.
    deprecated: "use dirExists".}
```
   **Deprecated:** use dirExists  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/os.nim#L1166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/os.nim#L1166)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/os.html>

osproc
======


This module implements an advanced facility for executing OS processes and process communication.

 **See also:**

 * [os module](os)
* [streams module](streams)
* [memfiles module](memfiles)

 Imports
-------

  <strutils>, <os>, <strtabs>, <streams>, <cpuinfo>, <streamwrapper>, <since>, <posix>, <times>  Types
-----

  
```
ProcessOption = enum
  poEchoCmd,                ## Echo the command before execution.
  poUsePath, ## Asks system to search for executable using PATH environment
              ## variable.
              ## On Windows, this is the default.
  poEvalCommand, ## Pass `command` directly to the shell, without quoting.
                  ## Use it only if `command` comes from trusted source.
  poStdErrToStdOut,         ## Merge stdout and stderr to the stdout stream.
  poParentStreams,          ## Use the parent's streams.
  poInteractive, ## Optimize the buffer handling for responsiveness for
                  ## UI applications. Currently this only affects
                  ## Windows: Named pipes are used so that you can peek
                  ## at the process' output streams.
  poDaemon                   ## Windows: The program creates no Window.
                             ## Unix: Start the program as a daemon. This is still
                             ## work in progress!
```
  Options that can be passed to [startProcess proc](#startProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L35)  
```
Process = ref ProcessObj
```
  Represents an operating system process. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L67)   Consts
------

  
```
poDemon = poDaemon
```
  Nim versions before 0.20 used the wrong spelling ("demon"). Now `ProcessOption` uses the correct spelling ("daemon"), and this is needed just for backward compatibility. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L69)   Procs
-----

  
```
proc processID(p: Process): int {...}{.gcsafe, extern: "nosp$1", raises: [], tags: [].}
```
  Returns `p`'s process ID.

 See also:

 * [os.getCurrentProcessId proc](os#getCurrentProcessId)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L205)  
```
proc inputHandle(p: Process): FileHandle {...}{.gcsafe, extern: "nosp$1", tags: [],
    raises: [].}
```
  Returns `p`'s input file handle for writing to.

 **WARNING**: The returned `FileHandle` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [outputHandle proc](#outputHandle,Process)
* [errorHandle proc](#errorHandle,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L290)  
```
proc outputHandle(p: Process): FileHandle {...}{.gcsafe, extern: "nosp$1", tags: [],
    raises: [].}
```
  Returns `p`'s output file handle for reading from.

 **WARNING**: The returned `FileHandle` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [inputHandle proc](#inputHandle,Process)
* [errorHandle proc](#errorHandle,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L302)  
```
proc errorHandle(p: Process): FileHandle {...}{.gcsafe, extern: "nosp$1", tags: [],
    raises: [].}
```
  Returns `p`'s error file handle for reading from.

 **WARNING**: The returned `FileHandle` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [inputHandle proc](#inputHandle,Process)
* [outputHandle proc](#outputHandle,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L314)  
```
proc countProcessors(): int {...}{.gcsafe, extern: "nosp$1", raises: [], tags: [].}
```
  Returns the number of the processors/cores the machine has. Returns 0 if it cannot be detected. It is implemented just calling `cpuinfo.countProcessors`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L326)  
```
proc execProcesses(cmds: openArray[string];
                   options = {poStdErrToStdOut, poParentStreams};
                   n = countProcessors(); beforeRunEvent: proc (idx: int) = nil;
                   afterRunEvent: proc (idx: int; p: Process) = nil): int {...}{.
    gcsafe, extern: "nosp$1",
    tags: [ExecIOEffect, TimeEffect, ReadEnvEffect, RootEffect],
    raises: [Exception, OSError].}
```
  Executes the commands `cmds` in parallel. Creates `n` processes that execute in parallel.

 The highest (absolute) return value of all processes is returned. Runs `beforeRunEvent` before running each command.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L332)  
```
proc readLines(p: Process): (seq[string], int) {...}{.
    raises: [Exception, IOError, OSError], tags: [ReadIOEffect].}
```
  Convenience function for working with `startProcess` to read data from a background process.

 See also:

 * [lines iterator](#lines.i,Process)

 Example:

 
```
const opts = {poUsePath, poDaemon, poStdErrToStdOut}
var ps: seq[Process]
for prog in ["a", "b"]: # run 2 progs in parallel
  ps.add startProcess("nim", "", ["r", prog], nil, opts)
for p in ps:
  let (lines, exCode) = p.readLines
  if exCode != 0:
    for line in lines: echo line
  p.close
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L478)  
```
proc execProcess(command: string; workingDir: string = "";
                 args: openArray[string] = []; env: StringTableRef = nil;
    options: set[ProcessOption] = {poStdErrToStdOut, poUsePath, poEvalCommand}): TaintedString {...}{.
    gcsafe, extern: "nosp$1", tags: [ExecIOEffect, ReadIOEffect, RootEffect],
    raises: [Exception, IOError, OSError].}
```
  A convenience procedure that executes `command` with `startProcess` and returns its output as a string.

 **WARNING:** This function uses `poEvalCommand` by default for backwards compatibility. Make sure to pass options explicitly.

 See also:

 * [startProcess proc](#startProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)
* [execProcesses proc](#execProcesses,openArray%5Bstring%5D,proc(int),proc(int,Process))
* [execCmd proc](#execCmd,string)

 Example:

 
```
let outp = execProcess("nim", args=["c", "-r", "mytestfile.nim"], options={poUsePath})
let outp_shell = execProcess("nim c -r mytestfile.nim")
# Note: outp may have an interleave of text from the nim compile
# and any output from mytestfile when it runs
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L501)  
```
proc startProcess(command: string; workingDir: string = "";
                  args: openArray[string] = []; env: StringTableRef = nil;
                  options: set[ProcessOption] = {poStdErrToStdOut}): owned(
    Process) {...}{.gcsafe, extern: "nosp$1",
               tags: [ExecIOEffect, ReadEnvEffect, RootEffect],
               raises: [OSError, Exception].}
```
  Starts a process. `Command` is the executable file, `workingDir` is the process's working directory. If `workingDir == ""` the current directory is used (default). `args` are the command line arguments that are passed to the process. On many operating systems, the first command line argument is the name of the executable. `args` should *not* contain this argument! `env` is the environment that will be passed to the process. If `env == nil` (default) the environment is inherited of the parent process. `options` are additional flags that may be passed to `startProcess`. See the documentation of [ProcessOption](#ProcessOption) for the meaning of these flags.

 You need to [close](#close,Process) the process when done.

 Note that you can't pass any `args` if you use the option `poEvalCommand`, which invokes the system shell to run the specified `command`. In this situation you have to concatenate manually the contents of `args` to `command` carefully escaping/quoting any special characters, since it will be passed *as is* to the system shell. Each system/shell may feature different escaping rules, so try to avoid this kind of shell invocation if possible as it leads to non portable software.

 Return value: The newly created process object. Nil is never returned, but `OSError` is raised in case of an error.

 See also:

 * [execProcesses proc](#execProcesses,openArray%5Bstring%5D,proc(int),proc(int,Process))
* [execProcess proc](#execProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)
* [execCmd proc](#execCmd,string)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L960)  
```
proc close(p: Process) {...}{.gcsafe, extern: "nosp$1", tags: [WriteIOEffect],
                         raises: [Exception, IOError, OSError].}
```
  When the process has finished executing, cleanup related handles.

 **WARNING:** If the process has not finished executing, this will forcibly terminate the process. Doing so may result in zombie processes and [pty leaks](http://stackoverflow.com/questions/27021641/how-to-fix-request-failed-on-channel-0).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1184)  
```
proc suspend(p: Process) {...}{.gcsafe, extern: "nosp$1", tags: [], raises: [OSError].}
```
  Suspends the process `p`.

 See also:

 * [resume proc](#resume,Process)
* [terminate proc](#terminate,Process)
* [kill proc](#kill,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1201)  
```
proc resume(p: Process) {...}{.gcsafe, extern: "nosp$1", tags: [], raises: [OSError].}
```
  Resumes the process `p`.

 See also:

 * [suspend proc](#suspend,Process)
* [terminate proc](#terminate,Process)
* [kill proc](#kill,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1204)  
```
proc running(p: Process): bool {...}{.gcsafe, extern: "nosp$1", tags: [],
                                 raises: [OSError].}
```
  Returns true if the process `p` is still running. Returns immediately. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1207)  
```
proc terminate(p: Process) {...}{.gcsafe, extern: "nosp$1", tags: [],
                             raises: [OSError].}
```
  Stop the process `p`.

 On Posix OSes the procedure sends `SIGTERM` to the process. On Windows the Win32 API function `TerminateProcess()` is called to stop the process.

 See also:

 * [suspend proc](#suspend,Process)
* [resume proc](#resume,Process)
* [kill proc](#kill,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1225)  
```
proc kill(p: Process) {...}{.gcsafe, extern: "nosp$1", tags: [], raises: [OSError].}
```
  Kill the process `p`.

 On Posix OSes the procedure sends `SIGKILL` to the process. On Windows `kill` is simply an alias for [terminate()](#terminate,Process).

 See also:

 * [suspend proc](#suspend,Process)
* [resume proc](#resume,Process)
* [terminate proc](#terminate,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1229)  
```
proc waitForExit(p: Process; timeout: int = -1): int {...}{.gcsafe, extern: "nosp$1",
    tags: [], raises: [OSError, OSError, ValueError].}
```
  Waits for the process to finish and returns `p`'s error code.

 **WARNING**: Be careful when using `waitForExit` for processes created without `poParentStreams` because they may fill output buffers, causing deadlock.

 On posix, if the process has exited because of a signal, 128 + signal number will be returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1362)  
```
proc peekExitCode(p: Process): int {...}{.gcsafe, extern: "nosp$1", tags: [],
                                     raises: [].}
```
  Return `-1` if the process is still running. Otherwise the process' exit code.

 On posix, if the process has exited because of a signal, 128 + signal number will be returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1468)  
```
proc inputStream(p: Process): Stream {...}{.gcsafe, extern: "nosp$1", tags: [],
                                       raises: [OSError].}
```
  Returns `p`'s input stream for writing to.

 **WARNING**: The returned `Stream` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [outputStream proc](#outputStream,Process)
* [errorStream proc](#errorStream,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1487)  
```
proc outputStream(p: Process): Stream {...}{.gcsafe, extern: "nosp$1", tags: [],
                                        raises: [OSError].}
```
  Returns `p`'s output stream for reading from.

 You cannot perform peek/write/setOption operations to this stream. Use [peekableOutputStream proc](#peekableOutputStream,Process) if you need to peek stream.

 **WARNING**: The returned `Stream` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [inputStream proc](#inputStream,Process)
* [errorStream proc](#errorStream,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1493)  
```
proc errorStream(p: Process): Stream {...}{.gcsafe, extern: "nosp$1", tags: [],
                                       raises: [OSError].}
```
  Returns `p`'s error stream for reading from.

 You cannot perform peek/write/setOption operations to this stream. Use [peekableErrorStream proc](#peekableErrorStream,Process) if you need to peek stream.

 **WARNING**: The returned `Stream` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [inputStream proc](#inputStream,Process)
* [outputStream proc](#outputStream,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1499)  
```
proc peekableOutputStream(p: Process): Stream {...}{.gcsafe, extern: "nosp$1",
    tags: [], raises: [OSError].}
```
  Returns `p`'s output stream for reading from.

 You can peek returned stream.

 **WARNING**: The returned `Stream` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [outputStream proc](#outputStream,Process)
* [peekableErrorStream proc](#peekableErrorStream,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1505)  
```
proc peekableErrorStream(p: Process): Stream {...}{.gcsafe, extern: "nosp$1",
    tags: [], raises: [OSError].}
```
  Returns `p`'s error stream for reading from.

 You can run peek operation to returned stream.

 **WARNING**: The returned `Stream` should not be closed manually as it is closed when closing the Process `p`.

 See also:

 * [errorStream proc](#errorStream,Process)
* [peekableOutputStream proc](#peekableOutputStream,Process)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1511)  
```
proc execCmd(command: string): int {...}{.gcsafe, extern: "nosp$1", tags: [
    ExecIOEffect, ReadIOEffect, RootEffect], raises: [].}
```
  Executes `command` and returns its error code.

 Standard input, output, error streams are inherited from the calling process. This operation is also often called system.

 See also:

 * [execCmdEx proc](#execCmdEx,string,set%5BProcessOption%5D)
* [startProcess proc](#startProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)
* [execProcess proc](#execProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)

 Example:

 
```
let errC = execCmd("nim c -r mytestfile.nim")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1520)  
```
proc hasData(p: Process): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1560)  
```
proc execCmdEx(command: string;
               options: set[ProcessOption] = {poStdErrToStdOut, poUsePath};
               env: StringTableRef = nil; workingDir = ""; input = ""): tuple[
    output: TaintedString, exitCode: int] {...}{.
    tags: [ExecIOEffect, ReadIOEffect, RootEffect], gcsafe,
    raises: [OSError, Exception, IOError].}
```
  A convenience proc that runs the `command`, and returns its `output` and `exitCode`. `env` and `workingDir` params behave as for `startProcess`. If `input.len > 0`, it is passed as stdin.

 Note: this could block if `input.len` is greater than your OS's maximum pipe buffer size.

 See also:

 * [execCmd proc](#execCmd,string)
* [startProcess proc](#startProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)
* [execProcess proc](#execProcess,string,string,openArray%5Bstring%5D,StringTableRef,set%5BProcessOption%5D)

 Example:

 
```
var result = execCmdEx("nim r --hints:off -", options = {}, input = "echo 3*4")
import strutils, strtabs
stripLineEnd(result[0]) ## portable way to remove trailing newline, if any
doAssert result == ("12", 0)
doAssert execCmdEx("ls --nonexistant").exitCode != 0
when defined(posix):
  assert execCmdEx("echo $FO", env = newStringTable({"FO": "B"})) == ("B\n", 0)
  assert execCmdEx("echo $PWD", workingDir = "/") == ("/\n", 0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L1570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L1570)   Iterators
---------

  
```
iterator lines(p: Process): string {...}{.tags: [ReadIOEffect],
                                     raises: [Exception, IOError, OSError].}
```
  Convenience iterator for working with `startProcess` to read data from a background process.

 See also:

 * [readLines proc](#readLines,Process)

 Example:

 
```
const opts = {poUsePath, poDaemon, poStdErrToStdOut}
var ps: seq[Process]
for prog in ["a", "b"]: # run 2 progs in parallel
  ps.add startProcess("nim", "", ["r", prog], nil, opts)
for p in ps:
  var i = 0
  for line in p.lines:
    echo line
    i.inc
    if i > 100: break
  p.close
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/osproc.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/osproc.nim#L449)   Exports
-------

  [quoteShell](os#quoteShell,string), [quoteShellWindows](os#quoteShellWindows,string), [quoteShellPosix](os#quoteShellPosix,string) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/osproc.html>

streams
=======


This module provides a stream interface and two implementations thereof: the [FileStream](#FileStream) and the [StringStream](#StringStream) which implement the stream interface for Nim file objects (`File`) and strings.

 Other modules may provide other implementations for this standard stream interface.

 Basic usage
-----------


The basic flow of using this module is:

 1. Open input stream
2. Read or write stream
3. Close stream

 ### StringStream example



```
import streams

var strm = newStringStream("""The first line
the second line
the third line""")

var line = ""

while strm.readLine(line):
  echo line

# Output:
# The first line
# the second line
# the third line

strm.close()
```
 ### FileStream example


Write file stream example:

 
```
import streams

var strm = newFileStream("somefile.txt", fmWrite)
var line = ""

if not isNil(strm):
  strm.writeLine("The first line")
  strm.writeLine("the second line")
  strm.writeLine("the third line")
  strm.close()

# Output (somefile.txt):
# The first line
# the second line
# the third line
```

Read file stream example:

 
```
import streams

var strm = newFileStream("somefile.txt", fmRead)
var line = ""

if not isNil(strm):
  while strm.readLine(line):
    echo line
  strm.close()

# Output:
# The first line
# the second line
# the third line
```
 See also
--------


* [asyncstreams module](asyncstreams)
* [io module](io) for [FileMode enum](io#FileMode)

 Imports
-------

  <since>  Types
-----

  
```
Stream = ref StreamObj
```
  All procedures of this module use this type. Procedures don't directly use [StreamObj](#StreamObj). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L106)  
```
StreamObj = object of RootObj
  closeImpl*: proc (s: Stream) {...}{.nimcall, raises: [Exception, IOError, OSError],
                                 tags: [WriteIOEffect], gcsafe.}
  atEndImpl*: proc (s: Stream): bool {...}{.nimcall,
                                       raises: [Defect, IOError, OSError],
                                       tags: [], gcsafe.}
  setPositionImpl*: proc (s: Stream; pos: int) {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [], gcsafe.}
  getPositionImpl*: proc (s: Stream): int {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [], gcsafe.}
  readDataStrImpl*: proc (s: Stream; buffer: var string; slice: Slice[int]): int {...}{.
      nimcall, raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
  readLineImpl*: proc (s: Stream; line: var TaintedString): bool {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
  readDataImpl*: proc (s: Stream; buffer: pointer; bufLen: int): int {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
  peekDataImpl*: proc (s: Stream; buffer: pointer; bufLen: int): int {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [ReadIOEffect], gcsafe.}
  writeDataImpl*: proc (s: Stream; buffer: pointer; bufLen: int) {...}{.nimcall,
      raises: [Defect, IOError, OSError], tags: [WriteIOEffect], gcsafe.}
  flushImpl*: proc (s: Stream) {...}{.nimcall, raises: [Defect, IOError, OSError],
                                 tags: [WriteIOEffect], gcsafe.}
```
  Stream interface that supports writing or reading.

 **Note:**

 * That these fields here shouldn't be used directly. They are accessible so that a stream implementation can override them.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L109)  
```
StringStream = ref StringStreamObj
```
  A stream that encapsulates a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1129)  
```
StringStreamObj = object of StreamObj
  data*: string              ## A string data.
                             ## This is updated when called `writeLine` etc.
  pos: int
```
  A string stream object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1131)  
```
FileStream = ref FileStreamObj
```
  A stream that encapsulates a `File`.

 **Note:** Not available for JS backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1302)  
```
FileStreamObj = object of Stream
  f: File
```
  A file stream object.

 **Note:** Not available for JS backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1306)   Procs
-----

  
```
proc flush(s: Stream) {...}{.raises: [IOError, OSError], tags: [WriteIOEffect].}
```
  Flushes the buffers that the stream `s` might use.

 This procedure causes any unwritten data for that stream to be delivered to the host environment to be written to the file.

 See also:

 * [close proc](#close,Stream)

 **Example:**

 
```
from os import removeFile

var strm = newFileStream("somefile.txt", fmWrite)

doAssert "Before write:" & readFile("somefile.txt") == "Before write:"
strm.write("hello")
doAssert "After  write:" & readFile("somefile.txt") == "After  write:"

strm.flush()
doAssert "After  flush:" & readFile("somefile.txt") == "After  flush:hello"
strm.write("HELLO")
strm.flush()
doAssert "After  flush:" & readFile("somefile.txt") == "After  flush:helloHELLO"

strm.close()
doAssert "After  close:" & readFile("somefile.txt") == "After  close:helloHELLO"
removeFile("somefile.txt")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L140)  
```
proc close(s: Stream) {...}{.raises: [Exception, IOError, OSError],
                        tags: [WriteIOEffect].}
```
  Closes the stream `s`.

 See also:

 * [flush proc](#flush,Stream)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
## do something...
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L169)  
```
proc atEnd(s: Stream): bool {...}{.raises: [IOError, OSError], tags: [].}
```
  Checks if more data can be read from `s`. Returns `true` if all data has been read. **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
var line = ""
doAssert strm.atEnd() == false
while strm.readLine(line):
  discard
doAssert strm.atEnd() == true
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L180)  
```
proc setPosition(s: Stream; pos: int) {...}{.raises: [IOError, OSError], tags: [].}
```
  Sets the position `pos` of the stream `s`. **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
strm.setPosition(4)
doAssert strm.readLine() == "first line"
strm.setPosition(0)
doAssert strm.readLine() == "The first line"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L194)  
```
proc getPosition(s: Stream): int {...}{.raises: [IOError, OSError], tags: [].}
```
  Retrieves the current position in the stream `s`. **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
doAssert strm.getPosition() == 0
discard strm.readLine()
doAssert strm.getPosition() == 15
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L206)  
```
proc readData(s: Stream; buffer: pointer; bufLen: int): int {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Low level proc that reads data into an untyped `buffer` of `bufLen` size.

 **JS note:** `buffer` is treated as a `ptr string` and written to between `0..<bufLen`.

 **Example:**

 
```
var strm = newStringStream("abcde")
var buffer: array[6, char]
doAssert strm.readData(addr(buffer), 1024) == 5
doAssert buffer == ['a', 'b', 'c', 'd', 'e', '\x00']
doAssert strm.atEnd() == true
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L217)  
```
proc readDataStr(s: Stream; buffer: var string; slice: Slice[int]): int {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Low level proc that reads data into a string `buffer` at `slice`. **Example:**

 
```
var strm = newStringStream("abcde")
var buffer = "12345"
doAssert strm.readDataStr(buffer, 0..3) == 4
doAssert buffer == "abcd5"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L232)  
```
proc readAll(s: Stream): string {...}{.raises: [IOError, OSError],
                                  tags: [ReadIOEffect].}
```
  Reads all available data. **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
doAssert strm.readAll() == "The first line\nthe second line\nthe third line"
doAssert strm.atEnd() == true
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L260)  
```
proc peekData(s: Stream; buffer: pointer; bufLen: int): int {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Low level proc that reads data into an untyped `buffer` of `bufLen` size without moving stream position.

 **JS note:** `buffer` is treated as a `ptr string` and written to between `0..<bufLen`.

 **Example:**

 
```
var strm = newStringStream("abcde")
var buffer: array[6, char]
doAssert strm.peekData(addr(buffer), 1024) == 5
doAssert buffer == ['a', 'b', 'c', 'd', 'e', '\x00']
doAssert strm.atEnd() == false
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L293)  
```
proc writeData(s: Stream; buffer: pointer; bufLen: int) {...}{.
    raises: [IOError, OSError], tags: [WriteIOEffect].}
```
  Low level proc that writes an untyped `buffer` of `bufLen` size to the stream `s`.

 **JS note:** `buffer` is treated as a `ptr string` and read between `0..<bufLen`.

 **Example:**

 
```
## writeData
var strm = newStringStream("")
var buffer = ['a', 'b', 'c', 'd', 'e']
strm.writeData(addr(buffer), sizeof(buffer))
doAssert strm.atEnd() == true
## readData
strm.setPosition(0)
var buffer2: array[6, char]
doAssert strm.readData(addr(buffer2), sizeof(buffer2)) == 5
doAssert buffer2 == ['a', 'b', 'c', 'd', 'e', '\x00']
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L309)  
```
proc write[T](s: Stream; x: T)
```
  Generic write procedure. Writes `x` to the stream `s`. Implementation:

 **Note:** Not available for JS backend. Use [write(Stream, string)](#write,Stream,string) for now.

 
```
s.writeData(s, unsafeAddr(x), sizeof(x))
```
 **Example:**

 
```
var strm = newStringStream("")
strm.write("abcde")
strm.setPosition(0)
doAssert strm.readAll() == "abcde"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L330)  
```
proc write(s: Stream; x: string) {...}{.raises: [IOError, OSError],
                                   tags: [WriteIOEffect].}
```
  Writes the string `x` to the the stream `s`. No length field or terminating zero is written. **Example:**

 
```
var strm = newStringStream("")
strm.write("THE FIRST LINE")
strm.setPosition(0)
doAssert strm.readLine() == "THE FIRST LINE"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L348)  
```
proc write(s: Stream; args: varargs[string, `$`]) {...}{.raises: [IOError, OSError],
    tags: [WriteIOEffect].}
```
  Writes one or more strings to the the stream. No length fields or terminating zeros are written. **Example:**

 
```
var strm = newStringStream("")
strm.write(1, 2, 3, 4)
strm.setPosition(0)
doAssert strm.readLine() == "1234"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L368)  
```
proc writeLine(s: Stream; args: varargs[string, `$`]) {...}{.
    raises: [IOError, OSError], tags: [WriteIOEffect].}
```
  Writes one or more strings to the the stream `s` followed by a new line. No length field or terminating zero is written. **Example:**

 
```
var strm = newStringStream("")
strm.writeLine(1, 2)
strm.writeLine(3, 4)
strm.setPosition(0)
doAssert strm.readAll() == "12\n34\n"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L380)  
```
proc read[T](s: Stream; result: var T)
```
  Generic read procedure. Reads `result` from the stream `s`.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream("012")
## readInt
var i: int8
strm.read(i)
doAssert i == 48
## readData
var buffer: array[2, char]
strm.read(buffer)
doAssert buffer == ['1', '2']
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L394)  
```
proc peek[T](s: Stream; result: var T)
```
  Generic peek procedure. Peeks `result` from the stream `s`.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream("012")
## peekInt
var i: int8
strm.peek(i)
doAssert i == 48
## peekData
var buffer: array[2, char]
strm.peek(buffer)
doAssert buffer == ['0', '1']
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L413)  
```
proc readChar(s: Stream): char {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Reads a char from the stream `s`.

 Raises `IOError` if an error occurred. Returns '\0' as an EOF marker.

 **Example:**

 
```
var strm = newStringStream("12\n3")
doAssert strm.readChar() == '1'
doAssert strm.readChar() == '2'
doAssert strm.readChar() == '\n'
doAssert strm.readChar() == '3'
doAssert strm.readChar() == '\x00'
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L432)  
```
proc peekChar(s: Stream): char {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Peeks a char from the stream `s`. Raises `IOError` if an error occurred. Returns '\0' as an EOF marker. **Example:**

 
```
var strm = newStringStream("12\n3")
doAssert strm.peekChar() == '1'
doAssert strm.peekChar() == '1'
discard strm.readAll()
doAssert strm.peekChar() == '\x00'
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L453)  
```
proc readBool(s: Stream): bool {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Reads a bool from the stream `s`.

 A bool is one byte long and it is `true` for every non-zero (`0000_0000`) value. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(true)
strm.write(false)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readBool() == true
doAssert strm.readBool() == false
doAssertRaises(IOError): discard strm.readBool()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L471)  
```
proc peekBool(s: Stream): bool {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Peeks a bool from the stream `s`.

 A bool is one byte long and it is `true` for every non-zero (`0000_0000`) value. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(true)
strm.write(false)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekBool() == true
## not false
doAssert strm.peekBool() == true
doAssert strm.readBool() == true
doAssert strm.peekBool() == false
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L496)  
```
proc readInt8(s: Stream): int8 {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Reads an int8 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i8)
strm.write(2'i8)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readInt8() == 1'i8
doAssert strm.readInt8() == 2'i8
doAssertRaises(IOError): discard strm.readInt8()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L523)  
```
proc peekInt8(s: Stream): int8 {...}{.raises: [IOError, OSError],
                                 tags: [ReadIOEffect].}
```
  Peeks an int8 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i8)
strm.write(2'i8)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekInt8() == 1'i8
## not 2'i8
doAssert strm.peekInt8() == 1'i8
doAssert strm.readInt8() == 1'i8
doAssert strm.peekInt8() == 2'i8
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L542)  
```
proc readInt16(s: Stream): int16 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Reads an int16 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i16)
strm.write(2'i16)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readInt16() == 1'i16
doAssert strm.readInt16() == 2'i16
doAssertRaises(IOError): discard strm.readInt16()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L563)  
```
proc peekInt16(s: Stream): int16 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Peeks an int16 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i16)
strm.write(2'i16)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekInt16() == 1'i16
## not 2'i16
doAssert strm.peekInt16() == 1'i16
doAssert strm.readInt16() == 1'i16
doAssert strm.peekInt16() == 2'i16
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L582)  
```
proc readInt32(s: Stream): int32 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Reads an int32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i32)
strm.write(2'i32)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readInt32() == 1'i32
doAssert strm.readInt32() == 2'i32
doAssertRaises(IOError): discard strm.readInt32()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L603)  
```
proc peekInt32(s: Stream): int32 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Peeks an int32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i32)
strm.write(2'i32)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekInt32() == 1'i32
## not 2'i32
doAssert strm.peekInt32() == 1'i32
doAssert strm.readInt32() == 1'i32
doAssert strm.peekInt32() == 2'i32
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L622)  
```
proc readInt64(s: Stream): int64 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Reads an int64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i64)
strm.write(2'i64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readInt64() == 1'i64
doAssert strm.readInt64() == 2'i64
doAssertRaises(IOError): discard strm.readInt64()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L643) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L643)  
```
proc peekInt64(s: Stream): int64 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Peeks an int64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'i64)
strm.write(2'i64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekInt64() == 1'i64
## not 2'i64
doAssert strm.peekInt64() == 1'i64
doAssert strm.readInt64() == 1'i64
doAssert strm.peekInt64() == 2'i64
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L662)  
```
proc readUint8(s: Stream): uint8 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Reads an uint8 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u8)
strm.write(2'u8)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readUint8() == 1'u8
doAssert strm.readUint8() == 2'u8
doAssertRaises(IOError): discard strm.readUint8()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L683)  
```
proc peekUint8(s: Stream): uint8 {...}{.raises: [IOError, OSError],
                                   tags: [ReadIOEffect].}
```
  Peeks an uint8 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u8)
strm.write(2'u8)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekUint8() == 1'u8
## not 2'u8
doAssert strm.peekUint8() == 1'u8
doAssert strm.readUint8() == 1'u8
doAssert strm.peekUint8() == 2'u8
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L702)  
```
proc readUint16(s: Stream): uint16 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Reads an uint16 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u16)
strm.write(2'u16)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readUint16() == 1'u16
doAssert strm.readUint16() == 2'u16
doAssertRaises(IOError): discard strm.readUint16()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L723)  
```
proc peekUint16(s: Stream): uint16 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Peeks an uint16 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u16)
strm.write(2'u16)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekUint16() == 1'u16
## not 2'u16
doAssert strm.peekUint16() == 1'u16
doAssert strm.readUint16() == 1'u16
doAssert strm.peekUint16() == 2'u16
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L742)  
```
proc readUint32(s: Stream): uint32 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Reads an uint32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u32)
strm.write(2'u32)
strm.flush()
strm.setPosition(0)

## get data
doAssert strm.readUint32() == 1'u32
doAssert strm.readUint32() == 2'u32
doAssertRaises(IOError): discard strm.readUint32()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L763) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L763)  
```
proc peekUint32(s: Stream): uint32 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Peeks an uint32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u32)
strm.write(2'u32)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekUint32() == 1'u32
## not 2'u32
doAssert strm.peekUint32() == 1'u32
doAssert strm.readUint32() == 1'u32
doAssert strm.peekUint32() == 2'u32
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L783) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L783)  
```
proc readUint64(s: Stream): uint64 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Reads an uint64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u64)
strm.write(2'u64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readUint64() == 1'u64
doAssert strm.readUint64() == 2'u64
doAssertRaises(IOError): discard strm.readUint64()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L804) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L804)  
```
proc peekUint64(s: Stream): uint64 {...}{.raises: [IOError, OSError],
                                     tags: [ReadIOEffect].}
```
  Peeks an uint64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'u64)
strm.write(2'u64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekUint64() == 1'u64
## not 2'u64
doAssert strm.peekUint64() == 1'u64
doAssert strm.readUint64() == 1'u64
doAssert strm.peekUint64() == 2'u64
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L823) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L823)  
```
proc readFloat32(s: Stream): float32 {...}{.raises: [IOError, OSError],
                                       tags: [ReadIOEffect].}
```
  Reads a float32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'f32)
strm.write(2'f32)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readFloat32() == 1'f32
doAssert strm.readFloat32() == 2'f32
doAssertRaises(IOError): discard strm.readFloat32()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L844) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L844)  
```
proc peekFloat32(s: Stream): float32 {...}{.raises: [IOError, OSError],
                                       tags: [ReadIOEffect].}
```
  Peeks a float32 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'f32)
strm.write(2'f32)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekFloat32() == 1'f32
## not 2'f32
doAssert strm.peekFloat32() == 1'f32
doAssert strm.readFloat32() == 1'f32
doAssert strm.peekFloat32() == 2'f32
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L863)  
```
proc readFloat64(s: Stream): float64 {...}{.raises: [IOError, OSError],
                                       tags: [ReadIOEffect].}
```
  Reads a float64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [readStr](#readStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'f64)
strm.write(2'f64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.readFloat64() == 1'f64
doAssert strm.readFloat64() == 2'f64
doAssertRaises(IOError): discard strm.readFloat64()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L884) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L884)  
```
proc peekFloat64(s: Stream): float64 {...}{.raises: [IOError, OSError],
                                       tags: [ReadIOEffect].}
```
  Peeks a float64 from the stream `s`. Raises `IOError` if an error occurred.

 **Note:** Not available for JS backend. Use [peekStr](#peekStr,Stream,int) for now.

 **Example:**

 
```
var strm = newStringStream()
## setup for reading data
strm.write(1'f64)
strm.write(2'f64)
strm.flush()
strm.setPosition(0)
## get data
doAssert strm.peekFloat64() == 1'f64
## not 2'f64
doAssert strm.peekFloat64() == 1'f64
doAssert strm.readFloat64() == 1'f64
doAssert strm.peekFloat64() == 2'f64
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L903) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L903)  
```
proc readStr(s: Stream; length: int; str: var TaintedString) {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Reads a string of length `length` from the stream `s`. Raises `IOError` if an error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L938) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L938)  
```
proc readStr(s: Stream; length: int): TaintedString {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Reads a string of length `length` from the stream `s`. Raises `IOError` if an error occurred. **Example:**

 
```
var strm = newStringStream("abcde")
doAssert strm.readStr(2) == "ab"
doAssert strm.readStr(2) == "cd"
doAssert strm.readStr(2) == "e"
doAssert strm.readStr(2) == ""
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L943) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L943)  
```
proc peekStr(s: Stream; length: int; str: var TaintedString) {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Peeks a string of length `length` from the stream `s`. Raises `IOError` if an error occurred. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L964) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L964)  
```
proc peekStr(s: Stream; length: int): TaintedString {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Peeks a string of length `length` from the stream `s`. Raises `IOError` if an error occurred. **Example:**

 
```
var strm = newStringStream("abcde")
doAssert strm.peekStr(2) == "ab"
## not "cd
doAssert strm.peekStr(2) == "ab"
doAssert strm.readStr(2) == "ab"
doAssert strm.peekStr(2) == "cd"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L969) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L969)  
```
proc readLine(s: Stream; line: var TaintedString): bool {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Reads a line of text from the stream `s` into `line`. `line` must not be `nil`! May throw an IO exception.

 A line of text may be delimited by `LF` or `CRLF`. The newline character(s) are not part of the returned string. Returns `false` if the end of the file has been reached, `true` otherwise. If `false` is returned `line` contains no new data.

 See also:

 * [readLine(Stream) proc](#readLine,Stream)
* [peekLine(Stream) proc](#peekLine,Stream)
* [peekLine(Stream, TaintedString) proc](#peekLine,Stream,TaintedString)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
var line = ""
doAssert strm.readLine(line) == true
doAssert line == "The first line"
doAssert strm.readLine(line) == true
doAssert line == "the second line"
doAssert strm.readLine(line) == true
doAssert line == "the third line"
doAssert strm.readLine(line) == false
doAssert line == ""
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L983) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L983)  
```
proc peekLine(s: Stream; line: var TaintedString): bool {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Peeks a line of text from the stream `s` into `line`. `line` must not be `nil`! May throw an IO exception.

 A line of text may be delimited by `CR`, `LF` or `CRLF`. The newline character(s) are not part of the returned string. Returns `false` if the end of the file has been reached, `true` otherwise. If `false` is returned `line` contains no new data.

 See also:

 * [readLine(Stream) proc](#readLine,Stream)
* [readLine(Stream, TaintedString) proc](#readLine,Stream,TaintedString)
* [peekLine(Stream) proc](#peekLine,Stream)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
var line = ""
doAssert strm.peekLine(line) == true
doAssert line == "The first line"
doAssert strm.peekLine(line) == true
## not "the second line"
doAssert line == "The first line"
doAssert strm.readLine(line) == true
doAssert line == "The first line"
doAssert strm.peekLine(line) == true
doAssert line == "the second line"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1026) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1026)  
```
proc readLine(s: Stream): TaintedString {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  Reads a line from a stream `s`. Raises `IOError` if an error occurred.

 **Note:** This is not very efficient.

 See also:

 * [readLine(Stream, TaintedString) proc](#readLine,Stream,TaintedString)
* [peekLine(Stream) proc](#peekLine,Stream)
* [peekLine(Stream, TaintedString) proc](#peekLine,Stream,TaintedString)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
doAssert strm.readLine() == "The first line"
doAssert strm.readLine() == "the second line"
doAssert strm.readLine() == "the third line"
doAssertRaises(IOError): discard strm.readLine()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1057) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1057)  
```
proc peekLine(s: Stream): TaintedString {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  Peeks a line from a stream `s`. Raises `IOError` if an error occurred.

 **Note:** This is not very efficient.

 See also:

 * [readLine(Stream) proc](#readLine,Stream)
* [readLine(Stream, TaintedString) proc](#readLine,Stream,TaintedString)
* [peekLine(Stream, TaintedString) proc](#peekLine,Stream,TaintedString)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
doAssert strm.peekLine() == "The first line"
## not "the second line"
doAssert strm.peekLine() == "The first line"
doAssert strm.readLine() == "The first line"
doAssert strm.peekLine() == "the second line"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1087) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1087)  
```
proc newStringStream(s: string = ""): owned StringStream {...}{.raises: [], tags: [].}
```
  Creates a new stream from the string `s`.

 See also:

 * [newFileStream proc](#newFileStream,File) creates a file stream from opened File.
* [newFileStream proc](#newFileStream,string,FileMode,int) creates a file stream from the file name and the mode.
* [openFileStream proc](#openFileStream,string,FileMode,int) creates a file stream from the file name and the mode.

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
doAssert strm.readLine() == "The first line"
doAssert strm.readLine() == "the second line"
doAssert strm.readLine() == "the third line"
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1269)  
```
proc newFileStream(f: File): owned FileStream {...}{.raises: [], tags: [].}
```
  Creates a new stream from the file `f`.

 **Note:** Not available for JS backend.

 See also:

 * [newStringStream proc](#newStringStream,string) creates a new stream from string.
* [newFileStream proc](#newFileStream,string,FileMode,int) is the same as using [open proc](io#open,File,string,FileMode,int) on Examples.
* [openFileStream proc](#openFileStream,string,FileMode,int) creates a file stream from the file name and the mode.

 **Example:**

 
```
## Input (somefile.txt):
## The first line
## the second line
## the third line
var f: File
if open(f, "somefile.txt", fmRead, -1):
  var strm = newFileStream(f)
  var line = ""
  while strm.readLine(line):
    echo line
  ## Output:
  ## The first line
  ## the second line
  ## the third line
  strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1339)  
```
proc newFileStream(filename: string; mode: FileMode = fmRead; bufSize: int = -1): owned
    FileStream {...}{.raises: [], tags: [].}
```
  Creates a new stream from the file named `filename` with the mode `mode`.

 If the file cannot be opened, `nil` is returned. See the [io module](io) for a list of available [FileMode enums](io#FileMode).

 **Note:**

 * **This function returns nil in case of failure.** To prevent unexpected behavior and ensure proper error handling, use [openFileStream proc](#openFileStream,string,FileMode,int) instead.
* Not available for JS backend.

 See also:

 * [newStringStream proc](#newStringStream,string) creates a new stream from string.
* [newFileStream proc](#newFileStream,File) creates a file stream from opened File.
* [openFileStream proc](#openFileStream,string,FileMode,int) creates a file stream from the file name and the mode.

 **Example:**

 
```
from os import removeFile
var strm = newFileStream("somefile.txt", fmWrite)
if not isNil(strm):
  strm.writeLine("The first line")
  strm.writeLine("the second line")
  strm.writeLine("the third line")
  strm.close()
  ## Output (somefile.txt)
  ## The first line
  ## the second line
  ## the third line
  removeFile("somefile.txt")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1382)  
```
proc openFileStream(filename: string; mode: FileMode = fmRead;
                    bufSize: int = -1): owned FileStream {...}{.raises: [IOError],
    tags: [].}
```
  Creates a new stream from the file named `filename` with the mode `mode`. If the file cannot be opened, an IO exception is raised.

 **Note:** Not available for JS backend.

 See also:

 * [newStringStream proc](#newStringStream,string) creates a new stream from string.
* [newFileStream proc](#newFileStream,File) creates a file stream from opened File.
* [newFileStream proc](#newFileStream,string,FileMode,int) creates a file stream from the file name and the mode.

 **Example:**

 
```
try:
  ## Input (somefile.txt):
  ## The first line
  ## the second line
  ## the third line
  var strm = openFileStream("somefile.txt")
  echo strm.readLine()
  ## Output:
  ## The first line
  strm.close()
except:
  stderr.write getCurrentExceptionMsg()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1420)   Iterators
---------

  
```
iterator lines(s: Stream): TaintedString {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  Iterates over every line in the stream. The iteration is based on `readLine`.

 See also:

 * [readLine(Stream) proc](#readLine,Stream)
* [readLine(Stream, TaintedString) proc](#readLine,Stream,TaintedString)

 **Example:**

 
```
var strm = newStringStream("The first line\nthe second line\nthe third line")
var lines: seq[string]
for line in strm.lines():
  lines.add line
doAssert lines == @["The first line", "the second line", "the third line"]
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streams.nim#L1109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streams.nim#L1109)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/streams.html>

terminal
========

 This module contains a few procedures to control the *terminal* (also called *console*). On UNIX, the implementation simply uses ANSI escape sequences and does not depend on any other module, on Windows it uses the Windows API. Changing the style is permanent even after program termination! Use the code `system.addQuitProc(resetAttributes)` to restore the defaults. Similarly, if you hide the cursor, make sure to unhide it with `showCursor` before quitting.

 Imports
-------

  <macros>, <strformat>, <strutils>, <colors>, <termios>, <posix>, <os>, <parseutils>, <termios>  Types
-----

  
```
Style = enum
  styleBright = 1,          ## bright text
  styleDim,                 ## dim text
  styleItalic,              ## italic (or reverse on terminals not supporting)
  styleUnderscore,          ## underscored text
  styleBlink,               ## blinking/bold text
  styleBlinkRapid,          ## rapid blinking/bold text (not widely supported)
  styleReverse,             ## reverse
  styleHidden,              ## hidden text
  styleStrikethrough         ## strikethrough
```
  different styles for text output [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L483)  
```
ForegroundColor = enum
  fgBlack = 30,             ## black
  fgRed,                    ## red
  fgGreen,                  ## green
  fgYellow,                 ## yellow
  fgBlue,                   ## blue
  fgMagenta,                ## magenta
  fgCyan,                   ## cyan
  fgWhite,                  ## white
  fg8Bit,                   ## 256-color (not supported, see ``enableTrueColors`` instead.)
  fgDefault                  ## default terminal foreground color
```
  terminal's foreground colors [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L537)  
```
BackgroundColor = enum
  bgBlack = 40,             ## black
  bgRed,                    ## red
  bgGreen,                  ## green
  bgYellow,                 ## yellow
  bgBlue,                   ## blue
  bgMagenta,                ## magenta
  bgCyan,                   ## cyan
  bgWhite,                  ## white
  bg8Bit,                   ## 256-color (not supported, see ``enableTrueColors`` instead.)
  bgDefault                  ## default terminal background color
```
  terminal's background colors [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L549)  
```
TerminalCmd = enum
  resetStyle,               ## reset attributes
  fgColor,                  ## set foreground's true color
  bgColor                    ## set background's true color
```
  commands that can be expressed as arguments [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L678)   Consts
------

  
```
ansiResetCode = "\e[0m"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L53)   Procs
-----

  
```
proc terminalWidthIoctl(fds: openArray[int]): int {...}{.raises: [], tags: [].}
```
  Returns terminal width from first fd that supports the ioctl. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L223)  
```
proc terminalHeightIoctl(fds: openArray[int]): int {...}{.raises: [], tags: [].}
```
  Returns terminal height from first fd that supports the ioctl. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L232)  
```
proc terminalWidth(): int {...}{.raises: [ValueError], tags: [ReadEnvEffect].}
```
  Returns some reasonable terminal width from either standard file descriptors, controlling terminal, environment variables or tradition. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L243)  
```
proc terminalHeight(): int {...}{.raises: [ValueError], tags: [ReadEnvEffect].}
```
  Returns some reasonable terminal height from either standard file descriptors, controlling terminal, environment variables or tradition. Zero is returned if the height could not be determined. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L260)  
```
proc terminalSize(): tuple[w, h: int] {...}{.raises: [ValueError],
                                        tags: [ReadEnvEffect].}
```
  Returns the terminal width and height as a tuple. Internally calls `terminalWidth` and `terminalHeight`, so the same assumptions apply. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L278)  
```
proc hideCursor(f: File) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Hides the cursor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L293)  
```
proc showCursor(f: File) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Shows the cursor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L300)  
```
proc setCursorPos(f: File; x, y: int) {...}{.raises: [IOError, ValueError],
                                        tags: [WriteIOEffect].}
```
  Sets the terminal's cursor to the (x,y) position. (0,0) is the upper left of the screen. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L307)  
```
proc setCursorXPos(f: File; x: int) {...}{.raises: [IOError, ValueError],
                                      tags: [WriteIOEffect].}
```
  Sets the terminal's cursor to the x position. The y position is not changed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L316)  
```
proc cursorUp(f: File; count = 1) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Moves the cursor up by `count` rows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L348)  
```
proc cursorDown(f: File; count = 1) {...}{.raises: [IOError, ValueError],
                                      tags: [WriteIOEffect].}
```
  Moves the cursor down by `count` rows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L358)  
```
proc cursorForward(f: File; count = 1) {...}{.raises: [IOError, ValueError],
    tags: [WriteIOEffect].}
```
  Moves the cursor forward by `count` columns. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L368)  
```
proc cursorBackward(f: File; count = 1) {...}{.raises: [IOError, ValueError],
    tags: [WriteIOEffect].}
```
  Moves the cursor backward by `count` columns. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L378)  
```
proc eraseLine(f: File) {...}{.raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  Erases the entire current line. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L419)  
```
proc eraseScreen(f: File) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Erases the screen with the background colour and moves the cursor to home. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L442)  
```
proc resetAttributes(f: File) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Resets all attributes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L469)  
```
proc ansiStyleCode(style: int): string {...}{.raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L494)  
```
proc setStyle(f: File; style: set[Style]) {...}{.raises: [IOError, ValueError],
    tags: [WriteIOEffect].}
```
  Sets the terminal style. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L504)  
```
proc writeStyled(txt: string; style: set[Style] = {styleBright}) {...}{.
    raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  Writes the text `txt` in a given `style` to stdout. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L519)  
```
proc setForegroundColor(f: File; fg: ForegroundColor; bright = false) {...}{.
    raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  Sets the terminal's foreground color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L564)  
```
proc setBackgroundColor(f: File; bg: BackgroundColor; bright = false) {...}{.
    raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  Sets the terminal's background color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L593)  
```
proc ansiForegroundColorCode(fg: ForegroundColor; bright = false): string {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L622)  
```
proc ansiForegroundColorCode(color: Color): string {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L631)  
```
proc ansiBackgroundColorCode(color: Color): string {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L640)  
```
proc setForegroundColor(f: File; color: Color) {...}{.raises: [IOError, ValueError],
    tags: [RootEffect, WriteIOEffect].}
```
  Sets the terminal's foreground true color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L649)  
```
proc setBackgroundColor(f: File; color: Color) {...}{.raises: [IOError, ValueError],
    tags: [RootEffect, WriteIOEffect].}
```
  Sets the terminal's background true color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L654)  
```
proc isatty(f: File): bool {...}{.raises: [], tags: [].}
```
  Returns true if `f` is associated with a terminal device. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L666)  
```
proc getch(): char {...}{.raises: [IOError, EOFError], tags: [ReadIOEffect].}
```
  Read a single character from the terminal, blocking until it is entered. The character is not printed to the terminal. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L749)  
```
proc readPasswordFromStdin(prompt: string; password: var TaintedString): bool {...}{.
    tags: [ReadIOEffect, WriteIOEffect], raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L800) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L800)  
```
proc readPasswordFromStdin(prompt = "password: "): TaintedString {...}{.
    raises: [IOError], tags: [ReadIOEffect, WriteIOEffect].}
```
  Reads a password from stdin without printing it. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L814) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L814)  
```
proc resetAttributes() {...}{.noconv, raises: [IOError], tags: [WriteIOEffect].}
```
  Resets all attributes on stdout. It is advisable to register this as a quit proc with `system.addQuitProc(resetAttributes)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L843)  
```
proc isTrueColorSupported(): bool {...}{.raises: [], tags: [RootEffect].}
```
  Returns true if a terminal supports true color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L849) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L849)  
```
proc enableTrueColors() {...}{.raises: [], tags: [RootEffect, ReadEnvEffect].}
```
  Enable true color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L856) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L856)  
```
proc disableTrueColors() {...}{.raises: [], tags: [RootEffect].}
```
  Disable true color. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L889) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L889)   Macros
------

  
```
macro styledWrite(f: File; m: varargs[typed]): untyped
```
  Similar to `write`, but treating terminal style arguments specially. When some argument is `Style`, `set[Style]`, `ForegroundColor`, `BackgroundColor` or `TerminalCmd` then it is not sent directly to `f`, but instead corresponding terminal style proc is called.

 Example:

 
```
stdout.styledWrite(fgRed, "red text ")
stdout.styledWrite(fgGreen, "green text")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L699)   Templates
---------

  
```
template ansiStyleCode(style: Style): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L497)  
```
template ansiStyleCode(style: static[Style]): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L501)  
```
template ansiForegroundColorCode(fg: static[ForegroundColor];
                                 bright: static[bool] = false): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L627)  
```
template ansiForegroundColorCode(color: static[Color]): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L635)  
```
template ansiBackgroundColorCode(color: static[Color]): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L644)  
```
template styledWriteLine(f: File; args: varargs[untyped])
```
  Calls `styledWrite` and appends a newline at the end.

 Example:

 
```
proc error(msg: string) =
  styledWriteLine(stderr, fgRed, "Error: ", resetStyle, msg)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L732) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L732)  
```
template styledEcho(args: varargs[untyped])
```
  Echoes styles arguments to stdout using `styledWriteLine`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L745)  
```
template hideCursor()
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L821) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L821)  
```
template showCursor()
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L822)  
```
template setCursorPos(x, y: int)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L823) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L823)  
```
template setCursorXPos(x: int)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L824)  
```
template cursorUp(count = 1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L827) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L827)  
```
template cursorDown(count = 1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L828) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L828)  
```
template cursorForward(count = 1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L829)  
```
template cursorBackward(count = 1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L830)  
```
template eraseLine()
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L831) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L831)  
```
template eraseScreen()
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L832)  
```
template setStyle(style: set[Style])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L833)  
```
template setForegroundColor(fg: ForegroundColor; bright = false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L835) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L835)  
```
template setBackgroundColor(bg: BackgroundColor; bright = false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L837) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L837)  
```
template setForegroundColor(color: Color)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L839)  
```
template setBackgroundColor(color: Color)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/terminal.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/terminal.nim#L841)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/terminal.html>

complex
=======

 This module implements complex numbers. Complex numbers are currently implemented as generic on a 64-bit or 32-bit float.

 Imports
-------

  <math>  Types
-----

  
```
Complex[T] = object
  re*, im*: T                ## A complex number, consisting of a real and an imaginary part.
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L19)  
```
Complex64 = Complex[float64]
```
  Alias for a pair of 64-bit floats. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L22)  
```
Complex32 = Complex[float32]
```
  Alias for a pair of 32-bit floats. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L24)   Procs
-----

  
```
proc complex[T: SomeFloat](re: T; im: T = 0.0): Complex[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L27)  
```
proc complex32(re: float32; im: float32 = 0.0): Complex[float32] {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L31)  
```
proc complex64(re: float64; im: float64 = 0.0): Complex[float64] {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L35)  
```
proc abs[T](z: Complex[T]): T
```
  Returns the distance from (0,0) to `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L44)  
```
proc abs2[T](z: Complex[T]): T
```
  Returns the squared distance from (0,0) to `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L48)  
```
proc conjugate[T](z: Complex[T]): Complex[T]
```
  Conjugates of complex number `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L52)  
```
proc inv[T](z: Complex[T]): Complex[T]
```
  Multiplicatives inverse of complex number `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L57)  
```
proc `==`[T](x, y: Complex[T]): bool
```
  Compares two complex numbers `x` and `y` for equality. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L61)  
```
proc `+`[T](x: T; y: Complex[T]): Complex[T]
```
  Adds a real number to a complex number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L65)  
```
proc `+`[T](x: Complex[T]; y: T): Complex[T]
```
  Adds a complex number to a real number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L70)  
```
proc `+`[T](x, y: Complex[T]): Complex[T]
```
  Adds two complex numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L75)  
```
proc `-`[T](z: Complex[T]): Complex[T]
```
  Unary minus for complex numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L80)  
```
proc `-`[T](x: T; y: Complex[T]): Complex[T]
```
  Subtracts a complex number from a real number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L85)  
```
proc `-`[T](x: Complex[T]; y: T): Complex[T]
```
  Subtracts a real number from a complex number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L89)  
```
proc `-`[T](x, y: Complex[T]): Complex[T]
```
  Subtracts two complex numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L94)  
```
proc `/`[T](x: Complex[T]; y: T): Complex[T]
```
  Divides complex number `x` by real number `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L99)  
```
proc `/`[T](x: T; y: Complex[T]): Complex[T]
```
  Divides real number `x` by complex number `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L104)  
```
proc `/`[T](x, y: Complex[T]): Complex[T]
```
  Divides `x` by `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L108)  
```
proc `*`[T](x: T; y: Complex[T]): Complex[T]
```
  Multiplies a real number and a complex number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L122)  
```
proc `*`[T](x: Complex[T]; y: T): Complex[T]
```
  Multiplies a complex number with a real number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L127)  
```
proc `*`[T](x, y: Complex[T]): Complex[T]
```
  Multiplies `x` with `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L132)  
```
proc `+=`[T](x: var Complex[T]; y: Complex[T])
```
  Adds `y` to `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L138)  
```
proc `-=`[T](x: var Complex[T]; y: Complex[T])
```
  Subtracts `y` from `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L143)  
```
proc `*=`[T](x: var Complex[T]; y: Complex[T])
```
  Multiplies `y` to `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L148)  
```
proc `/=`[T](x: var Complex[T]; y: Complex[T])
```
  Divides `x` by `y` in place. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L154)  
```
proc sqrt[T](z: Complex[T]): Complex[T]
```
  Square root for a complex number `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L159)  
```
proc exp[T](z: Complex[T]): Complex[T]
```
  `e` raised to the power `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L182)  
```
proc ln[T](z: Complex[T]): Complex[T]
```
  Returns the natural log of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L190)  
```
proc log10[T](z: Complex[T]): Complex[T]
```
  Returns the log base 10 of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L195)  
```
proc log2[T](z: Complex[T]): Complex[T]
```
  Returns the log base 2 of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L199)  
```
proc pow[T](x, y: Complex[T]): Complex[T]
```
  `x` raised to the power `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L203)  
```
proc pow[T](x: Complex[T]; y: T): Complex[T]
```
  Complex number `x` raised to the power `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L225)  
```
proc sin[T](z: Complex[T]): Complex[T]
```
  Returns the sine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L230)  
```
proc arcsin[T](z: Complex[T]): Complex[T]
```
  Returns the inverse sine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L235)  
```
proc cos[T](z: Complex[T]): Complex[T]
```
  Returns the cosine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L239)  
```
proc arccos[T](z: Complex[T]): Complex[T]
```
  Returns the inverse cosine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L244)  
```
proc tan[T](z: Complex[T]): Complex[T]
```
  Returns the tangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L248)  
```
proc arctan[T](z: Complex[T]): Complex[T]
```
  Returns the inverse tangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L252)  
```
proc cot[T](z: Complex[T]): Complex[T]
```
  Returns the cotangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L256)  
```
proc arccot[T](z: Complex[T]): Complex[T]
```
  Returns the inverse cotangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L260)  
```
proc sec[T](z: Complex[T]): Complex[T]
```
  Returns the secant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L264)  
```
proc arcsec[T](z: Complex[T]): Complex[T]
```
  Returns the inverse secant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L268)  
```
proc csc[T](z: Complex[T]): Complex[T]
```
  Returns the cosecant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L272)  
```
proc arccsc[T](z: Complex[T]): Complex[T]
```
  Returns the inverse cosecant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L276)  
```
proc sinh[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic sine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L280)  
```
proc arcsinh[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic sine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L284)  
```
proc cosh[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic cosine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L288)  
```
proc arccosh[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic cosine of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L292)  
```
proc tanh[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic tangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L296)  
```
proc arctanh[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic tangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L300)  
```
proc sech[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic secant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L304)  
```
proc arcsech[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic secant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L308)  
```
proc csch[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic cosecant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L312)  
```
proc arccsch[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic cosecant of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L316)  
```
proc coth[T](z: Complex[T]): Complex[T]
```
  Returns the hyperbolic cotangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L320)  
```
proc arccoth[T](z: Complex[T]): Complex[T]
```
  Returns the inverse hyperbolic cotangent of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L324)  
```
proc phase[T](z: Complex[T]): T
```
  Returns the phase of `z`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L328)  
```
proc polar[T](z: Complex[T]): tuple[r, phi: T]
```
  Returns `z` in polar coordinates. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L332)  
```
proc rect[T](r, phi: T): Complex[T]
```
  Returns the complex number with polar coordinates `r` and `phi`.`result.re = r * cos(phi)`  
`result.im = r * sin(phi)`  


 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L336)  
```
proc `$`(z: Complex): string
```
  Returns `z`'s string representation as `"(re, im)"`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L344)   Templates
---------

  
```
template im(arg: typedesc[float32]): Complex32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L39)  
```
template im(arg: typedesc[float64]): Complex64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L40)  
```
template im(arg: float32): Complex32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L41)  
```
template im(arg: float64): Complex64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/complex.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/complex.nim#L42)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/complex.html>

fenv
====

 Floating-point environment. Handling of floating-point rounding and exceptions (overflow, division by zero, etc.).

 Types
-----

  
```
Tfenv {...}{.importc: "fenv_t", header: "<fenv.h>", final, pure.} = object
```
  Represents the entire floating-point environment. The floating-point environment refers collectively to any floating-point status flags and control modes supported by the implementation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L43)  
```
Tfexcept {...}{.importc: "fexcept_t", header: "<fenv.h>", final, pure.} = object
```
  Represents the floating-point status flags collectively, including any status the implementation associates with the flags. A floating-point status flag is a system variable whose value is set (but never cleared) when a floating-point exception is raised, which occurs as a side effect of exceptional floating-point arithmetic to provide auxiliary information. A floating-point control mode is a system variable whose value may be set by the user to affect the subsequent behavior of floating-point arithmetic. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L48)   Vars
----

  
```
FE_DIVBYZERO: cint
```
  division by zero [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L17)  
```
FE_INEXACT: cint
```
  inexact result [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L19)  
```
FE_INVALID: cint
```
  invalid operation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L21)  
```
FE_OVERFLOW: cint
```
  result not representable due to overflow [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L23)  
```
FE_UNDERFLOW: cint
```
  result not representable due to underflow [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L25)  
```
FE_ALL_EXCEPT: cint
```
  bitwise OR of all supported exceptions [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L27)  
```
FE_DOWNWARD: cint
```
  round toward -Inf [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L29)  
```
FE_TONEAREST: cint
```
  round to nearest [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L31)  
```
FE_TOWARDZERO: cint
```
  round toward 0 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L33)  
```
FE_UPWARD: cint
```
  round toward +Inf [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L35)  
```
FE_DFL_ENV: cint
```
  macro of type pointer to fenv\_t to be used as the argument to functions taking an argument of type fenv\_t; in this case the default environment will be used [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L37)   Procs
-----

  
```
proc feclearexcept(excepts: cint): cint {...}{.importc, header: "<fenv.h>".}
```
  Clear the supported exceptions represented by `excepts`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L59)  
```
proc fegetexceptflag(flagp: ptr Tfexcept; excepts: cint): cint {...}{.importc,
    header: "<fenv.h>".}
```
  Store implementation-defined representation of the exception flags indicated by `excepts` in the object pointed to by `flagp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L62)  
```
proc feraiseexcept(excepts: cint): cint {...}{.importc, header: "<fenv.h>".}
```
  Raise the supported exceptions represented by `excepts`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L67)  
```
proc fesetexceptflag(flagp: ptr Tfexcept; excepts: cint): cint {...}{.importc,
    header: "<fenv.h>".}
```
  Set complete status for exceptions indicated by `excepts` according to the representation in the object pointed to by `flagp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L70)  
```
proc fetestexcept(excepts: cint): cint {...}{.importc, header: "<fenv.h>".}
```
  Determine which of subset of the exceptions specified by `excepts` are currently set. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L75)  
```
proc fegetround(): cint {...}{.importc, header: "<fenv.h>".}
```
  Get current rounding direction. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L79)  
```
proc fesetround(roundingDirection: cint): cint {...}{.importc, header: "<fenv.h>".}
```
  Establish the rounding direction represented by `roundingDirection`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L82)  
```
proc fegetenv(envp: ptr Tfenv): cint {...}{.importc, header: "<fenv.h>".}
```
  Store the current floating-point environment in the object pointed to by `envp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L85)  
```
proc feholdexcept(envp: ptr Tfenv): cint {...}{.importc, header: "<fenv.h>".}
```
  Save the current environment in the object pointed to by `envp`, clear exception flags and install a non-stop mode (if available) for all exceptions. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L89)  
```
proc fesetenv(a1: ptr Tfenv): cint {...}{.importc, header: "<fenv.h>".}
```
  Establish the floating-point environment represented by the object pointed to by `envp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L94)  
```
proc feupdateenv(envp: ptr Tfenv): cint {...}{.importc, header: "<fenv.h>".}
```
  Save current exceptions in temporary storage, install environment represented by object pointed to by `envp` and raise exceptions according to saved exceptions. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L98)   Templates
---------

  
```
template fpRadix(): int
```
  The (integer) value of the radix used to represent any floating point type on the architecture used to build the program. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L126)  
```
template mantissaDigits(T: typedesc[float32]): int
```
  Number of digits (in base `floatingPointRadix`) in the mantissa of 32-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L130)  
```
template digits(T: typedesc[float32]): int
```
  Number of decimal digits that can be represented in a 32-bit floating-point type without losing precision. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L133)  
```
template minExponent(T: typedesc[float32]): int
```
  Minimum (negative) exponent for 32-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L136)  
```
template maxExponent(T: typedesc[float32]): int
```
  Maximum (positive) exponent for 32-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L138)  
```
template min10Exponent(T: typedesc[float32]): int
```
  Minimum (negative) exponent in base 10 for 32-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L140)  
```
template max10Exponent(T: typedesc[float32]): int
```
  Maximum (positive) exponent in base 10 for 32-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L143)  
```
template minimumPositiveValue(T: typedesc[float32]): float32
```
  The smallest positive (nonzero) number that can be represented in a 32-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L146)  
```
template maximumPositiveValue(T: typedesc[float32]): float32
```
  The largest positive number that can be represented in a 32-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L149)  
```
template epsilon(T: typedesc[float32]): float32
```
  The difference between 1.0 and the smallest number greater than 1.0 that can be represented in a 32-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L152)  
```
template mantissaDigits(T: typedesc[float64]): int
```
  Number of digits (in base `floatingPointRadix`) in the mantissa of 64-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L156)  
```
template digits(T: typedesc[float64]): int
```
  Number of decimal digits that can be represented in a 64-bit floating-point type without losing precision. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L159)  
```
template minExponent(T: typedesc[float64]): int
```
  Minimum (negative) exponent for 64-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L162)  
```
template maxExponent(T: typedesc[float64]): int
```
  Maximum (positive) exponent for 64-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L164)  
```
template min10Exponent(T: typedesc[float64]): int
```
  Minimum (negative) exponent in base 10 for 64-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L166)  
```
template max10Exponent(T: typedesc[float64]): int
```
  Maximum (positive) exponent in base 10 for 64-bit floating-point numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L169)  
```
template minimumPositiveValue(T: typedesc[float64]): float64
```
  The smallest positive (nonzero) number that can be represented in a 64-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L172)  
```
template maximumPositiveValue(T: typedesc[float64]): float64
```
  The largest positive number that can be represented in a 64-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L175)  
```
template epsilon(T: typedesc[float64]): float64
```
  The difference between 1.0 and the smallest number greater than 1.0 that can be represented in a 64-bit floating-point type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/fenv.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/fenv.nim#L178)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/fenv.html>

math
====


*Constructive mathematics is naturally typed.* -- Simon Thompson

 Basic math routines for Nim.

 Note that the trigonometric functions naturally operate on radians. The helper functions [degToRad](#degToRad,T) and [radToDeg](#radToDeg,T) provide conversion between radians and degrees.

 
```
import math
from sequtils import map

let a = [0.0, PI/6, PI/4, PI/3, PI/2]

echo a.map(sin)
# @[0.0, 0.499…, 0.707…, 0.866…, 1.0]

echo a.map(tan)
# @[0.0, 0.577…, 0.999…, 1.732…, 1.633…e+16]

echo cos(degToRad(180.0))
# -1.0

echo sqrt(-1.0)
# nan   (use `complex` module)
```

This module is available for the [JavaScript target](backends#backends-the-javascript-target).

 **See also:**

 * [complex module](complex) for complex numbers and their mathematical operations
* [rationals module](rationals) for rational numbers and their mathematical operations
* [fenv module](fenv) for handling of floating-point rounding and exceptions (overflow, zero-divide, etc.)
* [random module](random) for fast and tiny random number generator
* [mersenne module](mersenne) for Mersenne twister random number generator
* [stats module](stats) for statistical analysis
* [strformat module](strformat) for formatting floats for print
* [system module](system) Some very basic and trivial math operators are on system directly, to name a few `shr`, `shl`, `xor`, `clamp`, etc.

 Imports
-------

  <since>, <bitops>  Types
-----

  
```
FloatClass = enum
  fcNormal,                 ## value is an ordinary nonzero floating point value
  fcSubnormal,              ## value is a subnormal (a very small) floating point value
  fcZero,                   ## value is zero
  fcNegZero,                ## value is the negative zero
  fcNan,                    ## value is Not-A-Number (NAN)
  fcInf,                    ## value is positive infinity
  fcNegInf                   ## value is negative infinity
```
  Describes the class a floating point value belongs to. This is the type that is returned by [classify proc](#classify,float). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L125)   Consts
------

  
```
PI = 3.141592653589793
```
  The circle constant PI (Ludolph's number) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L106)  
```
TAU = 6.283185307179586
```
  The circle constant TAU (= 2 \* PI) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L107)  
```
E = 2.718281828459045
```
  Euler's number [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L108)  
```
MaxFloat64Precision = 16
```
  Maximum number of meaningful digits after the decimal point for Nim's `float64` type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L110)  
```
MaxFloat32Precision = 8
```
  Maximum number of meaningful digits after the decimal point for Nim's `float32` type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L113)  
```
MaxFloatPrecision = 16
```
  Maximum number of meaningful digits after the decimal point for Nim's `float` type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L116)  
```
MinFloatNormal = 2.225073858507201e-308
```
  Smallest normal number for Nim's `float` type. (= 2^-1022). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L120)   Procs
-----

  
```
proc binom(n, k: int): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Computes the [binomial coefficient](https://en.wikipedia.org/wiki/Binomial_coefficient). **Example:**

 
```
doAssert binom(6, 2) == binom(6, 4)
doAssert binom(6, 2) == 15
doAssert binom(-6, 2) == 1
doAssert binom(6, 0) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L61)  
```
proc fac(n: int): int {...}{.raises: [], tags: [].}
```
  Computes the [factorial](https://en.wikipedia.org/wiki/Factorial) of a non-negative integer `n`.

 See also:

 * [prod proc](#prod,openArray%5BT%5D)

 **Example:**

 
```
doAssert fac(3) == 6
doAssert fac(4) == 24
doAssert fac(10) == 3628800
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L79)  
```
proc classify(x: float): FloatClass {...}{.raises: [], tags: [].}
```
  Classifies a floating point value.

 Returns `x`'s class as specified by [FloatClass enum](#FloatClass).

 **Example:**

 
```
doAssert classify(0.3) == fcNormal
doAssert classify(0.0) == fcZero
doAssert classify(0.3/0.0) == fcInf
doAssert classify(-0.3/0.0) == fcNegInf
doAssert classify(5.0e-324) == fcSubnormal
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L136)  
```
proc isPowerOfTwo(x: int): bool {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns `true`, if `x` is a power of two, `false` otherwise.

 Zero and negative numbers are not a power of two.

 See also:

 * [nextPowerOfTwo proc](#nextPowerOfTwo,int)

 **Example:**

 
```
doAssert isPowerOfTwo(16) == true
doAssert isPowerOfTwo(5) == false
doAssert isPowerOfTwo(0) == false
doAssert isPowerOfTwo(-16) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L161)  
```
proc nextPowerOfTwo(x: int): int {...}{.noSideEffect, raises: [], tags: [].}
```
  Returns `x` rounded up to the nearest power of two.

 Zero and negative numbers get rounded up to 1.

 See also:

 * [isPowerOfTwo proc](#isPowerOfTwo,int)

 **Example:**

 
```
doAssert nextPowerOfTwo(16) == 16
doAssert nextPowerOfTwo(5) == 8
doAssert nextPowerOfTwo(0) == 1
doAssert nextPowerOfTwo(-16) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L175)  
```
proc sum[T](x: openArray[T]): T {...}{.noSideEffect.}
```
  Computes the sum of the elements in `x`.

 If `x` is empty, 0 is returned.

 See also:

 * [prod proc](#prod,openArray%5BT%5D)
* [cumsum proc](#cumsum,openArray%5BT%5D)
* [cumsummed proc](#cumsummed,openArray%5BT%5D)

 **Example:**

 
```
doAssert sum([1, 2, 3, 4]) == 10
doAssert sum([-1.5, 2.7, -0.1]) == 1.1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L199)  
```
proc prod[T](x: openArray[T]): T {...}{.noSideEffect.}
```
  Computes the product of the elements in `x`.

 If `x` is empty, 1 is returned.

 See also:

 * [sum proc](#sum,openArray%5BT%5D)
* [fac proc](#fac,int)

 **Example:**

 
```
doAssert prod([1, 2, 3, 4]) == 24
doAssert prod([-4, 3, 5]) == -60
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L213)  
```
proc cumsummed[T](x: openArray[T]): seq[T]
```
  Return cumulative (aka prefix) summation of `x`.

 See also:

 * [sum proc](#sum,openArray%5BT%5D)
* [cumsum proc](#cumsum,openArray%5BT%5D) for the in-place version

 **Example:**

 
```
let a = [1, 2, 3, 4]
doAssert cumsummed(a) == @[1, 3, 6, 10]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L227)  
```
proc cumsum[T](x: var openArray[T])
```
  Transforms `x` in-place (must be declared as `var`) into its cumulative (aka prefix) summation.

 See also:

 * [sum proc](#sum,openArray%5BT%5D)
* [cumsummed proc](#cumsummed,openArray%5BT%5D) for a version which returns cumsummed sequence

 **Example:**

 
```
var a = [1, 2, 3, 4]
cumsum(a)
doAssert a == @[1, 3, 6, 10]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L240)  
```
proc sqrt(x: float32): float32 {...}{.importc: "sqrtf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L256)  
```
proc sqrt(x: float64): float64 {...}{.importc: "sqrt", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the square root of `x`.

 See also:

 * [cbrt proc](#cbrt,float64) for cubic root

 
```
echo sqrt(4.0)  ## 2.0
echo sqrt(1.44) ## 1.2
echo sqrt(-4.0) ## nan
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L257)  
```
proc cbrt(x: float32): float32 {...}{.importc: "cbrtf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L267)  
```
proc cbrt(x: float64): float64 {...}{.importc: "cbrt", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the cubic root of `x`.

 See also:

 * [sqrt proc](#sqrt,float64) for square root

 
```
echo cbrt(8.0)   ## 2.0
echo cbrt(2.197) ## 1.3
echo cbrt(-27.0) ## -3.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L268)  
```
proc ln(x: float32): float32 {...}{.importc: "logf", header: "<math.h>", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L278)  
```
proc ln(x: float64): float64 {...}{.importc: "log", header: "<math.h>", noSideEffect.}
```
  Computes the [natural logarithm](https://en.wikipedia.org/wiki/Natural_logarithm) of `x`.

 See also:

 * [log proc](#log,T,T)
* [log10 proc](#log10,float64)
* [log2 proc](#log2,float64)
* [exp proc](#exp,float64)

 
```
echo ln(exp(4.0)) ## 4.0
echo ln(1.0))     ## 0.0
echo ln(0.0)      ## -inf
echo ln(-7.0)     ## nan
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L279)  
```
proc log[T: SomeFloat](x, base: T): T {...}{.noSideEffect.}
```
  Computes the logarithm of `x` to base `base`.

 See also:

 * [ln proc](#ln,float64)
* [log10 proc](#log10,float64)
* [log2 proc](#log2,float64)
* [exp proc](#exp,float64)

 
```
echo log(9.0, 3.0)  ## 2.0
echo log(32.0, 2.0) ## 5.0
echo log(0.0, 2.0)  ## -inf
echo log(-7.0, 4.0) ## nan
echo log(8.0, -2.0) ## nan
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L304)  
```
proc log10(x: float32): float32 {...}{.importc: "log10f", header: "<math.h>",
                                  noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L322)  
```
proc log10(x: float64): float64 {...}{.importc: "log10", header: "<math.h>",
                                  noSideEffect.}
```
  Computes the common logarithm (base 10) of `x`.

 See also:

 * [ln proc](#ln,float64)
* [log proc](#log,T,T)
* [log2 proc](#log2,float64)
* [exp proc](#exp,float64)

 
```
echo log10(100.0)  ## 2.0
echo log10(0.0)    ## nan
echo log10(-100.0) ## -inf
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L323)  
```
proc exp(x: float32): float32 {...}{.importc: "expf", header: "<math.h>",
                                noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L336)  
```
proc exp(x: float64): float64 {...}{.importc: "exp", header: "<math.h>", noSideEffect.}
```
  Computes the exponential function of `x` (e^x).

 See also:

 * [ln proc](#ln,float64)
* [log proc](#log,T,T)
* [log10 proc](#log10,float64)
* [log2 proc](#log2,float64)

 
```
echo exp(1.0)     ## 2.718281828459045
echo ln(exp(4.0)) ## 4.0
echo exp(0.0)     ## 1.0
echo exp(-1.0)    ## 0.3678794411714423
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L337)  
```
proc sin(x: float32): float32 {...}{.importc: "sinf", header: "<math.h>",
                                noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L351)  
```
proc sin(x: float64): float64 {...}{.importc: "sin", header: "<math.h>", noSideEffect.}
```
  Computes the sine of `x`.

 See also:

 * [cos proc](#cos,float64)
* [tan proc](#tan,float64)
* [arcsin proc](#arcsin,float64)
* [sinh proc](#sinh,float64)

 
```
echo sin(PI / 6)         ## 0.4999999999999999
echo sin(degToRad(90.0)) ## 1.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L352)  
```
proc cos(x: float32): float32 {...}{.importc: "cosf", header: "<math.h>",
                                noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L364)  
```
proc cos(x: float64): float64 {...}{.importc: "cos", header: "<math.h>", noSideEffect.}
```
  Computes the cosine of `x`.

 See also:

 * [sin proc](#sin,float64)
* [tan proc](#tan,float64)
* [arccos proc](#arccos,float64)
* [cosh proc](#cosh,float64)

 
```
echo cos(2 * PI)         ## 1.0
echo cos(degToRad(60.0)) ## 0.5000000000000001
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L365)  
```
proc tan(x: float32): float32 {...}{.importc: "tanf", header: "<math.h>",
                                noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L377)  
```
proc tan(x: float64): float64 {...}{.importc: "tan", header: "<math.h>", noSideEffect.}
```
  Computes the tangent of `x`.

 See also:

 * [sin proc](#sin,float64)
* [cos proc](#cos,float64)
* [arctan proc](#arctan,float64)
* [tanh proc](#tanh,float64)

 
```
echo tan(degToRad(45.0)) ## 0.9999999999999999
echo tan(PI / 4)         ## 0.9999999999999999
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L378)  
```
proc sinh(x: float32): float32 {...}{.importc: "sinhf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L390)  
```
proc sinh(x: float64): float64 {...}{.importc: "sinh", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the [hyperbolic sine](https://en.wikipedia.org/wiki/Hyperbolic_function#Definitions) of `x`.

 See also:

 * [cosh proc](#cosh,float64)
* [tanh proc](#tanh,float64)
* [arcsinh proc](#arcsinh,float64)
* [sin proc](#sin,float64)

 
```
echo sinh(0.0)            ## 0.0
echo sinh(1.0)            ## 1.175201193643801
echo sinh(degToRad(90.0)) ## 2.301298902307295
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L391)  
```
proc cosh(x: float32): float32 {...}{.importc: "coshf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L404)  
```
proc cosh(x: float64): float64 {...}{.importc: "cosh", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the [hyperbolic cosine](https://en.wikipedia.org/wiki/Hyperbolic_function#Definitions) of `x`.

 See also:

 * [sinh proc](#sinh,float64)
* [tanh proc](#tanh,float64)
* [arccosh proc](#arccosh,float64)
* [cos proc](#cos,float64)

 
```
echo cosh(0.0)            ## 1.0
echo cosh(1.0)            ## 1.543080634815244
echo cosh(degToRad(90.0)) ## 2.509178478658057
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L405)  
```
proc tanh(x: float32): float32 {...}{.importc: "tanhf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L418)  
```
proc tanh(x: float64): float64 {...}{.importc: "tanh", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the [hyperbolic tangent](https://en.wikipedia.org/wiki/Hyperbolic_function#Definitions) of `x`.

 See also:

 * [sinh proc](#sinh,float64)
* [cosh proc](#cosh,float64)
* [arctanh proc](#arctanh,float64)
* [tan proc](#tan,float64)

 
```
echo tanh(0.0)            ## 0.0
echo tanh(1.0)            ## 0.7615941559557649
echo tanh(degToRad(90.0)) ## 0.9171523356672744
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L419)  
```
proc arccos(x: float32): float32 {...}{.importc: "acosf", header: "<math.h>",
                                   noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L433)  
```
proc arccos(x: float64): float64 {...}{.importc: "acos", header: "<math.h>",
                                   noSideEffect.}
```
  Computes the arc cosine of `x`.

 See also:

 * [arcsin proc](#arcsin,float64)
* [arctan proc](#arctan,float64)
* [arctan2 proc](#arctan2,float64,float64)
* [cos proc](#cos,float64)

 
```
echo radToDeg(arccos(0.0)) ## 90.0
echo radToDeg(arccos(1.0)) ## 0.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L434)  
```
proc arcsin(x: float32): float32 {...}{.importc: "asinf", header: "<math.h>",
                                   noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L446)  
```
proc arcsin(x: float64): float64 {...}{.importc: "asin", header: "<math.h>",
                                   noSideEffect.}
```
  Computes the arc sine of `x`.

 See also:

 * [arccos proc](#arccos,float64)
* [arctan proc](#arctan,float64)
* [arctan2 proc](#arctan2,float64,float64)
* [sin proc](#sin,float64)

 
```
echo radToDeg(arcsin(0.0)) ## 0.0
echo radToDeg(arcsin(1.0)) ## 90.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L447)  
```
proc arctan(x: float32): float32 {...}{.importc: "atanf", header: "<math.h>",
                                   noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L459)  
```
proc arctan(x: float64): float64 {...}{.importc: "atan", header: "<math.h>",
                                   noSideEffect.}
```
  Calculate the arc tangent of `x`.

 See also:

 * [arcsin proc](#arcsin,float64)
* [arccos proc](#arccos,float64)
* [arctan2 proc](#arctan2,float64,float64)
* [tan proc](#tan,float64)

 
```
echo arctan(1.0) ## 0.7853981633974483
echo radToDeg(arctan(1.0)) ## 45.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L460)  
```
proc arctan2(y, x: float32): float32 {...}{.importc: "atan2f", header: "<math.h>",
                                       noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L472)  
```
proc arctan2(y, x: float64): float64 {...}{.importc: "atan2", header: "<math.h>",
                                       noSideEffect.}
```
  Calculate the arc tangent of `y` / `x`.

 It produces correct results even when the resulting angle is near pi/2 or -pi/2 (`x` near 0).

 See also:

 * [arcsin proc](#arcsin,float64)
* [arccos proc](#arccos,float64)
* [arctan proc](#arctan,float64)
* [tan proc](#tan,float64)

 
```
echo arctan2(1.0, 0.0) ## 1.570796326794897
echo radToDeg(arctan2(1.0, 0.0)) ## 90.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L474)  
```
proc arcsinh(x: float32): float32 {...}{.importc: "asinhf", header: "<math.h>",
                                    noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L489) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L489)  
```
proc arcsinh(x: float64): float64 {...}{.importc: "asinh", header: "<math.h>",
                                    noSideEffect.}
```
  Computes the inverse hyperbolic sine of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L490)  
```
proc arccosh(x: float32): float32 {...}{.importc: "acoshf", header: "<math.h>",
                                    noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L492)  
```
proc arccosh(x: float64): float64 {...}{.importc: "acosh", header: "<math.h>",
                                    noSideEffect.}
```
  Computes the inverse hyperbolic cosine of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L493)  
```
proc arctanh(x: float32): float32 {...}{.importc: "atanhf", header: "<math.h>",
                                    noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L495)  
```
proc arctanh(x: float64): float64 {...}{.importc: "atanh", header: "<math.h>",
                                    noSideEffect.}
```
  Computes the inverse hyperbolic tangent of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L496)  
```
proc cot[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the cotangent of `x` (1 / tan(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L524)  
```
proc sec[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the secant of `x` (1 / cos(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L526)  
```
proc csc[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the cosecant of `x` (1 / sin(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L528)  
```
proc coth[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the hyperbolic cotangent of `x` (1 / tanh(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L531)  
```
proc sech[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the hyperbolic secant of `x` (1 / cosh(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L533)  
```
proc csch[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the hyperbolic cosecant of `x` (1 / sinh(x)). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L535)  
```
proc arccot[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse cotangent of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L538)  
```
proc arcsec[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse secant of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L540)  
```
proc arccsc[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse cosecant of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L542)  
```
proc arccoth[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse hyperbolic cotangent of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L545)  
```
proc arcsech[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse hyperbolic secant of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L547)  
```
proc arccsch[T: float32 | float64](x: T): T {...}{.noSideEffect.}
```
  Computes the inverse hyperbolic cosecant of `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L549)  
```
proc hypot(x, y: float32): float32 {...}{.importc: "hypotf", header: "<math.h>",
                                     noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L555)  
```
proc hypot(x, y: float64): float64 {...}{.importc: "hypot", header: "<math.h>",
                                     noSideEffect.}
```
  Computes the hypotenuse of a right-angle triangle with `x` and `y` as its base and height. Equivalent to `sqrt(x*x + y*y)`.
```
echo hypot(4.0, 3.0) ## 5.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L556)  
```
proc pow(x, y: float32): float32 {...}{.importc: "powf", header: "<math.h>",
                                   noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L562)  
```
proc pow(x, y: float64): float64 {...}{.importc: "pow", header: "<math.h>",
                                   noSideEffect.}
```
  Computes x to power raised of y.

 To compute power between integers (e.g. 2^6), use [^ proc](#%5E,T,Natural).

 See also:

 * [^ proc](#%5E,T,Natural)
* [sqrt proc](#sqrt,float64)
* [cbrt proc](#cbrt,float64)

 
```
echo pow(100, 1.5)  ## 1000.0
echo pow(16.0, 0.5) ## 4.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L563)  
```
proc erf(x: float32): float32 {...}{.importc: "erff", header: "<math.h>",
                                noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L579)  
```
proc erf(x: float64): float64 {...}{.importc: "erf", header: "<math.h>", noSideEffect.}
```
  Computes the [error function](https://en.wikipedia.org/wiki/Error_function) for `x`.

 Note: Not available for JS backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L580)  
```
proc erfc(x: float32): float32 {...}{.importc: "erfcf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L584)  
```
proc erfc(x: float64): float64 {...}{.importc: "erfc", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the [complementary error function](https://en.wikipedia.org/wiki/Error_function#Complementary_error_function) for `x`.

 Note: Not available for JS backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L585)  
```
proc gamma(x: float32): float32 {...}{.importc: "tgammaf", header: "<math.h>",
                                  noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L589)  
```
proc gamma(x: float64): float64 {...}{.importc: "tgamma", header: "<math.h>",
                                  noSideEffect.}
```
  Computes the the [gamma function](https://en.wikipedia.org/wiki/Gamma_function) for `x`.

 Note: Not available for JS backend.

 See also:

 * [lgamma proc](#lgamma,float64) for a natural log of gamma function

 
```
echo gamma(1.0)  # 1.0
echo gamma(4.0)  # 6.0
echo gamma(11.0) # 3628800.0
echo gamma(-1.0) # nan
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L590)  
```
proc lgamma(x: float32): float32 {...}{.importc: "lgammaf", header: "<math.h>",
                                   noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L603)  
```
proc lgamma(x: float64): float64 {...}{.importc: "lgamma", header: "<math.h>",
                                   noSideEffect.}
```
  Computes the natural log of the gamma function for `x`.

 Note: Not available for JS backend.

 See also:

 * [gamma proc](#gamma,float64) for gamma function

 
```
echo lgamma(1.0)  # 1.0
echo lgamma(4.0)  # 1.791759469228055
echo lgamma(11.0) # 15.10441257307552
echo lgamma(-1.0) # inf
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L604)  
```
proc floor(x: float32): float32 {...}{.importc: "floorf", header: "<math.h>",
                                  noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L618)  
```
proc floor(x: float64): float64 {...}{.importc: "floor", header: "<math.h>",
                                  noSideEffect.}
```
  Computes the floor function (i.e., the largest integer not greater than `x`).

 See also:

 * [ceil proc](#ceil,float64)
* [round proc](#round,float64)
* [trunc proc](#trunc,float64)

 
```
echo floor(2.1)  ## 2.0
echo floor(2.9)  ## 2.0
echo floor(-3.5) ## -4.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L619)  
```
proc ceil(x: float32): float32 {...}{.importc: "ceilf", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L632)  
```
proc ceil(x: float64): float64 {...}{.importc: "ceil", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the ceiling function (i.e., the smallest integer not smaller than `x`).

 See also:

 * [floor proc](#floor,float64)
* [round proc](#round,float64)
* [trunc proc](#trunc,float64)

 
```
echo ceil(2.1)  ## 3.0
echo ceil(2.9)  ## 3.0
echo ceil(-2.1) ## -2.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L633)  
```
proc round(x: float32): float32 {...}{.importc: "roundf", header: "<math.h>",
                                  noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L703)  
```
proc round(x: float64): float64 {...}{.importc: "round", header: "<math.h>",
                                  noSideEffect.}
```
  Rounds a float to zero decimal places.

 Used internally by the [round proc](#round,T,int) when the specified number of places is 0.

 See also:

 * [round proc](#round,T,int) for rounding to the specific number of decimal places
* [floor proc](#floor,float64)
* [ceil proc](#ceil,float64)
* [trunc proc](#trunc,float64)

 
```
echo round(3.4) ## 3.0
echo round(3.5) ## 4.0
echo round(4.5) ## 5.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L704)  
```
proc trunc(x: float32): float32 {...}{.importc: "truncf", header: "<math.h>",
                                  noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L722)  
```
proc trunc(x: float64): float64 {...}{.importc: "trunc", header: "<math.h>",
                                  noSideEffect.}
```
  Truncates `x` to the decimal point.

 See also:

 * [floor proc](#floor,float64)
* [ceil proc](#ceil,float64)
* [round proc](#round,float64)

 
```
echo trunc(PI) # 3.0
echo trunc(-1.85) # -1.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L723)  
```
proc `mod`(x, y: float32): float32 {...}{.importc: "fmodf", header: "<math.h>",
                                     noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L735)  
```
proc `mod`(x, y: float64): float64 {...}{.importc: "fmod", header: "<math.h>",
                                     noSideEffect.}
```
  Computes the modulo operation for float values (the remainder of `x` divided by `y`).

 See also:

 * [floorMod proc](#floorMod,T,T) for Python-like (% operator) behavior

 
```
( 6.5 mod  2.5) ==  1.5
(-6.5 mod  2.5) == -1.5
( 6.5 mod -2.5) ==  1.5
(-6.5 mod -2.5) == -1.5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L736)  
```
proc round[T: float32 | float64](x: T; places: int): T {...}{.noSideEffect.}
```
  Decimal rounding on a binary floating point number.

 This function is NOT reliable. Floating point numbers cannot hold non integer decimals precisely. If `places` is 0 (or omitted), round to the nearest integral value following normal mathematical rounding rules (e.g. `round(54.5) -> 55.0`). If `places` is greater than 0, round to the given number of decimal places, e.g. `round(54.346, 2) -> 54.350000000000001421…`. If `places` is negative, round to the left of the decimal place, e.g. `round(537.345, -1) -> 540.0`

 
```
echo round(PI, 2) ## 3.14
echo round(PI, 4) ## 3.1416
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L771) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L771)  
```
proc floorDiv[T: SomeInteger](x, y: T): T {...}{.noSideEffect.}
```
  Floor division is conceptually defined as `floor(x / y)`.

 This is different from the [system.div](system#div,int,int) operator, which is defined as `trunc(x / y)`. That is, `div` rounds towards `0` and `floorDiv` rounds down.

 See also:

 * [system.div proc](system#div,int,int) for integer division
* [floorMod proc](#floorMod,T,T) for Python-like (% operator) behavior

 
```
echo floorDiv( 13,  3) #  4
echo floorDiv(-13,  3) # -5
echo floorDiv( 13, -3) # -5
echo floorDiv(-13, -3) #  4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L792)  
```
proc floorMod[T: SomeNumber](x, y: T): T {...}{.noSideEffect.}
```
  Floor modulus is conceptually defined as `x - (floorDiv(x, y) * y)`.

 This proc behaves the same as the `%` operator in Python.

 See also:

 * [mod proc](#mod,float64,float64)
* [floorDiv proc](#floorDiv,T,T)

 
```
echo floorMod( 13,  3) #  1
echo floorMod(-13,  3) #  2
echo floorMod( 13, -3) # -2
echo floorMod(-13, -3) # -1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L812) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L812)  
```
proc c_frexp(x: float32; exponent: var int32): float32 {...}{.importc: "frexp",
    header: "<math.h>", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L830)  
```
proc c_frexp(x: float64; exponent: var int32): float64 {...}{.importc: "frexp",
    header: "<math.h>", noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L832)  
```
proc frexp[T, U](x: T; exponent: var U): T {...}{.noSideEffect.}
```
  Split a number into mantissa and exponent.

 `frexp` calculates the mantissa m (a float greater than or equal to 0.5 and less than 1) and the integer value n such that `x` (the original float value) equals `m * 2**n`. frexp stores n in `exponent` and returns m. 

 **Example:**

 
```
var x: int
doAssert frexp(5.0, x) == 0.625
doAssert x == 3
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L834)  
```
proc log2(x: float32): float32 {...}{.importc: "log2f", header: "<math.h>",
                                 noSideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L867)  
```
proc log2(x: float64): float64 {...}{.importc: "log2", header: "<math.h>",
                                 noSideEffect.}
```
  Computes the binary logarithm (base 2) of `x`.

 See also:

 * [log proc](#log,T,T)
* [log10 proc](#log10,float64)
* [ln proc](#ln,float64)
* [exp proc](#exp,float64)

 
```
echo log2(8.0)  # 3.0
echo log2(1.0)  # 0.0
echo log2(0.0)  # -inf
echo log2(-2.0) # nan
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L868)  
```
proc splitDecimal[T: float32 | float64](x: T): tuple[intpart: T, floatpart: T] {...}{.
    noSideEffect.}
```
  Breaks `x` into an integer and a fractional part.

 Returns a tuple containing `intpart` and `floatpart` representing the integer part and the fractional part respectively.

 Both parts have the same sign as `x`. Analogous to the `modf` function in C. 

 **Example:**

 
```
doAssert splitDecimal(5.25) == (intpart: 5.0, floatpart: 0.25)
doAssert splitDecimal(-2.73) == (intpart: -2.0, floatpart: -0.73)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L900) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L900)  
```
proc degToRad[T: float32 | float64](d: T): T {...}{.inline.}
```
  Convert from degrees to radians.

 See also:

 * [radToDeg proc](#radToDeg,T)

 **Example:**

 
```
doAssert degToRad(180.0) == 3.141592653589793
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L923) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L923)  
```
proc radToDeg[T: float32 | float64](d: T): T {...}{.inline.}
```
  Convert from radians to degrees.

 See also:

 * [degToRad proc](#degToRad,T)

 **Example:**

 
```
doAssert radToDeg(2 * PI) == 360.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L933)  
```
proc sgn[T: SomeNumber](x: T): int {...}{.inline.}
```
  Sign function.

 Returns:

 * `-1` for negative numbers and `NegInf`,
* `1` for positive numbers and `Inf`,
* `0` for positive zero, negative zero and `NaN`

 **Example:**

 
```
doAssert sgn(5) == 1
doAssert sgn(0) == 0
doAssert sgn(-4.1) == -1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L943) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L943)  
```
proc `^`[T: SomeNumber](x: T; y: Natural): T
```
  Computes `x` to the power `y`.

 Exponent `y` must be non-negative, use [pow proc](#pow,float64,float64) for negative exponents.

 See also:

 * [pow proc](#pow,float64,float64) for negative exponent or floats
* [sqrt proc](#sqrt,float64)
* [cbrt proc](#cbrt,float64)

 **Example:**

 
```
assert -3.0^0 == 1.0
assert -3^1 == -3
assert -3^2 == 9
assert -3.0^3 == -27.0
assert -3.0^4 == 81.0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L960)  
```
proc gcd[T](x, y: T): T
```
  Computes the greatest common (positive) divisor of `x` and `y`.

 Note that for floats, the result cannot always be interpreted as "greatest decimal `z` such that `z*N == x and z*M == y` where N and M are positive integers."

 See also:

 * [gcd proc](#gcd,SomeInteger,SomeInteger) for integer version
* [lcm proc](#lcm,T,T)

 **Example:**

 
```
doAssert gcd(13.5, 9.0) == 4.5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L995) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L995)  
```
proc gcd(x, y: SomeInteger): SomeInteger
```
  Computes the greatest common (positive) divisor of `x` and `y`, using binary GCD (aka Stein's) algorithm.

 See also:

 * [gcd proc](#gcd,T,T) for floats version
* [lcm proc](#lcm,T,T)

 **Example:**

 
```
doAssert gcd(12, 8) == 4
doAssert gcd(17, 63) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L1013)  
```
proc gcd[T](x: openArray[T]): T
```
  Computes the greatest common (positive) divisor of the elements of `x`.

 See also:

 * [gcd proc](#gcd,T,T) for integer version

 **Example:**

 
```
doAssert gcd(@[13.5, 9.0]) == 4.5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L1046) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L1046)  
```
proc lcm[T](x, y: T): T
```
  Computes the least common multiple of `x` and `y`.

 See also:

 * [gcd proc](#gcd,T,T)

 **Example:**

 
```
doAssert lcm(24, 30) == 120
doAssert lcm(13, 39) == 39
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L1059)  
```
proc lcm[T](x: openArray[T]): T
```
  Computes the least common multiple of the elements of `x`.

 See also:

 * [gcd proc](#gcd,T,T) for integer version

 **Example:**

 
```
doAssert lcm(@[24, 30]) == 120
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/math.nim#L1069) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/math.nim#L1069)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/math.html>

mersenne
========


**Example:**

 
```
static:
  block:
    var rando: MersenneTwister = newMersenneTwister(uint32.high)  ## Must be "var".
    doAssert rando.getNum() != rando.getNum()  ## Pseudo random number. Works at compile-time.
```
 Types
-----

  
```
MersenneTwister = object
  mt: array[0 .. 623, uint32]
  index: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mersenne.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mersenne.nim#L11)   Procs
-----

  
```
proc newMersenneTwister(seed: uint32): MersenneTwister {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mersenne.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mersenne.nim#L15)  
```
proc getNum(m: var MersenneTwister): uint32 {...}{.raises: [], tags: [].}
```
  Returns the next pseudo random number ranging from 0 to high(uint32) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mersenne.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mersenne.nim#L30)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/mersenne.html>

random
======


Nim's standard random number generator.

 Its implementation is based on the `xoroshiro128+` (xor/rotate/shift/rotate) library.

 * More information: <http://xoroshiro.di.unimi.it>/
* C implementation: <http://xoroshiro.di.unimi.it/xoroshiro128plus.c>

 **Do not use this module for cryptographic purposes!**

 Basic usage
-----------


To get started, here are some examples:

 
```
import random

# Call randomize() once to initialize the default random number generator
# If this is not called, the same results will occur every time these
# examples are run
randomize()

# Pick a number between 0 and 100
let num = rand(100)
echo num

# Roll a six-sided die
let roll = rand(1..6)
echo roll

# Pick a marble from a bag
let marbles = ["red", "blue", "green", "yellow", "purple"]
let pick = sample(marbles)
echo pick

# Shuffle some cards
var cards = ["Ace", "King", "Queen", "Jack", "Ten"]
shuffle(cards)
echo cards
```

These examples all use the default random number generator. The [Rand type](#Rand) represents the state of a random number generator. For convenience, this module contains a default Rand state that corresponds to the default random number generator. Most procs in this module which do not take in a Rand parameter, including those called in the above examples, use the default generator. Those procs are **not** thread-safe.

 Note that the default generator always starts in the same state. The [randomize proc](#randomize) can be called to initialize the default generator with a seed based on the current time, and it only needs to be called once before the first usage of procs from this module. If `randomize` is not called, then the default generator will always produce the same results.

 Generators that are independent of the default one can be created with the [initRand proc](#initRand,int64).

 Again, it is important to remember that this module must **not** be used for cryptographic applications.

 See also
--------


* [math module](math) for basic math routines
* [mersenne module](mersenne) for the Mersenne Twister random number generator
* [stats module](stats) for statistical analysis
* [list of cryptographic and hashing modules](lib#pure-libraries-hashing) in the standard library

 Imports
-------

  <algorithm>, <math>, <since>, <times>  Types
-----

  
```
Rand = object
  a0, a1: Ui
```
  State of a random number generator.

 Create a new Rand state using the [initRand proc](#initRand,int64).

 The module contains a default Rand state for convenience. It corresponds to the default random number generator's state. The default Rand state always starts with the same values, but the [randomize proc](#randomize) can be used to seed the default generator with a value based on the current time.

 Many procs have two variations: one that takes in a Rand parameter and another that uses the default generator. The procs that use the default generator are **not** thread-safe!

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L97)   Procs
-----

  
```
proc next(r: var Rand): uint64 {...}{.raises: [], tags: [].}
```
  Computes a random `uint64` number using the given state.

 See also:

 * [rand proc](#rand,Rand,Natural) that returns an integer between zero and a given upper bound
* [rand proc](#rand,Rand,range%5B%5D) that returns a float
* [rand proc](#rand,Rand,HSlice%5BT,T%5D) that accepts a slice
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type
* [skipRandomNumbers proc](#skipRandomNumbers,Rand)

 **Example:**

 
```
var r = initRand(2019)
doAssert r.next() == 138_744_656_611_299'u64
doAssert r.next() == 979_810_537_855_049_344'u64
doAssert r.next() == 3_628_232_584_225_300_704'u64
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L125)  
```
proc skipRandomNumbers(s: var Rand) {...}{.raises: [], tags: [].}
```
  The jump function for the generator.

 This proc is equivalent to 2^64 calls to [next](#next,Rand), and it can be used to generate 2^64 non-overlapping subsequences for parallel computations.

 When multiple threads are generating random numbers, each thread must own the [Rand](#Rand) state it is using so that the thread can safely obtain random numbers. However, if each thread creates its own Rand state, the subsequences of random numbers that each thread generates may overlap, even if the provided seeds are unique. This is more likely to happen as the number of threads and amount of random numbers generated increases.

 If many threads will generate random numbers concurrently, it is better to create a single Rand state and pass it to each thread. After passing the Rand state to a thread, call this proc before passing it to the next one. By using the Rand state this way, the subsequences of random numbers generated in each thread will never overlap as long as no thread generates more than 2^64 random numbers.

 The following example below demonstrates this pattern:

 
```
# Compile this example with --threads:on
import random
import threadpool

const spawns = 4
const numbers = 100000

proc randomSum(rand: Rand): int =
  var r = rand
  for i in 1..numbers:
    result += rand(1..10)

var r = initRand(2019)
var vals: array[spawns, FlowVar[int]]
for val in vals.mitems:
  val = spawn(randomSum(r))
  r.skipRandomNumbers()

for val in vals:
  echo ^val
```

See also:

 * [next proc](#next,Rand)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L147)  
```
proc rand(r: var Rand; max: Natural): int {...}{.gcsafe, locks: 0, raises: [],
    tags: [].}
```
  Returns a random integer in the range `0..max` using the given state.

 See also:

 * [rand proc](#rand,int) that returns an integer using the default random number generator
* [rand proc](#rand,Rand,range%5B%5D) that returns a float
* [rand proc](#rand,Rand,HSlice%5BT,T%5D) that accepts a slice
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
var r = initRand(123)
doAssert r.rand(100) == 0
doAssert r.rand(100) == 96
doAssert r.rand(100) == 66
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L210)  
```
proc rand(max: int): int {...}{.gcsafe, locks: 0, raises: [], tags: [].}
```
  Returns a random integer in the range `0..max`.

 If [randomize](#randomize) has not been called, the sequence of random numbers returned from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [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%5BT,T%5D) that accepts a slice
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
randomize(123)
doAssert rand(100) == 0
doAssert rand(100) == 96
doAssert rand(100) == 66
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L230)  
```
proc rand(r: var Rand; max: range[0.0 .. high(float)]): float {...}{.gcsafe,
    locks: 0, raises: [], tags: [].}
```
  Returns a random floating point number in the range `0.0..max` using the given state.

 See also:

 * [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%5BT,T%5D) that accepts a slice
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
var r = initRand(234)
let f = r.rand(1.0)
## f = 8.717181376738381e-07
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L252)  
```
proc rand(max: float): float {...}{.gcsafe, locks: 0, raises: [], tags: [].}
```
  Returns a random floating point number in the range `0.0..max`.

 If [randomize](#randomize) has not been called, the sequence of random numbers returned from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [rand proc](#rand,Rand,range%5B%5D) that returns a float using a provided state
* [rand proc](#rand,int) that returns an integer
* [rand proc](#rand,HSlice%5BT,T%5D) that accepts a slice
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
randomize(234)
let f = rand(1.0)
## f = 8.717181376738381e-07
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L273)  
```
proc rand[T: Ordinal or SomeFloat](r: var Rand; x: HSlice[T, T]): T
```
  For a slice `a..b`, returns a value in the range `a..b` using the given state.

 Allowed types for `T` are integers, floats, and enums without holes.

 See also:

 * [rand proc](#rand,HSlice%5BT,T%5D) 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%5B%5D) that returns a float
* [rand proc](#rand,typedesc%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
var r = initRand(345)
doAssert r.rand(1..6) == 4
doAssert r.rand(1..6) == 4
doAssert r.rand(1..6) == 6
let f = r.rand(-1.0 .. 1.0)
## f = 0.8741183448756229
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L294)  
```
proc rand[T: Ordinal or SomeFloat](x: HSlice[T, T]): T
```
  For a slice `a..b`, returns a value in the range `a..b`.

 Allowed types for `T` are integers, floats, and enums without holes.

 If [randomize](#randomize) has not been called, the sequence of random numbers returned from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [rand proc](#rand,Rand,HSlice%5BT,T%5D) 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%5BT%5D) that accepts an integer or range type

 **Example:**

 
```
randomize(345)
doAssert rand(1..6) == 4
doAssert rand(1..6) == 4
doAssert rand(1..6) == 6
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L318)  
```
proc rand[T: SomeInteger](t: typedesc[T]): T
```
  Returns a random integer in the range `low(T)..high(T)`.

 If [randomize](#randomize) has not been called, the sequence of random numbers returned from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [rand proc](#rand,int) that returns an integer
* [rand proc](#rand,float) that returns a floating point number
* [rand proc](#rand,HSlice%5BT,T%5D) that accepts a slice

 **Example:**

 
```
randomize(567)
doAssert rand(int8) == 55
doAssert rand(int8) == -42
doAssert rand(int8) == 43
doAssert rand(uint32) == 578980729'u32
doAssert rand(uint32) == 4052940463'u32
doAssert rand(uint32) == 2163872389'u32
doAssert rand(range[1..16]) == 11
doAssert rand(range[1..16]) == 4
doAssert rand(range[1..16]) == 16
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L342)  
```
proc sample[T](r: var Rand; s: set[T]): T
```
  Returns a random element from the set `s` using the given state.

 See also:

 * [sample proc](#sample,set%5BT%5D) that uses the default random number generator
* [sample proc](#sample,Rand,openArray%5BT%5D) for openarrays
* [sample proc](#sample,Rand,openArray%5BT%5D,openArray%5BU%5D) that uses a cumulative distribution function

 **Example:**

 
```
var r = initRand(987)
let s = {1, 3, 5, 7, 9}
doAssert r.sample(s) == 5
doAssert r.sample(s) == 7
doAssert r.sample(s) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L371)  
```
proc sample[T](s: set[T]): T
```
  Returns a random element from the set `s`.

 If [randomize](#randomize) has not been called, the order of outcomes from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [sample proc](#sample,Rand,set%5BT%5D) that uses a provided state
* [sample proc](#sample,openArray%5BT%5D) for openarrays
* [sample proc](#sample,openArray%5BT%5D,openArray%5BU%5D) that uses a cumulative distribution function

 **Example:**

 
```
randomize(987)
let s = {1, 3, 5, 7, 9}
doAssert sample(s) == 5
doAssert sample(s) == 7
doAssert sample(s) == 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L392)  
```
proc sample[T](r: var Rand; a: openArray[T]): T
```
  Returns a random element from `a` using the given state.

 See also:

 * [sample proc](#sample,openArray%5BT%5D) that uses the default random number generator
* [sample proc](#sample,Rand,openArray%5BT%5D,openArray%5BU%5D) that uses a cumulative distribution function
* [sample proc](#sample,Rand,set%5BT%5D) for sets

 **Example:**

 
```
let marbles = ["red", "blue", "green", "yellow", "purple"]
var r = initRand(456)
doAssert r.sample(marbles) == "blue"
doAssert r.sample(marbles) == "yellow"
doAssert r.sample(marbles) == "red"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L414)  
```
proc sample[T](a: openArray[T]): T
```
  Returns a random element from `a`.

 If [randomize](#randomize) has not been called, the order of outcomes from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [sample proc](#sample,Rand,openArray%5BT%5D) that uses a provided state
* [sample proc](#sample,openArray%5BT%5D,openArray%5BU%5D) that uses a cumulative distribution function
* [sample proc](#sample,set%5BT%5D) for sets

 **Example:**

 
```
let marbles = ["red", "blue", "green", "yellow", "purple"]
randomize(456)
doAssert sample(marbles) == "blue"
doAssert sample(marbles) == "yellow"
doAssert sample(marbles) == "red"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L431)  
```
proc sample[T, U](r: var Rand; a: openArray[T]; cdf: openArray[U]): T
```
  Returns an element from `a` using a cumulative distribution function (CDF) and the given state.

 The `cdf` argument does not have to be normalized, and it could contain any type of elements that can be converted to a `float`. It must be the same length as `a`. Each element in `cdf` should be greater than or equal to the previous element.

 The outcome of the [cumsum](math#cumsum,openArray%5BT%5D) proc and the return value of the [cumsummed](math#cumsummed,openArray%5BT%5D) proc, which are both in the math module, can be used as the `cdf` argument.

 See also:

 * [sample proc](#sample,openArray%5BT%5D,openArray%5BU%5D) that also utilizes a CDF but uses the default random number generator
* [sample proc](#sample,Rand,openArray%5BT%5D) that does not use a CDF
* [sample proc](#sample,Rand,set%5BT%5D) for sets

 **Example:**

 
```
from math import cumsummed

let marbles = ["red", "blue", "green", "yellow", "purple"]
let count = [1, 6, 8, 3, 4]
let cdf = count.cumsummed
var r = initRand(789)
doAssert r.sample(marbles, cdf) == "red"
doAssert r.sample(marbles, cdf) == "green"
doAssert r.sample(marbles, cdf) == "blue"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L453)  
```
proc sample[T, U](a: openArray[T]; cdf: openArray[U]): T
```
  Returns an element from `a` using a cumulative distribution function (CDF).

 This proc works similarly to [sample[T, U](Rand, openArray[T], openArray[U])](#sample,Rand,openArray%5BT%5D,openArray%5BU%5D). See that proc's documentation for more details.

 If [randomize](#randomize) has not been called, the order of outcomes from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [sample proc](#sample,Rand,openArray%5BT%5D,openArray%5BU%5D) that also utilizes a CDF but uses a provided state
* [sample proc](#sample,openArray%5BT%5D) that does not use a CDF
* [sample proc](#sample,set%5BT%5D) for sets

 **Example:**

 
```
from math import cumsummed

let marbles = ["red", "blue", "green", "yellow", "purple"]
let count = [1, 6, 8, 3, 4]
let cdf = count.cumsummed
randomize(789)
doAssert sample(marbles, cdf) == "red"
doAssert sample(marbles, cdf) == "green"
doAssert sample(marbles, cdf) == "blue"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L488)  
```
proc gauss(r: var Rand; mu = 0.0; sigma = 1.0): float {...}{.raises: [], tags: [].}
```
  Returns a Gaussian random variate, with mean `mu` and standard deviation `sigma` using the given state. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L520)  
```
proc gauss(mu = 0.0; sigma = 1.0): float {...}{.raises: [], tags: [].}
```
  Returns a Gaussian random variate, with mean `mu` and standard deviation `sigma`.

 If [randomize](#randomize) has not been called, the order of outcomes from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L536) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L536)  
```
proc initRand(seed: int64): Rand {...}{.raises: [], tags: [].}
```
  Initializes a new [Rand](#Rand) state using the given seed.

 `seed` must not be zero. Providing a specific seed will produce the same results for that seed each time.

 The resulting state is independent of the default random number generator's state.

 See also:

 * [randomize proc](#randomize,int64) that accepts a seed for the default random number generator
* [randomize proc](#randomize) that initializes the default random number generator using the current time

 **Example:**

 
```
from times import getTime, toUnix, nanosecond

var r1 = initRand(123)

let now = getTime()
var r2 = initRand(now.toUnix * 1_000_000_000 + now.nanosecond)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L547)  
```
proc randomize(seed: int64) {...}{.gcsafe, locks: 0, raises: [], tags: [].}
```
  Initializes the default random number generator with the given seed.

 `seed` must not be zero. Providing a specific seed will produce the same results for that seed each time.

 See also:

 * [initRand proc](#initRand,int64)
* [randomize proc](#randomize) that uses the current time instead

 **Example:**

 
```
from times import getTime, toUnix, nanosecond

randomize(123)

let now = getTime()
randomize(now.toUnix * 1_000_000_000 + now.nanosecond)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L573)  
```
proc shuffle[T](r: var Rand; x: var openArray[T])
```
  Shuffles a sequence of elements in-place using the given state.

 See also:

 * [shuffle proc](#shuffle,openArray%5BT%5D) that uses the default random number generator

 **Example:**

 
```
var cards = ["Ace", "King", "Queen", "Jack", "Ten"]
var r = initRand(678)
r.shuffle(cards)
doAssert cards == ["King", "Ace", "Queen", "Ten", "Jack"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L591)  
```
proc shuffle[T](x: var openArray[T])
```
  Shuffles a sequence of elements in-place.

 If [randomize](#randomize) has not been called, the order of outcomes from this proc will always be the same.

 This proc uses the default random number generator. Thus, it is **not** thread-safe.

 See also:

 * [shuffle proc](#shuffle,Rand,openArray%5BT%5D) that uses a provided state

 **Example:**

 
```
var cards = ["Ace", "King", "Queen", "Jack", "Ten"]
randomize(678)
shuffle(cards)
doAssert cards == ["King", "Ace", "Queen", "Ten", "Jack"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L606)  
```
proc randomize() {...}{.gcsafe, locks: 0, raises: [], tags: [TimeEffect].}
```
  Initializes the default random number generator with a value based on the current time.

 This proc only needs to be called once, and it should be called before the first usage of procs from this module that use the default random number generator.

 **Note:** Does not work for NimScript.

 See also:

 * [randomize proc](#randomize,int64) that accepts a seed
* [initRand proc](#initRand,int64)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/random.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/random.nim#L627)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/random.html>

rationals
=========

 This module implements rational numbers, consisting of a numerator `num` and a denominator `den`, both of type int. The denominator can not be 0.

 Imports
-------

  <math>, <hashes>  Types
-----

  
```
Rational[T] = object
  num*, den*: T
```
  a rational number, consisting of a numerator and denominator [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L17)   Procs
-----

  
```
proc initRational[T: SomeInteger](num, den: T): Rational[T]
```
  Create a new rational number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L21)  
```
proc `//`[T](num, den: T): Rational[T]
```
  A friendlier version of `initRational`. Example usage:
```
var x = 1//3 + 1//5
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L27)  
```
proc `$`[T](x: Rational[T]): string
```
  Turn a rational number into a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L33)  
```
proc toRational[T: SomeInteger](x: T): Rational[T]
```
  Convert some integer `x` to a rational number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L37)  
```
proc toRational(x: float; n: int = high(int) shr 32): Rational[int] {...}{.
    raises: [], tags: [].}
```
  Calculates the best rational numerator and denominator that approximates to `x`, where the denominator is smaller than `n` (default is the largest possible int to give maximum resolution).

 The algorithm is based on the theory of continued fractions.

 
```
import math, rationals
for i in 1..10:
  let t = (10 ^ (i+3)).int
  let x = toRational(PI, t)
  let newPI = x.num / x.den
  echo x, " ", newPI, " error: ", PI - newPI, "  ", t
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L42)  
```
proc toFloat[T](x: Rational[T]): float
```
  Convert a rational number `x` to a float. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L77)  
```
proc toInt[T](x: Rational[T]): int
```
  Convert a rational number `x` to an int. Conversion rounds towards 0 if `x` does not contain an integer value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L81)  
```
proc reduce[T: SomeInteger](x: var Rational[T])
```
  Reduce rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L86)  
```
proc `+`[T](x, y: Rational[T]): Rational[T]
```
  Add two rational numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L98)  
```
proc `+`[T](x: Rational[T]; y: T): Rational[T]
```
  Add rational `x` to int `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L105)  
```
proc `+`[T](x: T; y: Rational[T]): Rational[T]
```
  Add int `x` to rational `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L110)  
```
proc `+=`[T](x: var Rational[T]; y: Rational[T])
```
  Add rational `y` to rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L115)  
```
proc `+=`[T](x: var Rational[T]; y: T)
```
  Add int `y` to rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L122)  
```
proc `-`[T](x: Rational[T]): Rational[T]
```
  Unary minus for rational numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L126)  
```
proc `-`[T](x, y: Rational[T]): Rational[T]
```
  Subtract two rational numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L131)  
```
proc `-`[T](x: Rational[T]; y: T): Rational[T]
```
  Subtract int `y` from rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L138)  
```
proc `-`[T](x: T; y: Rational[T]): Rational[T]
```
  Subtract rational `y` from int `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L143)  
```
proc `-=`[T](x: var Rational[T]; y: Rational[T])
```
  Subtract rational `y` from rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L148)  
```
proc `-=`[T](x: var Rational[T]; y: T)
```
  Subtract int `y` from rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L155)  
```
proc `*`[T](x, y: Rational[T]): Rational[T]
```
  Multiply two rational numbers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L159)  
```
proc `*`[T](x: Rational[T]; y: T): Rational[T]
```
  Multiply rational `x` with int `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L165)  
```
proc `*`[T](x: T; y: Rational[T]): Rational[T]
```
  Multiply int `x` with rational `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L171)  
```
proc `*=`[T](x: var Rational[T]; y: Rational[T])
```
  Multiply rationals `y` to `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L177)  
```
proc `*=`[T](x: var Rational[T]; y: T)
```
  Multiply int `y` to rational `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L183)  
```
proc reciprocal[T](x: Rational[T]): Rational[T]
```
  Calculate the reciprocal of `x`. (1/x) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L188)  
```
proc `/`[T](x, y: Rational[T]): Rational[T]
```
  Divide rationals `x` by `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L199)  
```
proc `/`[T](x: Rational[T]; y: T): Rational[T]
```
  Divide rational `x` by int `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L205)  
```
proc `/`[T](x: T; y: Rational[T]): Rational[T]
```
  Divide int `x` by Rational `y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L211)  
```
proc `/=`[T](x: var Rational[T]; y: Rational[T])
```
  Divide rationals `x` by `y` in place. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L217)  
```
proc `/=`[T](x: var Rational[T]; y: T)
```
  Divide rational `x` by int `y` in place. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L223)  
```
proc cmp(x, y: Rational): int
```
  Compares two rationals. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L228)  
```
proc `<`(x, y: Rational): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L232)  
```
proc `<=`(x, y: Rational): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L235)  
```
proc `==`(x, y: Rational): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L238)  
```
proc abs[T](x: Rational[T]): Rational[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L241)  
```
proc `div`[T: SomeInteger](x, y: Rational[T]): T
```
  Computes the rational truncated division. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L245)  
```
proc `mod`[T: SomeInteger](x, y: Rational[T]): Rational[T]
```
  Computes the rational modulo by truncated division (remainder). This is same as `x - (x div y) * y`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L249)  
```
proc floorDiv[T: SomeInteger](x, y: Rational[T]): T
```
  Computes the rational floor division.

 Floor division is conceptually defined as `floor(x / y)`. This is different from the `div` operator, which is defined as `trunc(x / y)`. That is, `div` rounds towards `0` and `floorDiv` rounds down.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L255)  
```
proc floorMod[T: SomeInteger](x, y: Rational[T]): Rational[T]
```
  Computes the rational modulo by floor division (modulo).

 This is same as `x - floorDiv(x, y) * y`. This proc behaves the same as the `%` operator in python.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L264)  
```
proc hash[T](x: Rational[T]): Hash
```
  Computes hash for rational `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/rationals.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/rationals.nim#L272)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rationals.html>

stats
=====


Statistical analysis framework for performing basic statistical analysis of data. The data is analysed in a single pass, when a data value is pushed to the `RunningStat` or `RunningRegress` objects

 `RunningStat` calculates for a single data set

 * n (data count)
* min (smallest value)
* max (largest value)
* sum
* mean
* variance
* varianceS (sample var)
* standardDeviation
* standardDeviationS (sample stddev)
* skewness (the third statistical moment)
* kurtosis (the fourth statistical moment)

 `RunningRegress` calculates for two sets of data

 * n
* slope
* intercept
* correlation

 Procs have been provided to calculate statistics on arrays and sequences.

 However, if more than a single statistical calculation is required, it is more efficient to push the data once to the RunningStat object, and call the numerous statistical procs for the RunningStat object.

 
```
var rs: RunningStat
rs.push(MySeqOfData)
rs.mean()
rs.variance()
rs.skewness()
rs.kurtosis()
```
 **Example:**

 
```
static:
  block:
    var statistics: RunningStat  ## Must be "var"
    statistics.push(@[1.0, 2.0, 1.0, 4.0, 1.0, 4.0, 1.0, 2.0])
    doAssert statistics.n == 8
    template `===`(a, b: float): bool = (abs(a - b) < 1e-9)
    doAssert statistics.mean() === 2.0
    doAssert statistics.variance() === 1.5
    doAssert statistics.varianceS() === 1.714285714285715
    doAssert statistics.skewness() === 0.8164965809277261
    doAssert statistics.skewnessS() === 1.018350154434631
    doAssert statistics.kurtosis() === -1.0
    doAssert statistics.kurtosisS() === -0.7000000000000008
```
 Imports
-------

  <math>  Types
-----

  
```
RunningStat = object
  n*: int                    ## number of pushed data
  min*, max*, sum*: float    ## self-explaining
  mom1, mom2, mom3, mom4: float ## statistical moments, mom1 is mean
```
  an accumulator for statistical data [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L56)  
```
RunningRegress = object
  n*: int                    ## number of pushed data
  x_stats*: RunningStat      ## stats for first set of data
  y_stats*: RunningStat      ## stats for second set of data
  s_xy: float                ## accumulated data for combined xy
```
  an accumulator for regression calculations [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L62)   Procs
-----

  
```
proc clear(s: var RunningStat) {...}{.raises: [], tags: [].}
```
  reset `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L69)  
```
proc push(s: var RunningStat; x: float) {...}{.raises: [], tags: [].}
```
  pushes a value `x` for processing [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L80)  
```
proc push(s: var RunningStat; x: int) {...}{.raises: [], tags: [].}
```
  pushes a value `x` for processing.

 `x` is simply converted to `float` and the other push operation is called.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L99)  
```
proc push(s: var RunningStat; x: openArray[float | int])
```
  pushes all values of `x` for processing.

 Int values of `x` are simply converted to `float` and the other push operation is called.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L106)  
```
proc mean(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current mean of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L114)  
```
proc variance(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current population variance of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L118)  
```
proc varianceS(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current sample variance of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L122)  
```
proc standardDeviation(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current population standard deviation of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L126)  
```
proc standardDeviationS(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current sample standard deviation of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L130)  
```
proc skewness(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current population skewness of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L134)  
```
proc skewnessS(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current sample skewness of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L138)  
```
proc kurtosis(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current population kurtosis of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L143)  
```
proc kurtosisS(s: RunningStat): float {...}{.raises: [], tags: [].}
```
  computes the current sample kurtosis of `s` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L147)  
```
proc `+`(a, b: RunningStat): RunningStat {...}{.raises: [], tags: [].}
```
  combine two RunningStats.

 Useful if performing parallel analysis of data series and need to re-combine parallel result sets

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L152)  
```
proc `+=`(a: var RunningStat; b: RunningStat) {...}{.inline, raises: [], tags: [].}
```
  add a second RunningStats `b` to `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L180)  
```
proc `$`(a: RunningStat): string {...}{.raises: [], tags: [].}
```
  produces a string representation of the `RunningStat`. The exact format is currently unspecified and subject to change. Currently it contains:* the number of probes
* min, max values
* sum, mean and standard deviation.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L184)  
```
proc mean[T](x: openArray[T]): float
```
  computes the mean of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L202)  
```
proc variance[T](x: openArray[T]): float
```
  computes the population variance of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L208)  
```
proc varianceS[T](x: openArray[T]): float
```
  computes the sample variance of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L214)  
```
proc standardDeviation[T](x: openArray[T]): float
```
  computes the population standardDeviation of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L220)  
```
proc standardDeviationS[T](x: openArray[T]): float
```
  computes the sample standardDeviation of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L226)  
```
proc skewness[T](x: openArray[T]): float
```
  computes the population skewness of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L232)  
```
proc skewnessS[T](x: openArray[T]): float
```
  computes the sample skewness of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L238)  
```
proc kurtosis[T](x: openArray[T]): float
```
  computes the population kurtosis of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L244)  
```
proc kurtosisS[T](x: openArray[T]): float
```
  computes the sample kurtosis of `x` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L250)  
```
proc clear(r: var RunningRegress) {...}{.raises: [], tags: [].}
```
  reset `r` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L258)  
```
proc push(r: var RunningRegress; x, y: float) {...}{.raises: [], tags: [].}
```
  pushes two values `x` and `y` for processing [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L265)  
```
proc push(r: var RunningRegress; x, y: int) {...}{.inline, raises: [], tags: [].}
```
  pushes two values `x` and `y` for processing.

 `x` and `y` are converted to `float` and the other push operation is called.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L273)  
```
proc push(r: var RunningRegress; x, y: openArray[float | int])
```
  pushes two sets of values `x` and `y` for processing. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L280)  
```
proc slope(r: RunningRegress): float {...}{.raises: [], tags: [].}
```
  computes the current slope of `r` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L286)  
```
proc intercept(r: RunningRegress): float {...}{.raises: [], tags: [].}
```
  computes the current intercept of `r` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L291)  
```
proc correlation(r: RunningRegress): float {...}{.raises: [], tags: [].}
```
  computes the current correlation of the two data sets pushed into `r` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L295)  
```
proc `+`(a, b: RunningRegress): RunningRegress {...}{.raises: [], tags: [].}
```
  combine two `RunningRegress` objects.

 Useful if performing parallel analysis of data series and need to re-combine parallel result sets

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L301)  
```
proc `+=`(a: var RunningRegress; b: RunningRegress) {...}{.raises: [], tags: [].}
```
  add RunningRegress `b` to `a` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/stats.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/stats.nim#L316)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/stats.html>

sums
====

 Fast sumation functions. 


**Example:**

 
```
static:
  block:
    const data = [1, 2, 3, 4, 5, 6, 7, 8, 9]
    doAssert sumKbn(data) == 45
    doAssert sumPairs(data) == 45
```
 Imports
-------

  <math>  Funcs
-----

  
```
func sumKbn[T](x: openArray[T]): T
```
  Kahan-Babuška-Neumaier summation: O(1) error growth, at the expense of a considerable increase in computational expense. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sums.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sums.nim#L12)  
```
func sumPairs[T](x: openArray[T]): T
```
  Pairwise (cascade) summation of `x[i0:i0+n-1]`, with O(log n) error growth (vs O(n) for a simple loop) with negligible performance cost if the base case is large enough.

 See, e.g.:

 * <http://en.wikipedia.org/wiki/Pairwise_summation> Higham, Nicholas J. (1993), "The accuracy of floating point summation", SIAM Journal on Scientific Computing 14 (4): 783–799.

 In fact, the root-mean-square error growth, assuming random roundoff errors, is only O(sqrt(log n)), which is nearly indistinguishable from O(1) in practice. See:

 * Manfred Tasche and Hansmartin Zeuner, Handbook of Analytic-Computational Methods in Applied Mathematics (2000).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sums.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sums.nim#L37)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sums.html>

asyncdispatch
=============


This module implements asynchronous IO. This includes a dispatcher, a `Future` type implementation, and an `async` macro which allows asynchronous code to be written in a synchronous style with the `await` keyword.

 The dispatcher acts as a kind of event loop. You must call `poll` on it (or a function which does so for you such as `waitFor` or `runForever`) in order to poll for any outstanding events. The underlying implementation is based on epoll on Linux, IO Completion Ports on Windows and select on other operating systems.

 The `poll` function will not, on its own, return any events. Instead an appropriate `Future` object will be completed. A `Future` is a type which holds a value which is not yet available, but which *may* be available in the future. You can check whether a future is finished by using the `finished` function. When a future is finished it means that either the value that it holds is now available or it holds an error instead. The latter situation occurs when the operation to complete a future fails with an exception. You can distinguish between the two situations with the `failed` function.

 Future objects can also store a callback procedure which will be called automatically once the future completes.

 Futures therefore can be thought of as an implementation of the proactor pattern. In this pattern you make a request for an action, and once that action is fulfilled a future is completed with the result of that action. Requests can be made by calling the appropriate functions. For example: calling the `recv` function will create a request for some data to be read from a socket. The future which the `recv` function returns will then complete once the requested amount of data is read **or** an exception occurs.

 Code to read some data from a socket may look something like this:

 
```
var future = socket.recv(100)
future.addCallback(
  proc () =
    echo(future.read)
)
```
 All asynchronous functions returning a `Future` will not block. They will not however return immediately. An asynchronous function will have code which will be executed before an asynchronous request is made, in most cases this code sets up the request.

 In the above example, the `recv` function will return a brand new `Future` instance once the request for data to be read from the socket is made. This `Future` instance will complete once the requested amount of data is read, in this case it is 100 bytes. The second line sets a callback on this future which will be called once the future completes. All the callback does is write the data stored in the future to `stdout`. The `read` function is used for this and it checks whether the future completes with an error for you (if it did it will simply raise the error), if there is no error however it returns the value of the future.

 Asynchronous procedures
-----------------------


Asynchronous procedures remove the pain of working with callbacks. They do this by allowing you to write asynchronous code the same way as you would write synchronous code.

 An asynchronous procedure is marked using the `{.async.}` pragma. When marking a procedure with the `{.async.}` pragma it must have a `Future[T]` return type or no return type at all. If you do not specify a return type then `Future[void]` is assumed.

 Inside asynchronous procedures `await` can be used to call any procedures which return a `Future`; this includes asynchronous procedures. When a procedure is "awaited", the asynchronous procedure it is awaited in will suspend its execution until the awaited procedure's Future completes. At which point the asynchronous procedure will resume its execution. During the period when an asynchronous procedure is suspended other asynchronous procedures will be run by the dispatcher.

 The `await` call may be used in many contexts. It can be used on the right hand side of a variable declaration: `var data = await socket.recv(100)`, in which case the variable will be set to the value of the future automatically. It can be used to await a `Future` object, and it can be used to await a procedure returning a `Future[void]`: `await socket.send("foobar")`.

 If an awaited future completes with an error, then `await` will re-raise this error. To avoid this, you can use the `yield` keyword instead of `await`. The following section shows different ways that you can handle exceptions in async procs.

 ### Handling Exceptions


The most reliable way to handle exceptions is to use `yield` on a future then check the future's `failed` property. For example:

 
```
var future = sock.recv(100)
yield future
if future.failed:
  # Handle exception
```
 The `async` procedures also offer limited support for the try statement.

 
```
try:
  let data = await sock.recv(100)
  echo("Received ", data)
except:
  # Handle exception
```
 Unfortunately the semantics of the try statement may not always be correct, and occasionally the compilation may fail altogether. As such it is better to use the former style when possible.

 Discarding futures
------------------


Futures should **never** be discarded. This is because they may contain errors. If you do not care for the result of a Future then you should use the `asyncCheck` procedure instead of the `discard` keyword. Note however that this does not wait for completion, and you should use `waitFor` for that purpose.

 Examples
--------


For examples take a look at the documentation for the modules implementing asynchronous IO. A good place to start is the [asyncnet module](asyncnet).

 Investigating pending futures
-----------------------------


It's possible to get into a situation where an async proc, or more accurately a `Future[T]` gets stuck and never completes. This can happen for various reasons and can cause serious memory leaks. When this occurs it's hard to identify the procedure that is stuck.

 Thankfully there is a mechanism which tracks the count of each pending future. All you need to do to enable it is compile with `-d:futureLogging` and use the `getFuturesInProgress` procedure to get the list of pending futures together with the stack traces to the moment of their creation.

 You may also find it useful to use this [prometheus package](https://github.com/dom96/prometheus) which will log the pending futures into prometheus, allowing you to analyse them via a nice graph.

 Limitations/Bugs
----------------


* The effect system (`raises: []`) does not work with async procedures.

 `asyncdispatch` module depends on the `asyncmacro` module to work properly. Imports
-------

  <os>, <tables>, <strutils>, <times>, <heapqueue>, <options>, <asyncstreams>, <options>, <math>, <monotimes>, <asyncfutures>, <nativesockets>, <net>, <deques>, <winlean>, <sets>, <hashes>, <macros>, <strutils>, <asyncfutures>, <posix>  Types
-----

  
```
CompletionData = object
  fd*: AsyncFD
  cb*: owned(proc (fd: AsyncFD; bytesTransferred: DWORD; errcode: OSErrorCode) {...}{.
      closure, gcsafe.})
  cell*: ForeignCell
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L246)  
```
PDispatcher = ref object of PDispatcherBase
  ioPort: Handle
  handles*: HashSet[AsyncFD]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L254)  
```
CustomRef = ref CustomObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L261)  
```
AsyncFD = distinct int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L263)  
```
AsyncEvent = ptr AsyncEventImpl
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L276)  
```
Callback = proc (fd: AsyncFD): bool {...}{.closure, gcsafe.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L278)   Procs
-----

  
```
proc `==`(x: AsyncFD; y: AsyncFD): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L281)  
```
proc newDispatcher(): owned PDispatcher {...}{.raises: [], tags: [].}
```
  Creates a new Dispatcher instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L283)  
```
proc setGlobalDispatcher(disp: sink PDispatcher) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L293)  
```
proc getGlobalDispatcher(): PDispatcher {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L299)  
```
proc getIoHandler(disp: PDispatcher): Handle {...}{.raises: [], tags: [].}
```
  Returns the underlying IO Completion Port handle (Windows) or selector (Unix) for the specified dispatcher. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L304)  
```
proc register(fd: AsyncFD) {...}{.raises: [Exception, OSError], tags: [RootEffect].}
```
  Registers `fd` with the dispatcher. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L309)  
```
proc hasPendingOperations(): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  Returns `true` if the global dispatcher has pending operations. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L327)  
```
proc newCustom(): CustomRef {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L424)  
```
proc recv(socket: AsyncFD; size: int; flags = {SafeDisconn}): owned(
    Future[string]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads **up to** `size` bytes from `socket`. Returned future will complete once all the data requested is read, a part of the data has been read, or the socket has disconnected in which case the future will complete with a value of `""`.

 **Warning**: The `Peek` socket flag is not supported on Windows.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L431)  
```
proc recvInto(socket: AsyncFD; buf: pointer; size: int; flags = {SafeDisconn}): owned(
    Future[int]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads **up to** `size` bytes from `socket` into `buf`, which must at least be of that size. Returned future will complete once all the data requested is read, a part of the data has been read, or the socket has disconnected in which case the future will complete with a value of `0`.

 **Warning**: The `Peek` socket flag is not supported on Windows.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L504)  
```
proc send(socket: AsyncFD; buf: pointer; size: int; flags = {SafeDisconn}): owned(
    Future[void]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Sends `size` bytes from `buf` to `socket`. The returned future will complete once all data has been sent.

 **WARNING**: Use it with caution. If `buf` refers to GC'ed object, you must use GC\_ref/GC\_unref calls to avoid early freeing of the buffer.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L570)  
```
proc sendTo(socket: AsyncFD; data: pointer; size: int; saddr: ptr SockAddr;
            saddrLen: SockLen; flags = {SafeDisconn}): owned(Future[void]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Sends `data` to specified destination `saddr`, using socket `socket`. The returned future will complete once all data has been sent. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L615)  
```
proc recvFromInto(socket: AsyncFD; data: pointer; size: int;
                  saddr: ptr SockAddr; saddrLen: ptr SockLen;
                  flags = {SafeDisconn}): owned(Future[int]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Receives a datagram data from `socket` into `buf`, which must be at least of size `size`, address of datagram's sender will be stored into `saddr` and `saddrLen`. Returned future will complete once one datagram has been received, and will return size of packet received. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L660)  
```
proc acceptAddr(socket: AsyncFD; flags = {SafeDisconn};
                inheritable = defined(nimInheritHandles)): owned(
    Future[tuple[address: string, client: AsyncFD]]) {...}{.
    raises: [Exception, ValueError, OSError, ValueError, Exception],
    tags: [RootEffect].}
```
  Accepts a new connection. Returns a future containing the client socket corresponding to that connection and the remote address of the client. The future will complete when the connection is successfully accepted.

 The resulting client socket is automatically registered to the dispatcher.

 If `inheritable` is false (the default), the resulting client socket will not be inheritable by child processes.

 The `accept` call may result in an error if the connecting socket disconnects during the duration of the `accept`. If the `SafeDisconn` flag is specified then this error will not be raised and instead accept will be called again.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L708)  
```
proc setInheritable(fd: AsyncFD; inheritable: bool): bool {...}{.raises: [], tags: [].}
```
  Control whether a file handle can be inherited by child processes. Returns `true` on success.

 This procedure is not guaranteed to be available for all platforms. Test for availability with [declared()](#declared).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L805) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L805)  
```
proc closeSocket(socket: AsyncFD) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Closes a socket and ensures that it is unregistered. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L807) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L807)  
```
proc unregister(fd: AsyncFD) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Unregisters `fd`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L812) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L812)  
```
proc contains(disp: PDispatcher; fd: AsyncFD): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L816)  
```
proc addRead(fd: AsyncFD; cb: Callback) {...}{.raises: [Exception, OSError],
    tags: [RootEffect].}
```
  Start watching the file descriptor for read availability and then call the callback `cb`.

 This is not `pure` mechanism for Windows Completion Ports (IOCP), so if you can avoid it, please do it. Use `addRead` only if really need it (main usecase is adaptation of unix-like libraries to be asynchronous on Windows).

 If you use this function, you don't need to use asyncdispatch.recv() or asyncdispatch.accept(), because they are using IOCP, please use nativesockets.recv() and nativesockets.accept() instead.

 Be sure your callback `cb` returns `true`, if you want to remove watch of `read` notifications, and `false`, if you want to continue receiving notifications.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L911)  
```
proc addWrite(fd: AsyncFD; cb: Callback) {...}{.raises: [Exception, OSError],
    tags: [RootEffect].}
```
  Start watching the file descriptor for write availability and then call the callback `cb`.

 This is not `pure` mechanism for Windows Completion Ports (IOCP), so if you can avoid it, please do it. Use `addWrite` only if really need it (main usecase is adaptation of unix-like libraries to be asynchronous on Windows).

 If you use this function, you don't need to use asyncdispatch.send() or asyncdispatch.connect(), because they are using IOCP, please use nativesockets.send() and nativesockets.connect() instead.

 Be sure your callback `cb` returns `true`, if you want to remove watch of `write` notifications, and `false`, if you want to continue receiving notifications.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L929) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L929)  
```
proc addTimer(timeout: int; oneshot: bool; cb: Callback) {...}{.
    raises: [Exception, OSError], tags: [RootEffect].}
```
  Registers callback `cb` to be called when timer expired.

 Parameters:

 * `timeout` - timeout value in milliseconds.
* `oneshot`
	+ `true` - generate only one timeout event
	+ `false` - generate timeout events periodically

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L982) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L982)  
```
proc addProcess(pid: int; cb: Callback) {...}{.raises: [Exception, OSError],
    tags: [RootEffect].}
```
  Registers callback `cb` to be called when process with process ID `pid` exited. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1016) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1016)  
```
proc newAsyncEvent(): AsyncEvent {...}{.raises: [OSError], tags: [].}
```
  Creates a new thread-safe `AsyncEvent` object.

 New `AsyncEvent` object is not automatically registered with dispatcher like `AsyncSocket`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1035)  
```
proc trigger(ev: AsyncEvent) {...}{.raises: [OSError], tags: [].}
```
  Set event `ev` to signaled state. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1050)  
```
proc unregister(ev: AsyncEvent) {...}{.raises: [Exception, OSError],
                                  tags: [RootEffect].}
```
  Unregisters event `ev`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1055) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1055)  
```
proc close(ev: AsyncEvent) {...}{.raises: [OSError], tags: [].}
```
  Closes event `ev`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1066) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1066)  
```
proc addEvent(ev: AsyncEvent; cb: Callback) {...}{.raises: [Exception, OSError],
    tags: [RootEffect].}
```
  Registers callback `cb` to be called when `ev` will be signaled [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1073) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1073)  
```
proc drain(timeout = 500) {...}{.raises: [Exception, ValueError, OSError],
                            tags: [TimeEffect, RootEffect].}
```
  Waits for completion of **all** events and processes them. Raises `ValueError` if there are no pending operations. In contrast to `poll` this processes as many events as are available until the timeout has elapsed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1611)  
```
proc poll(timeout = 500) {...}{.raises: [Exception, ValueError, OSError],
                           tags: [RootEffect, TimeEffect].}
```
  Waits for completion events and processes them. Raises `ValueError` if there are no pending operations. This runs the underlying OS epoll or kqueue primitive only once. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1623)  
```
proc createAsyncNativeSocket(domain: cint; sockType: cint; protocol: cint;
                             inheritable = defined(nimInheritHandles)): AsyncFD {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1640)  
```
proc createAsyncNativeSocket(domain: Domain = Domain.AF_INET;
                             sockType: SockType = SOCK_STREAM;
                             protocol: Protocol = IPPROTO_TCP;
                             inheritable = defined(nimInheritHandles)): AsyncFD {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1645)  
```
proc dial(address: string; port: Port; protocol: Protocol = IPPROTO_TCP): owned(
    Future[AsyncFD]) {...}{.raises: [OSError, ValueError, Exception],
                       tags: [RootEffect].}
```
  Establishes connection to the specified `address`:`port` pair via the specified protocol. The procedure iterates through possible resolutions of the `address` until it succeeds, meaning that it seamlessly works with both IPv4 and IPv6. Returns the async file descriptor, registered in the dispatcher of the current thread, ready to send or receive data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1803) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1803)  
```
proc connect(socket: AsyncFD; address: string; port: Port;
             domain = Domain.AF_INET): owned(Future[void]) {...}{.
    raises: [OSError, IOError, ValueError, Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1818) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1818)  
```
proc sleepAsync(ms: int | float): owned(Future[void])
```
  Suspends the execution of the current async procedure for the next `ms` milliseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1833)  
```
proc withTimeout[T](fut: Future[T]; timeout: int): owned(Future[bool])
```
  Returns a future which will complete once `fut` completes or after `timeout` milliseconds has elapsed.

 If `fut` completes first the returned future will hold true, otherwise, if `timeout` milliseconds has elapsed first, the returned future will hold false.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1845) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1845)  
```
proc accept(socket: AsyncFD; flags = {SafeDisconn};
            inheritable = defined(nimInheritHandles)): owned(Future[AsyncFD]) {...}{.
    raises: [Exception, ValueError, OSError], tags: [RootEffect].}
```
  Accepts a new connection. Returns a future containing the client socket corresponding to that connection.

 If `inheritable` is false (the default), the resulting client socket will not be inheritable by child processes.

 The future will complete when the connection is successfully accepted.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1867)  
```
proc send(socket: AsyncFD; data: string; flags = {SafeDisconn}): owned(
    Future[void]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Sends `data` to `socket`. The returned future will complete once all data has been sent. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1891) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1891)  
```
proc readAll(future: FutureStream[string]): owned(Future[string]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Returns a future that will complete when all the string data from the specified future stream is retrieved. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1913) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1913)  
```
proc callSoon(cbproc: proc () {...}{.gcsafe.}) {...}{.gcsafe, raises: [Exception],
    tags: [RootEffect].}
```
  Schedule `cbproc` to be called as soon as possible. The callback is called when control returns to the event loop. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1924)  
```
proc runForever() {...}{.raises: [Exception, ValueError, OSError],
                    tags: [RootEffect, TimeEffect].}
```
  Begins a never ending global dispatcher poll loop. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1927) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1927)  
```
proc waitFor[T](fut: Future[T]): T
```
  **Blocks** the current thread until the specified future completes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1932) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1932)  
```
proc activeDescriptors(): int {...}{.inline, raises: [], tags: [].}
```
  Returns the current number of active file descriptors for the current event loop. This is a cheap operation that does not involve a system call. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1939) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1939)  
```
proc maxDescriptors(): int {...}{.raises: OSError, tags: [].}
```
  Returns the maximum number of active file descriptors for the current process. This involves a system call. For now `maxDescriptors` is supported on the following OSes: Windows, Linux, OSX, BSD. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncdispatch.nim#L1951) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncdispatch.nim#L1951)   Macros
------

  
```
macro async(prc: untyped): untyped
```
  Macro which processes async procedures into the appropriate iterators and yield statements. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncmacro.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncmacro.nim#L289)  
```
macro multisync(prc: untyped): untyped
```
  Macro which processes async procedures into both asynchronous and synchronous procedures.

 The generated async procedures use the `async` macro, whereas the generated synchronous procedures simply strip off the `await` calls.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncmacro.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncmacro.nim#L348)   Templates
---------

  
```
template await(f: typed): untyped {...}{.used.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncmacro.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncmacro.nim#L138)  
```
template await[T](f: Future[T]): auto {...}{.used.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncmacro.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncmacro.nim#L142)   Exports
-------

  [Port](nativesockets#Port), [SocketFlag](net#SocketFlag), [and](asyncfutures#and,Future%5BT%5D,Future%5BY%5D), [addCallback](asyncfutures#addCallback,Future%5BT%5D,proc(Future%5BT%5D)), [asyncCheck](asyncfutures#asyncCheck,Future%5BT%5D), [or](asyncfutures#or,Future%5BT%5D,Future%5BY%5D), [read](asyncfutures#read), [fail](asyncfutures#fail,Future%5BT%5D,ref.Exception), [setCallSoonProc](asyncfutures#setCallSoonProc), [addCallback](asyncfutures#addCallback,FutureBase,proc)), [clean](asyncfutures#clean,FutureVar%5BT%5D), [clearCallbacks](asyncfutures#clearCallbacks,FutureBase), [newFutureVar](asyncfutures#newFutureVar,string), [mget](asyncfutures#mget,FutureVar%5BT%5D), [Future](asyncfutures#Future), [failed](asyncfutures#failed,FutureBase), [$](asyncfutures#%24,seq%5BStackTraceEntry%5D), [callback=](asyncfutures#callback=,FutureBase,proc)), [complete](asyncfutures#complete,FutureVar%5BT%5D,T), [callback=](asyncfutures#callback=,Future%5BT%5D,proc(Future%5BT%5D)), [NimAsyncContinueSuffix](asyncfutures#NimAsyncContinueSuffix), [FutureBase](asyncfutures#FutureBase), [all](asyncfutures#all,varargs%5BFuture%5BT%5D%5D), [complete](asyncfutures#complete,FutureVar%5BT%5D), [FutureError](asyncfutures#FutureError), [getCallSoonProc](asyncfutures#getCallSoonProc), [FutureVar](asyncfutures#FutureVar), [isFutureLoggingEnabled](asyncfutures#isFutureLoggingEnabled), [complete](asyncfutures#complete,Future%5Bvoid%5D), [readError](asyncfutures#readError,Future%5BT%5D), [complete](asyncfutures#complete,Future%5BT%5D,T), [newFuture](asyncfutures#newFuture,string), [finished](asyncfutures#finished), [len](asyncstreams#len,FutureStream%5BT%5D), [callback=](asyncstreams#callback=,FutureStream%5BT%5D,proc(FutureStream%5BT%5D)), [fail](asyncstreams#fail,FutureStream%5BT%5D,ref.Exception), [newFutureStream](asyncstreams#newFutureStream,string), [finished](asyncstreams#finished,FutureStream%5BT%5D), [write](asyncstreams#write,FutureStream%5BT%5D,T), [complete](asyncstreams#complete,FutureStream%5BT%5D), [FutureStream](asyncstreams#FutureStream), [read](asyncstreams#read,FutureStream%5BT%5D), [failed](asyncstreams#failed,FutureStream%5BT%5D) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncdispatch.html>

asyncfile
=========

 This module implements asynchronous file reading and writing.



```
import asyncfile, asyncdispatch, os

proc main() {.async.} =
  var file = openAsync(getTempDir() / "foobar.txt", fmReadWrite)
  await file.write("test")
  file.setFilePos(0)
  let data = await file.readAll()
  doAssert data == "test"
  file.close()

waitFor main()
```
 Imports
-------

  <asyncdispatch>, <os>, <winlean>  Types
-----

  
```
AsyncFile = ref object
  fd: AsyncFD
  offset: int64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L35)   Procs
-----

  
```
proc getFileSize(f: AsyncFile): int64 {...}{.raises: [OSError], tags: [].}
```
  Retrieves the specified file's size. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L72)  
```
proc newAsyncFile(fd: AsyncFD): AsyncFile {...}{.raises: [Exception, OSError],
    tags: [RootEffect].}
```
  Creates `AsyncFile` with a previously opened file descriptor `fd`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L86)  
```
proc openAsync(filename: string; mode = fmRead): AsyncFile {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  Opens a file specified by the path in `filename` using the specified FileMode `mode` asynchronously. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L92)  
```
proc readBuffer(f: AsyncFile; buf: pointer; size: int): Future[int] {...}{.
    raises: [ValueError, Exception], tags: [RootEffect].}
```
  Read `size` bytes from the specified file asynchronously starting at the current position of the file pointer.

 If the file pointer is past the end of the file then zero is returned and no bytes are read into `buf`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L126)  
```
proc read(f: AsyncFile; size: int): Future[string] {...}{.
    raises: [ValueError, Exception], tags: [RootEffect].}
```
  Read `size` bytes from the specified file asynchronously starting at the current position of the file pointer.

 If the file pointer is past the end of the file then an empty string is returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L203)  
```
proc readLine(f: AsyncFile): Future[string] {...}{.raises: [Exception, ValueError],
    tags: [RootEffect].}
```
  Reads a single line from the specified file asynchronously. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L297)  
```
proc getFilePos(f: AsyncFile): int64 {...}{.raises: [], tags: [].}
```
  Retrieves the current position of the file pointer that is used to read from the specified file. The file's first byte has the index zero. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L310)  
```
proc setFilePos(f: AsyncFile; pos: int64) {...}{.raises: [], tags: [].}
```
  Sets the position of the file pointer that is used for read/write operations. The file's first byte has the index zero. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L316)  
```
proc readAll(f: AsyncFile): Future[string] {...}{.raises: [Exception, ValueError],
    tags: [RootEffect].}
```
  Reads all data from the specified file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L325)  
```
proc writeBuffer(f: AsyncFile; buf: pointer; size: int): Future[void] {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Writes `size` bytes from `buf` to the file specified asynchronously.

 The returned Future will complete once all data has been written to the specified file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L334)  
```
proc write(f: AsyncFile; data: string): Future[void] {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Writes `data` to the file specified asynchronously.

 The returned Future will complete once all data has been written to the specified file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L403)  
```
proc setFileSize(f: AsyncFile; length: int64) {...}{.raises: [OSError], tags: [].}
```
  Set a file length. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L484)  
```
proc close(f: AsyncFile) {...}{.raises: [Exception, OSError], tags: [RootEffect].}
```
  Closes the file specified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L501)  
```
proc writeFromStream(f: AsyncFile; fs: FutureStream[string]): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Reads data from the specified future stream until it is completed. The data which is read is written to the file immediately and freed from memory.

 This procedure is perfect for saving streamed data to a file without wasting memory.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L511)  
```
proc readToStream(f: AsyncFile; fs: FutureStream[string]): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Writes data to the specified future stream as the file is read. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfile.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfile.nim#L525)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncfile.html>

asyncftpclient
==============

 This module implements an asynchronous FTP client. It allows you to connect to an FTP server and perform operations on it such as for example:


* The upload of new files.
* The removal of existing files.
* Download of files.
* Changing of files' permissions.
* Navigation through the FTP server's directories.

 Connecting to an FTP server
---------------------------


In order to begin any sort of transfer of files you must first connect to an FTP server. You can do so with the `connect` procedure.

 
```
import asyncdispatch, asyncftpclient
proc main() {.async.} =
  var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test")
  await ftp.connect()
  echo("Connected")
waitFor(main())
```

A new `main` async procedure must be declared to allow the use of the `await` keyword. The connection will complete asynchronously and the client will be connected after the `await ftp.connect()` call.

 Uploading a new file
--------------------


After a connection is made you can use the `store` procedure to upload a new file to the FTP server. Make sure to check you are in the correct working directory before you do so with the `pwd` procedure, you can also instead specify an absolute path.

 
```
import asyncdispatch, asyncftpclient
proc main() {.async.} =
  var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test")
  await ftp.connect()
  let currentDir = await ftp.pwd()
  assert currentDir == "/home/user/"
  await ftp.store("file.txt", "file.txt")
  echo("File finished uploading")
waitFor(main())
```
 Checking the progress of a file transfer
----------------------------------------


The progress of either a file upload or a file download can be checked by specifying a `onProgressChanged` procedure to the `store` or `retrFile` procedures.

 Procs that take an `onProgressChanged` callback will call this every `progressInterval` milliseconds.

 
```
import asyncdispatch, asyncftpclient

proc onProgressChanged(total, progress: BiggestInt,
                        speed: float) {.async.} =
  echo("Uploaded ", progress, " of ", total, " bytes")
  echo("Current speed: ", speed, " kb/s")

proc main() {.async.} =
  var ftp = newAsyncFtpClient("example.com", user = "test", pass = "test", progressInterval = 500)
  await ftp.connect()
  await ftp.store("file.txt", "/home/user/file.txt", onProgressChanged)
  echo("File finished uploading")
waitFor(main())
```
 Imports
-------

  <asyncdispatch>, <asyncnet>, <nativesockets>, <strutils>, <parseutils>, <os>, <times>, <net>  Types
-----

  
```
AsyncFtpClient = ref object
  csock*: AsyncSocket
  dsock*: AsyncSocket
  user*, pass*: string
  address*: string
  port*: Port
  progressInterval: int
  jobInProgress*: bool
  job*: FtpJob
  dsockConnected*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L85)  
```
FtpJobType = enum
  JRetrText, JRetr, JStore
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L96)  
```
FtpEventType = enum
  EvTransferProgress, EvLines, EvRetr, EvStore
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L113)  
```
FtpEvent = object
  filename*: string
  case typ*: FtpEventType
  of EvLines:
      lines*: string         ## Lines that have been transferred.
    
  of EvRetr, EvStore:       ## Retr/Store operation finished.
      nil

  of EvTransferProgress:
      bytesTotal*: BiggestInt ## Bytes total.
      bytesFinished*: BiggestInt ## Bytes transferred.
      speed*: BiggestInt     ## Speed in bytes/s
      currentJob*: FtpJobType ## The current job being performed.
```
  Event [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L116)  
```
ReplyError = object of IOError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L129)  
```
ProgressChangedProc = proc (total, progress: BiggestInt; speed: float): Future[
    void] {...}{.closure, gcsafe.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L131)   Procs
-----

  
```
proc send(ftp: AsyncFtpClient; m: string): Future[TaintedString] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Send a message to the server, and wait for a primary reply. `\c\L` is added for you.

 You need to make sure that the message `m` doesn't contain any newline characters. Failing to do so will raise `AssertionDefect`.

 **Note:** The server may return multiple lines of coded replies.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L149)  
```
proc connect(ftp: AsyncFtpClient): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Connect to the FTP server specified by `ftp`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L185)  
```
proc pwd(ftp: AsyncFtpClient): Future[TaintedString] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Returns the current working directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L204)  
```
proc cd(ftp: AsyncFtpClient; dir: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Changes the current directory on the remote FTP server to `dir`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L210)  
```
proc cdup(ftp: AsyncFtpClient): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Changes the current directory to the parent of the current directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L214)  
```
proc listDirs(ftp: AsyncFtpClient; dir = ""): Future[seq[string]] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Returns a list of filenames in the given directory. If `dir` is "", the current directory is used. If `async` is true, this function will return immediately and it will be your job to use asyncdispatch's `poll` to progress this operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L231)  
```
proc fileExists(ftp: AsyncFtpClient; file: string): Future[bool] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Determines whether `file` exists. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L242)  
```
proc createDir(ftp: AsyncFtpClient; dir: string; recursive = false): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Creates a directory `dir`. If `recursive` is true, the topmost subdirectory of `dir` will be created first, following the secondmost... etc. this allows you to give a full path as the `dir` without worrying about subdirectories not existing. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L248)  
```
proc chmod(ftp: AsyncFtpClient; path: string; permissions: set[FilePermission]): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Changes permission of `path` to `permissions`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L266)  
```
proc list(ftp: AsyncFtpClient; dir = ""): Future[string] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Lists all files in `dir`. If `dir` is `""`, uses the current working directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L287)  
```
proc retrText(ftp: AsyncFtpClient; file: string): Future[string] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Retrieves `file`. File must be ASCII text. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L297)  
```
proc defaultOnProgressChanged(total, progress: BiggestInt; speed: float): Future[
    void] {...}{.nimcall, gcsafe, raises: [Exception], tags: [RootEffect].}
```
  Default FTP `onProgressChanged` handler. Does nothing. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L332)  
```
proc retrFile(ftp: AsyncFtpClient; file, dest: string;
              onProgressChanged: ProgressChangedProc = defaultOnProgressChanged): owned(
    Future[void]) {...}{.raises: [Exception],
                    tags: [RootEffect, TimeEffect, WriteIOEffect].}
```
  Downloads `file` and saves it to `dest`. The `EvRetr` event is passed to the specified `handleEvent` function when the download is finished. The event's `filename` field will be equal to `file`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L340)  
```
proc store(ftp: AsyncFtpClient; file, dest: string;
           onProgressChanged: ProgressChangedProc = defaultOnProgressChanged): owned(
    Future[void]) {...}{.raises: [Exception],
                    tags: [RootEffect, ReadIOEffect, TimeEffect].}
```
  Uploads `file` to `dest` on the remote FTP server. Usage of this function asynchronously is recommended to view the progress of the download. The `EvStore` event is passed to the specified `handleEvent` function when the upload is finished, and the `filename` field will be equal to `file`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L392)  
```
proc rename(ftp: AsyncFtpClient; nameFrom: string; nameTo: string): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Rename a file or directory on the remote FTP Server from current name `name_from` to new name `name_to` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L407)  
```
proc removeFile(ftp: AsyncFtpClient; filename: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Delete a file `filename` on the remote FTP server [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L413)  
```
proc removeDir(ftp: AsyncFtpClient; dir: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Delete a directory `dir` on the remote FTP server [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L417)  
```
proc newAsyncFtpClient(address: string; port = Port(21); user, pass = "";
                       progressInterval: int = 1000): AsyncFtpClient {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  Creates a new `AsyncFtpClient` object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncftpclient.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncftpclient.nim#L421)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncftpclient.html>

asynchttpserver
===============


This module implements a high performance asynchronous HTTP server.

 This HTTP server has not been designed to be used in production, but for testing applications locally. Because of this, when deploying your application in production you should use a reverse proxy (for example nginx) instead of allowing users to connect directly to this server.

 Example
-------


This example will create an HTTP server on port 8080. The server will respond to all requests with a `200 OK` response code and "Hello World" as the response body.

 
```
import asynchttpserver, asyncdispatch

proc main {.async.} =
  var server = newAsyncHttpServer()
  proc cb(req: Request) {.async.} =
    let headers = {"Date": "Tue, 29 Apr 2014 23:40:08 GMT",
        "Content-type": "text/plain; charset=utf-8"}
    await req.respond(Http200, "Hello World", headers.newHttpHeaders())
  
  server.listen Port(8080)
  while true:
    if server.shouldAcceptRequest():
      await server.acceptRequest(cb)
    else:
      poll()

asyncCheck main()
runForever()
```
 Imports
-------

  <asyncnet>, <asyncdispatch>, <parseutils>, <uri>, <strutils>, <httpcore>  Types
-----

  
```
Request = object
  client*: AsyncSocket
  reqMethod*: HttpMethod
  headers*: HttpHeaders
  protocol*: tuple[orig: string, major, minor: int]
  url*: Uri
  hostname*: string          ## The hostname of the client that made the request.
  body*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L59)  
```
AsyncHttpServer = ref object
  socket: AsyncSocket
  reuseAddr: bool
  reusePort: bool
  maxBody: int               ## The maximum content-length that will be read for the body.
  maxFDs: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L68)   Consts
------

  
```
nimMaxDescriptorsFallback = 16000
```
  fallback value for when `maxDescriptors` is not available. This can be set on the command line during compilation via `-d:nimMaxDescriptorsFallback=N` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L308)   Procs
-----

  
```
proc newAsyncHttpServer(reuseAddr = true; reusePort = false; maxBody = 8388608): AsyncHttpServer {...}{.
    raises: [], tags: [].}
```
  Creates a new `AsyncHttpServer` instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L75)  
```
proc sendHeaders(req: Request; headers: HttpHeaders): Future[void] {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Sends the specified headers to the requesting client. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L84)  
```
proc respond(req: Request; code: HttpCode; content: string;
             headers: HttpHeaders = nil): Future[void] {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Responds to the request with the specified `HttpCode`, headers and content.

 This procedure will **not** close the client socket.

 Example:

 
```
import json
proc handler(req: Request) {.async.} =
  if req.url.path == "/hello-world":
    let msg = %* {"message": "Hello World"}
    let headers = newHttpHeaders([("Content-Type","application/json")])
    await req.respond(Http200, $msg, headers)
  else:
    await req.respond(Http404, "Not Found")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L90)  
```
proc listen(server: AsyncHttpServer; port: Port; address = "") {...}{.
    raises: [OSError, Exception, ValueError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect].}
```
  Listen to the given port and address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L313)  
```
proc shouldAcceptRequest(server: AsyncHttpServer;
                         assumedDescriptorsPerRequest = 5): bool {...}{.inline,
    raises: [], tags: [].}
```
  Returns true if the process's current number of opened file descriptors is still within the maximum limit and so it's reasonable to accept yet another request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L327)  
```
proc acceptRequest(server: AsyncHttpServer; callback: proc (request: Request): Future[
    void] {...}{.closure, gcsafe.}): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Accepts a single request. Write an explicit loop around this proc so that errors can be handled properly. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L336)  
```
proc serve(server: AsyncHttpServer; port: Port;
           callback: proc (request: Request): Future[void] {...}{.closure, gcsafe.};
           address = ""; assumedDescriptorsPerRequest = -1): owned(Future[void]) {...}{.
    raises: [Exception],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, TimeEffect].}
```
  Starts the process of listening for incoming HTTP connections on the specified address and port.

 When a request is made by a client the specified callback will be called.

 If `assumedDescriptorsPerRequest` is 0 or greater the server cares about the process's maximum file descriptor limit. It then ensures that the process still has the resources for `assumedDescriptorsPerRequest` file descriptors before accepting a connection.

 You should prefer to call `acceptRequest` instead with a custom server loop so that you're in control over the error handling and logging.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L345) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L345)  
```
proc close(server: AsyncHttpServer) {...}{.raises: [Exception, LibraryError, SslError],
                                      tags: [RootEffect].}
```
  Terminates the async http server instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asynchttpserver.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asynchttpserver.nim#L368)   Exports
-------

  [Http417](httpcore#Http417), [Http503](httpcore#Http503), [Http431](httpcore#Http431), [==](httpcore#==,tuple%5Bstring,int,int%5D,HttpVersion), [contains](httpcore#contains,HttpHeaderValues,string), [Http304](httpcore#Http304), [Http406](httpcore#Http406), [==](httpcore#==,string,HttpCode), [$](httpcore#%24,HttpHeaders), [clear](httpcore#clear,HttpHeaders), [Http408](httpcore#Http408), [$](httpcore#%24,HttpMethod), [Http411](httpcore#Http411), [is3xx](httpcore#is3xx,HttpCode), [Http418](httpcore#Http418), [Http206](httpcore#Http206), [HttpMethod](httpcore#HttpMethod), [Http101](httpcore#Http101), [httpNewLine](httpcore#httpNewLine), [Http505](httpcore#Http505), [Http413](httpcore#Http413), [newHttpHeaders](httpcore#newHttpHeaders), [Http200](httpcore#Http200), [[]=](httpcore#%5B%5D=,HttpHeaders,string,string), [Http414](httpcore#Http414), [add](httpcore#add,HttpHeaders,string,string), [Http401](httpcore#Http401), [Http205](httpcore#Http205), [==](httpcore#==,HttpCode,HttpCode), [Http407](httpcore#Http407), [Http500](httpcore#Http500), [Http404](httpcore#Http404), [Http416](httpcore#Http416), [Http308](httpcore#Http308), [Http302](httpcore#Http302), [HttpHeaders](httpcore#HttpHeaders), [Http300](httpcore#Http300), [Http428](httpcore#Http428), [Http410](httpcore#Http410), [is2xx](httpcore#is2xx,HttpCode), [Http202](httpcore#Http202), [Http502](httpcore#Http502), [headerLimit](httpcore#headerLimit), [HttpHeaderValues](httpcore#HttpHeaderValues), [contains](httpcore#contains,set%5BHttpMethod%5D,string), [newHttpHeaders](httpcore#newHttpHeaders,openArray%5Btuple%5Bstring,string%5D%5D), [$](httpcore#%24,HttpCode), [[]](httpcore#%5B%5D,HttpHeaders,string), [Http305](httpcore#Http305), [Http451](httpcore#Http451), [Http409](httpcore#Http409), [Http504](httpcore#Http504), [Http426](httpcore#Http426), [hasKey](httpcore#hasKey,HttpHeaders,string), [del](httpcore#del,HttpHeaders,string), [pairs](httpcore#pairs.i,HttpHeaders), [Http429](httpcore#Http429), [HttpVersion](httpcore#HttpVersion), [[]=](httpcore#%5B%5D=,HttpHeaders,string,seq%5Bstring%5D), [Http421](httpcore#Http421), [Http307](httpcore#Http307), [Http301](httpcore#Http301), [is4xx](httpcore#is4xx,HttpCode), [Http203](httpcore#Http203), [getOrDefault](httpcore#getOrDefault,HttpHeaders,string), [Http100](httpcore#Http100), [Http501](httpcore#Http501), [len](httpcore#len,HttpHeaders), [Http400](httpcore#Http400), [Http403](httpcore#Http403), [is5xx](httpcore#is5xx,HttpCode), [Http415](httpcore#Http415), [toString](httpcore#toString.c,HttpHeaderValues), [Http412](httpcore#Http412), [Http405](httpcore#Http405), [Http303](httpcore#Http303), [Http204](httpcore#Http204), [Http201](httpcore#Http201), [HttpCode](httpcore#HttpCode), [Http422](httpcore#Http422), [[]](httpcore#%5B%5D,HttpHeaders,string,int) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asynchttpserver.html>

asyncnet
========

 This module implements a high-level asynchronous sockets API based on the asynchronous dispatcher defined in the `asyncdispatch` module. 


Asynchronous IO in Nim
----------------------


Async IO in Nim consists of multiple layers (from highest to lowest):

 * `asyncnet` module
* Async await
* `asyncdispatch` module (event loop)
* `selectors` module

 Each builds on top of the layers below it. The selectors module is an abstraction for the various system `select()` mechanisms such as epoll or kqueue. If you wish you can use it directly, and some people have done so [successfully](http://goran.krampe.se/2014/10/25/nim-socketserver/). But you must be aware that on Windows it only supports `select()`.

 The async dispatcher implements the proactor pattern and also has an implementation of IOCP. It implements the proactor pattern for other OS' via the selectors module. Futures are also implemented here, and indeed all the procedures return a future.

 The final layer is the async await transformation. This allows you to write asynchronous code in a synchronous style and works similar to C#'s await. The transformation works by converting any async procedures into an iterator.

 This is all single threaded, fully non-blocking and does give you a lot of control. In theory you should be able to work with any of these layers interchangeably (as long as you only care about non-Windows platforms).

 For most applications using `asyncnet` is the way to go as it builds over all the layers, providing some extra features such as buffering.

 SSL ===

 SSL can be enabled by compiling with the `-d:ssl` flag.

 You must create a new SSL context with the `newContext` function defined in the `net` module. You may then call `wrapSocket` on your socket using the newly created SSL context to get an SSL socket.

 Examples
--------

 ### Chat server


The following example demonstrates a simple chat server.

 
```
import asyncnet, asyncdispatch

var clients {.threadvar.}: seq[AsyncSocket]

proc processClient(client: AsyncSocket) {.async.} =
  while true:
    let line = await client.recvLine()
    if line.len == 0: break
    for c in clients:
      await c.send(line & "\c\L")

proc serve() {.async.} =
  clients = @[]
  var server = newAsyncSocket()
  server.setSockOpt(OptReuseAddr, true)
  server.bindAddr(Port(12345))
  server.listen()
  
  while true:
    let client = await server.accept()
    clients.add client
    
    asyncCheck processClient(client)

asyncCheck serve()
runForever()
```
 Imports
-------

  <since>, <asyncdispatch>, <nativesockets>, <net>, <os>, <openssl>  Types
-----

  
```
AsyncSocket = ref AsyncSocketDesc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L130)   Procs
-----

  
```
proc newAsyncSocket(fd: AsyncFD; domain: Domain = AF_INET;
                    sockType: SockType = SOCK_STREAM;
                    protocol: Protocol = IPPROTO_TCP; buffered = true;
                    inheritable = defined(nimInheritHandles)): owned(AsyncSocket) {...}{.
    raises: [OSError], tags: [].}
```
  Creates a new `AsyncSocket` based on the supplied params.

 The supplied `fd`'s non-blocking state will be enabled implicitly.

 If `inheritable` is false (the default), the supplied `fd` will not be inheritable by child processes.

 **Note**: This procedure will **NOT** register `fd` with the global async dispatcher. You need to do this manually. If you have used `newAsyncNativeSocket` to create `fd` then it's already registered.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L132)  
```
proc newAsyncSocket(domain: Domain = AF_INET; sockType: SockType = SOCK_STREAM;
                    protocol: Protocol = IPPROTO_TCP; buffered = true;
                    inheritable = defined(nimInheritHandles)): owned(AsyncSocket) {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  Creates a new asynchronous socket.

 This procedure will also create a brand new file descriptor for this socket.

 If `inheritable` is false (the default), the new file descriptor will not be inheritable by child processes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L160)  
```
proc getLocalAddr(socket: AsyncSocket): (string, Port) {...}{.
    raises: [OSError, Exception], tags: [].}
```
  Get the socket's local address and port number.

 This is high-level interface for getsockname.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L175)  
```
proc getPeerAddr(socket: AsyncSocket): (string, Port) {...}{.
    raises: [OSError, Exception], tags: [].}
```
  Get the socket's peer address and port number.

 This is high-level interface for getpeername.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L181)  
```
proc newAsyncSocket(domain, sockType, protocol: cint; buffered = true;
                    inheritable = defined(nimInheritHandles)): owned(AsyncSocket) {...}{.
    raises: [OSError, Exception], tags: [RootEffect].}
```
  Creates a new asynchronous socket.

 This procedure will also create a brand new file descriptor for this socket.

 If `inheritable` is false (the default), the new file descriptor will not be inheritable by child processes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L187)  
```
proc dial(address: string; port: Port; protocol = IPPROTO_TCP; buffered = true): owned(
    Future[AsyncSocket]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Establishes connection to the specified `address`:`port` pair via the specified protocol. The procedure iterates through possible resolutions of the `address` until it succeeds, meaning that it seamlessly works with both IPv4 and IPv6. Returns AsyncSocket ready to send or receive data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L281)  
```
proc connect(socket: AsyncSocket; address: string; port: Port): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Connects `socket` to server at `address:port`.

 Returns a `Future` which will complete when the connection succeeds or an error occurs.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L292)  
```
proc recvInto(socket: AsyncSocket; buf: pointer; size: int;
              flags = {SafeDisconn}): owned(Future[int]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads **up to** `size` bytes from `socket` into `buf`.

 For buffered sockets this function will attempt to read all the requested data. It will read this data in `BufferSize` chunks.

 For unbuffered sockets this function makes no effort to read all the data requested. It will return as much data as the operating system gives it.

 If socket is disconnected during the recv operation then the future may complete with only a part of the requested data.

 If socket is disconnected and no data is available to be read then the future will complete with a value of `0`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L334)  
```
proc recv(socket: AsyncSocket; size: int; flags = {SafeDisconn}): owned(
    Future[string]) {...}{.raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads **up to** `size` bytes from `socket`.

 For buffered sockets this function will attempt to read all the requested data. It will read this data in `BufferSize` chunks.

 For unbuffered sockets this function makes no effort to read all the data requested. It will return as much data as the operating system gives it.

 If socket is disconnected during the recv operation then the future may complete with only a part of the requested data.

 If socket is disconnected and no data is available to be read then the future will complete with a value of `""`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L382)  
```
proc send(socket: AsyncSocket; buf: pointer; size: int; flags = {SafeDisconn}): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Sends `size` bytes from `buf` to `socket`. The returned future will complete once all data has been sent. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L434)  
```
proc send(socket: AsyncSocket; data: string; flags = {SafeDisconn}): owned(
    Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Sends `data` to `socket`. The returned future will complete once all data has been sent. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L448)  
```
proc acceptAddr(socket: AsyncSocket; flags = {SafeDisconn};
                inheritable = defined(nimInheritHandles)): owned(
    Future[tuple[address: string, client: AsyncSocket]]) {...}{.
    raises: [Exception, ValueError, OSError], tags: [RootEffect].}
```
  Accepts a new connection. Returns a future containing the client socket corresponding to that connection and the remote address of the client.

 If `inheritable` is false (the default), the resulting client socket will not be inheritable by child processes.

 The future will complete when the connection is successfully accepted.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L461)  
```
proc accept(socket: AsyncSocket; flags = {SafeDisconn}): owned(
    Future[AsyncSocket]) {...}{.raises: [Exception, ValueError, OSError],
                           tags: [RootEffect].}
```
  Accepts a new connection. Returns a future containing the client socket corresponding to that connection. If `inheritable` is false (the default), the resulting client socket will not be inheritable by child processes. The future will complete when the connection is successfully accepted. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L485) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L485)  
```
proc recvLineInto(socket: AsyncSocket; resString: FutureVar[string];
                  flags = {SafeDisconn}; maxLength = MaxLineLength): owned(
    Future[void]) {...}{.raises: [ValueError, Exception], tags: [RootEffect].}
```
  Reads a line of data from `socket` into `resString`.

 If a full line is read `\r\L` is not added to `line`, however if solely `\r\L` is read then `line` will be set to it.

 If the socket is disconnected, `line` will be set to `""`.

 If the socket is disconnected in the middle of a line (before `\r\L` is read) then line will be set to `""`. The partial line **will be lost**.

 The `maxLength` parameter determines the maximum amount of characters that can be read. `resString` will be truncated after that.

 **Warning**: The `Peek` flag is not yet implemented.

 **Warning**: `recvLineInto` on unbuffered sockets assumes that the protocol uses `\r\L` to delimit a new line.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L504)  
```
proc recvLine(socket: AsyncSocket; flags = {SafeDisconn};
              maxLength = MaxLineLength): owned(Future[string]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads a line of data from `socket`. Returned future will complete once a full line is read or an error occurs.

 If a full line is read `\r\L` is not added to `line`, however if solely `\r\L` is read then `line` will be set to it.

 If the socket is disconnected, `line` will be set to `""`.

 If the socket is disconnected in the middle of a line (before `\r\L` is read) then line will be set to `""`. The partial line **will be lost**.

 The `maxLength` parameter determines the maximum amount of characters that can be read. The result is truncated after that.

 **Warning**: The `Peek` flag is not yet implemented.

 **Warning**: `recvLine` on unbuffered sockets assumes that the protocol uses `\r\L` to delimit a new line.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L597)  
```
proc listen(socket: AsyncSocket; backlog = SOMAXCONN) {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  Marks `socket` as accepting connections. `Backlog` specifies the maximum length of the queue of pending connections.

 Raises an OSError error upon failure.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L626)  
```
proc bindAddr(socket: AsyncSocket; port = Port(0); address = "") {...}{.
    tags: [ReadIOEffect], raises: [ValueError, OSError].}
```
  Binds `address`:`port` to the socket.

 If `address` is "" then ADDR\_ANY will be bound.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L635)  
```
proc connectUnix(socket: AsyncSocket; path: string): owned(Future[void]) {...}{.
    raises: [], tags: [].}
```
  Binds Unix socket to `path`. This only works on Unix-style systems: Mac OS X, BSD and Linux [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L657)  
```
proc bindUnix(socket: AsyncSocket; path: string) {...}{.tags: [ReadIOEffect],
    raises: [].}
```
  Binds Unix socket to `path`. This only works on Unix-style systems: Mac OS X, BSD and Linux [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L688)  
```
proc close(socket: AsyncSocket) {...}{.raises: [Exception, LibraryError, SslError],
                                  tags: [RootEffect].}
```
  Closes the socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L710)  
```
proc wrapSocket(ctx: SslContext; socket: AsyncSocket) {...}{.raises: [SslError],
    tags: [].}
```
  Wraps a socket in an SSL context. This function effectively turns `socket` into an SSL socket.

 **Disclaimer**: This code is not well tested, may be very unsafe and prone to security vulnerabilities.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L736)  
```
proc wrapConnectedSocket(ctx: SslContext; socket: AsyncSocket;
                         handshake: SslHandshakeType; hostname: string = "") {...}{.
    raises: [SslError], tags: [].}
```
  Wraps a connected socket in an SSL context. This function effectively turns `socket` into an SSL socket. `hostname` should be specified so that the client knows which hostname the server certificate should be validated against.

 This should be called on a connected socket, and will perform an SSL handshake immediately.

 **Disclaimer**: This code is not well tested, may be very unsafe and prone to security vulnerabilities.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L754)  
```
proc getPeerCertificates(socket: AsyncSocket): seq[Certificate] {...}{.
    raises: [Exception], tags: [].}
```
  Returns the certificate chain received by the peer we are connected to through the given socket. The handshake must have been completed and the certificate chain must have been verified successfully or else an empty sequence is returned. The chain is ordered from leaf certificate to root certificate. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L779)  
```
proc getSockOpt(socket: AsyncSocket; opt: SOBool; level = SOL_SOCKET): bool {...}{.
    tags: [ReadIOEffect], raises: [OSError].}
```
  Retrieves option `opt` as a boolean value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L790) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L790)  
```
proc setSockOpt(socket: AsyncSocket; opt: SOBool; value: bool;
                level = SOL_SOCKET) {...}{.tags: [WriteIOEffect], raises: [OSError].}
```
  Sets option `opt` to a boolean value specified by `value`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L796)  
```
proc isSsl(socket: AsyncSocket): bool {...}{.raises: [], tags: [].}
```
  Determines whether `socket` is a SSL socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L802) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L802)  
```
proc getFd(socket: AsyncSocket): SocketHandle {...}{.raises: [], tags: [].}
```
  Returns the socket's file descriptor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L806) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L806)  
```
proc isClosed(socket: AsyncSocket): bool {...}{.raises: [], tags: [].}
```
  Determines whether the socket has been closed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L810) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L810)  
```
proc sendTo(socket: AsyncSocket; address: string; port: Port; data: string;
            flags = {SafeDisconn}): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  This proc sends `data` to the specified `address`, which may be an IP address or a hostname. If a hostname is specified this function will try each IP of that hostname. The returned future will complete once all data has been sent.

 If an error occurs an OSError exception will be raised.

 This proc is normally used with connectionless sockets (UDP sockets).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L816)  
```
proc recvFrom(socket: AsyncSocket; data: FutureVar[string]; size: int;
              address: FutureVar[string]; port: FutureVar[Port];
              flags = {SafeDisconn}): owned(Future[int]) {...}{.
    raises: [ValueError, Exception], tags: [RootEffect].}
```
  Receives a datagram data from `socket` into `data`, which must be at least of size `size`. The address and port of datagram's sender will be stored into `address` and `port`, respectively. Returned future will complete once one datagram has been received, and will return size of packet received.

 If an error occurs an OSError exception will be raised.

 This proc is normally used with connectionless sockets (UDP sockets).

 **Notes**

 * `data` must be initialized to the length of `size`.
* `address` must be initialized to 46 in length.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L863)  
```
proc recvFrom(socket: AsyncSocket; size: int; flags = {SafeDisconn}): owned(
    Future[tuple[data: string, address: string, port: Port]]) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Receives a datagram data from `socket`, which must be at least of size `size`. Returned future will complete once one datagram has been received and will return tuple with: data of packet received; and address and port of datagram's sender.

 If an error occurs an OSError exception will be raised.

 This proc is normally used with connectionless sockets (UDP sockets).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncnet.nim#L917) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncnet.nim#L917)   Exports
-------

  [SOBool](net#SOBool) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncnet.html>

asyncstreams
============

 Unstable API.

 Imports
-------

  <asyncfutures>, <deques>  Types
-----

  
```
FutureStream[T] = ref object
  queue: Deque[T]
  finished: bool
  cb: proc () {...}{.closure, gcsafe.}
  error*: ref Exception
```
  Special future that acts as a queue. Its API is still experimental and so is subject to change. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L17)   Procs
-----

  
```
proc newFutureStream[T](fromProc = "unspecified"): FutureStream[T]
```
  Create a new `FutureStream`. This future's callback is activated when two events occur:* New data is written into the future stream.
* The future stream is completed (this means that no more data will be written).

 Specifying `fromProc`, which is a string specifying the name of the proc that this future belongs to, is a good habit as it helps with debugging.

 **Note:** The API of FutureStream is still new and so has a higher likelihood of changing in the future.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L26)  
```
proc complete[T](future: FutureStream[T])
```
  Completes a `FutureStream` signalling the end of data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L42)  
```
proc fail[T](future: FutureStream[T]; error: ref Exception)
```
  Completes `future` with `error`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L49)  
```
proc callback=[T](future: FutureStream[T];
                  cb: proc (future: FutureStream[T]) {...}{.closure, gcsafe.})
```
  Sets the callback proc to be called when data was placed inside the future stream.

 The callback is also called when the future is completed. So you should use `finished` to check whether data is available.

 If the future stream already has data or is finished then `cb` will be called immediately.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L57)  
```
proc finished[T](future: FutureStream[T]): bool
```
  Check if a `FutureStream` is finished. `true` value means that no more data will be placed inside the stream *and* that there is no data waiting to be retrieved. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L72)  
```
proc failed[T](future: FutureStream[T]): bool
```
  Determines whether `future` completed with an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L78)  
```
proc write[T](future: FutureStream[T]; value: T): Future[void]
```
  Writes the specified value inside the specified future stream.

 This will raise `ValueError` if `future` is finished.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L82)  
```
proc read[T](future: FutureStream[T]): owned(Future[(bool, T)])
```
  Returns a future that will complete when the `FutureStream` has data placed into it. The future will be completed with the oldest value stored inside the stream. The return value will also determine whether data was retrieved, `false` means that the future stream was completed and no data was retrieved.

 This function will remove the data that was returned from the underlying `FutureStream`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L97)  
```
proc len[T](future: FutureStream[T]): int
```
  Returns the amount of data pieces inside the stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncstreams.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncstreams.nim#L142)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncstreams.html>

cgi
===

 This module implements helper procs for CGI applications. Example:



```
import strtabs, cgi

# Fill the values when debugging:
when debug:
  setTestData("name", "Klaus", "password", "123456")
# read the data into `myData`
var myData = readData()
# check that the data's variable names are "name" or "password"
validateData(myData, "name", "password")
# start generating content:
writeContentType()
# generate content:
write(stdout, "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01//EN\">\n")
write(stdout, "<html><head><title>Test</title></head><body>\n")
writeLine(stdout, "your name: " & myData["name"])
writeLine(stdout, "your password: " & myData["password"])
writeLine(stdout, "</body></html>")
```
 Imports
-------

  <strutils>, <os>, <strtabs>, <cookies>, <uri>  Types
-----

  
```
CgiError = object of IOError
```
  exception that is raised if a CGI error occurs [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L56)  
```
RequestMethod = enum
  methodNone,               ## no REQUEST_METHOD environment variable
  methodPost,               ## query uses the POST method
  methodGet                  ## query uses the GET method
```
  the used request method [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L57)   Procs
-----

  
```
proc xmlEncode(s: string): string {...}{.raises: [], tags: [].}
```
  Encodes a value to be XML safe:* `"` is replaced by `&quot;`
* `<` is replaced by `&lt;`
* `>` is replaced by `&gt;`
* `&` is replaced by `&amp;`
* every other character is carried over.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L45)  
```
proc cgiError(msg: string) {...}{.noreturn, raises: [CgiError], tags: [].}
```
  raises an ECgi exception with message `msg`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L62)  
```
proc readData(allowedMethods: set[RequestMethod] = {methodNone, methodPost,
    methodGet}): StringTableRef {...}{.raises: [CgiError, ValueError, IOError],
                                  tags: [ReadEnvEffect, ReadIOEffect].}
```
  Read CGI data. If the client does not use a method listed in the `allowedMethods` set, an `ECgi` exception is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L126)  
```
proc readData(data: string): StringTableRef {...}{.raises: [CgiError], tags: [].}
```
  Read CGI data from a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L134)  
```
proc validateData(data: StringTableRef; validKeys: varargs[string]) {...}{.
    raises: [CgiError], tags: [].}
```
  validates data; raises `ECgi` if this fails. This checks that each variable name of the CGI `data` occurs in the `validKeys` array. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L140)  
```
proc getContentLength(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `CONTENT_LENGTH` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L147)  
```
proc getContentType(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `CONTENT_TYPE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L151)  
```
proc getDocumentRoot(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `DOCUMENT_ROOT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L155)  
```
proc getGatewayInterface(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `GATEWAY_INTERFACE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L159)  
```
proc getHttpAccept(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_ACCEPT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L163)  
```
proc getHttpAcceptCharset(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_ACCEPT_CHARSET` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L167)  
```
proc getHttpAcceptEncoding(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_ACCEPT_ENCODING` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L171)  
```
proc getHttpAcceptLanguage(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_ACCEPT_LANGUAGE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L175)  
```
proc getHttpConnection(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_CONNECTION` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L179)  
```
proc getHttpCookie(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_COOKIE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L183)  
```
proc getHttpHost(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_HOST` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L187)  
```
proc getHttpReferer(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_REFERER` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L191)  
```
proc getHttpUserAgent(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `HTTP_USER_AGENT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L195)  
```
proc getPathInfo(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `PATH_INFO` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L199)  
```
proc getPathTranslated(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `PATH_TRANSLATED` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L203)  
```
proc getQueryString(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `QUERY_STRING` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L207)  
```
proc getRemoteAddr(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REMOTE_ADDR` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L211)  
```
proc getRemoteHost(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REMOTE_HOST` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L215)  
```
proc getRemoteIdent(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REMOTE_IDENT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L219)  
```
proc getRemotePort(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REMOTE_PORT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L223)  
```
proc getRemoteUser(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REMOTE_USER` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L227)  
```
proc getRequestMethod(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REQUEST_METHOD` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L231)  
```
proc getRequestURI(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `REQUEST_URI` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L235)  
```
proc getScriptFilename(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SCRIPT_FILENAME` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L239)  
```
proc getScriptName(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SCRIPT_NAME` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L243)  
```
proc getServerAddr(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_ADDR` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L247)  
```
proc getServerAdmin(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_ADMIN` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L251)  
```
proc getServerName(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_NAME` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L255)  
```
proc getServerPort(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_PORT` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L259)  
```
proc getServerProtocol(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_PROTOCOL` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L263)  
```
proc getServerSignature(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_SIGNATURE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L267)  
```
proc getServerSoftware(): string {...}{.raises: [], tags: [ReadEnvEffect].}
```
  returns contents of the `SERVER_SOFTWARE` environment variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L271)  
```
proc setTestData(keysvalues: varargs[string]) {...}{.raises: [OSError],
    tags: [WriteEnvEffect].}
```
  fills the appropriate environment variables to test your CGI application. This can only simulate the 'GET' request method. `keysvalues` should provide embedded (name, value)-pairs. Example:
```
setTestData("name", "Hanz", "password", "12345")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L275)  
```
proc writeContentType() {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  call this before starting to send your HTML data to `stdout`. This implements this part of the CGI protocol:
```
write(stdout, "Content-type: text/html\n\n")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L293)  
```
proc writeErrorMessage(data: string) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Tries to reset browser state and writes `data` to stdout in <plaintext> tag. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L311)  
```
proc setStackTraceStdout() {...}{.raises: [], tags: [].}
```
  Makes Nim output stacktraces to stdout, instead of server log. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L320)  
```
proc setCookie(name, value: string) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  Sets a cookie. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L324)  
```
proc getCookie(name: string): TaintedString {...}{.raises: [], tags: [ReadEnvEffect].}
```
  Gets a cookie. If no cookie of `name` exists, "" is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L331)  
```
proc existsCookie(name: string): bool {...}{.raises: [], tags: [ReadEnvEffect].}
```
  Checks if a cookie of `name` exists. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L336)   Iterators
---------

  
```
iterator decodeData(data: string): tuple[key, value: TaintedString] {...}{.
    raises: [CgiError], tags: [].}
```
  Reads and decodes CGI data and yields the (name, value) pairs the data consists of. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L88)  
```
iterator decodeData(allowedMethods: set[RequestMethod] = {methodNone,
    methodPost, methodGet}): tuple[key, value: TaintedString] {...}{.
    raises: [CgiError, ValueError, IOError], tags: [ReadEnvEffect, ReadIOEffect].}
```
  Reads and decodes CGI data and yields the (name, value) pairs the data consists of. If the client does not use a method listed in the `allowedMethods` set, an `ECgi` exception is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cgi.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cgi.nim#L117)   Exports
-------

  [encodeUrl](uri#encodeUrl,string), [decodeUrl](uri#decodeUrl,string) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/cgi.html>

cookies
=======

 This module implements helper procs for parsing Cookies.

 Imports
-------

  <strtabs>, <times>  Procs
-----

  
```
proc parseCookies(s: string): StringTableRef {...}{.raises: [], tags: [].}
```
  parses cookies into a string table.

 The proc is meant to parse the Cookie header set by a client, not the "Set-Cookie" header set by servers.

 Example:

 
```
doAssert parseCookies("a=1; foo=bar") == {"a": 1, "foo": "bar"}.newStringTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cookies.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cookies.nim#L14)  
```
proc setCookie(key, value: string; domain = ""; path = ""; expires = "";
               noName = false; secure = false; httpOnly = false): string {...}{.
    raises: [], tags: [].}
```
  Creates a command in the format of `Set-Cookie: key=value; Domain=...; ...` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cookies.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cookies.nim#L40)  
```
proc setCookie(key, value: string; expires: DateTime | Time; domain = "";
               path = ""; noName = false; secure = false; httpOnly = false): string
```
  Creates a command in the format of `Set-Cookie: key=value; Domain=...; ...` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/cookies.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/cookies.nim#L54)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/cookies.html>

httpclient
==========

 This module implements a simple HTTP client that can be used to retrieve webpages and other data. 


Retrieving a website
--------------------


This example uses HTTP GET to retrieve `http://google.com`:

 
```
import httpclient
var client = newHttpClient()
echo client.getContent("http://google.com")
```

The same action can also be performed asynchronously, simply use the `AsyncHttpClient`:

 
```
import asyncdispatch, httpclient

proc asyncProc(): Future[string] {.async.} =
  var client = newAsyncHttpClient()
  return await client.getContent("http://example.com")

echo waitFor asyncProc()
```

The functionality implemented by `HttpClient` and `AsyncHttpClient` is the same, so you can use whichever one suits you best in the examples shown here.

 **Note:** You need to run asynchronous examples in an async proc otherwise you will get an `Undeclared identifier: 'await'` error.

 Using HTTP POST
---------------


This example demonstrates the usage of the W3 HTML Validator, it uses `multipart/form-data` as the `Content-Type` to send the HTML to be validated to the server.

 
```
var client = newHttpClient()
var data = newMultipartData()
data["output"] = "soap12"
data["uploaded_file"] = ("test.html", "text/html",
  "<html><head></head><body><p>test</p></body></html>")

echo client.postContent("http://validator.w3.org/check", multipart=data)
```

To stream files from disk when performing the request, use `addFiles`.

 **Note:** This will allocate a new `Mimetypes` database every time you call it, you can pass your own via the `mimeDb` parameter to avoid this.

 
```
let mimes = newMimetypes()
var client = newHttpClient()
var data = newMultipartData()
data.addFiles({"uploaded_file": "test.html"}, mimeDb = mimes)

echo client.postContent("http://validator.w3.org/check", multipart=data)
```

You can also make post requests with custom headers. This example sets `Content-Type` to `application/json` and uses a json object for the body

 
```
import httpclient, json

let client = newHttpClient()
client.headers = newHttpHeaders({ "Content-Type": "application/json" })
let body = %*{
    "data": "some text"
}
let response = client.request("http://some.api", httpMethod = HttpPost, body = $body)
echo response.status
```
 Progress reporting
------------------


You may specify a callback procedure to be called during an HTTP request. This callback will be executed every second with information about the progress of the HTTP request.

 
```
import asyncdispatch, httpclient

proc onProgressChanged(total, progress, speed: BiggestInt) {.async.} =
  echo("Downloaded ", progress, " of ", total)
  echo("Current rate: ", speed div 1000, "kb/s")

proc asyncProc() {.async.} =
  var client = newAsyncHttpClient()
  client.onProgressChanged = onProgressChanged
  discard await client.getContent("http://speedtest-ams2.digitalocean.com/100mb.test")

waitFor asyncProc()
```

If you would like to remove the callback simply set it to `nil`.

 
```
client.onProgressChanged = nil
```

**Warning:** The `total` reported by httpclient may be 0 in some cases.

 SSL/TLS support
---------------


This requires the OpenSSL library, fortunately it's widely used and installed on many operating systems. httpclient will use SSL automatically if you give any of the functions a url with the `https` schema, for example: `https://github.com/`.

 You will also have to compile with `ssl` defined like so: `nim c -d:ssl ...`.

 Certificate validation is NOT performed by default. This will change in future.

 A set of directories and files from the <ssl_certs> module are scanned to locate CA certificates.

 See [newContext](net#newContext) to tweak or disable certificate validation.

 Timeouts
--------


Currently only the synchronous functions support a timeout. The timeout is measured in milliseconds, once it is set any call on a socket which may block will be susceptible to this timeout.

 It may be surprising but the function as a whole can take longer than the specified timeout, only individual internal calls on the socket are affected. In practice this means that as long as the server is sending data an exception will not be raised, if however data does not reach the client within the specified timeout a `TimeoutError` exception will be raised.

 Here is how to set a timeout when creating an `HttpClient` instance:

 
```
import httpclient

let client = newHttpClient(timeout = 42)
```
 Proxy
-----


A proxy can be specified as a param to any of the procedures defined in this module. To do this, use the `newProxy` constructor. Unfortunately, only basic authentication is supported at the moment.

 Some examples on how to configure a Proxy for `HttpClient`:

 
```
import httpclient

let myProxy = newProxy("http://myproxy.network")
let client = newHttpClient(proxy = myProxy)
```

Get Proxy URL from environment variables:

 
```
import httpclient

var url = ""
try:
  if existsEnv("http_proxy"):
    url = getEnv("http_proxy")
  elif existsEnv("https_proxy"):
    url = getEnv("https_proxy")
except ValueError:
  echo "Unable to parse proxy from environment variables."

let myProxy = newProxy(url = url)
let client = newHttpClient(proxy = myProxy)
```
 Redirects
---------


The maximum redirects can be set with the `maxRedirects` of `int` type, it specifies the maximum amount of redirects to follow, it defaults to `5`, you can set it to `0` to disable redirects.

 Here you can see an example about how to set the `maxRedirects` of `HttpClient`:

 
```
import httpclient

let client = newHttpClient(maxRedirects = 0)
```
 Imports
-------

  <since>, <net>, <strutils>, <uri>, <parseutils>, <base64>, <os>, <mimetypes>, <streams>, <math>, <random>, <httpcore>, <times>, <tables>, <streams>, <monotimes>, <asyncnet>, <asyncdispatch>, <asyncfile>, <nativesockets>  Types
-----

  
```
Response = ref object
  version*: string
  status*: string
  headers*: HttpHeaders
  body: string
  bodyStream*: Stream
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L213)  
```
AsyncResponse = ref object
  version*: string
  status*: string
  headers*: HttpHeaders
  body: string
  bodyStream*: FutureStream[string]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L220)  
```
Proxy = ref object
  url*: Uri
  auth*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L277)  
```
MultipartEntries = openArray[tuple[name, content: string]]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L290)  
```
MultipartData = ref object
  content: seq[MultipartEntry]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L291)  
```
ProtocolError = object of IOError
```
  exception that is raised when server does not conform to the implemented protocol [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L294)  
```
HttpRequestError = object of IOError
```
  Thrown in the `getContent` proc and `postContent` proc, when the server returns an error [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L298)  
```
ProgressChangedProc[ReturnType] = proc (total, progress, speed: BiggestInt): ReturnType {...}{.
    closure, gcsafe.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L522)  
```
HttpClientBase[SocketType] = ref object
  socket: SocketType
  connected: bool
  currentURL: Uri            ## Where we are currently connected.
  headers*: HttpHeaders      ## Headers to send in requests.
  maxRedirects: Natural      ## Maximum redirects, set to ``0`` to disable.
  userAgent: string
  timeout*: int              ## Only used for blocking HttpClient for now.
  proxy: Proxy               ## ``nil`` or the callback to call when request progress changes.
  when SocketType is Socket:
    onProgressChanged
  else:
    onProgressChanged
  when false:
    sslContext
  contentTotal: BiggestInt
  contentProgress: BiggestInt
  oneSecondProgress: BiggestInt
  lastProgressReport: MonoTime
  when SocketType is AsyncSocket:
      bodyStream
      parseBodyFut

  else:
    bodyStream
  getBody: bool              ## When `false`, the body is never read in requestAux.
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L526)  
```
HttpClient = HttpClientBase[Socket]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L554)  
```
AsyncHttpClient = HttpClientBase[AsyncSocket]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L601)   Consts
------

  
```
defUserAgent = "Nim httpclient/1.4.8"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L302)   Procs
-----

  
```
proc code(response: Response | AsyncResponse): HttpCode {...}{.
    raises: [ValueError, OverflowDefect].}
```
  Retrieves the specified response's `HttpCode`.

 Raises a `ValueError` if the response's `status` does not have a corresponding `HttpCode`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L227)  
```
proc contentType(response: Response | AsyncResponse): string {...}{.inline.}
```
  Retrieves the specified response's content type.

 This is effectively the value of the "Content-Type" header.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L235)  
```
proc contentLength(response: Response | AsyncResponse): int
```
  Retrieves the specified response's content length.

 This is effectively the value of the "Content-Length" header.

 A `ValueError` exception will be raised if the value is not an integer.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L241)  
```
proc lastModified(response: Response | AsyncResponse): DateTime
```
  Retrieves the specified response's last modified time.

 This is effectively the value of the "Last-Modified" header.

 Raises a `ValueError` if the parsing fails or the value is not a correctly formatted time.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L251)  
```
proc body(response: Response): string {...}{.raises: [IOError, OSError],
                                        tags: [ReadIOEffect].}
```
  Retrieves the specified response's body.

 The response's body stream is read synchronously.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L261)  
```
proc body(response: AsyncResponse): Future[string] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Reads the response's body and caches it. The read is performed only once. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L269)  
```
proc newProxy(url: string; auth = ""): Proxy {...}{.raises: [], tags: [].}
```
  Constructs a new `TProxy` object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L328)  
```
proc newMultipartData(): MultipartData {...}{.inline, raises: [], tags: [].}
```
  Constructs a new `MultipartData` object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L332)  
```
proc `$`(data: MultipartData): string {...}{.raises: [], tags: [].}
```
  convert MultipartData to string so it's human readable when echo see <https://github.com/nim-lang/Nim/issues/11863> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L336)  
```
proc add(p: MultipartData; name, content: string; filename: string = "";
         contentType: string = ""; useStream = true) {...}{.raises: [ValueError],
    tags: [].}
```
  Add a value to the multipart data.

 When `useStream` is `false`, the file will be read into memory.

 Raises a `ValueError` exception if `name`, `filename` or `contentType` contain newline characters.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L348)  
```
proc add(p: MultipartData; xs: MultipartEntries): MultipartData {...}{.discardable,
    raises: [ValueError], tags: [].}
```
  Add a list of multipart entries to the multipart data `p`. All values are added without a filename and without a content type.
```
data.add({"action": "login", "format": "json"})
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L376)  
```
proc newMultipartData(xs: MultipartEntries): MultipartData {...}{.
    raises: [ValueError], tags: [].}
```
  Create a new multipart data object and fill it with the entries `xs` directly.
```
var data = newMultipartData({"action": "login", "format": "json"})
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L387)  
```
proc addFiles(p: MultipartData; xs: openArray[tuple[name, file: string]];
              mimeDb = newMimetypes(); useStream = true): MultipartData {...}{.
    discardable, raises: [IOError, ValueError], tags: [ReadIOEffect].}
```
  Add files to a multipart data object. The files will be streamed from disk when the request is being made. When `stream` is `false`, the files are instead read into memory, but beware this is very memory ineffecient even for small files. The MIME types will automatically be determined. Raises an `IOError` if the file cannot be opened or reading fails. To manually specify file content, filename and MIME type, use `[]=` instead.
```
data.addFiles({"uploaded_file": "public/test.html"})
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L397)  
```
proc `[]=`(p: MultipartData; name, content: string) {...}{.inline,
    raises: [ValueError], tags: [].}
```
  Add a multipart entry to the multipart data `p`. The value is added without a filename and without a content type.
```
data["username"] = "NimUser"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L418)  
```
proc `[]=`(p: MultipartData; name: string;
           file: tuple[name, contentType, content: string]) {...}{.inline,
    raises: [ValueError], tags: [].}
```
  Add a file to the multipart data `p`, specifying filename, contentType and content manually.
```
data["uploaded_file"] = ("test.html", "text/html",
  "<html><head></head><body><p>test</p></body></html>")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L426)  
```
proc newHttpClient(userAgent = defUserAgent; maxRedirects = 5;
                   sslContext = getDefaultSSL(); proxy: Proxy = nil;
                   timeout = -1; headers = newHttpHeaders()): HttpClient {...}{.
    raises: [], tags: [].}
```
  Creates a new HttpClient instance.

 `userAgent` specifies the user agent that will be used when making requests.

 `maxRedirects` specifies the maximum amount of redirects to follow, default is 5.

 `sslContext` specifies the SSL context to use for HTTPS requests. See [SSL/TLS support](##ssl-tls-support)

 `proxy` specifies an HTTP proxy to use for this HTTP client's connections.

 `timeout` specifies the number of milliseconds to allow before a `TimeoutError` is raised.

 `headers` specifies the HTTP Headers.

 **Example:**

 
```
import asyncdispatch, httpclient, strutils

proc asyncProc(): Future[string] {.async.} =
  var client = newAsyncHttpClient()
  return await client.getContent("http://example.com")

let exampleHtml = waitFor asyncProc()
assert "Example Domain" in exampleHtml
assert not ("Pizza" in exampleHtml)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L556)  
```
proc newAsyncHttpClient(userAgent = defUserAgent; maxRedirects = 5;
                        sslContext = getDefaultSSL(); proxy: Proxy = nil;
                        headers = newHttpHeaders()): AsyncHttpClient {...}{.
    raises: [], tags: [].}
```
  Creates a new AsyncHttpClient instance.

 `userAgent` specifies the user agent that will be used when making requests.

 `maxRedirects` specifies the maximum amount of redirects to follow, default is 5.

 `sslContext` specifies the SSL context to use for HTTPS requests.

 `proxy` specifies an HTTP proxy to use for this HTTP client's connections.

 `headers` specifies the HTTP Headers.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L603)  
```
proc close(client: HttpClient | AsyncHttpClient)
```
  Closes any connections held by the HTTP client. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L632)  
```
proc getSocket(client: HttpClient): Socket {...}{.inline, raises: [], tags: [].}
```
  Get network socket, useful if you want to find out more details about the connection

 this example shows info about local and remote endpoints

 
```
if client.connected:
  echo client.getSocket.getLocalAddr
  echo client.getSocket.getPeerAddr
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L638) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L638)  
```
proc getSocket(client: AsyncHttpClient): AsyncSocket {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L650)  
```
proc request(client: AsyncHttpClient; url: string; httpMethod: string;
             body = ""; headers: HttpHeaders = nil;
             multipart: MultipartData = nil): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a request using the custom method string specified by `httpMethod`.

 Connection will be kept alive. Further requests on the same `client` to the same hostname will not require a new connection to be made. The connection can be closed by using the `close` procedure.

 This procedure will follow redirects up to a maximum number of redirects specified in `client.maxRedirects`.

 You need to make sure that the `url` doesn't contain any newline characters. Failing to do so will raise `AssertionDefect`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1030) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1030)  
```
proc request(client: HttpClient; url: string; httpMethod: string; body = "";
             headers: HttpHeaders = nil; multipart: MultipartData = nil): Response {...}{.raises: [
    ValueError, IOError, OSError, HttpRequestError, Exception, LibraryError,
    SslError, TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1033) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1033)  
```
proc request(client: AsyncHttpClient; url: string; httpMethod = HttpGet;
             body = ""; headers: HttpHeaders = nil;
             multipart: MultipartData = nil): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a request using the method specified.

 Connection will be kept alive. Further requests on the same `client` to the same hostname will not require a new connection to be made. The connection can be closed by using the `close` procedure.

 When a request is made to a different hostname, the current connection will be closed.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1059)  
```
proc request(client: HttpClient; url: string; httpMethod = HttpGet; body = "";
             headers: HttpHeaders = nil; multipart: MultipartData = nil): Response {...}{.raises: [
    ValueError, IOError, OSError, HttpRequestError, Exception, LibraryError,
    SslError, TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1062) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1062)  
```
proc head(client: AsyncHttpClient; url: string): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a HEAD request.

 This procedure uses httpClient values such as `client.maxRedirects`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1084) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1084)  
```
proc head(client: HttpClient; url: string): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1085) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1085)  
```
proc get(client: AsyncHttpClient; url: string): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a GET request.

 This procedure uses httpClient values such as `client.maxRedirects`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1091) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1091)  
```
proc get(client: HttpClient; url: string): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1092) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1092)  
```
proc getContent(client: AsyncHttpClient; url: string): Future[string] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and returns the content of a GET request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1098) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1098)  
```
proc getContent(client: HttpClient; url: string): string {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1099) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1099)  
```
proc delete(client: AsyncHttpClient; url: string): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a DELETE request. This procedure uses httpClient values such as `client.maxRedirects`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1104)  
```
proc delete(client: HttpClient; url: string): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1105)  
```
proc deleteContent(client: AsyncHttpClient; url: string): Future[string] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and returns the content of a DELETE request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1110)  
```
proc deleteContent(client: HttpClient; url: string): string {...}{.raises: [
    ValueError, IOError, OSError, HttpRequestError, Exception, LibraryError,
    SslError, TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1111)  
```
proc post(client: AsyncHttpClient; url: string; body = "";
          multipart: MultipartData = nil): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a POST request. This procedure uses httpClient values such as `client.maxRedirects`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1116)  
```
proc post(client: HttpClient; url: string; body = "";
          multipart: MultipartData = nil): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1118)  
```
proc postContent(client: AsyncHttpClient; url: string; body = "";
                 multipart: MultipartData = nil): Future[string] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and returns the content of a POST request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1123)  
```
proc postContent(client: HttpClient; url: string; body = "";
                 multipart: MultipartData = nil): string {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1125)  
```
proc put(client: AsyncHttpClient; url: string; body = "";
         multipart: MultipartData = nil): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a PUT request. This procedure uses httpClient values such as `client.maxRedirects`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1130)  
```
proc put(client: HttpClient; url: string; body = "";
         multipart: MultipartData = nil): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1132)  
```
proc putContent(client: AsyncHttpClient; url: string; body = "";
                multipart: MultipartData = nil): Future[string] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL andreturns the content of a PUT request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1137)  
```
proc putContent(client: HttpClient; url: string; body = "";
                multipart: MultipartData = nil): string {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1138)  
```
proc patch(client: AsyncHttpClient; url: string; body = "";
           multipart: MultipartData = nil): Future[AsyncResponse] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and performs a PATCH request. This procedure uses httpClient values such as `client.maxRedirects`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1143)  
```
proc patch(client: HttpClient; url: string; body = "";
           multipart: MultipartData = nil): Response {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1145)  
```
proc patchContent(client: AsyncHttpClient; url: string; body = "";
                  multipart: MultipartData = nil): Future[string] {...}{.
    raises: [Exception, ValueError],
    tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  Connects to the hostname specified by the URL and returns the content of a PATCH request. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1150)  
```
proc patchContent(client: HttpClient; url: string; body = "";
                  multipart: MultipartData = nil): string {...}{.raises: [ValueError,
    IOError, OSError, HttpRequestError, Exception, LibraryError, SslError,
    TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1152)  
```
proc downloadFile(client: HttpClient; url: string; filename: string) {...}{.raises: [
    ValueError, IOError, OSError, HttpRequestError, Exception, LibraryError,
    SslError, TimeoutError, ProtocolError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, TimeEffect].}
```
  Downloads `url` and saves it to `filename`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1157)  
```
proc downloadFile(client: AsyncHttpClient; url: string; filename: string): Future[
    void] {...}{.raises: [Exception], tags: [ReadIOEffect, RootEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpclient.nim#L1173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpclient.nim#L1173)   Exports
-------

  [Http417](httpcore#Http417), [Http503](httpcore#Http503), [Http431](httpcore#Http431), [==](httpcore#==,tuple%5Bstring,int,int%5D,HttpVersion), [contains](httpcore#contains,HttpHeaderValues,string), [Http304](httpcore#Http304), [Http406](httpcore#Http406), [==](httpcore#==,string,HttpCode), [$](httpcore#%24,HttpHeaders), [clear](httpcore#clear,HttpHeaders), [Http408](httpcore#Http408), [$](httpcore#%24,HttpMethod), [Http411](httpcore#Http411), [is3xx](httpcore#is3xx,HttpCode), [Http418](httpcore#Http418), [Http206](httpcore#Http206), [HttpMethod](httpcore#HttpMethod), [Http101](httpcore#Http101), [httpNewLine](httpcore#httpNewLine), [Http505](httpcore#Http505), [Http413](httpcore#Http413), [newHttpHeaders](httpcore#newHttpHeaders), [Http200](httpcore#Http200), [[]=](httpcore#%5B%5D=,HttpHeaders,string,string), [Http414](httpcore#Http414), [add](httpcore#add,HttpHeaders,string,string), [Http401](httpcore#Http401), [Http205](httpcore#Http205), [==](httpcore#==,HttpCode,HttpCode), [Http407](httpcore#Http407), [Http500](httpcore#Http500), [Http404](httpcore#Http404), [Http416](httpcore#Http416), [Http308](httpcore#Http308), [Http302](httpcore#Http302), [HttpHeaders](httpcore#HttpHeaders), [Http300](httpcore#Http300), [Http428](httpcore#Http428), [Http410](httpcore#Http410), [is2xx](httpcore#is2xx,HttpCode), [Http202](httpcore#Http202), [Http502](httpcore#Http502), [headerLimit](httpcore#headerLimit), [HttpHeaderValues](httpcore#HttpHeaderValues), [contains](httpcore#contains,set%5BHttpMethod%5D,string), [newHttpHeaders](httpcore#newHttpHeaders,openArray%5Btuple%5Bstring,string%5D%5D), [$](httpcore#%24,HttpCode), [[]](httpcore#%5B%5D,HttpHeaders,string), [Http305](httpcore#Http305), [Http451](httpcore#Http451), [Http409](httpcore#Http409), [Http504](httpcore#Http504), [Http426](httpcore#Http426), [hasKey](httpcore#hasKey,HttpHeaders,string), [del](httpcore#del,HttpHeaders,string), [pairs](httpcore#pairs.i,HttpHeaders), [Http429](httpcore#Http429), [HttpVersion](httpcore#HttpVersion), [[]=](httpcore#%5B%5D=,HttpHeaders,string,seq%5Bstring%5D), [Http421](httpcore#Http421), [Http307](httpcore#Http307), [Http301](httpcore#Http301), [is4xx](httpcore#is4xx,HttpCode), [Http203](httpcore#Http203), [getOrDefault](httpcore#getOrDefault,HttpHeaders,string), [Http100](httpcore#Http100), [Http501](httpcore#Http501), [len](httpcore#len,HttpHeaders), [Http400](httpcore#Http400), [Http403](httpcore#Http403), [is5xx](httpcore#is5xx,HttpCode), [Http415](httpcore#Http415), [toString](httpcore#toString.c,HttpHeaderValues), [Http412](httpcore#Http412), [Http405](httpcore#Http405), [Http303](httpcore#Http303), [Http204](httpcore#Http204), [Http201](httpcore#Http201), [HttpCode](httpcore#HttpCode), [Http422](httpcore#Http422), [[]](httpcore#%5B%5D,HttpHeaders,string,int) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/httpclient.html>

mimetypes
=========

 This module implements a mimetypes database 


**Example:**

 
```
static:
  block:
    var m = newMimetypes()
    doAssert m.getMimetype("mp4") == "video/mp4"
    doAssert m.getExt("text/html") == "html"
    ## Values can be uppercase too.
    doAssert m.getMimetype("MP4") == "video/mp4"
    doAssert m.getExt("TEXT/HTML") == "html"
    ## If values are invalid then ``default`` is returned.
    doAssert m.getMimetype("INVALID") == "text/plain"
    doAssert m.getExt("INVALID/NONEXISTENT") == "txt"
    doAssert m.getMimetype("") == "text/plain"
    doAssert m.getExt("") == "txt"
    ## Register new Mimetypes.
    m.register(ext = "fakext", mimetype = "text/fakelang")
    doAssert m.getMimetype("fakext") == "text/fakelang"
    doAssert m.getMimetype("FaKeXT") == "text/fakelang"
```
 Imports
-------

  <strtabs>, <strutils>  Types
-----

  
```
MimeDB = object
  mimes: StringTableRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L15)   Consts
------

  
```
mimes = [("123", "application/vnd.lotus-1-2-3"),
         ("1km", "application/vnd.1000minds.decision-model+xml"),
         ("323", "text/h323"), ("3dm", "text/vnd.in3d.3dml"),
         ("3dmf", "x-world/x-3dmf"), ("3dml", "text/vnd.in3d.3dml"),
         ("3ds", "image/x-3ds"), ("3g2", "video/3gpp2"), ("3gp", "video/3gpp"),
         ("3gpp", "audio/3gpp"), ("3gpp2", "video/3gpp2"),
         ("3mf", "application/vnd.ms-3mfdocument"), ("669", "audio/x-mod"),
         ("726", "audio/32kadpcm"), ("7z", "application/x-7z-compressed"),
         ("a", "text/plain"), ("a2l", "application/a2l"),
         ("aa3", "audio/atrac3"), ("aab", "application/x-authorware-bin"),
         ("aac", "audio/x-aac"), ("aal", "audio/atrac-advanced-lossless"),
         ("aam", "application/x-authorware-map"),
         ("aas", "application/x-authorware-seg"), ("abc", "text/vnd.abc"),
         ("abw", "application/x-abiword"),
         ("ac", "application/pkix-attr-cert"), ("ac3", "audio/ac3"),
         ("acc", "application/vnd.americandynamics.acc"),
         ("ace", "application/x-ace-compressed"), ("acn", "audio/asc"),
         ("acu", "application/vnd.acucobol"),
         ("acutc", "application/vnd.acucorp"),
         ("acx", "application/internet-property-stream"),
         ("adp", "audio/adpcm"), ("aep", "application/vnd.audiograph"),
         ("afl", "video/animaflex"), ("afm", "application/x-font-type1"),
         ("afp", "application/vnd.ibm.modcap"),
         ("ahead", "application/vnd.ahead.space"),
         ("ai", "application/postscript"), ("aif", "audio/x-aiff"),
         ("aifc", "audio/x-aiff"), ("aiff", "audio/x-aiff"),
         ("aim", "application/x-aim"), ("aip", "text/x-audiosoft-intra"), (
    "air", "application/vnd.adobe.air-application-installer-package+zip"),
         ("ait", "application/vnd.dvb.ait"), ("alc", "chemical/x-alchemy"),
         ("ami", "application/vnd.amiga.ami"), ("aml", "application/aml"),
         ("amr", "audio/amr"), ("ani", "application/x-navi-animation"),
         ("anx", "application/x-annodex"),
         ("aos", "application/x-nokia-9000-communicator-add-on-software"),
         ("apinotes", "text/apinotes"),
         ("apk", "application/vnd.android.package-archive"),
         ("apkg", "application/vnd.anki"), ("apng", "image/apng"),
         ("appcache", "text/cache-manifest"),
         ("appimage", "application/appimage"),
         ("application", "application/x-ms-application"),
         ("apr", "application/vnd.lotus-approach"),
         ("aps", "application/mime"), ("apxml", "application/auth-policy+xml"),
         ("arc", "application/x-freearc"), ("arj", "application/x-arj"),
         ("art", "message/rfc822"), ("asar", "binary/asar"),
         ("asc", "text/plain"), ("ascii", "text/vnd.ascii-art"),
         ("asf", "application/vnd.ms-asf"),
         ("asice", "application/vnd.etsi.asic-e+zip"),
         ("asics", "application/vnd.etsi.asic-s+zip"), ("asm", "text/x-asm"),
         ("asn", "chemical/x-ncbi-asn1-spec"),
         ("aso", "application/vnd.accpac.simply.aso"), ("asp", "text/asp"),
         ("asr", "video/x-ms-asf"), ("asx", "video/x-ms-asf"),
         ("at3", "audio/atrac3"), ("atc", "application/vnd.acucorp"),
         ("atf", "application/atf"), ("atfx", "application/atfx"),
         ("atom", "application/atom+xml"),
         ("atomcat", "application/atomcat+xml"),
         ("atomdeleted", "application/atomdeleted+xml"),
         ("atomsrv", "application/atomserv+xml"),
         ("atomsvc", "application/atomsvc+xml"),
         ("atx", "application/vnd.antix.game-component"),
         ("atxml", "application/atxml"), ("au", "audio/basic"),
         ("auc", "application/tamp-apex-update-confirm"),
         ("avi", "video/x-msvideo"), ("avs", "video/avs-video"),
         ("aw", "application/applixware"), ("awb", "audio/amr-wb"),
         ("axa", "audio/x-annodex"), ("axs", "application/olescript"),
         ("axv", "video/x-annodex"),
         ("azf", "application/vnd.airzip.filesecure.azf"),
         ("azs", "application/vnd.airzip.filesecure.azs"),
         ("azv", "image/vnd.airzip.accelerator.azv"),
         ("azw", "application/vnd.amazon.ebook"),
         ("azw3", "application/vnd.amazon.mobi8-ebook"),
         ("b", "chemical/x-molconn-Z"), ("bak", "application/x-trash"),
         ("bar", "application/vnd.qualcomm.brew-app-res"),
         ("bas", "text/plain"), ("bash", "text/shell"),
         ("bat", "application/x-msdos-program"),
         ("bcpio", "application/x-bcpio"), ("bdf", "application/x-font-bdf"),
         ("bdm", "application/vnd.syncml.dm+wbxml"),
         ("bdoc", "application/bdoc"), ("bed", "application/vnd.realvnc.bed"),
         ("bh2", "application/vnd.fujitsu.oasysprs"), ("bib", "text/x-bibtex"),
         ("bik", "video/vnd.radgamettools.bink"),
         ("bin", "application/octet-stream"),
         ("bk2", "video/vnd.radgamettools.bink"),
         ("bkm", "application/vnd.nervana"), ("blb", "application/x-blorb"),
         ("blend", "binary/blender"), ("blorb", "application/x-blorb"),
         ("bm", "image/bmp"), ("bmed", "multipart/vnd.bint.med-plus"),
         ("bmi", "application/vnd.bmi"),
         ("bmml", "application/vnd.balsamiq.bmml+xml"), ("bmp", "image/bmp"),
         ("bmpr", "application/vnd.balsamiq.bmpr"),
         ("boo", "application/book"), ("book", "application/book"),
         ("box", "application/vnd.previewsystems.box"),
         ("boz", "application/x-bzip2"), ("bpd", "application/vnd.hbci"),
         ("bpk", "application/octet-stream"), ("brf", "text/plain"),
         ("bsd", "chemical/x-crossfire"), ("bsh", "application/x-bsh"),
         ("bsp", "model/vnd.valve.source.compiled-map"),
         ("btf", "image/prs.btif"), ("btif", "image/prs.btif"),
         ("bz", "application/x-bzip"), ("bz2", "application/x-bzip2"),
         ("c", "text/x-csrc"), ("c++", "text/x-c++src"),
         ("c11amc", "application/vnd.cluetrust.cartomobile-config"),
         ("c11amz", "application/vnd.cluetrust.cartomobile-config-pkg"),
         ("c3d", "chemical/x-chem3d"), ("c3ex", "application/cccex"),
         ("c4d", "application/vnd.clonk.c4group"),
         ("c4f", "application/vnd.clonk.c4group"),
         ("c4g", "application/vnd.clonk.c4group"),
         ("c4p", "application/vnd.clonk.c4group"),
         ("c4u", "application/vnd.clonk.c4group"),
         ("cab", "application/vnd.ms-cab-compressed"),
         ("cac", "chemical/x-cache"), ("cache", "application/x-cache"),
         ("caf", "audio/x-caf"), ("cap", "application/vnd.tcpdump.pcap"),
         ("car", "application/vnd.curl.car"),
         ("cascii", "chemical/x-cactvs-binary"),
         ("cat", "application/vnd.ms-pki.seccat"),
         ("cb7", "application/x-cbr"), ("cba", "application/x-cbr"),
         ("cbin", "chemical/x-cactvs-binary"), ("cbor", "application/cbor"),
         ("cbr", "application/x-cbr"), ("cbt", "application/x-cbr"),
         ("cbz", "application/vnd.comicbook+zip"), ("cc", "text/plain"),
         ("ccad", "application/clariscad"),
         ("ccc", "text/vnd.net2phone.commcenter.command"),
         ("ccmp", "application/ccmp+xml"), ("cco", "application/x-cocoa"),
         ("cct", "application/x-director"), ("ccxml", "application/ccxml+xml"),
         ("cda", "application/x-cdf"),
         ("cdbcmsg", "application/vnd.contact.cmsg"),
         ("cdf", "application/x-netcdf"), ("cdfx", "application/cdfx+xml"),
         ("cdkey", "application/vnd.mediastation.cdkey"),
         ("cdmia", "application/cdmi-capability"),
         ("cdmic", "application/cdmi-container"),
         ("cdmid", "application/cdmi-domain"),
         ("cdmio", "application/cdmi-object"),
         ("cdmiq", "application/cdmi-queue"), ("cdr", "image/x-coreldraw"),
         ("cdt", "image/x-coreldrawtemplate"), ("cdx", "chemical/x-cdx"),
         ("cdxml", "application/vnd.chemdraw+xml"),
         ("cdy", "application/vnd.cinderella"), ("cea", "application/cea"),
         ("cef", "chemical/x-cxf"), ("cellml", "application/cellml+xml"),
         ("cer", "application/pkix-cert"), ("cfg", "text/cfg"),
         ("cfs", "application/x-cfs-compressed"), ("cgm", "image/cgm"),
         ("cha", "application/x-chat"), ("chat", "application/x-chat"),
         ("chm", "application/vnd.ms-htmlhelp"),
         ("chrt", "application/vnd.kde.kchart"), ("cif", "chemical/x-cif"),
         ("cii", "application/vnd.anser-web-certificate-issue-initiation"),
         ("cil", "application/vnd.ms-artgalry"),
         ("cl", "application/simple-filter+xml"),
         ("cla", "application/vnd.claymore"), ("class", "application/java-vm"),
         ("clkk", "application/vnd.crick.clicker.keyboard"),
         ("clkp", "application/vnd.crick.clicker.palette"),
         ("clkt", "application/vnd.crick.clicker.template"),
         ("clkw", "application/vnd.crick.clicker.wordbank"),
         ("clkx", "application/vnd.crick.clicker"),
         ("clp", "application/x-msclip"), ("cls", "text/x-tex"),
         ("clue", "application/clue_info+xml"), ("cmake", "text/cmake"),
         ("cmc", "application/vnd.cosmocaller"), ("cmdf", "chemical/x-cmdf"),
         ("cml", "chemical/x-cml"),
         ("cmp", "application/vnd.yellowriver-custom-menu"),
         ("cmsc", "application/cms"), ("cmx", "image/x-cmx"),
         ("cnd", "text/jcr-cnd"), ("cnf", "text/cnf"),
         ("cod", "application/vnd.rim.cod"),
         ("coffee", "application/vnd.coffeescript"),
         ("com", "application/x-msdos-program"), ("conf", "text/plain"),
         ("copyright", "text/vnd.debian.copyright"),
         ("cpa", "chemical/x-compass"), ("cpio", "application/x-cpio"),
         ("cpkg", "application/vnd.xmpie.cpkg"),
         ("cpl", "application/cpl+xml"), ("cpp", "text/x-c++src"),
         ("cpt", "application/mac-compactpro"), ("cr2", "image/x-canon-cr2"),
         ("crd", "application/x-mscardfile"), ("crl", "application/pkix-crl"),
         ("crt", "application/x-x509-ca-cert"),
         ("crtr", "application/vnd.multiad.creator"),
         ("crw", "image/x-canon-crw"),
         ("crx", "application/x-chrome-extension"),
         ("cryptonote", "application/vnd.rig.cryptonote"), ("cs", "text/c#"),
         ("csf", "chemical/x-cache-csf"), ("csh", "application/x-csh"),
         ("csl", "application/vnd.citationstyles.style+xml"),
         ("csm", "chemical/x-csml"), ("csml", "chemical/x-csml"),
         ("cson", "text/cson"), ("csp", "application/vnd.commonspace"),
         ("csrattrs", "application/csrattrs"), ("css", "text/css"),
         ("cst", "application/vnd.commonspace"), ("csv", "text/csv"),
         ("csvs", "text/csv-schema"), ("ctab", "chemical/x-cactvs-binary"),
         ("ctx", "chemical/x-ctx"), ("cu", "application/cu-seeme"),
         ("cub", "chemical/x-gaussian-cube"),
         ("cuc", "application/tamp-community-update-confirm"),
         ("curl", "text/vnd.curl"), ("cw", "application/prs.cww"),
         ("cww", "application/prs.cww"), ("cxf", "chemical/x-cxf"),
         ("cxt", "application/x-director"), ("cxx", "text/plain"),
         ("d", "text/x-dsrc"), ("dae", "model/vnd.collada+xml"),
         ("daf", "application/vnd.mobius.daf"),
         ("dart", "application/vnd.dart"),
         ("dat", "application/x-ns-proxy-autoconfig"),
         ("dataless", "application/vnd.fdsn.seed"),
         ("davmount", "application/davmount+xml"),
         ("dbk", "application/docbook+xml"), ("dcd", "application/dcd"),
         ("dcf", "application/vnd.oma.drm.content"),
         ("dcm", "application/dicom"), ("dcr", "application/x-director"),
         ("dcurl", "text/vnd.curl.dcurl"),
         ("dd", "application/vnd.oma.dd+xml"),
         ("dd2", "application/vnd.oma.dd2+xml"),
         ("ddd", "application/vnd.fujixerox.ddd"),
         ("ddf", "application/vnd.syncml.dmddf+xml"),
         ("deb", "application/vnd.debian.binary-package"),
         ("deepv", "application/x-deepv"), ("def", "text/plain"),
         ("deploy", "application/octet-stream"),
         ("der", "application/x-x509-ca-cert"),
         ("dfac", "application/vnd.dreamfactory"),
         ("dgc", "application/x-dgc-compressed"), ("dib", "image/bmp"),
         ("dic", "text/x-c"), ("dif", "video/x-dv"), ("diff", "text/x-diff"),
         ("dii", "application/dii"),
         ("dim", "application/vnd.fastcopy-disk-image"),
         ("dir", "application/x-director"),
         ("dis", "application/vnd.mobius.dis"),
         ("disposition-notification", "message/disposition-notification"),
         ("dist", "application/vnd.apple.installer+xml"),
         ("distz", "application/vnd.apple.installer+xml"),
         ("dit", "application/dit"), ("djv", "image/vnd.djvu"),
         ("djvu", "image/vnd.djvu"), ("dl", "video/dl"),
         ("dll", "application/x-msdos-program"), ("dls", "audio/dls"),
         ("dm", "application/vnd.oma.drm.message"),
         ("dmg", "application/x-apple-diskimage"),
         ("dmp", "application/vnd.tcpdump.pcap"),
         ("dms", "text/vnd.dmclientscript"), ("dna", "application/vnd.dna"),
         ("doc", "application/msword"),
         ("docjson", "application/vnd.document+json"),
         ("docm", "application/vnd.ms-word.document.macroenabled.12"), ("docx",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.document"),
         ("dor", "model/vnd.gdl"), ("dot", "text/vnd.graphviz"),
         ("dotm", "application/vnd.ms-word.template.macroenabled.12"), ("dotx",
    "application/vnd.openxmlformats-officedocument.wordprocessingml.template"),
         ("dp", "application/vnd.osgi.dp"), ("dpg", "application/vnd.dpgraph"),
         ("dpgraph", "application/vnd.dpgraph"),
         ("dpkg", "application/vnd.xmpie.dpkg"),
         ("dr", "application/vnd.oma.drm.rights+xml"),
         ("dra", "audio/vnd.dra"),
         ("drc", "application/vnd.oma.drm.rights+wbxml"),
         ("drle", "image/dicom-rle"), ("drw", "application/drafting"),
         ("dsc", "text/prs.lines.tag"),
         ("dsm", "application/vnd.desmume.movie"),
         ("dssc", "application/dssc+der"), ("dtb", "application/x-dtbook+xml"),
         ("dtd", "application/xml-dtd"), ("dts", "audio/vnd.dts"),
         ("dtshd", "audio/vnd.dts.hd"), ("dump", "application/octet-stream"),
         ("dv", "video/x-dv"), ("dvb", "video/vnd.dvb.file"),
         ("dvc", "application/dvcs"), ("dvi", "application/x-dvi"),
         ("dwf", "model/vnd.dwf"), ("dwg", "image/vnd.dwg"),
         ("dx", "chemical/x-jcamp-dx"), ("dxf", "image/vnd.dxf"),
         ("dxp", "application/vnd.spotfire.dxp"),
         ("dxr", "application/x-director"), ("dzr", "application/vnd.dzr"),
         ("ear", "binary/zip"), ("ecelp4800", "audio/vnd.nuera.ecelp4800"),
         ("ecelp7470", "audio/vnd.nuera.ecelp7470"),
         ("ecelp9600", "audio/vnd.nuera.ecelp9600"),
         ("ecig", "application/vnd.evolv.ecig.settings"),
         ("ecigprofile", "application/vnd.evolv.ecig.profile"),
         ("ecigtheme", "application/vnd.evolv.ecig.theme"),
         ("ecma", "application/ecmascript"),
         ("edm", "application/vnd.novadigm.edm"),
         ("edx", "application/vnd.novadigm.edx"), ("efi", "application/efi"),
         ("efif", "application/vnd.picsel"),
         ("ei6", "application/vnd.pg.osasli"), ("ejs", "text/ejs"),
         ("el", "text/plain"), ("elc", "application/x-bytecode.elisp"),
         ("emb", "chemical/x-embl-dl-nucleotide"),
         ("embl", "chemical/x-embl-dl-nucleotide"), ("emf", "image/emf"),
         ("eml", "message/rfc822"),
         ("emm", "application/vnd.ibm.electronic-media"),
         ("emma", "application/emma+xml"),
         ("emotionml", "application/emotionml+xml"),
         ("emz", "application/x-msmetafile"),
         ("ent", "text/xml-external-parsed-entity"),
         ("entity", "application/vnd.nervana"), ("env", "application/x-envoy"),
         ("enw", "audio/evrcnw"), ("eol", "audio/vnd.digital-winds"),
         ("eot", "application/vnd.ms-fontobject"),
         ("ep", "application/vnd.bluetooth.ep.oob"),
         ("eps", "application/postscript"), ("eps2", "application/postscript"),
         ("eps3", "application/postscript"),
         ("epsf", "application/postscript"),
         ("epsi", "application/postscript"), ("epub", "application/epub+zip"),
         ("erb", "text/erb"), ("erf", "image/x-epson-erf"),
         ("es", "application/ecmascript"),
         ("es3", "application/vnd.eszigno3+xml"),
         ("esa", "application/vnd.osgi.subsystem"), ("escn", "text/godot"),
         ("esf", "application/vnd.epson.esf"),
         ("espass", "application/vnd.espass-espass+zip"),
         ("et3", "application/vnd.eszigno3+xml"), ("etx", "text/x-setext"),
         ("eva", "application/x-eva"), ("evb", "audio/evrcb"),
         ("evc", "audio/evrc"), ("evw", "audio/evrcwb"),
         ("evy", "application/x-envoy"),
         ("exe", "application/x-msdos-program"), ("exi", "application/exi"),
         ("exr", "image/aces"), ("ext", "application/vnd.novadigm.ext"),
         ("eyaml", "text/yaml"), ("ez", "application/andrew-inset"),
         ("ez2", "application/vnd.ezpix-album"),
         ("ez3", "application/vnd.ezpix-package"), ("f", "text/x-fortran"),
         ("f4v", "video/x-f4v"), ("f77", "text/x-fortran"),
         ("f90", "text/plain"), ("fb", "application/x-maker"),
         ("fbdoc", "application/x-maker"), ("fbs", "image/vnd.fastbidsheet"),
         ("fbx", "model/filmbox"),
         ("fcdt", "application/vnd.adobe.formscentral.fcdt"),
         ("fch", "chemical/x-gaussian-checkpoint"),
         ("fchk", "chemical/x-gaussian-checkpoint"),
         ("fcs", "application/vnd.isac.fcs"), ("fdf", "application/vnd.fdf"),
         ("fdt", "application/fdt+xml"),
         ("fe_launch", "application/vnd.denovo.fcselayout-link"),
         ("feature", "text/gherkin"),
         ("fg5", "application/vnd.fujitsu.oasysgp"),
         ("fgd", "application/x-director"), ("fh", "image/x-freehand"),
         ("fh4", "image/x-freehand"), ("fh5", "image/x-freehand"),
         ("fh7", "image/x-freehand"), ("fhc", "image/x-freehand"),
         ("fif", "image/fif"), ("fig", "application/x-xfig"),
         ("finf", "application/fastinfoset"), ("fish", "text/fish"),
         ("fit", "image/fits"), ("fits", "image/fits"),
         ("fla", "application/vnd.dtg.local.flash"), ("flac", "audio/x-flac"),
         ("fli", "video/x-fli"), ("flo", "application/vnd.micrografx.flo"),
         ("flr", "x-world/x-vrml"), ("flv", "video/x-flv"),
         ("flw", "application/vnd.kde.kivio"),
         ("flx", "text/vnd.fmi.flexstor"), ("fly", "text/vnd.fly"),
         ("fm", "application/vnd.framemaker"),
         ("fmf", "video/x-atomic3d-feature"),
         ("fnc", "application/vnd.frogans.fnc"),
         ("fo", "application/vnd.software602.filler.form+xml"),
         ("for", "text/x-fortran"), ("fpx", "image/vnd.fpx"),
         ("frame", "application/vnd.framemaker"),
         ("frl", "application/freeloader"), ("frm", "application/vnd.ufdl"),
         ("fsc", "application/vnd.fsc.weblaunch"), ("fst", "image/vnd.fst"),
         ("ftc", "application/vnd.fluxtime.clip"),
         ("fti", "application/vnd.anser-web-funds-transfer-initiation"),
         ("fts", "image/fits"), ("funk", "audio/make"),
         ("fvt", "video/vnd.fvt"), ("fxm", "video/x-javafx"),
         ("fxp", "application/vnd.adobe.fxp"),
         ("fxpl", "application/vnd.adobe.fxp"),
         ("fzs", "application/vnd.fuzzysheet"), ("g", "text/plain"),
         ("g2w", "application/vnd.geoplan"), ("g3", "image/g3fax"),
         ("g3w", "application/vnd.geospace"),
         ("gac", "application/vnd.groove-account"),
         ("gal", "chemical/x-gaussian-log"), ("gam", "application/x-tads"),
         ("gamin", "chemical/x-gamess-input"),
         ("gau", "chemical/x-gaussian-input"),
         ("gbr", "application/rpki-ghostbusters"),
         ("gca", "application/x-gca-compressed"), ("gcd", "text/x-pcs-gcd"),
         ("gcf", "application/x-graphing-calculator"),
         ("gcg", "chemical/x-gcg8-sequence"), ("gdl", "model/vnd.gdl"),
         ("gdoc", "application/vnd.google-apps.document"),
         ("gemspec", "text/ruby"), ("gen", "chemical/x-genbank"),
         ("geo", "application/vnd.dynageo"),
         ("geojson", "application/geo+json"),
         ("gex", "application/vnd.geometry-explorer"),
         ("gf", "application/x-tex-gf"),
         ("ggb", "application/vnd.geogebra.file"),
         ("ggt", "application/vnd.geogebra.tool"),
         ("ghf", "application/vnd.groove-help"), ("gif", "image/gif"),
         ("gim", "application/vnd.groove-identity-message"),
         ("gjc", "chemical/x-gaussian-input"),
         ("gjf", "chemical/x-gaussian-input"), ("gl", "video/gl"),
         ("glb", "model/gltf-binary"), ("gltf", "model/gltf+json"),
         ("gml", "application/gml+xml"), ("gmx", "application/vnd.gmx"),
         ("gnumeric", "application/x-gnumeric"), ("go", "text/go"),
         ("gotmpl", "text/gotmpl"), ("gph", "application/vnd.flographit"),
         ("gpt", "chemical/x-mopac-graph"), ("gpx", "application/gpx+xml"),
         ("gqf", "application/vnd.grafeq"), ("gqs", "application/vnd.grafeq"),
         ("gradle", "text/groovy"), ("gram", "application/srgs"),
         ("gramps", "application/x-gramps-xml"),
         ("gre", "application/vnd.geometry-explorer"),
         ("groovy", "text/groovy"), ("grv", "application/vnd.groove-injector"),
         ("grxml", "application/srgs+xml"), ("gsd", "audio/x-gsm"),
         ("gsf", "application/x-font-ghostscript"),
         ("gsheet", "application/vnd.google-apps.spreadsheet"),
         ("gslides", "application/vnd.google-apps.presentation"),
         ("gsm", "model/vnd.gdl"), ("gsp", "application/x-gsp"),
         ("gss", "application/x-gss"), ("gtar", "application/x-gtar"),
         ("gtm", "application/vnd.groove-tool-message"),
         ("gtw", "model/vnd.gtw"), ("gv", "text/vnd.graphviz"),
         ("gxf", "application/gxf"), ("gxt", "application/vnd.geonext"),
         ("gyb", "text/gyb"), ("gyp", "text/gyp"), ("gypi", "text/gyp"),
         ("gz", "application/gzip"), ("h", "text/x-chdr"),
         ("h++", "text/x-c++hdr"), ("h261", "video/h261"),
         ("h263", "video/h263"), ("h264", "video/h264"),
         ("hal", "application/vnd.hal+xml"), ("hbc", "application/vnd.hbci"),
         ("hbci", "application/vnd.hbci"),
         ("hbs", "text/x-handlebars-template"),
         ("hdd", "application/x-virtualbox-hdd"), ("hdf", "application/x-hdf"),
         ("hdr", "image/vnd.radiance"), ("hdt", "application/vnd.hdt"),
         ("heic", "image/heic"), ("heics", "image/heic-sequence"),
         ("heif", "image/heif"), ("heifs", "image/heif-sequence"),
         ("help", "application/x-helpfile"),
         ("hgl", "application/vnd.hp-hpgl"), ("hh", "text/plain"),
         ("hin", "chemical/x-hin"), ("hjson", "application/hjson"),
         ("hlb", "text/x-script"), ("hlp", "application/winhlp"),
         ("hpg", "application/vnd.hp-hpgl"),
         ("hpgl", "application/vnd.hp-hpgl"),
         ("hpi", "application/vnd.hp-hpid"),
         ("hpid", "application/vnd.hp-hpid"), ("hpp", "text/x-c++hdr"),
         ("hps", "application/vnd.hp-hps"),
         ("hpub", "application/prs.hpub+zip"),
         ("hqx", "application/mac-binhex40"), ("hs", "text/x-haskell"),
         ("hta", "application/hta"), ("htc", "text/x-component"),
         ("htke", "application/vnd.kenameaapp"), ("html", "text/html"),
         ("htt", "text/webviewhtml"), ("hvd", "application/vnd.yamaha.hv-dic"),
         ("hvp", "application/vnd.yamaha.hv-voice"),
         ("hvs", "application/vnd.yamaha.hv-script"), ("hx", "text/haxe"),
         ("hxml", "text/haxe"), ("hxx", "text/plain"),
         ("i2g", "application/vnd.intergeo"),
         ("ic0", "application/vnd.commerce-battelle"),
         ("ic1", "application/vnd.commerce-battelle"),
         ("ic2", "application/vnd.commerce-battelle"),
         ("ic3", "application/vnd.commerce-battelle"),
         ("ic4", "application/vnd.commerce-battelle"),
         ("ic5", "application/vnd.commerce-battelle"),
         ("ic6", "application/vnd.commerce-battelle"),
         ("ic7", "application/vnd.commerce-battelle"),
         ("ic8", "application/vnd.commerce-battelle"),
         ("ica", "application/vnd.commerce-battelle"),
         ("icc", "application/vnd.iccprofile"),
         ("icd", "application/vnd.commerce-battelle"),
         ("ice", "x-conference/x-cooltalk"),
         ("icf", "application/vnd.commerce-battelle"),
         ("icm", "application/vnd.iccprofile"), ("icns", "binary/icns"),
         ("ico", "image/x-icon"), ("ics", "text/calendar"),
         ("icz", "text/calendar"), ("idc", "text/plain"), ("idl", "text/idl"),
         ("ief", "image/ief"), ("iefs", "image/ief"), ("ifb", "text/calendar"),
         ("ifm", "application/vnd.shana.informed.formdata"),
         ("iges", "model/iges"), ("igl", "application/vnd.igloader"),
         ("igm", "application/vnd.insors.igm"),
         ("ign", "application/vnd.coreos.ignition+json"),
         ("ignition", "application/vnd.coreos.ignition+json"),
         ("igs", "model/iges"), ("igx", "application/vnd.micrografx.igx"),
         ("iif", "application/vnd.shana.informed.interchange"),
         ("iii", "application/x-iphone"), ("ima", "application/x-ima"),
         ("imap", "application/x-httpd-imap"),
         ("imf", "application/vnd.imagemeter.folder+zip"),
         ("img", "application/octet-stream"),
         ("imgcal", "application/vnd.3lightssoftware.imagescal"),
         ("imi", "application/vnd.imagemeter.image+zip"),
         ("imp", "application/vnd.accpac.simply.imp"),
         ("ims", "application/vnd.ms-ims"),
         ("imscc", "application/vnd.ims.imsccv1p1"), ("in", "text/plain"),
         ("inc", "text/inc"), ("inf", "application/inf"),
         ("info", "application/x-info"), ("ini", "text/ini"),
         ("ink", "application/inkml+xml"), ("inkml", "application/inkml+xml"),
         ("inp", "chemical/x-gamess-input"),
         ("ins", "application/x-internet-signup"),
         ("install", "application/x-install-instructions"),
         ("iota", "application/vnd.astraea-software.iota"),
         ("ip", "application/x-ip2"), ("ipfix", "application/ipfix"),
         ("ipk", "application/vnd.shana.informed.package"),
         ("irm", "application/vnd.ibm.rights-management"),
         ("irp", "application/vnd.irepository.package+xml"),
         ("ism", "model/vnd.gdl"), ("iso", "application/x-iso9660-image"),
         ("isp", "application/x-internet-signup"),
         ("ist", "chemical/x-isostar"), ("istr", "chemical/x-isostar"),
         ("isu", "video/x-isvideo"), ("it", "audio/it"),
         ("itp", "application/vnd.shana.informed.formtemplate"),
         ("its", "application/its+xml"), ("iv", "application/x-inventor"),
         ("ivp", "application/vnd.immervision-ivp"), ("ivr", "i-world/i-vrml"),
         ("ivu", "application/vnd.immervision-ivu"),
         ("ivy", "application/x-livescreen"), ("j2", "text/jinja"),
         ("jad", "text/vnd.sun.j2me.app-descriptor"), ("jade", "text/jade"),
         ("jam", "application/vnd.jam"), ("jar", "application/x-java-archive"),
         ("jardiff", "application/x-java-archive-diff"),
         ("java", "text/x-java-source"),
         ("jcm", "application/x-java-commerce"),
         ("jdx", "chemical/x-jcamp-dx"), ("jenkinsfile", "text/groovy"),
         ("jfif", "image/jpeg"), ("jinja", "text/jinja"),
         ("jinja2", "text/jinja"), ("jisp", "application/vnd.jisp"),
         ("jls", "image/jls"), ("jlt", "application/vnd.hp-jlyt"),
         ("jl", "text/julia"), ("jmz", "application/x-jmol"),
         ("jng", "image/x-jng"), ("jnlp", "application/x-java-jnlp-file"),
         ("joda", "application/vnd.joost.joda-archive"), ("jp2", "image/jp2"),
         ("jpe", "image/jpeg"), ("jpeg", "image/jpeg"), ("jpf", "image/jpx"),
         ("jpg", "image/jpeg"), ("jpg2", "image/jp2"), ("jpgm", "image/jpm"),
         ("jpgv", "video/jpeg"), ("jpm", "image/jpm"), ("jps", "image/x-jps"),
         ("jpx", "image/jpx"), ("jrd", "application/jrd+json"),
         ("js", "application/javascript"), ("json", "application/json"),
         ("json-patch", "application/json-patch+json"),
         ("json5", "application/json5"), ("jsonld", "application/ld+json"),
         ("jsonml", "application/jsonml+json"), ("jsx", "text/jsx"),
         ("jtd", "text/vnd.esmertec.theme-descriptor"),
         ("jut", "image/jutvision"), ("kar", "audio/midi"),
         ("karbon", "application/vnd.kde.karbon"),
         ("kcm", "application/vnd.nervana"), ("key", "application/pgp-keys"),
         ("keynote", "application/vnd.apple.keynote"),
         ("kfo", "application/vnd.kde.kformula"),
         ("kia", "application/vnd.kidspiration"),
         ("kil", "application/x-killustrator"), ("kin", "chemical/x-kinemage"),
         ("kml", "application/vnd.google-earth.kml+xml"),
         ("kmz", "application/vnd.google-earth.kmz"),
         ("kne", "application/vnd.kinar"), ("knp", "application/vnd.kinar"),
         ("kom", "application/vnd.hbci"),
         ("kon", "application/vnd.kde.kontour"), ("koz", "audio/vnd.audikoz"),
         ("kpr", "application/vnd.kde.kpresenter"),
         ("kpt", "application/vnd.kde.kpresenter"),
         ("kpxx", "application/vnd.ds-keypoint"), ("ksh", "application/x-ksh"),
         ("ksp", "application/vnd.kde.kspread"), ("kt", "text/kotlin"),
         ("ktr", "application/vnd.kahootz"), ("ktx", "image/ktx"),
         ("ktz", "application/vnd.kahootz"),
         ("kwd", "application/vnd.kde.kword"),
         ("kwt", "application/vnd.kde.kword"), ("l16", "audio/l16"),
         ("la", "audio/nspaudio"), ("lam", "audio/x-liveaudio"),
         ("lasjson", "application/vnd.las.las+json"),
         ("lasxml", "application/vnd.las.las+xml"),
         ("latex", "application/x-latex"), ("lbc", "audio/ilbc"),
         ("lbd", "application/vnd.llamagraphics.life-balance.desktop"),
         ("lbe", "application/vnd.llamagraphics.life-balance.exchange+xml"),
         ("le", "application/vnd.bluetooth.le.oob"),
         ("les", "application/vnd.hhe.lesson-player"), ("less", "text/less"),
         ("lgr", "application/lgr+xml"), ("lha", "application/octet-stream"),
         ("lhs", "text/x-literate-haskell"),
         ("lhx", "application/octet-stream"), ("lin", "application/bbolin"),
         ("link66", "application/vnd.route66.link66+xml"),
         ("list", "text/plain"), ("list3820", "application/vnd.ibm.modcap"),
         ("listafp", "application/vnd.ibm.modcap"), ("lmp", "model/vnd.gdl"),
         ("lnk", "application/x-ms-shortcut"), ("log", "text/plain"),
         ("lostsyncxml", "application/lostsync+xml"),
         ("lostxml", "application/lost+xml"),
         ("lrf", "application/octet-stream"),
         ("lrm", "application/vnd.ms-lrm"), ("lsf", "video/x-la-asf"),
         ("lsp", "text/x-script.lisp"), ("lst", "text/plain"),
         ("lsx", "video/x-la-asf"), ("ltf", "application/vnd.frogans.ltf"),
         ("ltx", "application/x-latex"), ("lua", "text/x-lua"),
         ("luac", "application/x-lua-bytecode"),
         ("lvp", "audio/vnd.lucent.voice"),
         ("lwp", "application/vnd.lotus-wordpro"), ("lxf", "application/lxf"),
         ("lyx", "application/x-lyx"), ("lzh", "application/octet-stream"),
         ("lzx", "application/x-lzx"),
         ("m", "application/vnd.wolfram.mathematica.package"),
         ("m13", "application/x-msmediaview"),
         ("m14", "application/x-msmediaview"), ("m15", "audio/x-mod"),
         ("m1v", "video/mpeg"), ("m21", "application/mp21"),
         ("m2a", "audio/mpeg"), ("m2v", "video/mpeg"), ("m3a", "audio/mpeg"),
         ("m3g", "application/m3g"), ("m3u", "audio/x-mpegurl"),
         ("m3u8", "application/vnd.apple.mpegurl"), ("m4a", "audio/x-m4a"),
         ("m4s", "video/iso.segment"), ("m4u", "video/vnd.mpegurl"),
         ("m4v", "video/x-m4v"), ("ma", "application/mathematica"),
         ("mads", "application/mads+xml"),
         ("mag", "application/vnd.ecowin.chart"), ("mail", "message/rfc822"),
         ("maker", "application/vnd.framemaker"),
         ("man", "application/x-troff-man"),
         ("manifest", "text/cache-manifest"), ("map", "application/x-navimap"),
         ("mar", "text/plain"), ("markdown", "text/markdown"),
         ("mathml", "application/mathml+xml"),
         ("mb", "application/mathematica"), ("mbd", "application/mbedlet"),
         ("mbk", "application/vnd.mobius.mbk"), ("mbox", "application/mbox"),
         ("mc$", "application/x-magic-cap-package-1.0"),
         ("mc1", "application/vnd.medcalcdata"),
         ("mcd", "application/vnd.mcd"), ("mcf", "image/vasa"),
         ("mcif", "chemical/x-mmcif"), ("mcm", "chemical/x-macmolecule"),
         ("mcp", "application/netmc"), ("mcurl", "text/vnd.curl.mcurl"),
         ("md", "text/markdown"), ("mdb", "application/x-msaccess"),
         ("mdc", "application/vnd.marlin.drm.mdcf"),
         ("mdi", "image/vnd.ms-modi"), ("me", "application/x-troff-me"),
         ("med", "audio/x-mod"), ("mesh", "model/mesh"),
         ("meta4", "application/metalink4+xml"),
         ("metalink", "application/metalink+xml"),
         ("mets", "application/mets+xml"), ("mf4", "application/mf4"),
         ("mfm", "application/vnd.mfmp"), ("mft", "application/rpki-manifest"),
         ("mgp", "application/vnd.osgeo.mapguide.package"),
         ("mgz", "application/vnd.proteus.magazine"),
         ("mht", "message/rfc822"), ("mhtml", "message/rfc822"),
         ("mib", "text/mib"), ("mid", "audio/midi"), ("midi", "audio/midi"),
         ("mie", "application/x-mie"), ("mif", "application/x-mif"),
         ("mime", "message/rfc822"), ("miz", "text/mizar"),
         ("mj2", "video/mj2"),
         ("mjf", "audio/x-vnd.audioexplosion.mjuicemediafile"),
         ("mjp2", "video/mj2"), ("mjpg", "video/x-motion-jpeg"),
         ("mjs", "application/javascript"), ("mk", "text/makefile"),
         ("mk3d", "video/x-matroska-3d"), ("mka", "audio/x-matroska"),
         ("mkd", "text/x-markdown"), ("mks", "video/x-matroska"),
         ("mkv", "video/x-matroska"), ("mlp", "application/vnd.dolby.mlp"),
         ("mm", "application/x-freemind"),
         ("mmd", "application/vnd.chipnuts.karaoke-mmd"),
         ("mmdb", "application/vnd.maxmind.maxmind-db"),
         ("mme", "application/base64"), ("mmf", "application/vnd.smaf"),
         ("mml", "text/mathml"), ("mmod", "chemical/x-macromodel-input"),
         ("mmr", "image/vnd.fujixerox.edmics-mmr"),
         ("mms", "application/vnd.wap.mms-message"), ("mng", "video/x-mng"),
         ("mny", "application/x-msmoney"),
         ("mobi", "application/x-mobipocket-ebook"), ("moc", "text/x-moc"),
         ("mod", "audio/x-mod"), ("model-inter", "application/vnd.vd-study"),
         ("mods", "application/mods+xml"), ("modulemap", "text/modulemap"),
         ("mol", "chemical/x-mdl-molfile"), ("mol2", "chemical/x-mol2"),
         ("moml", "model/vnd.moml+xml"), ("moo", "chemical/x-mopac-out"),
         ("moov", "video/quicktime"), ("mop", "chemical/x-mopac-input"),
         ("mopcrt", "chemical/x-mopac-input"), ("mov", "video/quicktime"),
         ("movie", "video/x-sgi-movie"), ("mp1", "audio/mpeg"),
         ("mp2", "audio/mpeg"), ("mp21", "application/mp21"),
         ("mp2a", "audio/mpeg"), ("mp3", "audio/mp3"), ("mp4", "video/mp4"),
         ("mp4a", "audio/mp4"), ("mp4s", "application/mp4"),
         ("mp4v", "video/mp4"), ("mpa", "video/mpeg"),
         ("mpc", "application/vnd.mophun.certificate"),
         ("mpd", "application/dash+xml"), ("mpdd", "application/dashdelta"),
         ("mpe", "video/mpeg"), ("mpeg", "video/mpeg"),
         ("mpega", "audio/mpeg"), ("mpf", "text/vnd.ms-mediapackage"),
         ("mpg", "video/mpeg"), ("mpg4", "video/mp4"), ("mpga", "audio/mpeg"),
         ("mpkg", "application/vnd.apple.installer+xml"),
         ("mpm", "application/vnd.blueice.multipass"),
         ("mpn", "application/vnd.mophun.application"),
         ("mpp", "application/vnd.ms-project"),
         ("mpt", "application/vnd.ms-project"),
         ("mpv", "application/x-project"), ("mpv2", "video/mpeg"),
         ("mpx", "application/x-project"),
         ("mpy", "application/vnd.ibm.minipay"),
         ("mqy", "application/vnd.mobius.mqy"), ("mrc", "application/marc"),
         ("mrcx", "application/marcxml+xml"), ("ms", "application/x-troff-ms"),
         ("msa", "application/vnd.msa-disk-image"),
         ("mscml", "application/mediaservercontrol+xml"),
         ("msd", "application/vnd.fdsn.mseed"),
         ("mseed", "application/vnd.fdsn.mseed"),
         ("mseq", "application/vnd.mseq"),
         ("msf", "application/vnd.epson.msf"),
         ("msg", "application/vnd.ms-outlook"), ("msh", "model/mesh"),
         ("msi", "application/x-msi"), ("msl", "application/vnd.mobius.msl"),
         ("msm", "model/vnd.gdl"), ("msty", "application/vnd.muvee.style"),
         ("mtm", "audio/x-mod"), ("mts", "model/vnd.mts"),
         ("multitrack", "audio/vnd.presonus.multitrack"),
         ("mus", "application/vnd.musician"),
         ("musd", "application/mmt-usd+xml"),
         ("musicxml", "application/vnd.recordare.musicxml+xml"),
         ("mv", "video/x-sgi-movie"), ("mvb", "application/x-msmediaview"),
         ("mvt", "application/vnd.mapbox-vector-tile"),
         ("mwc", "application/vnd.dpgraph"), ("mwf", "application/vnd.mfer"),
         ("mxf", "application/mxf"), ("mxi", "application/vnd.vd-study"),
         ("mxl", "application/vnd.recordare.musicxml"),
         ("mxmf", "audio/mobile-xmf"), ("mxml", "application/xv+xml"),
         ("mxs", "application/vnd.triscape.mxs"), ("mxu", "video/vnd.mpegurl"),
         ("my", "audio/make"), ("mzz", "application/x-vnd.audioexplosion.mzz"),
         ("n-gage", "application/vnd.nokia.n-gage.symbian.install"),
         ("n3", "text/n3"), ("nap", "image/naplps"),
         ("naplps", "image/naplps"), ("nb", "application/mathematica"),
         ("nbp", "application/vnd.wolfram.player"),
         ("nc", "application/x-netcdf"),
         ("ncm", "application/vnd.nokia.configuration-message"),
         ("ncx", "application/x-dtbncx+xml"),
         ("ndc", "application/vnd.osa.netdeploy"),
         ("ndjson", "application/json"),
         ("ndl", "application/vnd.lotus-notes"),
         ("nds", "application/vnd.nintendo.nitro.rom"),
         ("nef", "image/x-nikon-nef"), ("nfo", "text/x-nfo"),
         ("ngdat", "application/vnd.nokia.n-gage.data"),
         ("ngdoc", "text/ngdoc"), ("nif", "image/x-niff"),
         ("niff", "image/x-niff"), ("nim", "text/nim"),
         ("nimble", "text/nimble"), ("nimf", "text/nim"), ("nims", "text/nim"),
         ("nitf", "application/vnd.nitf"),
         ("nix", "application/x-mix-transfer"),
         ("nlu", "application/vnd.neurolanguage.nlu"),
         ("nml", "application/vnd.enliven"),
         ("nnd", "application/vnd.noblenet-directory"),
         ("nns", "application/vnd.noblenet-sealer"),
         ("nnw", "application/vnd.noblenet-web"),
         ("notebook", "application/vnd.smart.notebook"),
         ("npx", "image/vnd.net-fpx"), ("nq", "application/n-quads"),
         ("ns2", "application/vnd.lotus-notes"),
         ("ns3", "application/vnd.lotus-notes"),
         ("ns4", "application/vnd.lotus-notes"),
         ("nsc", "application/x-conference"),
         ("nsf", "application/vnd.lotus-notes"),
         ("nsg", "application/vnd.lotus-notes"),
         ("nsh", "application/vnd.lotus-notes"),
         ("nt", "application/n-triples"),
         ("ntf", "application/vnd.lotus-notes"),
         ("numbers", "application/vnd.apple.numbers"),
         ("nvd", "application/x-navidoc"), ("nwc", "application/x-nwc"),
         ("nws", "message/rfc822"), ("nzb", "application/x-nzb"),
         ("o", "application/x-object"), ("o4a", "application/vnd.oma.drm.dcf"),
         ("o4v", "application/vnd.oma.drm.dcf"),
         ("oa2", "application/vnd.fujitsu.oasys2"),
         ("oa3", "application/vnd.fujitsu.oasys3"),
         ("oas", "application/vnd.fujitsu.oasys"),
         ("obd", "application/x-msbinder"),
         ("obg", "application/vnd.openblox.game-binary"),
         ("obgx", "application/vnd.openblox.game+xml"),
         ("obj", "application/x-tgif"), ("oda", "application/oda"),
         ("odb", "application/vnd.oasis.opendocument.database"),
         ("odc", "application/vnd.oasis.opendocument.chart"),
         ("odd", "application/tei+xml"),
         ("odf", "application/vnd.oasis.opendocument.formula"),
         ("odft", "application/vnd.oasis.opendocument.formula-template"),
         ("odg", "application/vnd.oasis.opendocument.graphics"),
         ("odi", "application/vnd.oasis.opendocument.image"),
         ("odm", "application/vnd.oasis.opendocument.text-master"),
         ("odp", "application/vnd.oasis.opendocument.presentation"),
         ("ods", "application/vnd.oasis.opendocument.spreadsheet"),
         ("odt", "application/vnd.oasis.opendocument.text"),
         ("odx", "application/odx"), ("oeb", "application/vnd.openeye.oeb"),
         ("oga", "audio/ogg"), ("ogex", "model/vnd.opengex"),
         ("ogg", "audio/ogg"), ("ogv", "video/ogg"),
         ("ogx", "application/ogg"), ("old", "application/x-trash"),
         ("omc", "application/x-omc"), ("omcd", "application/x-omcdatamaker"),
         ("omcr", "application/x-omcregerator"),
         ("omdoc", "application/omdoc+xml"), ("omg", "audio/atrac3"),
         ("onepkg", "application/onenote"), ("onetmp", "application/onenote"),
         ("onetoc", "application/onenote"), ("onetoc2", "application/onenote"),
         ("opf", "application/oebps-package+xml"), ("opml", "text/x-opml"),
         ("oprc", "application/vnd.palm"), ("opus", "audio/ogg"),
         ("or2", "application/vnd.lotus-organizer"),
         ("or3", "application/vnd.lotus-organizer"),
         ("orf", "image/x-olympus-orf"), ("org", "text/x-org"),
         ("orq", "application/ocsp-request"),
         ("ors", "application/ocsp-response"),
         ("osf", "application/vnd.yamaha.openscoreformat"),
         ("osfpvg", "application/vnd.yamaha.openscoreformat.osfpvg+xml"),
         ("osm", "application/vnd.openstreetmap.data+xml"),
         ("otc", "application/vnd.oasis.opendocument.chart-template"),
         ("otf", "font/otf"),
         ("otg", "application/vnd.oasis.opendocument.graphics-template"),
         ("oth", "application/vnd.oasis.opendocument.text-web"),
         ("oti", "application/vnd.oasis.opendocument.image-template"),
         ("otp", "application/vnd.oasis.opendocument.presentation-template"),
         ("ots", "application/vnd.oasis.opendocument.spreadsheet-template"),
         ("ott", "application/vnd.oasis.opendocument.text-template"),
         ("ova", "application/x-virtualbox-ova"),
         ("ovf", "application/x-virtualbox-ovf"),
         ("owx", "application/owl+xml"),
         ("oxlicg", "application/vnd.oxli.countgraph"),
         ("oxps", "application/oxps"),
         ("oxt", "application/vnd.openofficeorg.extension"),
         ("oza", "application/x-oz-application"), ("p", "text/x-pascal"),
         ("p10", "application/pkcs10"), ("p12", "application/pkcs12"),
         ("p2p", "application/vnd.wfa.p2p"),
         ("p7a", "application/x-pkcs7-signature"),
         ("p7b", "application/x-pkcs7-certificates"),
         ("p7c", "application/pkcs7-mime"), ("p7m", "application/pkcs7-mime"),
         ("p7r", "application/x-pkcs7-certreqresp"),
         ("p7s", "application/pkcs7-signature"), ("p8", "application/pkcs8"),
         ("pac", "application/x-ns-proxy-autoconfig"),
         ("pack", "application/x-java-pack200"),
         ("package", "application/vnd.autopackage"),
         ("pages", "application/vnd.apple.pages"), ("par", "text/plain-bas"),
         ("part", "application/pro_eng"), ("pas", "text/pascal"),
         ("pat", "image/x-coreldrawpattern"), ("patch", "text/x-diff"),
         ("paw", "application/vnd.pawaafile"),
         ("pbd", "application/vnd.powerbuilder6"),
         ("pbm", "image/x-portable-bitmap"),
         ("pcap", "application/vnd.tcpdump.pcap"),
         ("pcf", "application/x-font-pcf"), ("pcl", "application/vnd.hp-pcl"),
         ("pclxl", "application/vnd.hp-pclxl"), ("pct", "image/x-pict"),
         ("pcurl", "application/vnd.curl.pcurl"), ("pcx", "image/x-pcx"),
         ("pdb", "application/vnd.palm"), ("pde", "text/x-processing"),
         ("pdf", "application/pdf"), ("pdx", "application/pdx"),
         ("pem", "text/pem"), ("pfa", "application/x-font-type1"),
         ("pfb", "application/x-font-type1"),
         ("pfm", "application/x-font-type1"),
         ("pfr", "application/font-tdpfr"), ("pfunk", "audio/make"),
         ("pfx", "application/pkcs12"),
         ("pgb", "image/vnd.globalgraphics.pgb"),
         ("pgm", "image/x-portable-graymap"),
         ("pgn", "application/x-chess-pgn"),
         ("pgp", "application/pgp-encrypted"),
         ("php", "application/x-httpd-php"),
         ("php3", "application/x-httpd-php3"),
         ("php3p", "application/x-httpd-php3-preprocessed"),
         ("php4", "application/x-httpd-php4"),
         ("php5", "application/x-httpd-php5"),
         ("phps", "application/x-httpd-php-source"),
         ("pht", "application/x-httpd-php"),
         ("phtml", "application/x-httpd-php"), ("pic", "image/pict"),
         ("pict", "image/pict"),
         ("pil", "application/vnd.piaccess.application-license"),
         ("pk", "application/x-tex-pk"), ("pkd", "application/vnd.hbci"),
         ("pkg", "application/vnd.apple.installer+xml"),
         ("pki", "application/pkixcmp"),
         ("pkipath", "application/pkix-pkipath"),
         ("pko", "application/ynd.ms-pkipko"),
         ("pkpass", "application/vnd.apple.pkpass"),
         ("pl", "application/x-perl"), ("plantuml", "text/plantuml"),
         ("plb", "application/vnd.3gpp.pic-bw-large"),
         ("plc", "application/vnd.mobius.plc"),
         ("plf", "application/vnd.pocketlearn"),
         ("plj", "audio/vnd.everad.plj"), ("plp", "application/vnd.panoply"),
         ("pls", "application/pls+xml"), ("plx", "application/x-pixclscript"),
         ("ply", "model/stanford"), ("pm", "text/plain"),
         ("pm4", "application/x-pagemaker"),
         ("pm5", "application/x-pagemaker"), ("pma", "application/x-perfmon"),
         ("pmc", "application/x-perfmon"),
         ("pml", "application/vnd.ctc-posml"),
         ("pmr", "application/x-perfmon"), ("pmw", "application/x-perfmon"),
         ("png", "image/png"), ("pnm", "image/x-portable-anymap"),
         ("po", "text/pofile"), ("pod", "text/x-pod"),
         ("portpkg", "application/vnd.macports.portpkg"),
         ("pot", "application/vnd.ms-powerpoint"),
         ("potm", "application/vnd.ms-powerpoint.template.macroenabled.12"), (
    "potx",
    "application/vnd.openxmlformats-officedocument.presentationml.template"),
         ("pov", "model/x-pov"), ("pp", "text/puppet"),
         ("ppa", "application/vnd.ms-powerpoint"),
         ("ppam", "application/vnd.ms-powerpoint.addin.macroenabled.12"),
         ("ppd", "application/vnd.cups-ppd"),
         ("ppkg", "application/vnd.xmpie.ppkg"),
         ("ppm", "image/x-portable-pixmap"),
         ("pps", "application/vnd.ms-powerpoint"),
         ("ppsm", "application/vnd.ms-powerpoint.slideshow.macroenabled.12"), (
    "ppsx",
    "application/vnd.openxmlformats-officedocument.presentationml.slideshow"),
         ("ppt", "application/vnd.ms-powerpoint"), ("pptm",
    "application/vnd.ms-powerpoint.presentation.macroenabled.12"), ("pptx",
    "application/vnd.openxmlformats-officedocument.presentationml.presentation"),
         ("ppz", "application/mspowerpoint"), ("pqa", "application/vnd.palm"),
         ("prc", "application/vnd.palm"),
         ("pre", "application/vnd.lotus-freelance"),
         ("preminet", "application/vnd.preminet"),
         ("prf", "application/pics-rules"), ("proto", "text/proto"),
         ("provn", "text/provenance-notation"),
         ("provx", "application/provenance+xml"),
         ("prt", "application/pro_eng"),
         ("prz", "application/vnd.lotus-freelance"),
         ("ps", "application/postscript"),
         ("psb", "application/vnd.3gpp.pic-bw-small"),
         ("psd", "image/vnd.adobe.photoshop"),
         ("pseg3820", "application/vnd.ibm.modcap"),
         ("psf", "application/x-font-linux-psf"), ("psid", "audio/prs.sid"),
         ("pskcxml", "application/pskc+xml"), ("pti", "image/prs.pti"),
         ("ptid", "application/vnd.pvi.ptid1"),
         ("pub", "application/x-mspublisher"), ("purs", "text/purescript"),
         ("pvb", "application/vnd.3gpp.pic-bw-var"), ("pvu", "paleovu/x-pv"),
         ("pwn", "application/vnd.3m.post-it-notes"),
         ("pwz", "application/vnd.ms-powerpoint"), ("pxd", "text/cython"),
         ("pxi", "text/cython"), ("py", "text/x-script.phyton"),
         ("pya", "audio/vnd.ms-playready.media.pya"),
         ("pyc", "application/x-python-code"), ("pyi", "text/pyi"),
         ("pyo", "application/x-python-code"),
         ("pyv", "video/vnd.ms-playready.media.pyv"), ("pyx", "text/cython"),
         ("qam", "application/vnd.epson.quickanime"),
         ("qbo", "application/vnd.intu.qbo"),
         ("qca", "application/vnd.ericsson.quickcall"),
         ("qcall", "application/vnd.ericsson.quickcall"),
         ("qcp", "audio/qcelp"), ("qd3", "x-world/x-3dmf"),
         ("qd3d", "x-world/x-3dmf"), ("qfx", "application/vnd.intu.qfx"),
         ("qgs", "application/x-qgis"), ("qif", "image/x-quicktime"),
         ("qps", "application/vnd.publishare-delta-tree"),
         ("qt", "video/quicktime"), ("qtc", "video/x-qtc"),
         ("qti", "image/x-quicktime"), ("qtif", "image/x-quicktime"),
         ("qtl", "application/x-quicktimeplayer"),
         ("quiz", "application/vnd.quobject-quoxdocument"),
         ("quox", "application/vnd.quobject-quoxdocument"),
         ("qvd", "application/vnd.theqvd"),
         ("qwd", "application/vnd.quark.quarkxpress"),
         ("qwt", "application/vnd.quark.quarkxpress"),
         ("qxb", "application/vnd.quark.quarkxpress"),
         ("qxd", "application/vnd.quark.quarkxpress"),
         ("qxl", "application/vnd.quark.quarkxpress"),
         ("qxt", "application/vnd.quark.quarkxpress"), ("r", "text/r"),
         ("ra", "audio/x-realaudio"), ("ram", "audio/x-pn-realaudio"),
         ("raml", "application/raml+yaml"),
         ("rapd", "application/route-apd+xml"),
         ("rar", "application/x-rar-compressed"),
         ("ras", "image/x-cmu-raster"), ("rast", "image/cmu-raster"),
         ("rb", "application/x-ruby"),
         ("rcprofile", "application/vnd.ipunplugged.rcprofile"),
         ("rct", "application/prs.nprend"), ("rd", "chemical/x-mdl-rdfile"),
         ("rda", "text/r"), ("rdata", "text/r"), ("rds", "text/r"),
         ("rdf", "application/rdf+xml"),
         ("rdf-crypt", "application/prs.rdf-xml-crypt"),
         ("rdz", "application/vnd.data-vision.rdz"),
         ("relo", "application/p2p-overlay+xml"),
         ("rep", "application/vnd.businessobjects"),
         ("request", "application/vnd.nervana"),
         ("res", "application/x-dtbresource+xml"),
         ("rexx", "text/x-script.rexx"), ("rf", "image/vnd.rn-realflash"),
         ("rfcxml", "application/rfc+xml"), ("rgb", "image/x-rgb"),
         ("rgbe", "image/vnd.radiance"),
         ("rhtml", "application/x-httpd-eruby"),
         ("rif", "application/reginfo+xml"), ("rip", "audio/vnd.rip"),
         ("ris", "application/x-research-info-systems"),
         ("rl", "application/resource-lists+xml"),
         ("rlc", "image/vnd.fujixerox.edmics-rlc"),
         ("rld", "application/resource-lists-diff+xml"), ("rlib", "text/rust"),
         ("rm", "application/vnd.rn-realmedia"), ("rmi", "audio/mid"),
         ("rmm", "audio/x-pn-realaudio"),
         ("rmp", "audio/x-pn-realaudio-plugin"),
         ("rms", "application/vnd.jcp.javame.midlet-rms"),
         ("rmvb", "application/vnd.rn-realmedia-vbr"),
         ("rnc", "application/relax-ng-compact-syntax"),
         ("rnd", "application/prs.nprend"), ("rng", "text/xml"),
         ("rnx", "application/vnd.rn-realplayer"),
         ("roa", "application/rpki-roa"), ("roff", "text/troff"),
         ("ros", "chemical/x-rosdal"), ("rp", "image/vnd.rn-realpix"),
         ("rp9", "application/vnd.cloanto.rp9"),
         ("rpm", "application/x-redhat-package-manager"),
         ("rpss", "application/vnd.nokia.radio-presets"),
         ("rpst", "application/vnd.nokia.radio-preset"),
         ("rq", "application/sparql-query"),
         ("rs", "application/rls-services+xml"),
         ("rsd", "application/rsd+xml"),
         ("rsheet", "application/urc-ressheet+xml"), ("rsm", "model/vnd.gdl"),
         ("rss", "application/rss+xml"), ("rst", "text/prs.fallenstein.rst"),
         ("rt", "text/richtext"), ("rtf", "text/rtf"),
         ("rtx", "text/richtext"), ("run", "application/x-makeself"),
         ("rusd", "application/route-usd+xml"),
         ("rv", "video/vnd.rn-realvideo"), ("rxn", "chemical/x-mdl-rxnfile"),
         ("s", "text/x-asm"), ("s11", "video/vnd.sealed.mpeg1"),
         ("s14", "video/vnd.sealed.mpeg4"),
         ("s1a", "application/vnd.sealedmedia.softseal.pdf"),
         ("s1e", "application/vnd.sealed.xls"),
         ("s1g", "image/vnd.sealedmedia.softseal.gif"),
         ("s1h", "application/vnd.sealedmedia.softseal.html"),
         ("s1j", "image/vnd.sealedmedia.softseal.jpg"),
         ("s1m", "audio/vnd.sealedmedia.softseal.mpeg"),
         ("s1n", "image/vnd.sealed.png"),
         ("s1p", "application/vnd.sealed.ppt"),
         ("s1q", "video/vnd.sealedmedia.softseal.mov"),
         ("s1w", "application/vnd.sealed.doc"),
         ("s3df", "application/vnd.sealed.3df"), ("s3m", "audio/s3m"),
         ("sac", "application/tamp-sequence-adjust-confirm"),
         ("saf", "application/vnd.yamaha.smaf-audio"),
         ("sam", "application/vnd.lotus-wordpro"),
         ("sandboxed", "text/html-sandboxed"), ("sass", "text/x-sass"),
         ("saveme", "application/octet-stream"),
         ("sbk", "application/x-tbook"), ("sbml", "application/sbml+xml"),
         ("sc", "application/vnd.ibm.secure-container"),
         ("scala", "text/x-scala"), ("scd", "application/x-msschedule"),
         ("sce", "application/vnd.etsi.asic-e+zip"),
         ("scim", "application/scim+json"),
         ("scld", "application/vnd.doremir.scorecloud-binary-document"),
         ("scm", "application/vnd.lotus-screencam"),
         ("scq", "application/scvp-cv-request"),
         ("scr", "application/x-silverlight"),
         ("scs", "application/scvp-cv-response"),
         ("scsf", "application/vnd.sealed.csf"), ("scss", "text/x-scss"),
         ("sct", "text/scriptlet"), ("scurl", "text/vnd.curl.scurl"),
         ("sd", "chemical/x-mdl-sdfile"), ("sd2", "audio/x-sd2"),
         ("sda", "application/vnd.stardivision.draw"),
         ("sdc", "application/vnd.stardivision.calc"),
         ("sdd", "application/vnd.stardivision.impress"),
         ("sdf", "application/vnd.kinar"),
         ("sdkd", "application/vnd.solent.sdkm+xml"),
         ("sdkm", "application/vnd.solent.sdkm+xml"), ("sdml", "text/plain"),
         ("sdo", "application/vnd.sealed.doc"),
         ("sdoc", "application/vnd.sealed.doc"), ("sdp", "application/sdp"),
         ("sdr", "application/sounder"),
         ("sdw", "application/vnd.stardivision.writer"),
         ("sea", "application/x-sea"), ("see", "application/vnd.seemail"),
         ("seed", "application/vnd.fdsn.seed"),
         ("sem", "application/vnd.sealed.eml"),
         ("sema", "application/vnd.sema"), ("semd", "application/vnd.semd"),
         ("semf", "application/vnd.semf"),
         ("seml", "application/vnd.sealed.eml"),
         ("ser", "application/java-serialized-object"),
         ("set", "application/set"),
         ("setpay", "application/set-payment-initiation"),
         ("setreg", "application/set-registration-initiation"),
         ("sfc", "application/vnd.nintendo.snes.rom"),
         ("sfd", "application/vnd.font-fontforge-sfd"),
         ("sfd-hdstx", "application/vnd.hydrostatix.sof-data"),
         ("sfs", "application/vnd.spotfire.sfs"), ("sfv", "text/x-sfv"),
         ("sgf", "application/x-go-sgf"), ("sgi", "image/sgi"),
         ("sgif", "image/vnd.sealedmedia.softseal.gif"),
         ("sgl", "application/vnd.stardivision.writer-global"),
         ("sgm", "text/sgml"), ("sgml", "text/sgml"),
         ("sh", "application/x-sh"), ("shar", "application/x-shar"),
         ("shex", "text/shex"), ("shf", "application/shf+xml"),
         ("shp", "application/x-qgis"), ("shx", "application/x-qgis"),
         ("si", "text/vnd.wap.si"), ("sic", "application/vnd.wap.sic"),
         ("sid", "image/x-mrsid-image"), ("sieve", "application/sieve"),
         ("sig", "application/pgp-signature"), ("sik", "application/x-trash"),
         ("sil", "audio/silk"), ("silo", "model/mesh"),
         ("sis", "application/vnd.symbian.install"),
         ("sisx", "x-epoc/x-sisx-app"), ("sit", "application/x-stuffit"),
         ("sitx", "application/x-stuffitx"), ("siv", "application/sieve"),
         ("sjp", "image/vnd.sealedmedia.softseal.jpg"),
         ("sjpg", "image/vnd.sealedmedia.softseal.jpg"),
         ("skd", "application/vnd.koan"), ("skm", "application/vnd.koan"),
         ("skp", "application/vnd.koan"), ("skt", "application/vnd.koan"),
         ("sl", "text/vnd.wap.sl"), ("sla", "application/vnd.scribus"),
         ("slaz", "application/vnd.scribus"),
         ("slc", "application/vnd.wap.slc"),
         ("sldm", "application/vnd.ms-powerpoint.slide.macroenabled.12"), (
    "sldx", "application/vnd.openxmlformats-officedocument.presentationml.slide"),
         ("sls", "application/route-s-tsid+xml"),
         ("slt", "application/vnd.epson.salt"),
         ("sm", "application/vnd.stepmania.stepchart"),
         ("smc", "application/vnd.nintendo.snes.rom"),
         ("smf", "application/vnd.stardivision.math"),
         ("smh", "application/vnd.sealed.mht"),
         ("smht", "application/vnd.sealed.mht"),
         ("smi", "application/smil+xml"), ("smil", "application/smil+xml"),
         ("smk", "video/vnd.radgamettools.smacker"),
         ("sml", "application/smil+xml"),
         ("smo", "video/vnd.sealedmedia.softseal.mov"),
         ("smov", "video/vnd.sealedmedia.softseal.mov"),
         ("smp", "audio/vnd.sealedmedia.softseal.mpeg"),
         ("smp3", "audio/vnd.sealedmedia.softseal.mpeg"),
         ("smpg", "video/vnd.sealed.mpeg1"),
         ("sms", "application/vnd.3gpp2.sms"), ("smv", "video/x-smv"),
         ("smzip", "application/vnd.stepmania.package"),
         ("snd", "audio/basic"), ("snf", "application/x-font-snf"),
         ("so", "application/octet-stream"), ("soa", "text/dns"),
         ("soc", "application/sgml-open-catalog"),
         ("sol", "application/solids"), ("spc", "text/x-speech"),
         ("spd", "application/vnd.sealedmedia.softseal.pdf"),
         ("spdf", "application/vnd.sealedmedia.softseal.pdf"),
         ("spec", "text/spec"), ("spf", "application/vnd.yamaha.smaf-phrase"),
         ("spl", "application/x-futuresplash"),
         ("spn", "image/vnd.sealed.png"), ("spng", "image/vnd.sealed.png"),
         ("spo", "text/vnd.in3d.spot"), ("spot", "text/vnd.in3d.spot"),
         ("spp", "application/scvp-vp-response"),
         ("sppt", "application/vnd.sealed.ppt"),
         ("spq", "application/scvp-vp-request"),
         ("spr", "application/x-sprite"), ("sprite", "application/x-sprite"),
         ("spx", "audio/ogg"), ("sql", "application/x-sql"),
         ("sr", "application/vnd.sigrok.session"),
         ("src", "application/x-wais-source"), ("srt", "application/x-subrip"),
         ("sru", "application/sru+xml"),
         ("srx", "application/sparql-results+xml"),
         ("ssdl", "application/ssdl+xml"),
         ("sse", "application/vnd.kodak-descriptor"),
         ("ssf", "application/vnd.epson.ssf"),
         ("ssi", "text/x-server-parsed-html"),
         ("ssm", "application/streamingmedia"),
         ("ssml", "application/ssml+xml"),
         ("sst", "application/vnd.ms-pki.certstore"),
         ("ssw", "video/vnd.sealed.swf"), ("sswf", "video/vnd.sealed.swf"),
         ("st", "application/vnd.sailingtracker.track"),
         ("stc", "application/vnd.sun.xml.calc.template"),
         ("std", "application/vnd.sun.xml.draw.template"),
         ("step", "application/step"), ("stf", "application/vnd.wt.stf"),
         ("sti", "application/vnd.sun.xml.impress.template"),
         ("stif", "application/vnd.sealed.tiff"),
         ("stk", "application/hyperstudio"),
         ("stl", "application/vnd.ms-pki.stl"), ("stm", "audio/x-stm"),
         ("stml", "application/vnd.sealedmedia.softseal.html"),
         ("stp", "application/step"), ("str", "application/vnd.pg.format"),
         ("study-inter", "application/vnd.vd-study"),
         ("stw", "application/vnd.sun.xml.writer.template"),
         ("sty", "text/x-tex"), ("styl", "text/stylus"),
         ("sub", "text/vnd.dvb.subtitle"),
         ("sus", "application/vnd.sus-calendar"),
         ("susp", "application/vnd.sus-calendar"),
         ("sv4cpio", "application/x-sv4cpio"),
         ("sv4crc", "application/x-sv4crc"),
         ("svc", "application/vnd.dvb.service"),
         ("svd", "application/vnd.svd"), ("svf", "image/x-dwg"),
         ("svg", "image/svg+xml"), ("svgz", "image/svg+xml"),
         ("sw", "chemical/x-swissprot"), ("swa", "application/x-director"),
         ("swf", "application/x-shockwave-flash"),
         ("swfl", "application/x-shockwave-flash"),
         ("swi", "application/vnd.aristanetworks.swi"),
         ("swift", "text/swift"), ("swiftdeps", "text/swiftdeps"),
         ("sxc", "application/vnd.sun.xml.calc"),
         ("sxd", "application/vnd.sun.xml.draw"),
         ("sxg", "application/vnd.sun.xml.writer.global"),
         ("sxi", "application/vnd.sun.xml.impress"),
         ("sxl", "application/vnd.sealed.xls"),
         ("sxls", "application/vnd.sealed.xls"),
         ("sxm", "application/vnd.sun.xml.math"),
         ("sxw", "application/vnd.sun.xml.writer"), ("t", "text/troff"),
         ("t3", "application/x-t3vm-image"), ("t38", "image/t38"),
         ("tac", "text/twisted"), ("tag", "text/prs.lines.tag"),
         ("taglet", "application/vnd.mynfc"), ("talk", "text/x-speech"),
         ("tam", "application/vnd.onepager"),
         ("tamp", "application/vnd.onepagertamp"),
         ("tamx", "application/vnd.onepagertamx"),
         ("tao", "application/vnd.tao.intent-module-archive"),
         ("tap", "image/vnd.tencent.tap"), ("tar", "application/x-tar"),
         ("tat", "application/vnd.onepagertat"),
         ("tatp", "application/vnd.onepagertatp"),
         ("tatx", "application/vnd.onepagertatx"),
         ("tau", "application/tamp-apex-update"),
         ("taz", "application/x-gtar"), ("tbk", "application/toolbook"),
         ("tcap", "application/vnd.3gpp2.tcap"), ("tcl", "application/x-tcl"),
         ("tcsh", "text/x-script.tcsh"),
         ("tcu", "application/tamp-community-update"),
         ("td", "application/urc-targetdesc+xml"),
         ("teacher", "application/vnd.smart.teacher"),
         ("tei", "application/tei+xml"), ("teicorpus", "application/tei+xml"),
         ("ter", "application/tamp-error"), ("tex", "application/x-tex"),
         ("texi", "application/x-texinfo"),
         ("texinfo", "application/x-texinfo"), ("text", "text/plain"),
         ("tf", "text/terraform"), ("tfi", "application/thraud+xml"),
         ("tfm", "application/x-tex-tfm"), ("tfx", "image/tiff-fx"),
         ("tga", "image/x-tga"), ("tgf", "chemical/x-mdl-tgf"),
         ("tgz", "application/gzip"),
         ("thmx", "application/vnd.ms-officetheme"), ("thrift", "text/thrift"),
         ("tif", "image/tiff"), ("tiff", "image/tiff"), ("tk", "text/x-tcl"),
         ("tlclient", "application/vnd.cendio.thinlinc.clientconf"),
         ("tm", "text/texmacs"), ("tmo", "application/vnd.tmobile-livetv"),
         ("tnef", "application/vnd.ms-tnef"),
         ("tnf", "application/vnd.ms-tnef"), ("toml", "text/toml"),
         ("torrent", "application/x-bittorrent"),
         ("tpl", "application/vnd.groove-tool-template"),
         ("tpt", "application/vnd.trid.tpt"), ("tr", "text/troff"),
         ("tra", "application/vnd.trueapp"),
         ("tree", "application/vnd.rainstor.data"),
         ("trig", "application/trig"), ("trm", "application/x-msterminal"),
         ("ts", "video/mp2t"), ("tsa", "application/tamp-sequence-adjust"),
         ("tscn", "text/godot"), ("tsd", "application/timestamped-data"),
         ("tsi", "audio/tsp-audio"), ("tsp", "audio/tsplayer"),
         ("tsq", "application/timestamp-query"),
         ("tsr", "application/timestamp-reply"),
         ("tst", "application/vnd.etsi.timestamp-token"),
         ("tsv", "text/tab-separated-values"), ("tsx", "text/tsx"),
         ("ttc", "font/collection"), ("ttf", "font/ttf"),
         ("ttl", "text/turtle"), ("ttml", "application/ttml+xml"),
         ("tuc", "application/tamp-update-confirm"),
         ("tur", "application/tamp-update"), ("turbot", "image/florian"),
         ("twd", "application/vnd.simtech-mindmapper"),
         ("twds", "application/vnd.simtech-mindmapper"),
         ("txd", "application/vnd.genomatix.tuxedo"),
         ("txf", "application/vnd.mobius.txf"), ("txt", "text/plain"),
         ("u32", "application/x-authorware-bin"),
         ("u8dsn", "message/global-delivery-status"),
         ("u8hdr", "message/global-headers"),
         ("u8mdn", "message/global-disposition-notification"),
         ("u8msg", "message/global"),
         ("udeb", "application/vnd.debian.binary-package"),
         ("ufd", "application/vnd.ufdl"), ("ufdl", "application/vnd.ufdl"),
         ("uil", "text/x-uil"), ("uis", "application/urc-uisocketdesc+xml"),
         ("uls", "text/iuls"), ("ult", "audio/x-mod"),
         ("ulx", "application/x-glulx"), ("umj", "application/vnd.umajin"),
         ("uni", "audio/x-mod"), ("unis", "text/uri-list"),
         ("unityweb", "application/vnd.unity"), ("unv", "application/i-deas"),
         ("uo", "application/vnd.uoml+xml"),
         ("uoml", "application/vnd.uoml+xml"), ("upa", "application/vnd.hbci"),
         ("uri", "text/uri-list"), ("uric", "text/vnd.si.uricatalogue"),
         ("urim", "application/vnd.uri-map"),
         ("urimap", "application/vnd.uri-map"), ("uris", "text/uri-list"),
         ("urls", "text/uri-list"), ("ustar", "application/x-ustar"),
         ("utz", "application/vnd.uiq.theme"), ("uu", "text/x-uuencode"),
         ("uue", "text/x-uuencode"), ("uva", "audio/vnd.dece.audio"),
         ("uvd", "application/vnd.dece.data"),
         ("uvf", "application/vnd.dece.data"),
         ("uvg", "image/vnd.dece.graphic"), ("uvh", "video/vnd.dece.hd"),
         ("uvi", "image/vnd.dece.graphic"), ("uvm", "video/vnd.dece.mobile"),
         ("uvp", "video/vnd.dece.pd"), ("uvs", "video/vnd.dece.sd"),
         ("uvt", "application/vnd.dece.ttml+xml"),
         ("uvu", "video/vnd.dece.mp4"), ("uvv", "video/vnd.dece.video"),
         ("uvva", "audio/vnd.dece.audio"),
         ("uvvd", "application/vnd.dece.data"),
         ("uvvf", "application/vnd.dece.data"),
         ("uvvg", "image/vnd.dece.graphic"), ("uvvh", "video/vnd.dece.hd"),
         ("uvvi", "image/vnd.dece.graphic"), ("uvvm", "video/vnd.dece.mobile"),
         ("uvvp", "video/vnd.dece.pd"), ("uvvs", "video/vnd.dece.sd"),
         ("uvvt", "application/vnd.dece.ttml+xml"),
         ("uvvu", "video/vnd.dece.mp4"), ("uvvv", "video/vnd.dece.video"),
         ("uvvx", "application/vnd.dece.unspecified"),
         ("uvvz", "application/vnd.dece.zip"),
         ("uvx", "application/vnd.dece.unspecified"),
         ("uvz", "application/vnd.dece.zip"),
         ("val", "chemical/x-ncbi-asn1-binary"),
         ("vbk", "audio/vnd.nortel.vbk"),
         ("vbox", "application/x-virtualbox-vbox"),
         ("vbox-extpack", "application/x-virtualbox-vbox-extpack"),
         ("vcard", "text/vcard"), ("vcd", "application/x-cdlink"),
         ("vcf", "text/x-vcard"), ("vcg", "application/vnd.groove-vcard"),
         ("vcs", "text/x-vcalendar"), ("vcx", "application/vnd.vcx"),
         ("vda", "application/vda"), ("vdi", "application/x-virtualbox-vdi"),
         ("vdo", "video/vdo"), ("vdx", "text/vdx"),
         ("vew", "application/vnd.lotus-approach"),
         ("vfr", "application/vnd.tml"),
         ("vhd", "application/x-virtualbox-vhd"),
         ("viaframe", "application/vnd.tml"), ("vim", "text/vim"),
         ("vis", "application/vnd.visionary"), ("viv", "video/vnd.vivo"),
         ("vivo", "video/vivo"), ("vmd", "application/vocaltec-media-desc"),
         ("vmdk", "application/x-virtualbox-vmdk"),
         ("vmf", "application/vocaltec-media-file"),
         ("vms", "chemical/x-vamas-iso14976"),
         ("vmt", "application/vnd.valve.source.material"),
         ("vob", "video/x-ms-vob"), ("voc", "audio/voc"),
         ("vor", "application/vnd.stardivision.writer"),
         ("vos", "video/vosaic"), ("vox", "audio/voxware"),
         ("vpm", "multipart/voice-message"), ("vqe", "audio/x-twinvq-plugin"),
         ("vqf", "audio/x-twinvq"), ("vql", "audio/x-twinvq-plugin"),
         ("vrm", "x-world/x-vrml"), ("vrml", "model/vrml"),
         ("vrt", "x-world/x-vrt"),
         ("vsc", "application/vnd.vidsoft.vidconference"),
         ("vsd", "application/vnd.visio"), ("vsf", "application/vnd.vsf"),
         ("vss", "application/vnd.visio"), ("vst", "application/vnd.visio"),
         ("vsw", "application/vnd.visio"),
         ("vtf", "image/vnd.valve.source.texture"), ("vtt", "text/vtt"),
         ("vtu", "model/vnd.vtu"), ("vue", "text/vue"),
         ("vwx", "application/vnd.vectorworks"),
         ("vxml", "application/voicexml+xml"),
         ("w3d", "application/x-director"),
         ("w60", "application/wordperfect6.0"),
         ("w61", "application/wordperfect6.1"), ("w6w", "application/msword"),
         ("wad", "application/x-doom"),
         ("wadl", "application/vnd.sun.wadl+xml"), ("war", "binary/zip"),
         ("wasm", "application/wasm"), ("wav", "audio/wave"),
         ("wax", "audio/x-ms-wax"), ("wb1", "application/x-qpro"),
         ("wbmp", "image/vnd.wap.wbmp"),
         ("wbs", "application/vnd.criticaltools.wbs+xml"),
         ("wbxml", "application/vnd.wap.wbxml"),
         ("wcm", "application/vnd.ms-works"),
         ("wdb", "application/vnd.ms-works"), ("wdp", "image/vnd.ms-photo"),
         ("web", "application/vnd.xara"), ("weba", "audio/webm"),
         ("webapp", "application/x-web-app-manifest+json"),
         ("webm", "video/webm"), ("webmanifest", "application/manifest+json"),
         ("webp", "image/webp"), ("wg", "application/vnd.pmi.widget"),
         ("wgt", "application/widget"), ("whl", "binary/wheel"),
         ("wif", "application/watcherinfo+xml"), ("win", "model/vnd.gdl"),
         ("wiz", "application/msword"), ("wk", "application/x-123"),
         ("wk1", "application/vnd.lotus-1-2-3"),
         ("wk3", "application/vnd.lotus-1-2-3"),
         ("wk4", "application/vnd.lotus-1-2-3"),
         ("wks", "application/vnd.ms-works"), ("wkt", "text/wkt"),
         ("wlnk", "application/link-format"), ("wm", "video/x-ms-wm"),
         ("wma", "audio/x-ms-wma"), ("wmc", "application/vnd.wmc"),
         ("wmd", "application/x-ms-wmd"), ("wmf", "image/wmf"),
         ("wml", "text/vnd.wap.wml"), ("wmlc", "application/vnd.wap.wmlc"),
         ("wmls", "text/vnd.wap.wmlscript"),
         ("wmlsc", "application/vnd.wap.wmlscriptc"),
         ("wmv", "video/x-ms-wmv"), ("wmx", "video/x-ms-wmx"),
         ("wmz", "application/x-ms-wmz"), ("woff", "font/woff"),
         ("woff2", "font/woff2"), ("word", "application/msword"),
         ("wp", "application/wordperfect"), ("wp5", "application/wordperfect"),
         ("wp6", "application/wordperfect"),
         ("wpd", "application/vnd.wordperfect"),
         ("wpl", "application/vnd.ms-wpl"),
         ("wps", "application/vnd.ms-works"), ("wq1", "application/x-lotus"),
         ("wqd", "application/vnd.wqd"), ("wri", "application/x-mswrite"),
         ("wrl", "model/vrml"), ("wrz", "model/vrml"),
         ("wsc", "message/vnd.wfa.wsc"), ("wsdl", "application/wsdl+xml"),
         ("wsgi", "text/wsgi"), ("wspolicy", "application/wspolicy+xml"),
         ("wsrc", "application/x-wais-source"),
         ("wtb", "application/vnd.webturbo"), ("wtk", "application/x-wintalk"),
         ("wv", "application/vnd.wv.csp+wbxml"), ("wvx", "video/x-ms-wvx"),
         ("wz", "application/x-wingz"), ("x-png", "image/png"),
         ("x32", "application/x-authorware-bin"),
         ("x3d", "application/vnd.hzn-3d-crossword"),
         ("x3db", "model/x3d+xml"), ("x3dbz", "model/x3d+binary"),
         ("x3dv", "model/x3d-vrml"), ("x3dvz", "model/x3d-vrml"),
         ("x3dz", "model/x3d+xml"),
         ("x_b", "model/vnd.parasolid.transmit.binary"),
         ("x_t", "model/vnd.parasolid.transmit.text"),
         ("xaf", "x-world/x-vrml"), ("xaml", "application/xaml+xml"),
         ("xap", "application/x-silverlight-app"),
         ("xar", "application/vnd.xara"), ("xav", "application/xcap-att+xml"),
         ("xbap", "application/x-ms-xbap"),
         ("xbd", "application/vnd.fujixerox.docuworks.binder"),
         ("xbm", "image/x-xbitmap"), ("xca", "application/xcap-caps+xml"),
         ("xcf", "application/x-xcf"), ("xcs", "application/calendar+xml"),
         ("xct", "application/vnd.fujixerox.docuworks.container"),
         ("xdd", "application/bacnet-xdd+zip"),
         ("xdf", "application/xcap-diff+xml"),
         ("xdm", "application/vnd.syncml.dm+xml"),
         ("xdp", "application/vnd.adobe.xdp+xml"),
         ("xdr", "video/x-amt-demorun"), ("xdssc", "application/dssc+xml"),
         ("xdw", "application/vnd.fujixerox.docuworks"),
         ("xel", "application/xcap-el+xml"), ("xenc", "application/xenc+xml"),
         ("xer", "application/patch-ops-error+xml"),
         ("xfd", "application/vnd.xfdl"),
         ("xfdf", "application/vnd.adobe.xfdf"),
         ("xfdl", "application/vnd.xfdl"), ("xgz", "xgl/drawing"),
         ("xht", "application/xhtml+xml"), ("xhtm", "application/xhtml+xml"),
         ("xhtml", "application/xhtml+xml"), ("xhvml", "application/xv+xml"),
         ("xif", "image/vnd.xiff"), ("xl", "application/excel"),
         ("xla", "application/vnd.ms-excel"),
         ("xlam", "application/vnd.ms-excel.addin.macroenabled.12"),
         ("xlb", "application/vndms-excel"),
         ("xlc", "application/vnd.ms-excel"),
         ("xlf", "application/x-xliff+xml"),
         ("xlim", "application/vnd.xmpie.xlim"),
         ("xlm", "application/vnd.ms-excel"),
         ("xls", "application/vnd.ms-excel"),
         ("xlsb", "application/vnd.ms-excel.sheet.binary.macroenabled.12"),
         ("xlsm", "application/vnd.ms-excel.sheet.macroenabled.12"), ("xlsx",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"),
         ("xlt", "application/vnd.ms-excel"),
         ("xltm", "application/vnd.ms-excel.template.macroenabled.12"), ("xltx",
    "application/vnd.openxmlformats-officedocument.spreadsheetml.template"),
         ("xlw", "application/vnd.ms-excel"), ("xm", "audio/xm"),
         ("xml", "text/xml"), ("xmls", "application/dskpp+xml"),
         ("xmt_bin", "model/vnd.parasolid.transmit.binary"),
         ("xmt_txt", "model/vnd.parasolid.transmit.text"),
         ("xmz", "xgl/movie"), ("xns", "application/xcap-ns+xml"),
         ("xo", "application/vnd.olpc-sugar"), ("xof", "x-world/x-vrml"),
         ("xop", "application/xop+xml"), ("xpdl", "application/xml"),
         ("xpi", "application/x-xpinstall"),
         ("xpix", "application/x-vnd.ls-xpix"),
         ("xpl", "application/xproc+xml"), ("xpm", "image/x-xpixmap"),
         ("xpr", "application/vnd.is-xpr"),
         ("xps", "application/vnd.ms-xpsdocument"),
         ("xpw", "application/vnd.intercon.formnet"),
         ("xpx", "application/vnd.intercon.formnet"), ("xq", "text/xquery"),
         ("xql", "text/xquery"), ("xqm", "text/xquery"),
         ("xqu", "text/xquery"), ("xquery", "text/xquery"),
         ("xqy", "text/xquery"), ("xsd", "text/xml"),
         ("xsf", "application/prs.xsf+xml"), ("xsl", "application/xslt+xml"),
         ("xslt", "application/xslt+xml"),
         ("xsm", "application/vnd.syncml+xml"),
         ("xspf", "application/xspf+xml"), ("xsr", "video/x-amt-showrun"),
         ("xtel", "chemical/x-xtel"),
         ("xul", "application/vnd.mozilla.xul+xml"),
         ("xvm", "application/xv+xml"), ("xvml", "application/xv+xml"),
         ("xwd", "image/x-xwindowdump"), ("xyz", "chemical/x-xyz"),
         ("xyze", "image/vnd.radiance"), ("xz", "application/x-xz"),
         ("yaml", "text/yaml"), ("yang", "application/yang"),
         ("yin", "application/yin+xml"), ("yme", "application/vnd.yaoweme"),
         ("yml", "text/yaml"), ("ymp", "text/x-suse-ymp"),
         ("z1", "application/x-zmachine"), ("z2", "application/x-zmachine"),
         ("z3", "application/x-zmachine"), ("z4", "application/x-zmachine"),
         ("z5", "application/x-zmachine"), ("z6", "application/x-zmachine"),
         ("z7", "application/x-zmachine"), ("z8", "application/x-zmachine"),
         ("zaz", "application/vnd.zzazz.deck+xml"),
         ("zfc", "application/vnd.filmit.zfc"),
         ("zfo", "application/vnd.software602.filler.form-xml-zip"),
         ("zig", "text/zig"), ("zip", "application/zip"),
         ("zir", "application/vnd.zul"), ("zirz", "application/vnd.zul"),
         ("zmm", "application/vnd.handheld-entertainment+xml"),
         ("zmt", "chemical/x-mopac-input"), ("zone", "text/dns"),
         ("zoo", "application/octet-stream"), ("zsh", "text/x-script.zsh"),
         ("~", "application/x-trash")]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L18)   Funcs
-----

  
```
func newMimetypes(): MimeDB {...}{.raises: [], tags: [].}
```
  Creates a new Mimetypes database. The database will contain the most common mimetypes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L1885) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L1885)  
```
func getMimetype(mimedb: MimeDB; ext: string; default = "text/plain"): string {...}{.
    raises: [], tags: [].}
```
  Gets mimetype which corresponds to `ext`. Returns `default` if `ext` could not be found. `ext` can start with an optional dot which is ignored. `ext` is lowercased before querying `mimedb`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L1890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L1890)  
```
func getExt(mimedb: MimeDB; mimetype: string; default = "txt"): string {...}{.
    raises: [], tags: [].}
```
  Gets extension which corresponds to `mimetype`. Returns `default` if `mimetype` could not be found. Extensions are returned without the leading dot. `mimetype` is lowercased before querying `mimedb`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L1901) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L1901)  
```
func register(mimedb: var MimeDB; ext: string; mimetype: string) {...}{.raises: [],
    tags: [].}
```
  Adds `mimetype` to the `mimedb`. `mimetype` and `ext` are lowercased before registering on `mimedb`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/mimetypes.nim#L1912) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/mimetypes.nim#L1912)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/mimetypes.html>

nativesockets
=============

 This module implements a low-level cross-platform sockets interface. Look at the `net` module for the higher-level version.

 Imports
-------

  <os>, <options>, <since>, <winlean>  Types
-----

  
```
Port = distinct uint16
```
  port type [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L52)  
```
Domain = enum
  AF_UNSPEC = 0, ## unspecified domain (can be detected automatically by
                  ## some procedures, such as getaddrinfo)
  AF_UNIX = 1,              ## for local socket (using a file). Unsupported on Windows.
  AF_INET = 2,              ## for network protocol IPv4 or
  AF_INET6 = 23
```
  domain, which specifies the protocol family of the created socket. Other domains than those that are listed here are unsupported. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L54)  
```
SockType = enum
  SOCK_STREAM = 1,          ## reliable stream-oriented service or Stream Sockets
  SOCK_DGRAM = 2,           ## datagram service or Datagram Sockets
  SOCK_RAW = 3,             ## raw protocols atop the network layer.
  SOCK_SEQPACKET = 5         ## reliable sequenced packet service
```
  second argument to `socket` proc [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L64)  
```
Protocol = enum
  IPPROTO_TCP = 6,          ## Transmission control protocol.
  IPPROTO_UDP = 17,         ## User datagram protocol.
  IPPROTO_IP,               ## Internet protocol.
  IPPROTO_IPV6,             ## Internet Protocol Version 6.
  IPPROTO_RAW,              ## Raw IP Packets Protocol. Unsupported on Windows.
  IPPROTO_ICMP,             ## Internet Control message protocol.
  IPPROTO_ICMPV6             ## Internet Control message protocol for IPv6.
```
  third argument to `socket` proc [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L70)  
```
Servent = object
  name*: string
  aliases*: seq[string]
  port*: Port
  proto*: string
```
  information about a service [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L79)  
```
Hostent = object
  name*: string
  aliases*: seq[string]
  addrtype*: Domain
  length*: int
  addrList*: seq[string]
```
  information about a given host [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L85)   Lets
----

  
```
osInvalidSocket = INVALID_SOCKET
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L94)   Consts
------

  
```
IOCPARM_MASK = 127
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L97)  
```
IOC_IN = -2147483648
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L98)  
```
FIONBIO = -2147195266'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L99)   Procs
-----

  
```
proc ioctlsocket(s: SocketHandle; cmd: clong; argptr: ptr clong): cint {...}{.
    stdcall, importc: "ioctlsocket", dynlib: "ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L104)  
```
proc `==`(a, b: Port): bool {...}{.borrow.}
```
  `==` for ports. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L114)  
```
proc `$`(p: Port): string {...}{.borrow.}
```
  Returns the port number as a string [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L117)  
```
proc toInt(domain: Domain): cint {...}{.raises: [], tags: [].}
```
  Converts the Domain enum to a platform-dependent `cint`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L164)  
```
proc toKnownDomain(family: cint): Option[Domain] {...}{.raises: [], tags: [].}
```
  Converts the platform-dependent `cint` to the Domain or none(), if the `cint` is not known. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L167)  
```
proc toInt(typ: SockType): cint {...}{.raises: [], tags: [].}
```
  Converts the SockType enum to a platform-dependent `cint`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L175)  
```
proc toInt(p: Protocol): cint {...}{.raises: [], tags: [].}
```
  Converts the Protocol enum to a platform-dependent `cint`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L178)  
```
proc toSockType(protocol: Protocol): SockType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L195)  
```
proc getProtoByName(name: string): int {...}{.raises: [OSError], tags: [].}
```
  Returns a protocol code from the database that matches the protocol `name`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L204)  
```
proc close(socket: SocketHandle) {...}{.raises: [], tags: [].}
```
  Closes a socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L216)  
```
proc setInheritable(s: SocketHandle; inheritable: bool): bool {...}{.inline,
    raises: [], tags: [].}
```
  Set whether a socket is inheritable by child processes. Returns `true` on success.

 This function is not implemented on all platform, test for availability with `declared() <system.html#declared,untyped>`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L226)  
```
proc createNativeSocket(domain: cint; sockType: cint; protocol: cint;
                        inheritable: bool = defined(nimInheritHandles)): SocketHandle {...}{.
    raises: [], tags: [].}
```
  Creates a new socket; returns `osInvalidSocket` if an error occurs.

 `inheritable` decides if the resulting SocketHandle can be inherited by child processes.

 Use this overload if one of the enums specified above does not contain what you need.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L234)  
```
proc createNativeSocket(domain: Domain = AF_INET;
                        sockType: SockType = SOCK_STREAM;
                        protocol: Protocol = IPPROTO_TCP;
                        inheritable: bool = defined(nimInheritHandles)): SocketHandle {...}{.
    raises: [], tags: [].}
```
  Creates a new socket; returns `osInvalidSocket` if an error occurs.

 `inheritable` decides if the resulting SocketHandle can be inherited by child processes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L254)  
```
proc bindAddr(socket: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L264)  
```
proc listen(socket: SocketHandle; backlog = SOMAXCONN): cint {...}{.
    tags: [ReadIOEffect], raises: [].}
```
  Marks `socket` as accepting connections. `Backlog` specifies the maximum length of the queue of pending connections. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L268)  
```
proc getAddrInfo(address: string; port: Port; domain: Domain = AF_INET;
                 sockType: SockType = SOCK_STREAM;
                 protocol: Protocol = IPPROTO_TCP): ptr AddrInfo {...}{.
    raises: [OSError], tags: [].}
```
  
> **Warning**: The resulting `ptr AddrInfo` must be freed using `freeAddrInfo`!
> 
> 

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L278)  
```
proc ntohl(x: uint32): uint32 {...}{.raises: [], tags: [].}
```
  Converts 32-bit unsigned integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L305)  
```
proc ntohs(x: uint16): uint16 {...}{.raises: [], tags: [].}
```
  Converts 16-bit unsigned integers from network to host byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L315)  
```
proc getServByName(name, proto: string): Servent {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  Searches the database from the beginning and finds the first entry for which the service name specified by `name` matches the s\_name member and the protocol name specified by `proto` matches the s\_proto member.

 On posix this will search through the `/etc/services` file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L334)  
```
proc getServByPort(port: Port; proto: string): Servent {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  Searches the database from the beginning and finds the first entry for which the port specified by `port` matches the s\_port member and the protocol name specified by `proto` matches the s\_proto member.

 On posix this will search through the `/etc/services` file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L350)  
```
proc getHostByAddr(ip: string): Hostent {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  This function will lookup the hostname of an IP Address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L366)  
```
proc getHostByName(name: string): Hostent {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  This function will lookup the IP address of a hostname. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L408)  
```
proc getHostname(): string {...}{.tags: [ReadIOEffect], raises: [OSError].}
```
  Returns the local hostname (not the FQDN) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L437)  
```
proc getSockDomain(socket: SocketHandle): Domain {...}{.raises: [OSError, IOError],
    tags: [].}
```
  Returns the socket's domain (AF\_INET or AF\_INET6). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L453)  
```
proc getAddrString(sockAddr: ptr SockAddr): string {...}{.
    raises: [Exception, OSError, IOError], tags: [].}
```
  Returns the string representation of address within sockAddr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L466)  
```
proc getAddrString(sockAddr: ptr SockAddr; strAddress: var string) {...}{.
    raises: [Exception, OSError, IOError], tags: [].}
```
  Stores in `strAddress` the string representation of the address inside `sockAddr`

 **Note**

 * `strAddress` must be initialized to 46 in length.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L492)  
```
proc getSockName(socket: SocketHandle): Port {...}{.raises: [OSError], tags: [].}
```
  Returns the socket's associated port number. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L533)  
```
proc getLocalAddr(socket: SocketHandle; domain: Domain): (string, Port) {...}{.
    raises: [OSError, Exception], tags: [].}
```
  Returns the socket's local address and port number.

 Similar to POSIX's getsockname.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L548)  
```
proc getPeerAddr(socket: SocketHandle; domain: Domain): (string, Port) {...}{.
    raises: [OSError, Exception], tags: [].}
```
  Returns the socket's peer address and port number.

 Similar to POSIX's getpeername

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L585)  
```
proc getSockOptInt(socket: SocketHandle; level, optname: int): int {...}{.
    tags: [ReadIOEffect], raises: [OSError].}
```
  getsockopt for integer options. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L622)  
```
proc setSockOptInt(socket: SocketHandle; level, optname, optval: int) {...}{.
    tags: [WriteIOEffect], raises: [OSError].}
```
  setsockopt for integer options. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L632)  
```
proc setBlocking(s: SocketHandle; blocking: bool) {...}{.raises: [OSError], tags: [].}
```
  Sets blocking mode on socket.

 Raises OSError on error.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L640)  
```
proc selectRead(readfds: var seq[SocketHandle]; timeout = 500): int {...}{.
    raises: [], tags: [].}
```
  When a socket in `readfds` is ready to be read from then a non-zero value will be returned specifying the count of the sockets which can be read from. The sockets which cannot be read from will also be removed from `readfds`.

 `timeout` is specified in milliseconds and `-1` can be specified for an unlimited time.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L684)  
```
proc selectWrite(writefds: var seq[SocketHandle]; timeout = 500): int {...}{.
    tags: [ReadIOEffect], raises: [].}
```
  When a socket in `writefds` is ready to be written to then a non-zero value will be returned specifying the count of the sockets which can be written to. The sockets which cannot be written to will also be removed from `writefds`.

 `timeout` is specified in milliseconds and `-1` can be specified for an unlimited time.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L705) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L705)  
```
proc accept(fd: SocketHandle; inheritable = defined(nimInheritHandles)): (
    SocketHandle, string) {...}{.raises: [], tags: [].}
```
  Accepts a new client connection.

 `inheritable` decides if the resulting SocketHandle can be inherited by child processes.

 Returns (osInvalidSocket, "") if an error occurred.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L727)   Templates
---------

  
```
template htonl(x: uint32): untyped
```
  Converts 32-bit unsigned integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 4-byte swap operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L322)  
```
template htons(x: uint16): untyped
```
  Converts 16-bit unsigned integers from host to network byte order. On machines where the host byte order is the same as network byte order, this is a no-op; otherwise, it performs a 2-byte swap operation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/nativesockets.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/nativesockets.nim#L328)   Exports
-------

  [WSAEWOULDBLOCK](winlean#WSAEWOULDBLOCK), [WSAECONNRESET](winlean#WSAECONNRESET), [WSAECONNABORTED](winlean#WSAECONNABORTED), [WSAENETRESET](winlean#WSAENETRESET), [WSANOTINITIALISED](winlean#WSANOTINITIALISED), [WSAENOTSOCK](winlean#WSAENOTSOCK), [WSAEINPROGRESS](winlean#WSAEINPROGRESS), [WSAEINTR](winlean#WSAEINTR), [WSAEDISCON](winlean#WSAEDISCON), [ERROR\_NETNAME\_DELETED](winlean#ERROR_NETNAME_DELETED), [SocketHandle](winlean#SocketHandle), [Sockaddr\_in](winlean#Sockaddr_in), [AddrInfo](winlean#AddrInfo), [INADDR\_ANY](winlean#INADDR_ANY), [SockAddr](winlean#SockAddr), [SockLen](winlean#SockLen), [Sockaddr\_in6](winlean#Sockaddr_in6), [Sockaddr\_storage](winlean#Sockaddr_storage), [inet\_ntoa](winlean#inet_ntoa,InAddr), [recv](winlean#recv,SocketHandle,pointer,cint,cint), [==](system#==,seq%5BT%5D,seq%5BT%5D), [==](system#==,int16,int16), [==](system#==,uint16,uint16), [==](system#==,int,int), [==](system#==,cstring,cstring), [==](system#==,int64,int64), [==](system#==,float32,float32), [==](system#==,uint,uint), [==](system#==,ref.T,ref.T), [==](system#==,set%5BT%5D,set%5BT%5D), [==](system#==,Enum,Enum), [==](system#==,T,T), [==](system#==,uint32,uint32), [==](options#==,Option,Option), [==](system#==,bool,bool), [==](system#==,float,float), [==](os#==,OSErrorCode,OSErrorCode), [==](system#==,array%5BI,T%5D,array%5BI,T%5D), [==](system#==,T,T_2), [==](system#==,ptr.T,ptr.T), [==](system#==,char,char), [==](system#==,int8,int8), [==](system#==,uint8,uint8), [==](system#==,pointer,pointer), [==](system#==,string,string), [==](system#==,uint64,uint64), [==](system#==,openArray%5BT%5D,openArray%5BT%5D), [==](winlean#==,SocketHandle,SocketHandle), [==](system#==,int32,int32), [connect](winlean#connect,SocketHandle,ptr.SockAddr,SockLen), [send](winlean#send,SocketHandle,pointer,cint,cint), [accept](winlean#accept,SocketHandle,ptr.SockAddr,ptr.SockLen), [recvfrom](winlean#recvfrom,SocketHandle,cstring,cint,cint,ptr.SockAddr,ptr.SockLen), [sendto](winlean#sendto,SocketHandle,pointer,cint,cint,ptr.SockAddr,SockLen), [freeaddrinfo](winlean#freeaddrinfo,ptr.AddrInfo), [SO\_ERROR](winlean#SO_ERROR), [SOL\_SOCKET](winlean#SOL_SOCKET), [SOMAXCONN](winlean#SOMAXCONN), [SO\_ACCEPTCONN](winlean#SO_ACCEPTCONN), [SO\_BROADCAST](winlean#SO_BROADCAST), [SO\_DEBUG](winlean#SO_DEBUG), [SO\_DONTROUTE](winlean#SO_DONTROUTE), [SO\_KEEPALIVE](winlean#SO_KEEPALIVE), [SO\_OOBINLINE](winlean#SO_OOBINLINE), [SO\_REUSEADDR](winlean#SO_REUSEADDR), [SO\_REUSEPORT](winlean#SO_REUSEPORT), [MSG\_PEEK](winlean#MSG_PEEK) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nativesockets.html>

net
===


This module implements a high-level cross-platform sockets interface. The procedures implemented in this module are primarily for blocking sockets. For asynchronous non-blocking sockets use the `asyncnet` module together with the `asyncdispatch` module.

 The first thing you will always need to do in order to start using sockets, is to create a new instance of the `Socket` type using the `newSocket` procedure.

 SSL
---


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#newContext%2Cstring%2Cstring%2Cstring%2Cstring%2Cstring) procedure for additional details.

 SSL on Windows
--------------


On Windows the SSL library checks for valid certificates. It uses the `cacert.pem` file for this purpose which was extracted from `https://curl.se/ca/cacert.pem`. Besides the OpenSSL DLLs (e.g. libssl-1\_1-x64.dll, libcrypto-1\_1-x64.dll) you also need to ship `cacert.pem` with your `.exe` file.

 Examples
--------

 ### Connecting to a server


After you create a socket with the `newSocket` procedure, you can easily connect it to a server running at a known hostname (or IP address) and port. To do so over TCP, use the example below.

 
```
var socket = newSocket()
socket.connect("google.com", Port(80))
```

For SSL, use the following example (and make sure to compile with `-d:ssl`):

 
```
var socket = newSocket()
var ctx = newContext()
wrapSocket(ctx, socket)
socket.connect("google.com", Port(443))
```

UDP is a connectionless protocol, so UDP sockets don't have to explicitly call the [connect](net#connect%2CSocket%2Cstring) procedure. They can simply start sending data immediately.

 
```
var socket = newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)
socket.sendTo("192.168.0.1", Port(27960), "status\n")
```
 ### Creating a server


After you create a socket with the `newSocket` procedure, you can create a TCP server by calling the `bindAddr` and `listen` procedures.

 
```
var socket = newSocket()
socket.bindAddr(Port(1234))
socket.listen()
```

You can then begin accepting connections using the `accept` procedure.

 
```
var client: Socket
var address = ""
while true:
  socket.acceptAddr(client, address)
  echo("Client connected from: ", address)
```
 Imports
-------

  <since>, <nativesockets>, <os>, <strutils>, <times>, <sets>, <options>, <monotimes>, <ssl_certs>, <ssl_config>, <winlean>, <openssl>, <posix>, <posix>  Types
-----

  
```
Certificate = string
```
  DER encoded certificate [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L109)  
```
SslError = object of CatchableError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L111)  
```
SslCVerifyMode = enum
  CVerifyNone, CVerifyPeer, CVerifyPeerUseEnvVars
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L113)  
```
SslProtVersion = enum
  protSSLv2, protSSLv3, protTLSv1, protSSLv23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L116)  
```
SslContext = ref object
  context*: SslCtx
  referencedData: HashSet[int]
  extraInternal: SslContextExtraInternal
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L119)  
```
SslAcceptResult = enum
  AcceptNoClient = 0, AcceptNoHandshake, AcceptSuccess
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L124)  
```
SslHandshakeType = enum
  handshakeAsClient, handshakeAsServer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L127)  
```
SslClientGetPskFunc = proc (hint: string): tuple[identity: string, psk: string]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L130)  
```
SslServerGetPskFunc = proc (identity: string): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L132)  
```
SocketImpl = object
  fd: SocketHandle
  isBuffered: bool
  buffer: array[0 .. BufferSize, char]
  currPos: int
  bufLen: int
  when defineSsl:
      isSsl: bool
      sslHandle: SslPtr
      sslContext: SslContext
      sslNoHandshake: bool
      sslHasPeekChar: bool
      sslPeekChar: char
      sslNoShutdown: bool

  lastError: OSErrorCode     ## stores the last error on this socket
  domain: Domain
  sockType: SockType
  protocol: Protocol
```
  socket type [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L147)  
```
Socket = ref SocketImpl
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L166)  
```
SOBool = enum
  OptAcceptConn, OptBroadcast, OptDebug, OptDontRoute, OptKeepAlive,
  OptOOBInline, OptReuseAddr, OptReusePort, OptNoDelay
```
  Boolean socket options. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L168)  
```
ReadLineResult = enum
  ReadFullLine, ReadPartialLine, ReadDisconnected, ReadNone
```
  result for readLineAsync [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L172)  
```
TimeoutError = object of CatchableError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L175)  
```
SocketFlag {...}{.pure.} = enum
  Peek, SafeDisconn          ## Ensures disconnection exceptions (ECONNRESET, EPIPE etc) are not thrown.
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L177)  
```
IpAddressFamily {...}{.pure.} = enum
  IPv6,                     ## IPv6 address
  IPv4                       ## IPv4 address
```
  Describes the type of an IP address [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L185)  
```
IpAddress = object
  case family*: IpAddressFamily ## the type of the IP address (IPv4 or IPv6)
  of IpAddressFamily.IPv6:
      address_v6*: array[0 .. 15, uint8] ## Contains the IP address in bytes in
                                         ## case of IPv6
    
  of IpAddressFamily.IPv4:
      address_v4*: array[0 .. 3, uint8] ## Contains the IP address in bytes in
                                        ## case of IPv4
```
  stores an arbitrary IP address [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L189)   Consts
------

  
```
BufferSize: int = 4000
```
  size of a buffered socket's buffer [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L143)  
```
MaxLineLength = 1000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L144)   Procs
-----

  
```
proc isDisconnectionError(flags: set[SocketFlag]; lastError: OSErrorCode): bool {...}{.
    raises: [], tags: [].}
```
  Determines whether `lastError` is a disconnection error. Only does this if flags contains `SafeDisconn`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L204)  
```
proc toOSFlags(socketFlags: set[SocketFlag]): cint {...}{.raises: [], tags: [].}
```
  Converts the flags into the underlying OS representation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L222)  
```
proc newSocket(fd: SocketHandle; domain: Domain = AF_INET;
               sockType: SockType = SOCK_STREAM;
               protocol: Protocol = IPPROTO_TCP; buffered = true): owned(Socket) {...}{.
    raises: [], tags: [].}
```
  Creates a new socket as specified by the params. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L230)  
```
proc newSocket(domain, sockType, protocol: cint; buffered = true;
               inheritable = defined(nimInheritHandles)): owned(Socket) {...}{.
    raises: [OSError], tags: [].}
```
  Creates a new socket.

 The SocketHandle associated with the resulting Socket will not be inheritable by child processes by default. This can be changed via the `inheritable` parameter.

 If an error occurs OSError will be raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L248)  
```
proc newSocket(domain: Domain = AF_INET; sockType: SockType = SOCK_STREAM;
               protocol: Protocol = IPPROTO_TCP; buffered = true;
               inheritable = defined(nimInheritHandles)): owned(Socket) {...}{.
    raises: [OSError], tags: [].}
```
  Creates a new socket.

 The SocketHandle associated with the resulting Socket will not be inheritable by child processes by default. This can be changed via the `inheritable` parameter.

 If an error occurs OSError will be raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L263)  
```
proc parseIpAddress(addressStr: string): IpAddress {...}{.raises: [ValueError],
    tags: [].}
```
  Parses an IP address Raises ValueError on error [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L433)  
```
proc isIpAddress(addressStr: string): bool {...}{.tags: [], raises: [].}
```
  Checks if a string is an IP address Returns true if it is, false otherwise [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L443)  
```
proc toSockAddr(address: IpAddress; port: Port; sa: var Sockaddr_storage;
                sl: var SockLen) {...}{.raises: [], tags: [].}
```
  Converts `IpAddress` and `Port` to `SockAddr` and `SockLen` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L452)  
```
proc fromSockAddr(sa: Sockaddr_storage | SockAddr | Sockaddr_in | Sockaddr_in6;
                  sl: SockLen; address: var IpAddress; port: var Port) {...}{.inline.}
```
  Converts `SockAddr` and `SockLen` to `IpAddress` and `Port`. Raises `ObjectConversionDefect` in case of invalid `sa` and `sl` arguments. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L490)  
```
proc raiseSSLError(s = "") {...}{.raises: [SslError], tags: [].}
```
  Raises a new SSL error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L503)  
```
proc getExtraData(ctx: SslContext; index: int): RootRef {...}{.raises: [SslError],
    tags: [].}
```
  Retrieves arbitrary data stored inside SslContext. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L519)  
```
proc setExtraData(ctx: SslContext; index: int; data: RootRef) {...}{.
    raises: [SslError], tags: [].}
```
  Stores arbitrary data inside SslContext. The unique `index` should be retrieved using getSslContextExtraDataIndex. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L528)  
```
proc newContext(protVersion = protSSLv23; verifyMode = CVerifyPeer;
                certFile = ""; keyFile = ""; cipherList = CiphersIntermediate;
                caDir = ""; caFile = ""): SslContext {...}{.
    raises: [Exception, LibraryError, SslError, IOError],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
```
  Creates an SSL context.

 Protocol version specifies the protocol to use. SSLv2, SSLv3, TLSv1 are available with the addition of `protSSLv23` which allows for compatibility with all of them.

 There are three options for verify mode: `CVerifyNone`: certificates are not verified; `CVerifyPeer`: certificates are verified; `CVerifyPeerUseEnvVars`: certificates are verified and the optional environment variables SSL\_CERT\_FILE and SSL\_CERT\_DIR are also used to locate certificates

 The `nimDisableCertificateValidation` define overrides verifyMode and disables certificate verification globally!

 CA certificates will be loaded, in the following order, from:

 
> 
> * caFile, caDir, parameters, if set
> * if `verifyMode` is set to `CVerifyPeerUseEnvVars`, the SSL\_CERT\_FILE and SSL\_CERT\_DIR environment variables are used
> * a set of files and directories from the <ssl_certs> file.
> 
>  

 The last two parameters specify the certificate file path and the key file path, a server socket will most likely not work without these.

 Certificates can be generated using the following command:

 * `openssl req -x509 -nodes -days 365 -newkey rsa:4096 -keyout mykey.pem -out mycert.pem`

 or using ECDSA:

 * `openssl ecparam -out mykey.pem -name secp256k1 -genkey`
* `openssl req -new -key mykey.pem -x509 -nodes -days 365 -out mycert.pem`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L563)  
```
proc destroyContext(ctx: SslContext) {...}{.raises: [SslError], tags: [].}
```
  Free memory referenced by SslContext. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L666)  
```
proc pskIdentityHint=(ctx: SslContext; hint: string) {...}{.raises: [SslError],
    tags: [].}
```
  Sets the identity hint passed to server.

 Only used in PSK ciphersuites.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L676)  
```
proc clientGetPskFunc(ctx: SslContext): SslClientGetPskFunc {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L683)  
```
proc clientGetPskFunc=(ctx: SslContext; fun: SslClientGetPskFunc) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Sets function that returns the client identity and the PSK based on identity hint from the server.

 Only used in PSK ciphersuites.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L701)  
```
proc serverGetPskFunc(ctx: SslContext): SslServerGetPskFunc {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L710)  
```
proc serverGetPskFunc=(ctx: SslContext; fun: SslServerGetPskFunc) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Sets function that returns PSK based on the client identity.

 Only used in PSK ciphersuites.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L723)  
```
proc getPskIdentity(socket: Socket): string {...}{.raises: [], tags: [].}
```
  Gets the PSK identity provided by the client. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L731)  
```
proc wrapSocket(ctx: SslContext; socket: Socket) {...}{.raises: [SslError], tags: [].}
```
  Wraps a socket in an SSL context. This function effectively turns `socket` into an SSL socket.

 This must be called on an unconnected socket; an SSL session will be started when the socket is connected.

 FIXME: **Disclaimer**: This code is not well tested, may be very unsafe and prone to security vulnerabilities.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L736)  
```
proc wrapConnectedSocket(ctx: SslContext; socket: Socket;
                         handshake: SslHandshakeType; hostname: string = "") {...}{.
    raises: [SslError, Exception], tags: [RootEffect].}
```
  Wraps a connected socket in an SSL context. This function effectively turns `socket` into an SSL socket. `hostname` should be specified so that the client knows which hostname the server certificate should be validated against.

 This should be called on a connected socket, and will perform an SSL handshake immediately.

 FIXME: **Disclaimer**: This code is not well tested, may be very unsafe and prone to security vulnerabilities.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L779)  
```
proc getPeerCertificates(sslHandle: SslPtr): seq[Certificate] {...}{.
    raises: [Exception], tags: [].}
```
  Returns the certificate chain received by the peer we are connected to through the OpenSSL connection represented by `sslHandle`. The handshake must have been completed and the certificate chain must have been verified successfully or else an empty sequence is returned. The chain is ordered from leaf certificate to root certificate. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L811)  
```
proc getPeerCertificates(socket: Socket): seq[Certificate] {...}{.
    raises: [Exception], tags: [].}
```
  Returns the certificate chain received by the peer we are connected to through the given socket. The handshake must have been completed and the certificate chain must have been verified successfully or else an empty sequence is returned. The chain is ordered from leaf certificate to root certificate. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L830)  
```
proc sessionIdContext=(ctx: SslContext; sidCtx: string) {...}{.raises: [SslError],
    tags: [].}
```
  Sets the session id context in which a session can be reused. Used for permitting clients to reuse a session id instead of doing a new handshake.

 TLS clients might attempt to resume a session using the session id context, thus it must be set if verifyMode is set to CVerifyPeer or CVerifyPeerUseEnvVars, otherwise the connection will fail and SslError will be raised if resumption occurs.

 * Only useful if set server-side.
* Should be unique per-application to prevent clients from malfunctioning.
* sidCtx must be at most 32 characters in length.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L841)  
```
proc getSocketError(socket: Socket): OSErrorCode {...}{.raises: [OSError], tags: [].}
```
  Checks `osLastError` for a valid error. If it has been reset it uses the last error stored in the socket object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L857) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L857)  
```
proc socketError(socket: Socket; err: int = -1; async = false;
                 lastError = -1.OSErrorCode; flags: set[SocketFlag] = {}): void {...}{.
    gcsafe, raises: [SslError, OSError], tags: [].}
```
  Raises an OSError based on the error code returned by `SSL_get_error` (for SSL sockets) and `osLastError` otherwise.

 If `async` is `true` no error will be thrown in the case when the error was caused by no data being available to be read.

 If `err` is not lower than 0 no exception will be raised.

 If `flags` contains `SafeDisconn`, no exception will be raised when the error was caused by a peer disconnection.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L866)  
```
proc listen(socket: Socket; backlog = SOMAXCONN) {...}{.tags: [ReadIOEffect],
    raises: [OSError].}
```
  Marks `socket` as accepting connections. `Backlog` specifies the maximum length of the queue of pending connections.

 Raises an OSError error upon failure.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L931) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L931)  
```
proc bindAddr(socket: Socket; port = Port(0); address = "") {...}{.
    tags: [ReadIOEffect], raises: [ValueError, OSError].}
```
  Binds `address`:`port` to the socket.

 If `address` is "" then ADDR\_ANY will be bound.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L940) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L940)  
```
proc acceptAddr(server: Socket; client: var owned(Socket); address: var string;
                flags = {SafeDisconn}; inheritable = defined(nimInheritHandles)) {...}{.
    tags: [ReadIOEffect], gcsafe, locks: 0, raises: [OSError, IOError, SslError].}
```
  Blocks until a connection is being made from a client. When a connection is made sets `client` to the client socket and `address` to the address of the connecting client. This function will raise OSError if an error occurs.

 The resulting client will inherit any properties of the server socket. For example: whether the socket is buffered or not.

 The SocketHandle associated with the resulting client will not be inheritable by child processes by default. This can be changed via the `inheritable` parameter.

 The `accept` call may result in an error if the connecting socket disconnects during the duration of the `accept`. If the `SafeDisconn` flag is specified then this error will not be raised and instead accept will be called again.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L960)  
```
proc accept(server: Socket; client: var owned(Socket); flags = {SafeDisconn};
            inheritable = defined(nimInheritHandles)) {...}{.tags: [ReadIOEffect],
    raises: [OSError, IOError, SslError].}
```
  Equivalent to `acceptAddr` but doesn't return the address, only the socket.

 The SocketHandle associated with the resulting client will not be inheritable by child processes by default. This can be changed via the `inheritable` parameter.

 The `accept` call may result in an error if the connecting socket disconnects during the duration of the `accept`. If the `SafeDisconn` flag is specified then this error will not be raised and instead accept will be called again.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1059)  
```
proc close(socket: Socket; flags = {SafeDisconn}) {...}{.
    raises: [Exception, LibraryError, OSError, SslError, OSError],
    tags: [RootEffect].}
```
  Closes a socket.

 If `socket` is an SSL/TLS socket, this proc will also send a closure notification to the peer. If `SafeDisconn` is in `flags`, failure to do so due to disconnections will be ignored. This is generally safe in practice. See [here](https://security.stackexchange.com/a/82044) for more details.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1135)  
```
proc toCInt(opt: SOBool): cint {...}{.raises: [], tags: [].}
```
  Converts a `SOBool` into its Socket Option cint representation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1196)  
```
proc getSockOpt(socket: Socket; opt: SOBool; level = SOL_SOCKET): bool {...}{.
    tags: [ReadIOEffect], raises: [OSError].}
```
  Retrieves option `opt` as a boolean value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1209)  
```
proc getLocalAddr(socket: Socket): (string, Port) {...}{.
    raises: [OSError, Exception], tags: [].}
```
  Get the socket's local address and port number.

 This is high-level interface for getsockname.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1215)  
```
proc getPeerAddr(socket: Socket): (string, Port) {...}{.raises: [OSError, Exception],
    tags: [].}
```
  Get the socket's peer address and port number.

 This is high-level interface for getpeername.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1221)  
```
proc setSockOpt(socket: Socket; opt: SOBool; value: bool; level = SOL_SOCKET) {...}{.
    tags: [WriteIOEffect], raises: [OSError].}
```
  Sets option `opt` to a boolean value specified by `value`.
```
var socket = newSocket()
socket.setSockOpt(OptReusePort, true)
socket.setSockOpt(OptNoDelay, true, level=IPPROTO_TCP.toInt)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1227)  
```
proc connectUnix(socket: Socket; path: string) {...}{.raises: [], tags: [].}
```
  Connects to Unix socket on `path`. This only works on Unix-style systems: Mac OS X, BSD and Linux [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1240)  
```
proc bindUnix(socket: Socket; path: string) {...}{.raises: [], tags: [].}
```
  Binds Unix socket to `path`. This only works on Unix-style systems: Mac OS X, BSD and Linux [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1249)  
```
proc hasDataBuffered(s: Socket): bool {...}{.raises: [], tags: [].}
```
  Determines whether a socket has data buffered. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1269)  
```
proc recv(socket: Socket; data: pointer; size: int): int {...}{.tags: [ReadIOEffect],
    raises: [].}
```
  Receives data from a socket.

 **Note**: This is a low-level function, you may be interested in the higher level versions of this function which are also named `recv`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1326)  
```
proc recv(socket: Socket; data: pointer; size: int; timeout: int): int {...}{.
    tags: [ReadIOEffect, TimeEffect], raises: [TimeoutError, OSError].}
```
  overload with a `timeout` parameter in milliseconds. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1406)  
```
proc recv(socket: Socket; data: var string; size: int; timeout = -1;
          flags = {SafeDisconn}): int {...}{.raises: [TimeoutError, OSError, SslError],
                                        tags: [ReadIOEffect, TimeEffect].}
```
  Higher-level version of `recv`.

 Reads **up to** `size` bytes from `socket` into `buf`.

 For buffered sockets this function will attempt to read all the requested data. It will read this data in `BufferSize` chunks.

 For unbuffered sockets this function makes no effort to read all the data requested. It will return as much data as the operating system gives it.

 When 0 is returned the socket's connection has been closed.

 This function will throw an OSError exception when an error occurs. A value lower than 0 is never returned.

 A timeout may be specified in milliseconds, if enough data is not received within the time specified a TimeoutError exception will be raised.

 **Note**: `data` must be initialised.

 **Warning**: Only the `SafeDisconn` flag is currently supported.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1424)  
```
proc recv(socket: Socket; size: int; timeout = -1; flags = {SafeDisconn}): string {...}{.
    inline, raises: [TimeoutError, OSError, SslError],
    tags: [ReadIOEffect, TimeEffect].}
```
  Higher-level version of `recv` which returns a string.

 Reads **up to** `size` bytes from `socket` into `buf`.

 For buffered sockets this function will attempt to read all the requested data. It will read this data in `BufferSize` chunks.

 For unbuffered sockets this function makes no effort to read all the data requested. It will return as much data as the operating system gives it.

 When `""` is returned the socket's connection has been closed.

 This function will throw an OSError exception when an error occurs.

 A timeout may be specified in milliseconds, if enough data is not received within the time specified a TimeoutError exception will be raised.

 **Warning**: Only the `SafeDisconn` flag is currently supported.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1461)  
```
proc readLine(socket: Socket; line: var TaintedString; timeout = -1;
              flags = {SafeDisconn}; maxLength = MaxLineLength) {...}{.
    tags: [ReadIOEffect, TimeEffect], raises: [TimeoutError, OSError, SslError].}
```
  Reads a line of data from `socket`.

 If a full line is read `\r\L` is not added to `line`, however if solely `\r\L` is read then `line` will be set to it.

 If the socket is disconnected, `line` will be set to `""`.

 An OSError exception will be raised in the case of a socket error.

 A timeout can be specified in milliseconds, if data is not received within the specified time a TimeoutError exception will be raised.

 The `maxLength` parameter determines the maximum amount of characters that can be read. The result is truncated after that.

 **Warning**: Only the `SafeDisconn` flag is currently supported.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1506)  
```
proc recvLine(socket: Socket; timeout = -1; flags = {SafeDisconn};
              maxLength = MaxLineLength): TaintedString {...}{.
    raises: [TimeoutError, OSError, SslError], tags: [ReadIOEffect, TimeEffect].}
```
  Reads a line of data from `socket`.

 If a full line is read `\r\L` is not added to the result, however if solely `\r\L` is read then the result will be set to it.

 If the socket is disconnected, the result will be set to `""`.

 An OSError exception will be raised in the case of a socket error.

 A timeout can be specified in milliseconds, if data is not received within the specified time a TimeoutError exception will be raised.

 The `maxLength` parameter determines the maximum amount of characters that can be read. The result is truncated after that.

 **Warning**: Only the `SafeDisconn` flag is currently supported.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1562)  
```
proc recvFrom(socket: Socket; data: var string; length: int;
              address: var string; port: var Port; flags = 0'i32): int {...}{.
    tags: [ReadIOEffect], raises: [Exception, OSError, IOError, ValueError].}
```
  Receives data from `socket`. This function should normally be used with connection-less sockets (UDP sockets).

 If an error occurs an OSError exception will be raised. Otherwise the return value will be the length of data received.

 **Warning:** This function does not yet have a buffered implementation, so when `socket` is buffered the non-buffered implementation will be used. Therefore if `socket` contains something in its buffer this function will make no effort to return it.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1585)  
```
proc skip(socket: Socket; size: int; timeout = -1) {...}{.
    raises: [TimeoutError, OSError], tags: [TimeEffect, ReadIOEffect].}
```
  Skips `size` amount of bytes.

 An optional timeout can be specified in milliseconds, if skipping the bytes takes longer than specified a TimeoutError exception will be raised.

 Returns the number of skipped bytes.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1626)  
```
proc send(socket: Socket; data: pointer; size: int): int {...}{.
    tags: [WriteIOEffect], raises: [].}
```
  Sends data to a socket.

 **Note**: This is a low-level version of `send`. You likely should use the version below.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1641)  
```
proc send(socket: Socket; data: string; flags = {SafeDisconn}) {...}{.
    tags: [WriteIOEffect], raises: [SslError, OSError].}
```
  sends data to a socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1660)  
```
proc trySend(socket: Socket; data: string): bool {...}{.tags: [WriteIOEffect],
    raises: [].}
```
  Safe alternative to `send`. Does not raise an OSError when an error occurs, and instead returns `false` on failure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1675)  
```
proc sendTo(socket: Socket; address: string; port: Port; data: pointer;
            size: int; af: Domain = AF_INET; flags = 0'i32) {...}{.
    tags: [WriteIOEffect], raises: [OSError].}
```
  This proc sends `data` to the specified `address`, which may be an IP address or a hostname, if a hostname is specified this function will try each IP of that hostname.

 If an error occurs an OSError exception will be raised.

 **Note:** You may wish to use the high-level version of this function which is defined below.

 **Note:** This proc is not available for SSL sockets.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1680)  
```
proc sendTo(socket: Socket; address: string; port: Port; data: string) {...}{.
    tags: [WriteIOEffect], raises: [OSError].}
```
  This proc sends `data` to the specified `address`, which may be an IP address or a hostname, if a hostname is specified this function will try each IP of that hostname.

 If an error occurs an OSError exception will be raised.

 This is the high-level version of the above `sendTo` function.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1714)  
```
proc isSsl(socket: Socket): bool {...}{.raises: [], tags: [].}
```
  Determines whether `socket` is a SSL socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1726)  
```
proc getFd(socket: Socket): SocketHandle {...}{.raises: [], tags: [].}
```
  Returns the socket's file descriptor [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1733) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1733)  
```
proc IPv4_any(): IpAddress {...}{.raises: [], tags: [].}
```
  Returns the IPv4 any address, which can be used to listen on all available network adapters [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1739)  
```
proc IPv4_loopback(): IpAddress {...}{.raises: [], tags: [].}
```
  Returns the IPv4 loopback address (127.0.0.1) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1746)  
```
proc IPv4_broadcast(): IpAddress {...}{.raises: [], tags: [].}
```
  Returns the IPv4 broadcast address (255.255.255.255) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1752) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1752)  
```
proc IPv6_any(): IpAddress {...}{.raises: [], tags: [].}
```
  Returns the IPv6 any address (::0), which can be used to listen on all available network adapters [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1758) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1758)  
```
proc IPv6_loopback(): IpAddress {...}{.raises: [], tags: [].}
```
  Returns the IPv6 loopback address (::1) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1765) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1765)  
```
proc `==`(lhs, rhs: IpAddress): bool {...}{.raises: [], tags: [].}
```
  Compares two IpAddresses for Equality. Returns true if the addresses are equal [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1774) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1774)  
```
proc `$`(address: IpAddress): string {...}{.raises: [], tags: [].}
```
  Converts an IpAddress into the textual representation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1785) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1785)  
```
proc dial(address: string; port: Port; protocol = IPPROTO_TCP; buffered = true): owned(
    Socket) {...}{.tags: [ReadIOEffect, WriteIOEffect], raises: [OSError, IOError].}
```
  Establishes connection to the specified `address`:`port` pair via the specified protocol. The procedure iterates through possible resolutions of the `address` until it succeeds, meaning that it seamlessly works with both IPv4 and IPv6. Returns Socket ready to send or receive data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1849) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1849)  
```
proc connect(socket: Socket; address: string; port = Port(0)) {...}{.
    tags: [ReadIOEffect], raises: [OSError, SslError].}
```
  Connects socket to `address`:`port`. `Address` can be an IP address or a host name. If `address` is a host name, this function will try each IP of that host name. `htons` is already performed on `port` so you must not do it.

 If `socket` is an SSL socket a handshake will be automatically performed.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1907) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1907)  
```
proc connect(socket: Socket; address: string; port = Port(0); timeout: int) {...}{.
    tags: [ReadIOEffect, WriteIOEffect], raises: [OSError, TimeoutError].}
```
  Connects to server as specified by `address` on port specified by `port`.

 The `timeout` parameter specifies the time in milliseconds to allow for the connection to the server to be made.

 **Warning:** This procedure appears to be broken for SSL connections as of Nim v1.0.2. Consider using the other `connect` procedure. See <https://github.com/nim-lang/Nim/issues/15215> for more info.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1982) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1982)  
```
proc getPrimaryIPAddr(dest = parseIpAddress("8.8.8.8")): IpAddress {...}{.
    raises: [OSError, OSError, SslError, ValueError, Exception, LibraryError],
    tags: [ReadIOEffect, RootEffect].}
```
  Finds the local IP address, usually assigned to eth0 on LAN or wlan0 on WiFi, used to reach an external address. Useful to run local services.

 No traffic is sent.

 Supports IPv4 and v6. Raises OSError if external networking is not set up.

 
```
echo $getPrimaryIPAddr()  # "192.168.1.2"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L2008) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L2008)   Templates
---------

  
```
template `&=`(socket: Socket; data: typed)
```
  an alias for 'send'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/net.nim#L1671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/net.nim#L1671)   Exports
-------

  [Port](nativesockets#Port), [$](nativesockets#%24,Port), [==](system#==,int8,int8), [==](system#==,float,float), [==](winlean#==,SocketHandle,SocketHandle), [==](system#==,T,T), [==](system#==,seq%5BT%5D,seq%5BT%5D), [==](system#==,array%5BI,T%5D,array%5BI,T%5D), [==](options#==,Option,Option), [==](system#==,pointer,pointer), [==](os#==,OSErrorCode,OSErrorCode), [==](system#==,ref.T,ref.T), [==](system#==,string,string), [==](system#==,openArray%5BT%5D,openArray%5BT%5D), [==](system#==,Enum,Enum), [==](system#==,uint8,uint8), [==](system#==,int,int), [==](system#==,float32,float32), [==](system#==,int16,int16), [==](system#==,set%5BT%5D,set%5BT%5D), [==](system#==,int32,int32), [==](system#==,uint16,uint16), [==](system#==,uint32,uint32), [==](system#==,int64,int64), [==](system#==,cstring,cstring), [==](system#==,uint,uint), [==](system#==,uint64,uint64), [==](system#==,T,T_2), [==](system#==,char,char), [==](system#==,ptr.T,ptr.T), [==](system#==,bool,bool), [==](nativesockets#==,Port,Port), [Domain](nativesockets#Domain), [SockType](nativesockets#SockType), [Protocol](nativesockets#Protocol) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/net.html>

selectors
=========


This module allows high-level and efficient I/O multiplexing.

 Supported OS primitives: `epoll`, `kqueue`, `poll` and Windows `select`.

 To use threadsafe version of this module, it needs to be compiled with both `-d:threadsafe` and `--threads:on` options.

 Supported features: files, sockets, pipes, timers, processes, signals and user events.

 Fully supported OS: MacOSX, FreeBSD, OpenBSD, NetBSD, Linux (except for Android).

 Partially supported OS: Windows (only sockets and user events), Solaris (files, sockets, handles and user events). Android (files, sockets, handles and user events).

 TODO: `/dev/poll`, `event ports` and filesystem events.

 Imports
-------

  <os>, <nativesockets>  Types
-----

  
```
Selector[T] = ref object
```
  An object which holds descriptors to be checked for read/write status [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L47)  
```
IOSelectorsException = object of CatchableError
```
  Exception that is raised if an IOSelectors error occurs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L50)  
```
Event {...}{.pure.} = enum
  Read,                     ## Descriptor is available for read
  Write,                    ## Descriptor is available for write
  Timer,                    ## Timer descriptor is completed
  Signal,                   ## Signal is raised
  Process,                  ## Process is finished
  Vnode,                    ## BSD specific file change
  User,                     ## User event is raised
  Error,                    ## Error occurred while waiting for descriptor
  VnodeWrite,               ## NOTE_WRITE (BSD specific, write to file occurred)
  VnodeDelete,              ## NOTE_DELETE (BSD specific, unlink of file occurred)
  VnodeExtend,              ## NOTE_EXTEND (BSD specific, file extended)
  VnodeAttrib,              ## NOTE_ATTRIB (BSD specific, file attributes changed)
  VnodeLink,                ## NOTE_LINK (BSD specific, file link count changed)
  VnodeRename,              ## NOTE_RENAME (BSD specific, file renamed)
  VnodeRevoke                ## NOTE_REVOKE (BSD specific, file revoke occurred)
```
  An enum which hold event types [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L53)  
```
ReadyKey = object
  fd*: int                   ## file/socket descriptor
  events*: set[Event]        ## set of events
  errorCode*: OSErrorCode    ## additional error code information for
                             ## Error events
```
  An object which holds result for descriptor [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L71)  
```
SelectEvent = object
```
  An object which holds user defined event [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L78)   Consts
------

  
```
ioselSupportedPlatform = true
```
  This constant is used to determine whether the destination platform is fully supported by `ioselectors` module. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L34)   Procs
-----

  
```
proc newSelector[T](): Selector[T]
```
  Creates a new selector [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L81)  
```
proc close[T](s: Selector[T])
```
  Closes the selector. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L84)  
```
proc registerHandle[T](s: Selector[T]; fd: int | SocketHandle;
                       events: set[Event]; data: T)
```
  Registers file/socket descriptor `fd` to selector `s` with events set in `events`. The `data` is application-defined data, which will be passed when an event is triggered. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L87)  
```
proc updateHandle[T](s: Selector[T]; fd: int | SocketHandle; events: set[Event])
```
  Update file/socket descriptor `fd`, registered in selector `s` with new events set `event`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L93)  
```
proc registerTimer[T](s: Selector[T]; timeout: int; oneshot: bool; data: T): int {...}{.
    discardable.}
```
  Registers timer notification with `timeout` (in milliseconds) to selector `s`.

 If `oneshot` is `true`, timer will be notified only once.

 Set `oneshot` to `false` if you want periodic notifications.

 The `data` is application-defined data, which will be passed, when the timer is triggered.

 Returns the file descriptor for the registered timer.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L98)  
```
proc registerSignal[T](s: Selector[T]; signal: int; data: T): int {...}{.discardable.}
```
  Registers Unix signal notification with `signal` to selector `s`.

 The `data` is application-defined data, which will be passed when signal raises.

 Returns the file descriptor for the registered signal.

 **Note:** This function is not supported on `Windows`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L112)  
```
proc registerProcess[T](s: Selector[T]; pid: int; data: T): int {...}{.discardable.}
```
  Registers a process id (pid) notification (when process has exited) in selector `s`.

 The `data` is application-defined data, which will be passed when process with `pid` has exited.

 Returns the file descriptor for the registered signal.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L124)  
```
proc registerEvent[T](s: Selector[T]; ev: SelectEvent; data: T)
```
  Registers selector event `ev` in selector `s`.

 The `data` is application-defined data, which will be passed when `ev` happens.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L134)  
```
proc registerVnode[T](s: Selector[T]; fd: cint; events: set[Event]; data: T)
```
  Registers selector BSD/MacOSX specific vnode events for file descriptor `fd` and events `events`. `data` application-defined data, which to be passed, when vnode event happens.

 **Note:** This function is supported only by BSD and MacOSX.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L140)  
```
proc newSelectEvent(): SelectEvent {...}{.raises: [], tags: [].}
```
  Creates a new user-defined event. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L149)  
```
proc trigger(ev: SelectEvent) {...}{.raises: [], tags: [].}
```
  Trigger event `ev`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L152)  
```
proc close(ev: SelectEvent) {...}{.raises: [], tags: [].}
```
  Closes user-defined event `ev`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L155)  
```
proc unregister[T](s: Selector[T]; ev: SelectEvent)
```
  Unregisters user-defined event `ev` from selector `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L158)  
```
proc unregister[T](s: Selector[T]; fd: int | SocketHandle | cint)
```
  Unregisters file/socket descriptor `fd` from selector `s`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L161)  
```
proc selectInto[T](s: Selector[T]; timeout: int;
                   results: var openArray[ReadyKey]): int
```
  Waits for events registered in selector `s`.

 The `timeout` argument specifies the maximum number of milliseconds the function will be blocked for if no events are ready. Specifying a timeout of `-1` causes the function to block indefinitely. All available events will be stored in `results` array.

 Returns number of triggered events.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L164)  
```
proc select[T](s: Selector[T]; timeout: int): seq[ReadyKey]
```
  Waits for events registered in selector `s`.

 The `timeout` argument specifies the maximum number of milliseconds the function will be blocked for if no events are ready. Specifying a timeout of `-1` causes the function to block indefinitely.

 Returns a list of triggered events.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L175)  
```
proc getData[T](s: Selector[T]; fd: SocketHandle | int): var T
```
  Retrieves application-defined `data` associated with descriptor `fd`. If specified descriptor `fd` is not registered, empty/default value will be returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L184)  
```
proc setData[T](s: Selector[T]; fd: SocketHandle | int; data: var T): bool
```
  Associate application-defined `data` with descriptor `fd`.

 Returns `true`, if data was successfully updated, `false` otherwise.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L189)  
```
proc contains[T](s: Selector[T]; fd: SocketHandle | int): bool {...}{.inline.}
```
  Determines whether selector contains a file descriptor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L227)  
```
proc getFd[T](s: Selector[T]): int
```
  Retrieves the underlying selector's file descriptor.

 For *poll* and *select* selectors `-1` is returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L230)   Templates
---------

  
```
template isEmpty[T](s: Selector[T]): bool
```
  Returns `true`, if there are no registered events or descriptors in selector. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L194)  
```
template withData[T; ](s: Selector[T]; fd: SocketHandle | int;
                       value, body: untyped)
```
  Retrieves the application-data assigned with descriptor `fd` to `value`. This `value` can be modified in the scope of the `withData` call.
```
s.withData(fd, value) do:
  # block is executed only if ``fd`` registered in selector ``s``
  value.uid = 1000
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L198)  
```
template withData[T; ](s: Selector[T]; fd: SocketHandle | int;
                       value, body1, body2: untyped)
```
  Retrieves the application-data assigned with descriptor `fd` to `value`. This `value` can be modified in the scope of the `withData` call.
```
s.withData(fd, value) do:
  # block is executed only if ``fd`` registered in selector ``s``.
  value.uid = 1000
do:
  # block is executed if ``fd`` not registered in selector ``s``.
  raise
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/selectors.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/selectors.nim#L211)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/selectors.html>

smtp
====


This module implements the SMTP client protocol as specified by RFC 5321, this can be used to send mail to any SMTP Server.

 This module also implements the protocol used to format messages, as specified by RFC 2822.

 Example gmail use:

 
```
var msg = createMessage("Hello from Nim's SMTP",
                        "Hello!.\n Is this awesome or what?",
                        @["foo@gmail.com"])
let smtpConn = newSmtp(useSsl = true, debug=true)
smtpConn.connect("smtp.gmail.com", Port 465)
smtpConn.auth("username", "password")
smtpConn.sendmail("username@gmail.com", @["foo@gmail.com"], $msg)
```

Example for startTls use:

 
```
var msg = createMessage("Hello from Nim's SMTP",
                        "Hello!.\n Is this awesome or what?",
                        @["foo@gmail.com"])
let smtpConn = newSmtp(debug=true)
smtpConn.connect("smtp.mailtrap.io", Port 2525)
smtpConn.startTls()
smtpConn.auth("username", "password")
smtpConn.sendmail("username@gmail.com", @["foo@gmail.com"], $msg)
```

For SSL support this module relies on OpenSSL. If you want to enable SSL, compile with `-d:ssl`.

 Imports
-------

  <net>, <strutils>, <strtabs>, <base64>, <os>, <strutils>, <asyncnet>, <asyncdispatch>, <parsecfg>  Types
-----

  
```
Message = object
  msgTo: seq[string]
  msgCc: seq[string]
  msgSubject: string
  msgOtherHeaders: StringTableRef
  msgBody: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L52)  
```
ReplyError = object of IOError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L59)  
```
Smtp = SmtpBase[Socket]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L66)  
```
AsyncSmtp = SmtpBase[AsyncSocket]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L67)   Procs
-----

  
```
proc debugSend(smtp: AsyncSmtp; cmd: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Sends `cmd` on the socket connected to the SMTP server.

 If the `smtp` object was created with `debug` enabled, debugSend will invoke `echo("C:" & cmd)` before sending.

 This is a lower level proc and not something that you typically would need to call when using this module. One exception to this is if you are implementing any [SMTP extensions](https://en.wikipedia.org/wiki/Extended_SMTP).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L74)  
```
proc debugSend(smtp: Smtp; cmd: string) {...}{.raises: [SslError, OSError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L74)  
```
proc debugRecv(smtp: AsyncSmtp): Future[TaintedString] {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Receives a line of data from the socket connected to the SMTP server.

 If the `smtp` object was created with `debug` enabled, debugRecv will invoke `echo("S:" & result.string)` after the data is received.

 This is a lower level proc and not something that you typically would need to call when using this module. One exception to this is if you are implementing any [SMTP extensions](https://en.wikipedia.org/wiki/Extended_SMTP).

 See [checkReply(reply)](#checkReply,,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L89)  
```
proc debugRecv(smtp: Smtp): TaintedString {...}{.
    raises: [TimeoutError, OSError, SslError], tags: [ReadIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L89)  
```
proc createMessage(mSubject, mBody: string; mTo, mCc: seq[string];
                   otherHeaders: openArray[tuple[name, value: string]]): Message {...}{.
    raises: [], tags: [].}
```
  Creates a new MIME compliant message.

 You need to make sure that `mSubject`, `mTo` and `mCc` don't contain any newline characters. Failing to do so will raise `AssertionDefect`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L124)  
```
proc createMessage(mSubject, mBody: string; mTo, mCc: seq[string] = @[]): Message {...}{.
    raises: [], tags: [].}
```
  Alternate version of the above.

 You need to make sure that `mSubject`, `mTo` and `mCc` don't contain any newline characters. Failing to do so will raise `AssertionDefect`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L143)  
```
proc `$`(msg: Message): string {...}{.raises: [], tags: [].}
```
  stringify for `Message`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L159)  
```
proc newSmtp(useSsl = false; debug = false; sslContext: SslContext = nil): Smtp {...}{.
    raises: [OSError, SslError, Exception, LibraryError, IOError],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
```
  Creates a new `Smtp` instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L174)  
```
proc newAsyncSmtp(useSsl = false; debug = false; sslContext: SslContext = nil): AsyncSmtp {...}{.
    raises: [OSError, Exception, SslError, LibraryError, IOError],
    tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
```
  Creates a new `AsyncSmtp` instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L189)  
```
proc checkReply(smtp: AsyncSmtp; reply: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Calls [debugRecv](#debugRecv) 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.

 This is a lower level proc and not something that you typically would need to call when using this module. One exception to this is if you are implementing any [SMTP extensions](https://en.wikipedia.org/wiki/Extended_SMTP).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L213)  
```
proc checkReply(smtp: Smtp; reply: string) {...}{.
    raises: [TimeoutError, OSError, SslError, ReplyError],
    tags: [ReadIOEffect, TimeEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L213)  
```
proc helo(smtp: AsyncSmtp): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L228)  
```
proc helo(smtp: Smtp) {...}{.raises: [SslError, OSError, TimeoutError, ReplyError],
                        tags: [WriteIOEffect, ReadIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L228)  
```
proc connect(smtp: AsyncSmtp; address: string; port: Port): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Establishes a connection with a SMTP server. May fail with ReplyError or with a socket error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L233)  
```
proc connect(smtp: Smtp; address: string; port: Port) {...}{.
    raises: [OSError, SslError, TimeoutError, ReplyError],
    tags: [ReadIOEffect, TimeEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L234)  
```
proc startTls(smtp: AsyncSmtp; sslContext: SslContext = nil): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect, ReadDirEffect, ReadEnvEffect].}
```
  Put the SMTP connection in TLS (Transport Layer Security) mode. May fail with ReplyError [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L242)  
```
proc startTls(smtp: Smtp; sslContext: SslContext = nil) {...}{.raises: [SslError,
    OSError, TimeoutError, ReplyError, Exception, LibraryError, IOError], tags: [
    WriteIOEffect, ReadIOEffect, TimeEffect, RootEffect, ReadDirEffect,
    ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L242)  
```
proc auth(smtp: AsyncSmtp; username, password: string): owned(Future[void]) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Sends an AUTH command to the server to login as the `username` using `password`. May fail with ReplyError. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L256)  
```
proc auth(smtp: Smtp; username, password: string) {...}{.
    raises: [SslError, OSError, TimeoutError, ReplyError],
    tags: [WriteIOEffect, ReadIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L256)  
```
proc sendMail(smtp: AsyncSmtp; fromAddr: string; toAddrs: seq[string];
              msg: string): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Sends `msg` from `fromAddr` to the addresses specified in `toAddrs`. Messages may be formed using `createMessage` by converting the Message into a string.

 You need to make sure that `fromAddr` and `toAddrs` don't contain any newline characters. Failing to do so will raise `AssertionDefect`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L270)  
```
proc sendMail(smtp: Smtp; fromAddr: string; toAddrs: seq[string]; msg: string) {...}{.
    raises: [SslError, OSError, TimeoutError, ReplyError],
    tags: [WriteIOEffect, ReadIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L271)  
```
proc close(smtp: AsyncSmtp): owned(Future[void]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Disconnects from the SMTP server and closes the socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L294)  
```
proc close(smtp: Smtp) {...}{.raises: [SslError, OSError, Exception, LibraryError],
                         tags: [WriteIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/smtp.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/smtp.nim#L294)   Exports
-------

  [Port](nativesockets#Port) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/smtp.html>

uri
===


This module implements URI parsing as specified by RFC 3986.

 A Uniform Resource Identifier (URI) provides a simple and extensible means for identifying a resource. A URI can be further classified as a locator, a name, or both. The term “Uniform Resource Locator” (URL) refers to the subset of URIs.

 Basic usage
-----------

 ### Combine URIs



```
import uri
let host = parseUri("https://nim-lang.org")
let blog = "/blog.html"
let bloguri = host / blog
assert $host == "https://nim-lang.org"
assert $bloguri == "https://nim-lang.org/blog.html"
```
 ### Access URI item



```
import uri
let res = parseUri("sftp://127.0.0.1:4343")
if isAbsolute(res):
  assert res.port == "4343"
else:
  echo "Wrong format"
```
 ### Data URI Base64



```
doAssert getDataUri("Hello World", "text/plain") == "data:text/plain;charset=utf-8;base64,SGVsbG8gV29ybGQ="
doAssert getDataUri("Nim", "text/plain") == "data:text/plain;charset=utf-8;base64,Tmlt"
```
 Imports
-------

  <since>, <strutils>, <parseutils>, <base64>  Types
-----

  
```
Url = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L54)  
```
Uri = object
  scheme*, username*, password*: string
  hostname*, port*, path*, query*, anchor*: string
  opaque*: bool
  isIpv6: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L56)   Procs
-----

  
```
proc getDataUri(data, mime: string; encoding = "utf-8"): string {...}{.raises: [],
    tags: [].}
```
  Convenience proc for `base64.encode` returns a standard Base64 Data URI (RFC-2397)

 **See also:**

 * <mimetypes> for `mime` argument
* <https://tools.ietf.org/html/rfc2397>
* <https://en.wikipedia.org/wiki/Data_URI_scheme>

 **Example:**

 
```
static: doAssert getDataUri("Nim", "text/plain") == "data:text/plain;charset=utf-8;base64,Tmlt"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L496)   Funcs
-----

  
```
func encodeUrl(s: string; usePlus = true): string {...}{.raises: [], tags: [].}
```
  Encodes a URL according to RFC3986.

 This means that characters in the set `{'a'..'z', 'A'..'Z', '0'..'9', '-', '.', '_', '~'}` are carried over to the result. All other characters are encoded as `%xx` where `xx` denotes its hexadecimal value.

 As a special rule, when the value of `usePlus` is true, spaces are encoded as `+` instead of `%20`.

 **See also:**

 * [decodeUrl func](#decodeUrl,string)

 **Example:**

 
```
assert encodeUrl("https://nim-lang.org") == "https%3A%2F%2Fnim-lang.org"
assert encodeUrl("https://nim-lang.org/this is a test") == "https%3A%2F%2Fnim-lang.org%2Fthis+is+a+test"
assert encodeUrl("https://nim-lang.org/this is a test", false) == "https%3A%2F%2Fnim-lang.org%2Fthis%20is%20a%20test"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L62)  
```
func decodeUrl(s: string; decodePlus = true): string {...}{.raises: [], tags: [].}
```
  Decodes a URL according to RFC3986.

 This means that any `%xx` (where `xx` denotes a hexadecimal value) are converted to the character with ordinal number `xx`, and every other character is carried over. If `xx` is not a valid hexadecimal value, it is left intact.

 As a special rule, when the value of `decodePlus` is true, `+` characters are converted to a space.

 **See also:**

 * [encodeUrl func](#encodeUrl,string)

 **Example:**

 
```
assert decodeUrl("https%3A%2F%2Fnim-lang.org") == "https://nim-lang.org"
assert decodeUrl("https%3A%2F%2Fnim-lang.org%2Fthis+is+a+test") == "https://nim-lang.org/this is a test"
assert decodeUrl("https%3A%2F%2Fnim-lang.org%2Fthis%20is%20a%20test",
    false) == "https://nim-lang.org/this is a test"
assert decodeUrl("abc%xyz") == "abc%xyz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L91)  
```
func encodeQuery(query: openArray[(string, string)]; usePlus = true;
                 omitEq = true): string {...}{.raises: [], tags: [].}
```
  Encodes a set of (key, value) parameters into a URL query string.

 Every (key, value) pair is URL-encoded and written as `key=value`. If the value is an empty string then the `=` is omitted, unless `omitEq` is false. The pairs are joined together by a `&` character.

 The `usePlus` parameter is passed down to the `encodeUrl` function that is used for the URL encoding of the string values.

 **See also:**

 * [encodeUrl func](#encodeUrl,string)

 **Example:**

 
```
assert encodeQuery({: }) == ""
assert encodeQuery({"a": "1", "b": "2"}) == "a=1&b=2"
assert encodeQuery({"a": "1", "b": ""}) == "a=1&b"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L128)  
```
func initUri(): Uri {...}{.raises: [], tags: [].}
```
  Initializes a URI with `scheme`, `username`, `password`, `hostname`, `port`, `path`, `query` and `anchor`.

 **See also:**

 * [Uri type](#Uri) for available fields in the URI type

 **Example:**

 
```
var uri2: Uri
assert initUri() == uri2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L202)  
```
func initUri(isIpv6: bool): Uri {...}{.raises: [], tags: [].}
```
  Initializes a URI with `scheme`, `username`, `password`, `hostname`, `port`, `path`, `query`, `anchor` and `isIpv6`.

 **See also:**

 * [Uri type](#Uri) for available fields in the URI type

 **Example:**

 
```
var uri2 = initUri(isIpv6 = true)
uri2.scheme = "tcp"
uri2.hostname = "2001:0db8:85a3:0000:0000:8a2e:0370:7334"
uri2.port = "8080"
assert $uri2 == "tcp://[2001:0db8:85a3:0000:0000:8a2e:0370:7334]:8080"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L214)  
```
func parseUri(uri: string; result: var Uri) {...}{.raises: [], tags: [].}
```
  Parses a URI. The `result` variable will be cleared before.

 **See also:**

 * [Uri type](#Uri) for available fields in the URI type
* [initUri func](#initUri) for initializing a URI

 **Example:**

 
```
var res = initUri()
parseUri("https://nim-lang.org/docs/manual.html", res)
assert res.scheme == "https"
assert res.hostname == "nim-lang.org"
assert res.path == "/docs/manual.html"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L236)  
```
func parseUri(uri: string): Uri {...}{.raises: [], tags: [].}
```
  Parses a URI and returns it.

 **See also:**

 * [Uri type](#Uri) for available fields in the URI type

 **Example:**

 
```
let res = parseUri("ftp://Username:Password@Hostname")
assert res.username == "Username"
assert res.password == "Password"
assert res.scheme == "ftp"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L284)  
```
func combine(base: Uri; reference: Uri): Uri {...}{.raises: [], tags: [].}
```
  Combines a base URI with a reference URI.

 This uses the algorithm specified in [section 5.2.2 of RFC 3986](http://tools.ietf.org/html/rfc3986#section-5.2.2).

 This means that the slashes inside the base URIs path as well as reference URIs path affect the resulting URI.

 **See also:**

 * [/ func](#/,Uri,string) for building URIs

 **Example:**

 
```
let foo = combine(parseUri("https://nim-lang.org/foo/bar"), parseUri("/baz"))
assert foo.path == "/baz"
let bar = combine(parseUri("https://nim-lang.org/foo/bar"), parseUri("baz"))
assert bar.path == "/foo/baz"
let qux = combine(parseUri("https://nim-lang.org/foo/bar/"), parseUri("baz"))
assert qux.path == "/foo/bar/baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L338)  
```
func combine(uris: varargs[Uri]): Uri {...}{.raises: [], tags: [].}
```
  Combines multiple URIs together.

 **See also:**

 * [/ func](#/,Uri,string) for building URIs

 **Example:**

 
```
let foo = combine(parseUri("https://nim-lang.org/"), parseUri("docs/"),
    parseUri("manual.html"))
assert foo.hostname == "nim-lang.org"
assert foo.path == "/docs/manual.html"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L389)  
```
func isAbsolute(uri: Uri): bool {...}{.raises: [], tags: [].}
```
  Returns true if URI is absolute, false otherwise. **Example:**

 
```
let foo = parseUri("https://nim-lang.org")
assert isAbsolute(foo) == true
let bar = parseUri("nim-lang")
assert isAbsolute(bar) == false
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L403)  
```
func `/`(x: Uri; path: string): Uri {...}{.raises: [], tags: [].}
```
  Concatenates the path specified to the specified URIs path.

 Contrary to the [combine func](#combine,Uri,Uri) you do not have to worry about the slashes at the beginning and end of the path and URIs path respectively.

 **See also:**

 * [combine func](#combine,Uri,Uri)

 **Example:**

 
```
let foo = parseUri("https://nim-lang.org/foo/bar") / "/baz"
assert foo.path == "/foo/bar/baz"
let bar = parseUri("https://nim-lang.org/foo/bar") / "baz"
assert bar.path == "/foo/bar/baz"
let qux = parseUri("https://nim-lang.org/foo/bar/") / "baz"
assert qux.path == "/foo/bar/baz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L412)  
```
func `?`(u: Uri; query: openArray[(string, string)]): Uri {...}{.raises: [], tags: [].}
```
  Concatenates the query parameters to the specified URI object. **Example:**

 
```
let foo = parseUri("https://example.com") / "foo" ? {"bar": "qux"}
assert $foo == "https://example.com/foo?bar=qux"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L446)  
```
func `$`(u: Uri): string {...}{.raises: [], tags: [].}
```
  Returns the string representation of the specified URI object. **Example:**

 
```
let foo = parseUri("https://nim-lang.org")
assert $foo == "https://nim-lang.org"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/uri.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/uri.nim#L454)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/uri.html>

threadpool
==========


Implements Nim's [spawn](manual_experimental#parallel-amp-spawn).

 **See also:**

 * [threads module](threads)
* [channels module](channels)
* [locks module](locks)
* [asyncdispatch module](asyncdispatch)

 Unstable API.

 Imports
-------

  <cpuinfo>, <cpuload>, <locks>, <os>  Types
-----

  
```
FlowVarBase = ref FlowVarBaseObj
```
  Untyped base class for `FlowVar[T]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L104)  
```
FlowVar[T] {...}{.compilerProc.} = ref FlowVarObj[T]
```
  A data flow variable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L117)  
```
ThreadId = range[0 .. MaxDistinguishedThread - 1]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L318)   Consts
------

  
```
MaxThreadPoolSize = 256
```
  Maximum size of the thread pool. 256 threads should be good enough for anybody ;-) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L313)  
```
MaxDistinguishedThread = 32
```
  Maximum number of "distinguished" threads. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L315)   Procs
-----

  
```
proc blockUntil(fv: var FlowVarBaseObj) {...}{.raises: [], tags: [].}
```
  Waits until the value for the `fv` arrives.

 Usually it is not necessary to call this explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L140)  
```
proc awaitAndThen[T](fv: FlowVar[T]; action: proc (x: T) {...}{.closure.})
```
  Blocks until the `fv` is available and then passes its value to `action`.

 Note that due to Nim's parameter passing semantics this means that `T` doesn't need to be copied so `awaitAndThen` can sometimes be more efficient than [^ proc](#%5E,FlowVar%5BT%5D).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L232)  
```
proc unsafeRead[T](fv: FlowVar[ref T]): ptr T
```
  Blocks until the value is available and then returns this value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L250)  
```
proc `^`[T](fv: FlowVar[T]): T
```
  Blocks until the value is available and then returns this value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L259)  
```
proc blockUntilAny(flowVars: openArray[FlowVarBase]): int {...}{.raises: [], tags: [].}
```
  Awaits any of the given `flowVars`. Returns the index of one `flowVar` for which a value arrived.

 A `flowVar` only supports one call to `blockUntilAny` at the same time. That means if you `blockUntilAny([a,b])` and `blockUntilAny([b,c])` the second call will only block until `c`. If there is no `flowVar` left to be able to wait on, -1 is returned.

 **Note**: This results in non-deterministic behaviour and should be avoided.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L268)  
```
proc isReady(fv: FlowVarBase): bool {...}{.raises: [], tags: [].}
```
  Determines whether the specified `FlowVarBase`'s value is available.

 If `true`, awaiting `fv` will not block.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L297)  
```
proc setMinPoolSize(size: range[1 .. MaxThreadPoolSize]) {...}{.raises: [], tags: [].}
```
  Sets the minimum thread pool size. The default value of this is 4. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L399)  
```
proc setMaxPoolSize(size: range[1 .. MaxThreadPoolSize]) {...}{.raises: [], tags: [].}
```
  Sets the maximum thread pool size. The default value of this is `MaxThreadPoolSize` (256). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L403)  
```
proc preferSpawn(): bool {...}{.raises: [], tags: [].}
```
  Use this proc to determine quickly if a `spawn` or a direct call is preferable.

 If it returns `true`, a `spawn` may make sense. In general it is not necessary to call this directly; use [spawnX template](#spawnX.t) instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L444)  
```
proc spawn(call: sink typed): void {...}{.magic: "Spawn".}
```
  Always spawns a new task, so that the `call` is never executed on the calling thread.

 `call` has to be proc call `p(...)` where `p` is gcsafe and has a return type that is either `void` or compatible with `FlowVar[T]`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L453)  
```
proc pinnedSpawn(id: ThreadId; call: sink typed): void {...}{.magic: "Spawn".}
```
  Always spawns a new task on the worker thread with `id`, so that the `call` is **always** executed on the thread.

 `call` has to be proc call `p(...)` where `p` is gcsafe and has a return type that is either `void` or compatible with `FlowVar[T]`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L460)  
```
proc parallel(body: untyped) {...}{.magic: "Parallel".}
```
  A parallel section can be used to execute a block in parallel.

 `body` has to be in a DSL that is a particular subset of the language.

 Please refer to [the manual](manual_experimental#parallel-amp-spawn) for further information.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L478)  
```
proc sync() {...}{.raises: [], tags: [TimeEffect].}
```
  A simple barrier to wait for all `spawn`'ed tasks.

 If you need more elaborate waiting, you have to use an explicit barrier.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L587) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L587)   Templates
---------

  
```
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 not block the producer for an unknown amount of time.

 `call` has to be proc call `p(...)` where `p` is gcsafe and has a return type that is either 'void' or compatible with `FlowVar[T]`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/threadpool.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/threadpool.nim#L467)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/threadpool.html>

Nim Experimental Features
=========================

 About this document
-------------------


This document describes features of Nim that are to be considered experimental. Some of these are not covered by the `.experimental` pragma or `--experimental` switch because they are already behind a special syntax and one may want to use Nim libraries using these features without using them oneself.

 **Note**: Unless otherwise indicated, these features are not to be removed, but refined and overhauled.

 Package level objects
---------------------


Every Nim module resides in a (nimble) package. An object type can be attached to the package it resides in. If that is done, the type can be referenced from other modules as an incomplete object type. This feature allows to break up recursive type dependencies across module boundaries. Incomplete object types are always passed `byref` and can only be used in pointer like contexts (`var/ref/ptr IncompleteObject`) in general since the compiler does not yet know the size of the object. To complete an incomplete object the `package` pragma has to be used. `package` implies `byref`.

 As long as a type `T` is incomplete, neither `sizeof(T)` nor runtime type information for `T` is available.

 Example:

 
```
# module A (in an arbitrary package)
type
  Pack.SomeObject = object ## declare as incomplete object of package 'Pack'
  Triple = object
    a, b, c: ref SomeObject ## pointers to incomplete objects are allowed

## Incomplete objects can be used as parameters:
proc myproc(x: SomeObject) = discard
```


```
# module B (in package "Pack")
type
  SomeObject* {.package.} = object ## Use 'package' to complete the object
    s, t: string
    x, y: int
```
 Void type
---------


The `void` type denotes the absence of any type. Parameters of type `void` are treated as non-existent, `void` as a return type means that the procedure does not return a value:

 
```
proc nothing(x, y: void): void =
  echo "ha"

nothing() # writes "ha" to stdout
```

The `void` type is particularly useful for generic code:

 
```
proc callProc[T](p: proc (x: T), x: T) =
  when T is void:
    p()
  else:
    p(x)

proc intProc(x: int) = discard
proc emptyProc() = discard

callProc[int](intProc, 12)
callProc[void](emptyProc)
```

However, a `void` type cannot be inferred in generic code:

 
```
callProc(emptyProc)
# Error: type mismatch: got (proc ())
# but expected one of:
# callProc(p: proc (T), x: T)
```

The `void` type is only valid for parameters and return types; other symbols cannot have the type `void`.

 Covariance
----------


Covariance in Nim can be introduced only through pointer-like types such as `ptr` and `ref`. Sequence, Array and OpenArray types, instantiated with pointer-like types will be considered covariant if and only if they are also immutable. The introduction of a `var` modifier or additional `ptr` or `ref` indirections would result in invariant treatment of these types.

 `proc` types are currently always invariant, but future versions of Nim may relax this rule.

 User-defined generic types may also be covariant with respect to some of their parameters. By default, all generic params are considered invariant, but you may choose the apply the prefix modifier `in` to a parameter to make it contravariant or `out` to make it covariant:

 
```
type
  AnnotatedPtr[out T] =
    metadata: MyTypeInfo
    p: ref T
  
  RingBuffer[out T] =
    startPos: int
    data: seq[T]
  
  Action {.importcpp: "std::function<void ('0)>".} [in T] = object
```

When the designated generic parameter is used to instantiate a pointer-like type as in the case of `AnnotatedPtr` above, the resulting generic type will also have pointer-like covariance:

 
```
type
  GuiWidget = object of RootObj
  Button = object of GuiWidget
  ComboBox = object of GuiWidget

var
  widgetPtr: AnnotatedPtr[GuiWidget]
  buttonPtr: AnnotatedPtr[Button]

...

proc drawWidget[T](x: AnnotatedPtr[GuiWidget]) = ...

# you can call procs expecting base types by supplying a derived type
drawWidget(buttonPtr)

# and you can convert more-specific pointer types to more general ones
widgetPtr = buttonPtr
```

Just like with regular pointers, covariance will be enabled only for immutable values:

 
```
proc makeComboBox[T](x: var AnnotatedPtr[GuiWidget]) =
  x.p = new(ComboBox)

makeComboBox(buttonPtr) # Error, AnnotatedPtr[Button] cannot be modified
                        # to point to a ComboBox
```

On the other hand, in the `RingBuffer` example above, the designated generic param is used to instantiate the non-pointer `seq` type, which means that the resulting generic type will have covariance that mimics an array or sequence (i.e. it will be covariant only when instantiated with `ptr` and `ref` types):

 
```
type
  Base = object of RootObj
  Derived = object of Base

proc consumeBaseValues(b: RingBuffer[Base]) = ...

var derivedValues: RingBuffer[Derived]

consumeBaseValues(derivedValues) # Error, Base and Derived values may differ
                                 # in size

proc consumeBasePointers(b: RingBuffer[ptr Base]) = ...

var derivedPointers: RingBuffer[ptr Derived]

consumeBaseValues(derivedPointers) # This is legal
```

Please note that Nim will treat the user-defined pointer-like types as proper alternatives to the built-in pointer types. That is, types such as `seq[AnnotatedPtr[T]]` or `RingBuffer[AnnotatedPtr[T]]` will also be considered covariant and you can create new pointer-like types by instantiating other user-defined pointer-like types.

 The contravariant parameters introduced with the `in` modifier are currently useful only when interfacing with imported types having such semantics.

 Automatic dereferencing
-----------------------


Automatic dereferencing is performed for the first argument of a routine call. This feature has to be only enabled via `{.experimental: "implicitDeref".}`:

 
```
{.experimental: "implicitDeref".}

proc depth(x: NodeObj): int = ...

var
  n: Node
new(n)
echo n.depth
# no need to write n[].depth either
```
 Code reordering
---------------


The code reordering feature can implicitly rearrange procedure, template, and macro definitions along with variable declarations and initializations at the top level scope so that, to a large extent, a programmer should not have to worry about ordering definitions correctly or be forced to use forward declarations to preface definitions inside a module.

 Example:

 
```
{.experimental: "codeReordering".}

proc foo(x: int) =
  bar(x)

proc bar(x: int) =
  echo(x)

foo(10)
```

Variables can also be reordered as well. Variables that are *initialized* (i.e. variables that have their declaration and assignment combined in a single statement) can have their entire initialization statement reordered. Be wary of what code is executed at the top level:

 
```
{.experimental: "codeReordering".}

proc a() =
  echo(foo)

var foo = 5

a() # outputs: "5"
```

It is important to note that reordering *only* works for symbols at top level scope. Therefore, the following will *fail to compile:*

 
```
{.experimental: "codeReordering".}

proc a() =
  b()
  proc b() =
    echo("Hello!")

a()
```
 Named argument overloading
--------------------------


Routines with the same type signature can be called differently if a parameter has different names. This does not need an `experimental` switch, but is an unstable feature.

 
```
proc foo(x: int) =
  echo "Using x: ", x
proc foo(y: int) =
  echo "Using y: ", y

foo(x = 2)
# Using x: 2
foo(y = 2)
# Using y: 2
```
 Do notation
-----------


As a special more convenient notation, proc expressions involved in procedure calls can use the `do` keyword:

 
```
sort(cities) do (x,y: string) -> int:
  cmp(x.len, y.len)

# Less parenthesis using the method plus command syntax:
cities = cities.map do (x:string) -> string:
  "City of " & x

# In macros, the do notation is often used for quasi-quoting
macroResults.add quote do:
  if not `ex`:
    echo `info`, ": Check failed: ", `expString`
```

`do` is written after the parentheses enclosing the regular proc params. The proc expression represented by the do block is appended to them. In calls using the command syntax, the do block will bind to the immediately preceding expression, transforming it in a call.

 `do` with parentheses is an anonymous `proc`; however a `do` without parentheses is just a block of code. The `do` notation can be used to pass multiple blocks to a macro:

 
```
macro performWithUndo(task, undo: untyped) = ...

performWithUndo do:
  # multiple-line block of code
  # to perform the task
do:
  # code to undo it
```
 Special Operators
-----------------

 ### dot operators


**Note**: Dot operators are still experimental and so need to be enabled via `{.experimental: "dotOperators".}`.

 Nim offers a special family of dot operators that can be used to intercept and rewrite proc call and field access attempts, referring to previously undeclared symbol names. They can be used to provide a fluent interface to objects lying outside the static confines of the type system such as values from dynamic scripting languages or dynamic file formats such as JSON or XML.

 When Nim encounters an expression that cannot be resolved by the standard overload resolution rules, the current scope will be searched for a dot operator that can be matched against a re-written form of the expression, where the unknown field or proc name is passed to an `untyped` parameter:

 
```
a.b # becomes `.`(a, b)
a.b(c, d) # becomes `.`(a, b, c, d)
```

The matched dot operators can be symbols of any callable kind (procs, templates and macros), depending on the desired effect:

 
```
template `.` (js: PJsonNode, field: untyped): JSON = js[astToStr(field)]

var js = parseJson("{ x: 1, y: 2}")
echo js.x # outputs 1
echo js.y # outputs 2
```

The following dot operators are available:

 ### operator `.`


This operator will be matched against both field accesses and method calls.

 ### operator `.()`


This operator will be matched exclusively against method calls. It has higher precedence than the `.` operator and this allows one to handle expressions like `x.y` and `x.y()` differently if one is interfacing with a scripting language for example.

 ### operator `.=`


This operator will be matched against assignments to missing fields.

 
```
a.b = c # becomes `.=`(a, b, c)
```
 Not nil annotation
------------------


**Note:** This is an experimental feature. It can be enabled with `{.experimental: "notnil"}`.

 All types for which `nil` is a valid value can be annotated with the `not nil` annotation to exclude `nil` as a valid value:

 
```
{.experimental: "notnil"}

type
  PObject = ref TObj not nil
  TProc = (proc (x, y: int)) not nil

proc p(x: PObject) =
  echo "not nil"

# compiler catches this:
p(nil)

# and also this:
var x: PObject
p(x)
```

The compiler ensures that every code path initializes variables which contain non-nilable pointers. The details of this analysis are still to be specified here.

 Concepts
--------


Concepts, also known as "user-defined type classes", are used to specify an arbitrary set of requirements that the matched type must satisfy.

 Concepts are written in the following form:

 
```
type
  Comparable = concept x, y
    (x < y) is bool
  
  Stack[T] = concept s, var v
    s.pop() is T
    v.push(T)
    
    s.len is Ordinal
    
    for value in s:
      value is T
```

The concept is a match if:

 1. all of the expressions within the body can be compiled for the tested type
2. all statically evaluable boolean expressions in the body must be true

 The identifiers following the `concept` keyword represent instances of the currently matched type. You can apply any of the standard type modifiers such as `var`, `ref`, `ptr` and `static` to denote a more specific type of instance. You can also apply the `type` modifier to create a named instance of the type itself:

 
```
type
  MyConcept = concept x, var v, ref r, ptr p, static s, type T
    ...
```

Within the concept body, types can appear in positions where ordinary values and parameters are expected. This provides a more convenient way to check for the presence of callable symbols with specific signatures:

 
```
type
  OutputStream = concept var s
    s.write(string)
```

In order to check for symbols accepting `type` params, you must prefix the type with the explicit `type` modifier. The named instance of the type, following the `concept` keyword is also considered to have the explicit modifier and will be matched only as a type.

 
```
type
  # Let's imagine a user-defined casting framework with operators
  # such as `val.to(string)` and `val.to(JSonValue)`. We can test
  # for these with the following concept:
  MyCastables = concept x
    x.to(type string)
    x.to(type JSonValue)
  
  # Let's define a couple of concepts, known from Algebra:
  AdditiveMonoid* = concept x, y, type T
    x + y is T
    T.zero is T # require a proc such as `int.zero` or 'Position.zero'
  
  AdditiveGroup* = concept x, y, type T
    x is AdditiveMonoid
    -x is T
    x - y is T
```

Please note that the `is` operator allows one to easily verify the precise type signatures of the required operations, but since type inference and default parameters are still applied in the concept body, it's also possible to describe usage protocols that do not reveal implementation details.

 Much like generics, concepts are instantiated exactly once for each tested type and any static code included within the body is executed only once.

 ### Concept diagnostics


By default, the compiler will report the matching errors in concepts only when no other overload can be selected and a normal compilation error is produced. When you need to understand why the compiler is not matching a particular concept and, as a result, a wrong overload is selected, you can apply the `explain` pragma to either the concept body or a particular call-site.

 
```
type
  MyConcept {.explain.} = concept ...

overloadedProc(x, y, z) {.explain.}
```

This will provide Hints in the compiler output either every time the concept is not matched or only on the particular call-site.

 ### Generic concepts and type binding rules


The concept types can be parametric just like the regular generic types:

 
```
### matrixalgo.nim

import typetraits

type
  AnyMatrix*[R, C: static int; T] = concept m, var mvar, type M
    M.ValueType is T
    M.Rows == R
    M.Cols == C
    
    m[int, int] is T
    mvar[int, int] = T
    
    type TransposedType = stripGenericParams(M)[C, R, T]
  
  AnySquareMatrix*[N: static int, T] = AnyMatrix[N, N, T]
  
  AnyTransform3D* = AnyMatrix[4, 4, float]

proc transposed*(m: AnyMatrix): m.TransposedType =
  for r in 0 ..< m.R:
    for c in 0 ..< m.C:
      result[r, c] = m[c, r]

proc determinant*(m: AnySquareMatrix): int =
  ...

proc setPerspectiveProjection*(m: AnyTransform3D) =
  ...

--------------
### matrix.nim

type
  Matrix*[M, N: static int; T] = object
    data: array[M*N, T]

proc `[]`*(M: Matrix; m, n: int): M.T =
  M.data[m * M.N + n]

proc `[]=`*(M: var Matrix; m, n: int; v: M.T) =
  M.data[m * M.N + n] = v

# Adapt the Matrix type to the concept's requirements
template Rows*(M: typedesc[Matrix]): int = M.M
template Cols*(M: typedesc[Matrix]): int = M.N
template ValueType*(M: typedesc[Matrix]): typedesc = M.T

-------------
### usage.nim

import matrix, matrixalgo

var
  m: Matrix[3, 3, int]
  projectionMatrix: Matrix[4, 4, float]

echo m.transposed.determinant
setPerspectiveProjection projectionMatrix
```

When the concept type is matched against a concrete type, the unbound type parameters are inferred from the body of the concept in a way that closely resembles the way generic parameters of callable symbols are inferred on call sites.

 Unbound types can appear both as params to calls such as `s.push(T)` and on the right-hand side of the `is` operator in cases such as `x.pop is T` and `x.data is seq[T]`.

 Unbound static params will be inferred from expressions involving the `==` operator and also when types dependent on them are being matched:

 
```
type
  MatrixReducer[M, N: static int; T] = concept x
    x.reduce(SquareMatrix[N, T]) is array[M, int]
```

The Nim compiler includes a simple linear equation solver, allowing it to infer static params in some situations where integer arithmetic is involved.

 Just like in regular type classes, Nim discriminates between `bind once` and `bind many` types when matching the concept. You can add the `distinct` modifier to any of the otherwise inferable types to get a type that will be matched without permanently inferring it. This may be useful when you need to match several procs accepting the same wide class of types:

 
```
type
  Enumerable[T] = concept e
    for v in e:
      v is T

type
  MyConcept = concept o
    # this could be inferred to a type such as Enumerable[int]
    o.foo is distinct Enumerable
    
    # this could be inferred to a different type such as Enumerable[float]
    o.bar is distinct Enumerable
    
    # it's also possible to give an alias name to a `bind many` type class
    type Enum = distinct Enumerable
    o.baz is Enum
```

On the other hand, using `bind once` types allows you to test for equivalent types used in multiple signatures, without actually requiring any concrete types, thus allowing you to encode implementation-defined types:

 
```
type
  MyConcept = concept x
    type T1 = auto
    x.foo(T1)
    x.bar(T1) # both procs must accept the same type
    
    type T2 = seq[SomeNumber]
    x.alpha(T2)
    x.omega(T2) # both procs must accept the same type
                # and it must be a numeric sequence
```

As seen in the previous examples, you can refer to generic concepts such as `Enumerable[T]` just by their short name. Much like the regular generic types, the concept will be automatically instantiated with the bind once auto type in the place of each missing generic param.

 Please note that generic concepts such as `Enumerable[T]` can be matched against concrete types such as `string`. Nim doesn't require the concept type to have the same number of parameters as the type being matched. If you wish to express a requirement towards the generic parameters of the matched type, you can use a type mapping operator such as `genericHead` or `stripGenericParams` within the body of the concept to obtain the uninstantiated version of the type, which you can then try to instantiate in any required way. For example, here is how one might define the classic `Functor` concept from Haskell and then demonstrate that Nim's `Option[T]` type is an instance of it:

 
```
import sugar, typetraits

type
  Functor[A] = concept f
    type MatchedGenericType = genericHead(typeof(f))
      # `f` will be a value of a type such as `Option[T]`
      # `MatchedGenericType` will become the `Option` type
    
    f.val is A
      # The Functor should provide a way to obtain
      # a value stored inside it
    
    type T = auto
    map(f, A -> T) is MatchedGenericType[T]
      # And it should provide a way to map one instance of
      # the Functor to a instance of a different type, given
      # a suitable `map` operation for the enclosed values

import options
echo Option[int] is Functor # prints true
```
 ### Concept derived values


All top level constants or types appearing within the concept body are accessible through the dot operator in procs where the concept was successfully matched to a concrete type:

 
```
type
  DateTime = concept t1, t2, type T
    const Min = T.MinDate
    T.Now is T
    
    t1 < t2 is bool
    
    type TimeSpan = typeof(t1 - t2)
    TimeSpan * int is TimeSpan
    TimeSpan + TimeSpan is TimeSpan
    
    t1 + TimeSpan is T

proc eventsJitter(events: Enumerable[DateTime]): float =
  var
    # this variable will have the inferred TimeSpan type for
    # the concrete Date-like value the proc was called with:
    averageInterval: DateTime.TimeSpan
    
    deviation: float
  ...
```
 ### Concept refinement


When the matched type within a concept is directly tested against a different concept, we say that the outer concept is a refinement of the inner concept and thus it is more-specific. When both concepts are matched in a call during overload resolution, Nim will assign a higher precedence to the most specific one. As an alternative way of defining concept refinements, you can use the object inheritance syntax involving the `of` keyword:

 
```
type
  Graph = concept g, type G of EquallyComparable, Copyable
    type
      VertexType = G.VertexType
      EdgeType = G.EdgeType
    
    VertexType is Copyable
    EdgeType is Copyable
    
    var
      v: VertexType
      e: EdgeType
  
  IncidendeGraph = concept of Graph
    # symbols such as variables and types from the refined
    # concept are automatically in scope:
    
    g.source(e) is VertexType
    g.target(e) is VertexType
    
    g.outgoingEdges(v) is Enumerable[EdgeType]
  
  BidirectionalGraph = concept g, type G
    # The following will also turn the concept into a refinement when it
    # comes to overload resolution, but it doesn't provide the convenient
    # symbol inheritance
    g is IncidendeGraph
    
    g.incomingEdges(G.VertexType) is Enumerable[G.EdgeType]

proc f(g: IncidendeGraph)
proc f(g: BidirectionalGraph) # this one will be preferred if we pass a type
                              # matching the BidirectionalGraph concept
```
 Type bound operations
---------------------


There are 4 operations that are bound to a type:

 1. Assignment
2. Moves
3. Destruction
4. Deep copying for communication between threads

 These operations can be *overridden* instead of *overloaded*. This means the implementation is automatically lifted to structured types. For instance if type `T` has an overridden assignment operator `=` this operator is also used for assignments of the type `seq[T]`. Since these operations are bound to a type they have to be bound to a nominal type for reasons of simplicity of implementation: This means an overridden `deepCopy` for `ref T` is really bound to `T` and not to `ref T`. This also means that one cannot override `deepCopy` for both `ptr T` and `ref T` at the same time; instead a helper distinct or object type has to be used for one pointer type.

 Assignments, moves and destruction are specified in the <destructors> document.

 ### deepCopy


`=deepCopy` is a builtin that is invoked whenever data is passed to a `spawn`'ed proc to ensure memory safety. The programmer can override its behaviour for a specific `ref` or `ptr` type `T`. (Later versions of the language may weaken this restriction.)

 The signature has to be:

 
```
proc `=deepCopy`(x: T): T
```

This mechanism will be used by most data structures that support shared memory like channels to implement thread safe automatic memory management.

 The builtin `deepCopy` can even clone closures and their environments. See the documentation of [spawn](#parallel-amp-spawn-spawn-statement) for details.

 Case statement macros
---------------------


A macro that needs to be called match can be used to rewrite `case` statements in order to implement pattern matching for certain types. The following example implements a simplistic form of pattern matching for tuples, leveraging the existing equality operator for tuples (as provided in `system.==`):

 
```
{.experimental: "caseStmtMacros".}

import macros

macro match(n: tuple): untyped =
  result = newTree(nnkIfStmt)
  let selector = n[0]
  for i in 1 ..< n.len:
    let it = n[i]
    case it.kind
    of nnkElse, nnkElifBranch, nnkElifExpr, nnkElseExpr:
      result.add it
    of nnkOfBranch:
      for j in 0..it.len-2:
        let cond = newCall("==", selector, it[j])
        result.add newTree(nnkElifBranch, cond, it[^1])
    else:
      error "'match' cannot handle this node", it
  echo repr result

case ("foo", 78)
of ("foo", 78): echo "yes"
of ("bar", 88): echo "no"
else: discard
```

Currently case statement macros must be enabled explicitly via `{.experimental: "caseStmtMacros".}`.

 `match` macros are subject to overload resolution. First the `case`'s selector expression is used to determine which `match` macro to call. To this macro is then passed the complete `case` statement body and the macro is evaluated.

 In other words, the macro needs to transform the full `case` statement but only the statement's selector expression is used to determine which macro to call.

 Term rewriting macros
---------------------


Term rewriting macros are macros or templates that have not only a *name* but also a *pattern* that is searched for after the semantic checking phase of the compiler: This means they provide an easy way to enhance the compilation pipeline with user defined optimizations:

 
```
template optMul{`*`(a, 2)}(a: int): int = a+a

let x = 3
echo x * 2
```

The compiler now rewrites `x * 2` as `x + x`. The code inside the curlies is the pattern to match against. The operators `*`, `**`, `|`, `~` have a special meaning in patterns if they are written in infix notation, so to match verbatim against `*` the ordinary function call syntax needs to be used.

 Term rewriting macro are applied recursively, up to a limit. This means that if the result of a term rewriting macro is eligible for another rewriting, the compiler will try to perform it, and so on, until no more optimizations are applicable. To avoid putting the compiler into an infinite loop, there is a hard limit on how many times a single term rewriting macro can be applied. Once this limit has been passed, the term rewriting macro will be ignored.

 Unfortunately optimizations are hard to get right and even the tiny example is **wrong**:

 
```
template optMul{`*`(a, 2)}(a: int): int = a+a

proc f(): int =
  echo "side effect!"
  result = 55

echo f() * 2
```

We cannot duplicate 'a' if it denotes an expression that has a side effect! Fortunately Nim supports side effect analysis:

 
```
template optMul{`*`(a, 2)}(a: int{noSideEffect}): int = a+a

proc f(): int =
  echo "side effect!"
  result = 55

echo f() * 2 # not optimized ;-)
```

You can make one overload matching with a constraint and one without, and the one with a constraint will have precedence, and so you can handle both cases differently.

 So what about `2 * a`? We should tell the compiler `*` is commutative. We cannot really do that however as the following code only swaps arguments blindly:

 
```
template mulIsCommutative{`*`(a, b)}(a, b: int): int = b*a
```

What optimizers really need to do is a *canonicalization*:

 
```
template canonMul{`*`(a, b)}(a: int{lit}, b: int): int = b*a
```

The `int{lit}` parameter pattern matches against an expression of type `int`, but only if it's a literal.

 ### Parameter constraints


The parameter constraint expression can use the operators `|` (or), `&` (and) and `~` (not) and the following predicates:

 

| Predicate | Meaning |
| --- | --- |
| `atom` | The matching node has no children. |
| `lit` | The matching node is a literal like "abc", 12. |
| `sym` | The matching node must be a symbol (a bound identifier). |
| `ident` | The matching node must be an identifier (an unbound identifier). |
| `call` | The matching AST must be a call/apply expression. |
| `lvalue` | The matching AST must be an lvalue. |
| `sideeffect` | The matching AST must have a side effect. |
| `nosideeffect` | The matching AST must have no side effect. |
| `param` | A symbol which is a parameter. |
| `genericparam` | A symbol which is a generic parameter. |
| `module` | A symbol which is a module. |
| `type` | A symbol which is a type. |
| `var` | A symbol which is a variable. |
| `let` | A symbol which is a `let` variable. |
| `const` | A symbol which is a constant. |
| `result` | The special `result` variable. |
| `proc` | A symbol which is a proc. |
| `method` | A symbol which is a method. |
| `iterator` | A symbol which is an iterator. |
| `converter` | A symbol which is a converter. |
| `macro` | A symbol which is a macro. |
| `template` | A symbol which is a template. |
| `field` | A symbol which is a field in a tuple or an object. |
| `enumfield` | A symbol which is a field in an enumeration. |
| `forvar` | A for loop variable. |
| `label` | A label (used in `block` statements). |
| `nk*` | The matching AST must have the specified kind. (Example: `nkIfStmt` denotes an `if` statement.) |
| `alias` | States that the marked parameter needs to alias with *some* other parameter. |
| `noalias` | States that *every* other parameter must not alias with the marked parameter. |


Predicates that share their name with a keyword have to be escaped with backticks. The `alias` and `noalias` predicates refer not only to the matching AST, but also to every other bound parameter; syntactically they need to occur after the ordinary AST predicates:

 
```
template ex{a = b + c}(a: int{noalias}, b, c: int) =
  # this transformation is only valid if 'b' and 'c' do not alias 'a':
  a = b
  inc a, c
```
 ### Pattern operators


The operators `*`, `**`, `|`, `~` have a special meaning in patterns if they are written in infix notation.

 #### The `|` operator


The `|` operator if used as infix operator creates an ordered choice:

 
```
template t{0|1}(): untyped = 3
let a = 1
# outputs 3:
echo a
```

The matching is performed after the compiler performed some optimizations like constant folding, so the following does not work:

 
```
template t{0|1}(): untyped = 3
# outputs 1:
echo 1
```

The reason is that the compiler already transformed the 1 into "1" for the `echo` statement. However, a term rewriting macro should not change the semantics anyway. In fact they can be deactivated with the `--patterns:off` command line option or temporarily with the `patterns` pragma.

 #### The `{}` operator


A pattern expression can be bound to a pattern parameter via the `expr{param}` notation:

 
```
template t{(0|1|2){x}}(x: untyped): untyped = x+1
let a = 1
# outputs 2:
echo a
```
 #### The `~` operator


The `~` operator is the **not** operator in patterns:

 
```
template t{x = (~x){y} and (~x){z}}(x, y, z: bool) =
  x = y
  if x: x = z

var
  a = false
  b = true
  c = false
a = b and c
echo a
```
 #### The `*` operator


The `*` operator can *flatten* a nested binary expression like `a & b & c` to `&(a, b, c)`:

 
```
var
  calls = 0

proc `&&`(s: varargs[string]): string =
  result = s[0]
  for i in 1..len(s)-1: result.add s[i]
  inc calls

template optConc{ `&&` * a }(a: string): untyped = &&a

let space = " "
echo "my" && (space & "awe" && "some " ) && "concat"

# check that it's been optimized properly:
doAssert calls == 1
```

The second operator of `*` must be a parameter; it is used to gather all the arguments. The expression `"my" && (space & "awe" && "some " ) && "concat"` is passed to `optConc` in `a` as a special list (of kind `nkArgList`) which is flattened into a call expression; thus the invocation of `optConc` produces:

 
```
`&&`("my", space & "awe", "some ", "concat")
```
 #### The `**` operator


The `**` is much like the `*` operator, except that it gathers not only all the arguments, but also the matched operators in reverse polish notation:

 
```
import macros

type
  Matrix = object
    dummy: int

proc `*`(a, b: Matrix): Matrix = discard
proc `+`(a, b: Matrix): Matrix = discard
proc `-`(a, b: Matrix): Matrix = discard
proc `$`(a: Matrix): string = result = $a.dummy
proc mat21(): Matrix =
  result.dummy = 21

macro optM{ (`+`|`-`|`*`) ** a }(a: Matrix): untyped =
  echo treeRepr(a)
  result = newCall(bindSym"mat21")

var x, y, z: Matrix

echo x + y * z - x
```

This passes the expression `x + y * z - x` to the `optM` macro as an `nnkArgList` node containing:



```
Arglist
  Sym "x"
  Sym "y"
  Sym "z"
  Sym "*"
  Sym "+"
  Sym "x"
  Sym "-"
```
 (Which is the reverse polish notation of `x + y * z - x`.)

 ### Parameters


Parameters in a pattern are type checked in the matching process. If a parameter is of the type `varargs` it is treated specially and it can match 0 or more arguments in the AST to be matched against:

 
```
template optWrite{
  write(f, x)
  ((write|writeLine){w})(f, y)
}(x, y: varargs[untyped], f: File, w: untyped) =
  w(f, x, y)
```
 ### Example: Partial evaluation


The following example shows how some simple partial evaluation can be implemented with term rewriting:

 
```
proc p(x, y: int; cond: bool): int =
  result = if cond: x + y else: x - y

template optP1{p(x, y, true)}(x, y: untyped): untyped = x + y
template optP2{p(x, y, false)}(x, y: untyped): untyped = x - y
```
 ### Example: Hoisting


The following example shows how some form of hoisting can be implemented:

 
```
import pegs

template optPeg{peg(pattern)}(pattern: string{lit}): Peg =
  var gl {.global, gensym.} = peg(pattern)
  gl

for i in 0 .. 3:
  echo match("(a b c)", peg"'(' @ ')'")
  echo match("W_HI_Le", peg"\y 'while'")
```

The `optPeg` template optimizes the case of a peg constructor with a string literal, so that the pattern will only be parsed once at program startup and stored in a global `gl` which is then re-used. This optimization is called hoisting because it is comparable to classical loop hoisting.

 AST based overloading
---------------------


Parameter constraints can also be used for ordinary routine parameters; these constraints affect ordinary overloading resolution then:

 
```
proc optLit(a: string{lit|`const`}) =
  echo "string literal"
proc optLit(a: string) =
  echo "no string literal"

const
  constant = "abc"

var
  variable = "xyz"

optLit("literal")
optLit(constant)
optLit(variable)
```

However, the constraints `alias` and `noalias` are not available in ordinary routines.

 Parallel & Spawn
----------------


Nim has two flavors of parallelism:

 1. Structured parallelism via the `parallel` statement.
2. Unstructured parallelism via the standalone `spawn` statement.

 Nim has a builtin thread pool that can be used for CPU intensive tasks. For IO intensive tasks the `async` and `await` features should be used instead. Both parallel and spawn need the <threadpool> module to work.

 Somewhat confusingly, `spawn` is also used in the `parallel` statement with slightly different semantics. `spawn` always takes a call expression of the form `f(a, ...)`. Let `T` be `f`'s return type. If `T` is `void` then `spawn`'s return type is also `void` otherwise it is `FlowVar[T]`.

 Within a `parallel` section sometimes the `FlowVar[T]` is eliminated to `T`. This happens when `T` does not contain any GC'ed memory. The compiler can ensure the location in `location = spawn f(...)` is not read prematurely within a `parallel` section and so there is no need for the overhead of an indirection via `FlowVar[T]` to ensure correctness.

 **Note**: Currently exceptions are not propagated between `spawn`'ed tasks!

 ### Spawn statement


spawn can be used to pass a task to the thread pool:

 
```
import threadpool

proc processLine(line: string) =
  discard "do some heavy lifting here"

for x in lines("myinput.txt"):
  spawn processLine(x)
sync()
```

For reasons of type safety and implementation simplicity the expression that `spawn` takes is restricted:

 * It must be a call expression `f(a, ...)`.
* `f` must be `gcsafe`.
* `f` must not have the calling convention `closure`.
* `f`'s parameters may not be of type `var`. This means one has to use raw `ptr`'s for data passing reminding the programmer to be careful.
* `ref` parameters are deeply copied which is a subtle semantic change and can cause performance problems but ensures memory safety. This deep copy is performed via `system.deepCopy` and so can be overridden.
* For *safe* data exchange between `f` and the caller a global `TChannel` needs to be used. However, since spawn can return a result, often no further communication is required.

 `spawn` executes the passed expression on the thread pool and returns a data flow variable `FlowVar[T]` that can be read from. The reading with the `^` operator is **blocking**. However, one can use `blockUntilAny` to wait on multiple flow variables at the same time:

 
```
import threadpool, ...

# wait until 2 out of 3 servers received the update:
proc main =
  var responses = newSeq[FlowVarBase](3)
  for i in 0..2:
    responses[i] = spawn tellServer(Update, "key", "value")
  var index = blockUntilAny(responses)
  assert index >= 0
  responses.del(index)
  discard blockUntilAny(responses)
```

Data flow variables ensure that no data races are possible. Due to technical limitations not every type `T` is possible in a data flow variable: `T` has to be of the type `ref`, `string`, `seq` or of a type that doesn't contain a type that is garbage collected. This restriction is not hard to work-around in practice.

 ### Parallel statement


Example:

 
```
# Compute PI in an inefficient way
import strutils, math, threadpool
{.experimental: "parallel".}

proc term(k: float): float = 4 * math.pow(-1, k) / (2*k + 1)

proc pi(n: int): float =
  var ch = newSeq[float](n+1)
  parallel:
    for k in 0..ch.high:
      ch[k] = spawn term(float(k))
  for k in 0..ch.high:
    result += ch[k]

echo formatFloat(pi(5000))
```

The parallel statement is the preferred mechanism to introduce parallelism in a Nim program. A subset of the Nim language is valid within a `parallel` section. This subset is checked during semantic analysis to be free of data races. A sophisticated disjoint checker ensures that no data races are possible even though shared memory is extensively supported!

 The subset is in fact the full language with the following restrictions / changes:

 * `spawn` within a `parallel` section has special semantics.
* Every location of the form `a[i]` and `a[i..j]` and `dest` where `dest` is part of the pattern `dest = spawn f(...)` has to be provably disjoint. This is called the *disjoint check*.
* Every other complex location `loc` that is used in a spawned proc (`spawn f(loc)`) has to be immutable for the duration of the `parallel` section. This is called the *immutability check*. Currently it is not specified what exactly "complex location" means. We need to make this an optimization!
* Every array access has to be provably within bounds. This is called the *bounds check*.
* Slices are optimized so that no copy is performed. This optimization is not yet performed for ordinary slices outside of a `parallel` section.

 Guards and locks
----------------


Apart from `spawn` and `parallel` Nim also provides all the common low level concurrency mechanisms like locks, atomic intrinsics or condition variables.

 Nim significantly improves on the safety of these features via additional pragmas:

 1. A guard annotation is introduced to prevent data races.
2. Every access of a guarded memory location needs to happen in an appropriate locks statement.
3. Locks and routines can be annotated with lock levels to allow potential deadlocks to be detected during semantic analysis.

 ### Guards and the locks section

 #### Protecting global variables


Object fields and global variables can be annotated via a `guard` pragma:

 
```
var glock: TLock
var gdata {.guard: glock.}: int
```

The compiler then ensures that every access of `gdata` is within a `locks` section:

 
```
proc invalid =
  # invalid: unguarded access:
  echo gdata

proc valid =
  # valid access:
  {.locks: [glock].}:
    echo gdata
```

Top level accesses to `gdata` are always allowed so that it can be initialized conveniently. It is *assumed* (but not enforced) that every top level statement is executed before any concurrent action happens.

 The `locks` section deliberately looks ugly because it has no runtime semantics and should not be used directly! It should only be used in templates that also implement some form of locking at runtime:

 
```
template lock(a: TLock; body: untyped) =
  pthread_mutex_lock(a)
  {.locks: [a].}:
    try:
      body
    finally:
      pthread_mutex_unlock(a)
```

The guard does not need to be of any particular type. It is flexible enough to model low level lockfree mechanisms:

 
```
var dummyLock {.compileTime.}: int
var atomicCounter {.guard: dummyLock.}: int

template atomicRead(x): untyped =
  {.locks: [dummyLock].}:
    memoryReadBarrier()
    x

echo atomicRead(atomicCounter)
```

The `locks` pragma takes a list of lock expressions `locks: [a, b, ...]` in order to support *multi lock* statements. Why these are essential is explained in the [lock levels](#guards-and-locks-lock-levels) section.

 #### Protecting general locations


The `guard` annotation can also be used to protect fields within an object. The guard then needs to be another field within the same object or a global variable.

 Since objects can reside on the heap or on the stack this greatly enhances the expressivity of the language:

 
```
type
  ProtectedCounter = object
    v {.guard: L.}: int
    L: TLock

proc incCounters(counters: var openArray[ProtectedCounter]) =
  for i in 0..counters.high:
    lock counters[i].L:
      inc counters[i].v
```

The access to field `x.v` is allowed since its guard `x.L` is active. After template expansion, this amounts to:

 
```
proc incCounters(counters: var openArray[ProtectedCounter]) =
  for i in 0..counters.high:
    pthread_mutex_lock(counters[i].L)
    {.locks: [counters[i].L].}:
      try:
        inc counters[i].v
      finally:
        pthread_mutex_unlock(counters[i].L)
```

There is an analysis that checks that `counters[i].L` is the lock that corresponds to the protected location `counters[i].v`. This analysis is called path analysis because it deals with paths to locations like `obj.field[i].fieldB[j]`.

 The path analysis is **currently unsound**, but that doesn't make it useless. Two paths are considered equivalent if they are syntactically the same.

 This means the following compiles (for now) even though it really should not:

 
```
{.locks: [a[i].L].}:
  inc i
  access a[i].v
```
 ### Lock levels


Lock levels are used to enforce a global locking order in order to detect potential deadlocks during semantic analysis. A lock level is an constant integer in the range 0..1\_000. Lock level 0 means that no lock is acquired at all.

 If a section of code holds a lock of level `M` than it can also acquire any lock of level `N < M`. Another lock of level `M` cannot be acquired. Locks of the same level can only be acquired *at the same time* within a single `locks` section:

 
```
var a, b: TLock[2]
var x: TLock[1]
# invalid locking order: TLock[1] cannot be acquired before TLock[2]:
{.locks: [x].}:
  {.locks: [a].}:
    ...
# valid locking order: TLock[2] acquired before TLock[1]:
{.locks: [a].}:
  {.locks: [x].}:
    ...

# invalid locking order: TLock[2] acquired before TLock[2]:
{.locks: [a].}:
  {.locks: [b].}:
    ...

# valid locking order, locks of the same level acquired at the same time:
{.locks: [a, b].}:
  ...
```

Here is how a typical multilock statement can be implemented in Nim. Note how the runtime check is required to ensure a global ordering for two locks `a` and `b` of the same lock level:

 
```
template multilock(a, b: ptr TLock; body: untyped) =
  if cast[ByteAddress](a) < cast[ByteAddress](b):
    pthread_mutex_lock(a)
    pthread_mutex_lock(b)
  else:
    pthread_mutex_lock(b)
    pthread_mutex_lock(a)
  {.locks: [a, b].}:
    try:
      body
    finally:
      pthread_mutex_unlock(a)
      pthread_mutex_unlock(b)
```

Whole routines can also be annotated with a `locks` pragma that takes a lock level. This then means that the routine may acquire locks of up to this level. This is essential so that procs can be called within a `locks` section:

 
```
proc p() {.locks: 3.} = discard

var a: TLock[4]
{.locks: [a].}:
  # p's locklevel (3) is strictly less than a's (4) so the call is allowed:
  p()
```

As usual `locks` is an inferred effect and there is a subtype relation: `proc () {.locks: N.}` is a subtype of `proc () {.locks: M.}` iff (M <= N).

 The `locks` pragma can also take the special value `"unknown"`. This is useful in the context of dynamic method dispatching. In the following example, the compiler can infer a lock level of 0 for the `base` case. However, one of the overloaded methods calls a procvar which is potentially locking. Thus, the lock level of calling `g.testMethod` cannot be inferred statically, leading to compiler warnings. By using `{.locks: "unknown".}`, the base method can be marked explicitly as having unknown lock level as well:

 
```
type SomeBase* = ref object of RootObj
type SomeDerived* = ref object of SomeBase
  memberProc*: proc ()

method testMethod(g: SomeBase) {.base, locks: "unknown".} = discard
method testMethod(g: SomeDerived) =
  if g.memberProc != nil:
    g.memberProc()
```
 ### noRewrite pragma


Term rewriting macros and templates are currently greedy and they will rewrite as long as there is a match. There was no way to ensure some rewrite happens only once, e.g. when rewriting term to same term plus extra content.

 `noRewrite` pragma can actually prevent further rewriting on marked code, e.g. with given example `echo("ab")` will be rewritten just once:

 
```
template pwnEcho{echo(x)}(x: expr) =
  {.noRewrite.}: echo("pwned!")

echo "ab"
```

`noRewrite` pragma can be useful to control term-rewriting macros recursion.

 Taint mode
----------


The Nim compiler and most parts of the standard library support a taint mode. Input strings are declared with the TaintedString string type declared in the `system` module.

 If the taint mode is turned on (via the `--taintMode:on` command line option) it is a distinct string type which helps to detect input validation errors:

 
```
echo "your name: "
var name: TaintedString = stdin.readline
# it is safe here to output the name without any input validation, so
# we simply convert `name` to string to make the compiler happy:
echo "hi, ", name.string
```

If the taint mode is turned off, `TaintedString` is simply an alias for `string`.

 Aliasing restrictions in parameter passing
------------------------------------------


**Note**: The aliasing restrictions are currently not enforced by the implementation and need to be fleshed out further.

 "Aliasing" here means that the underlying storage locations overlap in memory at runtime. An "output parameter" is a parameter of type `var T`, an input parameter is any parameter that is not of type `var`.

 1. Two output parameters should never be aliased.
2. An input and an output parameter should not be aliased.
3. An output parameter should never be aliased with a global or thread local variable referenced by the called proc.
4. An input parameter should not be aliased with a global or thread local variable updated by the called proc.

 One problem with rules 3 and 4 is that they affect specific global or thread local variables, but Nim's effect tracking only tracks "uses no global variable" via `.noSideEffect`. The rules 3 and 4 can also be approximated by a different rule:

 1. A global or thread local variable (or a location derived from such a location) can only passed to a parameter of a `.noSideEffect` proc.

 Noalias annotation
------------------


Since version 1.4 of the Nim compiler, there is a `.noalias` annotation for variables and parameters. It is mapped directly to C/C++'s `restrict` keyword and means that the underlying pointer is pointing to a unique location in memory, no other aliases to this location exist. It is *unchecked* that this alias restriction is followed, if the restriction is violated, the backend optimizer is free to miscompile the code. This is an **unsafe** language feature.

 Ideally in later versions of the language, the restriction will be enforced at compile time. (Which is also why the name `noalias` was choosen instead of a more verbose name like `unsafeAssumeNoAlias`.)

 Strict funcs
------------


Since version 1.4 a stricter definition of "side effect" is available. In addition to the existing rule that a side effect is calling a function with side effects the following rule is also enforced:

 Any mutation to an object does count as a side effect if that object is reachable via a parameter that is not declared as a `var` parameter.

 For example:

 
```
{.experimental: "strictFuncs".}

type
  Node = ref object
    le, ri: Node
    data: string

func len(n: Node): int =
  # valid: len does not have side effects
  var it = n
  while it != nil:
    inc result
    it = it.ri

func mut(n: Node) =
  let m = n # is the statement that connected the mutation to the parameter
  m.data = "yeah" # the mutation is here
  # Error: 'mut' can have side effects
  # an object reachable from 'n' is potentially mutated
```

The algorithm behind this analysis is described in the [view types section](#view-types-algorithm).

 View types
----------


**Note**: `--experimental:views` is more effective with `--experimental:strictFuncs`.

 A view type is a type that is or contains one of the following types:

 * `var T` (mutable view into `T`)
* `lent T` (immutable view into `T`)
* `openArray[T]` (pair of (pointer to array of `T`, size))

 For example:

 
```
type
  View1 = var int
  View2 = openArray[byte]
  View3 = lent string
  View4 = Table[openArray[char], int]
```

Exceptions to this rule are types constructed via `ptr` or `proc`. For example, the following types are **not** view types:

 
```
type
  NotView1 = proc (x: openArray[int])
  NotView2 = ptr openArray[char]
  NotView3 = ptr array[4, var int]
```

A *mutable* view type is a type that is or contains a `var T` type. An *immutable* view type is a view type that is not a mutable view type.

 A *view* is a symbol (a let, var, const, etc.) that has a view type.

 Since version 1.4 Nim allows view types to be used as local variables. This feature needs to be enabled via `{.experimental: "views".}`.

 A local variable of a view type *borrows* from the locations and it is statically enforced that the view does not outlive the location it was borrowed from.

 For example:

 
```
{.experimental: "views".}

proc take(a: openArray[int]) =
  echo a.len

proc main(s: seq[int]) =
  var x: openArray[int] = s # 'x' is a view into 's'
  # it is checked that 'x' does not outlive 's' and
  # that 's' is not mutated.
  for i in 0 .. high(x):
    echo x[i]
  take(x)
  
  take(x.toOpenArray(0, 1)) # slicing remains possible
  let y = x  # create a view from a view
  take y
  # it is checked that 'y' does not outlive 'x' and
  # that 'x' is not mutated as long as 'y' lives.


main(@[11, 22, 33])
```

A local variable of a view type can borrow from a location derived from a parameter, another local variable, a global `const` or `let` symbol or a thread-local `var` or `let`.

 Let `p` the proc that is analysed for the correctness of the borrow operation.

 Let `source` be one of:

 * A formal parameter of `p`. Note that this does not cover parameters of inner procs.
* The `result` symbol of `p`.
* A local `var` or `let` or `const` of `p`. Note that this does not cover locals of inner procs.
* A thread-local `var` or `let`.
* A global `let` or `const`.
* A constant array/seq/object/tuple constructor.

 ### Path expressions


A location derived from `source` is then defined as a path expression that has `source` as the owner. A path expression `e` is defined recursively:

 * `source` itself is a path expression.
* Container access like `e[i]` is a path expression.
* Tuple access `e[0]` is a path expression.
* Object field access `e.field` is a path expression.
* `system.toOpenArray(e, ...)` is a path expression.
* Pointer dereference `e[]` is a path expression.
* An address `addr e`, `unsafeAddr e` is a path expression.
* A type conversion `T(e)` is a path expression.
* A cast expression `cast[T](e)` is a path expression.
* `f(e, ...)` is a path expression if `f`'s return type is a view type. Because the view can only have been borrowed from `e`, we then know that owner of `f(e, ...)` is `e`.

 If a view type is used as a return type, the location must borrow from a location that is derived from the first parameter that is passed to the proc. See [https://nim-lang.org/docs/manual.html#procedures-var-return-type](manual#procedures-var-return-type) for details about how this is done for `var T`.

 A mutable view can borrow from a mutable location, an immutable view can borrow from both a mutable or an immutable location.

 The *duration* of a borrow is the span of commands beginning from the assignment to the view and ending with the last usage of the view.

 For the duration of the borrow operation, no mutations to the borrowed locations may be performed except via the potentially mutable view that borrowed from the location. The borrowed location is said to be *sealed* during the borrow.

 
```
{.experimental: "views".}

type
  Obj = object
    field: string

proc dangerous(s: var seq[Obj]) =
  let v: lent Obj = s[0] # seal 's'
  s.setLen 0  # prevented at compile-time because 's' is sealed.
  echo v.field
```

The scope of the view does not matter:

 
```
proc valid(s: var seq[Obj]) =
  let v: lent Obj = s[0]  # begin of borrow
  echo v.field            # end of borrow
  s.setLen 0  # valid because 'v' isn't used afterwards
```

The analysis requires as much precision about mutations as is reasonably obtainable, so it is more effective with the experimental [strict funcs](#strict-funcs) feature. In other words `--experimental:views` works better with `--experimental:strictFuncs`.

 The analysis is currently control flow insensitive:

 
```
proc invalid(s: var seq[Obj]) =
  let v: lent Obj = s[0]
  if false:
    s.setLen 0
  echo v.field
```

In this example, the compiler assumes that `s.setLen 0` invalidates the borrow operation of `v` even though a human being can easily see that it will never do that at runtime.

 ### Start of a borrow


A borrow starts with one of the following:

 * The assignment of a non-view-type to a view-type.
* The assignment of a location that is derived from a local parameter to a view-type.

 ### End of a borrow


A borrow operation ends with the last usage of the view variable.

 ### Reborrows


A view `v` can borrow from multiple different locations. However, the borrow is always the full span of `v`'s lifetime and every location that is borrowed from is sealed during `v`'s lifetime.

 ### Algorithm


The following section is an outline of the algorithm that the current implementation uses. The algorithm performs two traversals over the AST of the procedure or global section of code that uses a view variable. No fixpoint iterations are performed, the complexity of the analysis is O(N) where N is the number of nodes of the AST.

 The first pass over the AST computes the lifetime of each local variable based on a notion of an "abstract time", in the implementation it's a simple integer that is incremented for every visited node.

 In the second pass information about the underlying object "graphs" is computed. Let `v` be a parameter or a local variable. Let `G(v)` be the graph that `v` belongs to. A graph is defined by the set of variables that belong to the graph. Initially for all `v`: `G(v) = {v}`. Every variable can only be part of a single graph.

 Assignments like `a = b` "connect" two variables, both variables end up in the same graph `{a, b} = G(a) = G(b)`. Unfortunately, the pattern to look for is much more complex than that and can involve multiple assignment targets and sources:



```
f(x, y) = g(a, b)
```
 connects `x` and `y` to `a` and `b`: `G(x) = G(y) = G(a) = G(b) = {x, y, a, b}`. A type based alias analysis rules out some of these combinations, for example a `string` value cannot possibly be connected to a `seq[int]`.

 A pattern like `v[] = value` or `v.field = value` marks `G(v)` as mutated. After the second pass a set of disjoint graphs was computed.

 For strict functions it is then enforced that there is no graph that is both mutated and has an element that is an immutable parameter (that is a parameter that is not of type `var T`).

 For borrow checking a different set of checks is performed. Let `v` be the view and `b` the location that is borrowed from.

 * The lifetime of `v` must not exceed `b`'s lifetime. Note: The lifetime of a parameter is the complete proc body.
* If `v` is a mutable view and `v` is used to actually mutate the borrowed location, then `b` has to be a mutable location. Note: If it is not actually used for mutation, borrowing a mutable view from an immutable location is allowed! This allows for many important idioms and will be justified in an upcoming RFC.
* During `v`'s lifetime, `G(b)` can only be modified by `v` (and only if `v` is a mutable view).
* If `v` is `result` then `b` has to be a location derived from the first formal parameter or from a constant location.
* A view cannot be used for a read or a write access before it was assigned to.



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/manual_experimental.html>

htmlparser
==========


**NOTE**: The behaviour might change in future versions as it is not clear what "*wild* HTML the real world uses" really implies.

 It can be used to parse a wild HTML document and output it as valid XHTML document (well, if you are lucky):

 
```
echo loadHtml("mydirty.html")
```

Every tag in the resulting tree is in lower case.

 **Note:** The resulting `XmlNode` already uses the `clientData` field, so it cannot be used by clients of this library.

 Example: Transforming hyperlinks
--------------------------------


This code demonstrates how you can iterate over all the tags in an HTML file and write back the modified version. In this case we look for hyperlinks ending with the extension `.rst` and convert them to `.html`.

 
```
import htmlparser
import xmltree  # To use '$' for XmlNode
import strtabs  # To access XmlAttributes
import os       # To use splitFile
import strutils # To use cmpIgnoreCase

proc transformHyperlinks() =
  let html = loadHtml("input.html")
  
  for a in html.findAll("a"):
    if a.attrs.hasKey "href":
      let (dir, filename, ext) = splitFile(a.attrs["href"])
      if cmpIgnoreCase(ext, ".rst") == 0:
        a.attrs["href"] = dir / filename & ".html"
  
  writeFile("output.html", $html)
```
 Imports
-------

  <strutils>, <streams>, <parsexml>, <xmltree>, <unicode>, <strtabs>, <os>  Types
-----

  
```
HtmlTag = enum
  tagUnknown,               ## unknown HTML element
  tagA,                     ## the HTML ``a`` element
  tagAbbr,                  ## the deprecated HTML ``abbr`` element
  tagAcronym,               ## the HTML ``acronym`` element
  tagAddress,               ## the HTML ``address`` element
  tagApplet,                ## the deprecated HTML ``applet`` element
  tagArea,                  ## the HTML ``area`` element
  tagArticle,               ## the HTML ``article`` element
  tagAside,                 ## the HTML ``aside`` element
  tagAudio,                 ## the HTML ``audio`` element
  tagB,                     ## the HTML ``b`` element
  tagBase,                  ## the HTML ``base`` element
  tagBdi,                   ## the HTML ``bdi`` element
  tagBdo,                   ## the deprecated HTML ``dbo`` element
  tagBasefont,              ## the deprecated HTML ``basefont`` element
  tagBig,                   ## the HTML ``big`` element
  tagBlockquote,            ## the HTML ``blockquote`` element
  tagBody,                  ## the HTML ``body`` element
  tagBr,                    ## the HTML ``br`` element
  tagButton,                ## the HTML ``button`` element
  tagCanvas,                ## the HTML ``canvas`` element
  tagCaption,               ## the HTML ``caption`` element
  tagCenter,                ## the deprecated HTML ``center`` element
  tagCite,                  ## the HTML ``cite`` element
  tagCode,                  ## the HTML ``code`` element
  tagCol,                   ## the HTML ``col`` element
  tagColgroup,              ## the HTML ``colgroup`` element
  tagCommand,               ## the HTML ``command`` element
  tagDatalist,              ## the HTML ``datalist`` element
  tagDd,                    ## the HTML ``dd`` element
  tagDel,                   ## the HTML ``del`` element
  tagDetails,               ## the HTML ``details`` element
  tagDfn,                   ## the HTML ``dfn`` element
  tagDialog,                ## the HTML ``dialog`` element
  tagDiv,                   ## the HTML ``div`` element
  tagDir,                   ## the deprecated HTLM ``dir`` element
  tagDl,                    ## the HTML ``dl`` element
  tagDt,                    ## the HTML ``dt`` element
  tagEm,                    ## the HTML ``em`` element
  tagEmbed,                 ## the HTML ``embed`` element
  tagFieldset,              ## the HTML ``fieldset`` element
  tagFigcaption,            ## the HTML ``figcaption`` element
  tagFigure,                ## the HTML ``figure`` element
  tagFont,                  ## the deprecated HTML ``font`` element
  tagFooter,                ## the HTML ``footer`` element
  tagForm,                  ## the HTML ``form`` element
  tagFrame,                 ## the HTML ``frame`` element
  tagFrameset,              ## the deprecated HTML ``frameset`` element
  tagH1,                    ## the HTML ``h1`` element
  tagH2,                    ## the HTML ``h2`` element
  tagH3,                    ## the HTML ``h3`` element
  tagH4,                    ## the HTML ``h4`` element
  tagH5,                    ## the HTML ``h5`` element
  tagH6,                    ## the HTML ``h6`` element
  tagHead,                  ## the HTML ``head`` element
  tagHeader,                ## the HTML ``header`` element
  tagHgroup,                ## the HTML ``hgroup`` element
  tagHtml,                  ## the HTML ``html`` element
  tagHr,                    ## the HTML ``hr`` element
  tagI,                     ## the HTML ``i`` element
  tagIframe,                ## the deprecated HTML ``iframe`` element
  tagImg,                   ## the HTML ``img`` element
  tagInput,                 ## the HTML ``input`` element
  tagIns,                   ## the HTML ``ins`` element
  tagIsindex,               ## the deprecated HTML ``isindex`` element
  tagKbd,                   ## the HTML ``kbd`` element
  tagKeygen,                ## the HTML ``keygen`` element
  tagLabel,                 ## the HTML ``label`` element
  tagLegend,                ## the HTML ``legend`` element
  tagLi,                    ## the HTML ``li`` element
  tagLink,                  ## the HTML ``link`` element
  tagMap,                   ## the HTML ``map`` element
  tagMark,                  ## the HTML ``mark`` element
  tagMenu,                  ## the deprecated HTML ``menu`` element
  tagMeta,                  ## the HTML ``meta`` element
  tagMeter,                 ## the HTML ``meter`` element
  tagNav,                   ## the HTML ``nav`` element
  tagNobr,                  ## the deprecated HTML ``nobr`` element
  tagNoframes,              ## the deprecated HTML ``noframes`` element
  tagNoscript,              ## the HTML ``noscript`` element
  tagObject,                ## the HTML ``object`` element
  tagOl,                    ## the HTML ``ol`` element
  tagOptgroup,              ## the HTML ``optgroup`` element
  tagOption,                ## the HTML ``option`` element
  tagOutput,                ## the HTML ``output`` element
  tagP,                     ## the HTML ``p`` element
  tagParam,                 ## the HTML ``param`` element
  tagPre,                   ## the HTML ``pre`` element
  tagProgress,              ## the HTML ``progress`` element
  tagQ,                     ## the HTML ``q`` element
  tagRp,                    ## the HTML ``rp`` element
  tagRt,                    ## the HTML ``rt`` element
  tagRuby,                  ## the HTML ``ruby`` element
  tagS,                     ## the deprecated HTML ``s`` element
  tagSamp,                  ## the HTML ``samp`` element
  tagScript,                ## the HTML ``script`` element
  tagSection,               ## the HTML ``section`` element
  tagSelect,                ## the HTML ``select`` element
  tagSmall,                 ## the HTML ``small`` element
  tagSource,                ## the HTML ``source`` element
  tagSpan,                  ## the HTML ``span`` element
  tagStrike,                ## the deprecated HTML ``strike`` element
  tagStrong,                ## the HTML ``strong`` element
  tagStyle,                 ## the HTML ``style`` element
  tagSub,                   ## the HTML ``sub`` element
  tagSummary,               ## the HTML ``summary`` element
  tagSup,                   ## the HTML ``sup`` element
  tagTable,                 ## the HTML ``table`` element
  tagTbody,                 ## the HTML ``tbody`` element
  tagTd,                    ## the HTML ``td`` element
  tagTextarea,              ## the HTML ``textarea`` element
  tagTfoot,                 ## the HTML ``tfoot`` element
  tagTh,                    ## the HTML ``th`` element
  tagThead,                 ## the HTML ``thead`` element
  tagTime,                  ## the HTML ``time`` element
  tagTitle,                 ## the HTML ``title`` element
  tagTr,                    ## the HTML ``tr`` element
  tagTrack,                 ## the HTML ``track`` element
  tagTt,                    ## the HTML ``tt`` element
  tagU,                     ## the deprecated HTML ``u`` element
  tagUl,                    ## the HTML ``ul`` element
  tagVar,                   ## the HTML ``var`` element
  tagVideo,                 ## the HTML ``video`` element
  tagWbr                     ## the HTML ``wbr`` element
```
  list of all supported HTML tags; order will always be alphabetically [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L55)   Consts
------

  
```
tagToStr = ["a", "abbr", "acronym", "address", "applet", "area", "article",
            "aside", "audio", "b", "base", "basefont", "bdi", "bdo", "big",
            "blockquote", "body", "br", "button", "canvas", "caption", "center",
            "cite", "code", "col", "colgroup", "command", "datalist", "dd",
            "del", "details", "dfn", "dialog", "div", "dir", "dl", "dt", "em",
            "embed", "fieldset", "figcaption", "figure", "font", "footer",
            "form", "frame", "frameset", "h1", "h2", "h3", "h4", "h5", "h6",
            "head", "header", "hgroup", "html", "hr", "i", "iframe", "img",
            "input", "ins", "isindex", "kbd", "keygen", "label", "legend", "li",
            "link", "map", "mark", "menu", "meta", "meter", "nav", "nobr",
            "noframes", "noscript", "object", "ol", "optgroup", "option",
            "output", "p", "param", "pre", "progress", "q", "rp", "rt", "ruby",
            "s", "samp", "script", "section", "select", "small", "source",
            "span", "strike", "strong", "style", "sub", "summary", "sup",
            "table", "tbody", "td", "textarea", "tfoot", "th", "thead", "time",
            "title", "tr", "track", "tt", "u", "ul", "var", "video", "wbr"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L183)  
```
InlineTags = {tagA, tagAbbr, tagAcronym, tagApplet, tagB, tagBasefont, tagBdo,
              tagBig, tagBr, tagButton, tagCite, tagCode, tagDel, tagDfn, tagEm,
              tagFont, tagI, tagImg, tagIns, tagInput, tagIframe, tagKbd,
              tagLabel, tagMap, tagObject, tagQ, tagSamp, tagScript, tagSelect,
              tagSmall, tagSpan, tagStrong, tagSub, tagSup, tagTextarea, tagTt,
              tagVar, tagApplet, tagBasefont, tagFont, tagIframe, tagU, tagS,
              tagStrike, tagWbr}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L204)  
```
BlockTags = {tagAddress, tagBlockquote, tagCenter, tagDel, tagDir, tagDiv,
             tagDl, tagFieldset, tagForm, tagH1, tagH2, tagH3, tagH4, tagH5,
             tagH6, tagHr, tagIns, tagIsindex, tagMenu, tagNoframes,
             tagNoscript, tagOl, tagP, tagPre, tagTable, tagUl, tagCenter,
             tagDir, tagIsindex, tagMenu, tagNoframes}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L211)  
```
SingleTags = {tagArea, tagBase, tagBasefont, tagBr, tagCol, tagFrame, tagHr,
              tagImg, tagIsindex, tagLink, tagMeta, tagParam, tagWbr}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L216)   Procs
-----

  
```
proc htmlTag(n: XmlNode): HtmlTag {...}{.raises: [], tags: [].}
```
  Gets `n`'s tag as a `HtmlTag`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L353)  
```
proc htmlTag(s: string): HtmlTag {...}{.raises: [], tags: [].}
```
  Converts `s` to a `HtmlTag`. If `s` is no HTML tag, `tagUnknown` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L359)  
```
proc runeToEntity(rune: Rune): string {...}{.raises: [], tags: [].}
```
  converts a Rune to its numeric HTML entity equivalent. **Example:**

 
```
import unicode
doAssert runeToEntity(Rune(0)) == ""
doAssert runeToEntity(Rune(-1)) == ""
doAssert runeToEntity("Ü".runeAt(0)) == "#220"
doAssert runeToEntity("∈".runeAt(0)) == "#8712"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L365)  
```
proc entityToRune(entity: string): Rune {...}{.raises: [], tags: [].}
```
  Converts an HTML entity name like `&Uuml;` or values like `&#220;` or `&#x000DC;` to its UTF-8 equivalent. Rune(0) is returned if the entity name is unknown. **Example:**

 
```
import unicode
doAssert entityToRune("") == Rune(0)
doAssert entityToRune("a") == Rune(0)
doAssert entityToRune("gt") == ">".runeAt(0)
doAssert entityToRune("Uuml") == "Ü".runeAt(0)
doAssert entityToRune("quest") == "?".runeAt(0)
doAssert entityToRune("#x0003F") == "?".runeAt(0)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L376)  
```
proc entityToUtf8(entity: string): string {...}{.raises: [], tags: [].}
```
  Converts an HTML entity name like `&Uuml;` or values like `&#220;` or `&#x000DC;` to its UTF-8 equivalent. "" is returned if the entity name is unknown. The HTML parser already converts entities to UTF-8. **Example:**

 
```
const sigma = "Σ"
doAssert entityToUtf8("") == ""
doAssert entityToUtf8("a") == ""
doAssert entityToUtf8("gt") == ">"
doAssert entityToUtf8("Uuml") == "Ü"
doAssert entityToUtf8("quest") == "?"
doAssert entityToUtf8("#63") == "?"
doAssert entityToUtf8("Sigma") == sigma
doAssert entityToUtf8("#931") == sigma
doAssert entityToUtf8("#0931") == sigma
doAssert entityToUtf8("#x3A3") == sigma
doAssert entityToUtf8("#x03A3") == sigma
doAssert entityToUtf8("#x3a3") == sigma
doAssert entityToUtf8("#X3a3") == sigma
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L1869) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L1869)  
```
proc parseHtml(s: Stream; filename: string; errors: var seq[string]): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the XML from stream `s` and returns a `XmlNode`. Every occurred parsing error is added to the `errors` sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L2013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L2013)  
```
proc parseHtml(s: Stream): XmlNode {...}{.raises: [IOError, OSError, ValueError,
    Exception], tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the HTML from stream `s` and returns a `XmlNode`. All parsing errors are ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L2038) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L2038)  
```
proc parseHtml(html: string): XmlNode {...}{.raises: [IOError, OSError, ValueError,
    Exception], tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the HTML from string `html` and returns a `XmlNode`. All parsing errors are ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L2044) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L2044)  
```
proc loadHtml(path: string; errors: var seq[string]): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Loads and parses HTML from file specified by `path`, and returns a `XmlNode`. Every occurred parsing error is added to the `errors` sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L2049) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L2049)  
```
proc loadHtml(path: string): XmlNode {...}{.raises: [IOError, OSError, ValueError,
    Exception], tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Loads and parses HTML from file specified by `path`, and returns a `XmlNode`. All parsing errors are ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlparser.nim#L2057) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlparser.nim#L2057)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/htmlparser.html>

json
====

 This module implements a simple high performance JSON parser. JSON (JavaScript Object Notation) is a lightweight data-interchange format that is easy for humans to read and write (unlike XML). It is easy for machines to parse and generate. JSON is based on a subset of the JavaScript Programming Language, Standard ECMA-262 3rd Edition - December 1999. 


Overview
--------

 ### Parsing JSON


JSON often arrives into your program (via an API or a file) as a `string`. The first step is to change it from its serialized form into a nested object structure called a `JsonNode`.

 The `parseJson` procedure takes a string containing JSON and returns a `JsonNode` object. This is an object variant and it is either a `JObject`, `JArray`, `JString`, `JInt`, `JFloat`, `JBool` or `JNull`. You check the kind of this object variant by using the `kind` accessor.

 For a `JsonNode` who's kind is `JObject`, you can access its fields using the `[]` operator. The following example shows how to do this:

 
```
import json

let jsonNode = parseJson("""{"key": 3.14}""")

doAssert jsonNode.kind == JObject
doAssert jsonNode["key"].kind == JFloat
```
 ### Reading values


Once you have a `JsonNode`, retrieving the values can then be achieved by using one of the helper procedures, which include:

 * `getInt`
* `getFloat`
* `getStr`
* `getBool`

 To retrieve the value of `"key"` you can do the following:

 
```
import json

let jsonNode = parseJson("""{"key": 3.14}""")

doAssert jsonNode["key"].getFloat() == 3.14
```

**Important:** The `[]` operator will raise an exception when the specified field does not exist.

 ### Handling optional keys


By using the `{}` operator instead of `[]`, it will return `nil` when the field is not found. The `get`-family of procedures will return a type's default value when called on `nil`.

 
```
import json

let jsonNode = parseJson("{}")

doAssert jsonNode{"nope"}.getInt() == 0
doAssert jsonNode{"nope"}.getFloat() == 0
doAssert jsonNode{"nope"}.getStr() == ""
doAssert jsonNode{"nope"}.getBool() == false
```
 ### Using default values


The `get`-family helpers also accept an additional parameter which allow you to fallback to a default value should the key's values be `null`:

 
```
import json

let jsonNode = parseJson("""{"key": 3.14, "key2": null}""")

doAssert jsonNode["key"].getFloat(6.28) == 3.14
doAssert jsonNode["key2"].getFloat(3.14) == 3.14
doAssert jsonNode{"nope"}.getFloat(3.14) == 3.14 # note the {}
```
 ### Unmarshalling


In addition to reading dynamic data, Nim can also unmarshal JSON directly into a type with the `to` macro.

 Note: Use [Option](options#Option) for keys sometimes missing in json responses, and backticks around keys with a reserved keyword as name.

 
```
import json
import options

type
  User = object
    name: string
    age: int
    `type`: Option[string]

let userJson = parseJson("""{ "name": "Nim", "age": 12 }""")
let user = to(userJson, User)
if user.`type`.isSome():
  assert user.`type`.get() != "robot"
```
 Creating JSON
-------------


This module can also be used to comfortably create JSON using the `%*` operator:

 
```
import json

var hisName = "John"
let herAge = 31
var j = %*
  [
    { "name": hisName, "age": 30 },
    { "name": "Susan", "age": herAge }
  ]

var j2 = %* {"name": "Isaac", "books": ["Robot Dreams"]}
j2["details"] = %* {"age":35, "pi":3.1415}
echo j2
```

See also: std/jsonutils for hookable json serialization/deserialization of arbitrary types.

 **Example:**

 
```
## Note: for JObject, key ordering is preserved, unlike in some languages,
## this is convenient for some use cases. Example:
type Foo = object
  a1, a2, a0, a3, a4: int
doAssert $(%* Foo()) == """{"a1":0,"a2":0,"a0":0,"a3":0,"a4":0}"""
```
 Imports
-------

  <hashes>, <tables>, <strutils>, <lexbase>, <streams>, <macros>, <parsejson>, <options>, <since>  Types
-----

  
```
JsonNodeKind = enum
  JNull, JBool, JInt, JFloat, JString, JObject, JArray
```
  possible JSON node types [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L169)  
```
JsonNode = ref JsonNodeObj
```
  JSON node [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L178)  
```
JsonNodeObj {...}{.acyclic.} = object
  isUnquoted: bool
  case kind*: JsonNodeKind
  of JString:
      str*: string

  of JInt:
      num*: BiggestInt

  of JFloat:
      fnum*: float

  of JBool:
      bval*: bool

  of JNull:
      nil

  of JObject:
      fields*: OrderedTable[string, JsonNode]

  of JArray:
      elems*: seq[JsonNode]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L179)   Procs
-----

  
```
proc newJString(s: string): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JString JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L198)  
```
proc newJInt(n: BiggestInt): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JInt JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L213)  
```
proc newJFloat(n: float): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JFloat JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L217)  
```
proc newJBool(b: bool): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JBool JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L221)  
```
proc newJNull(): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JNull JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L225)  
```
proc newJObject(): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JObject JsonNode` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L229)  
```
proc newJArray(): JsonNode {...}{.raises: [], tags: [].}
```
  Creates a new `JArray JsonNode` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L233)  
```
proc getStr(n: JsonNode; default: string = ""): string {...}{.raises: [], tags: [].}
```
  Retrieves the string value of a `JString JsonNode`.

 Returns `default` if `n` is not a `JString`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L237)  
```
proc getInt(n: JsonNode; default: int = 0): int {...}{.raises: [], tags: [].}
```
  Retrieves the int value of a `JInt JsonNode`.

 Returns `default` if `n` is not a `JInt`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L244)  
```
proc getBiggestInt(n: JsonNode; default: BiggestInt = 0): BiggestInt {...}{.
    raises: [], tags: [].}
```
  Retrieves the BiggestInt value of a `JInt JsonNode`.

 Returns `default` if `n` is not a `JInt`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L251)  
```
proc getFloat(n: JsonNode; default: float = 0.0): float {...}{.raises: [], tags: [].}
```
  Retrieves the float value of a `JFloat JsonNode`.

 Returns `default` if `n` is not a `JFloat` or `JInt`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L258)  
```
proc getBool(n: JsonNode; default: bool = false): bool {...}{.raises: [], tags: [].}
```
  Retrieves the bool value of a `JBool JsonNode`.

 Returns `default` if `n` is not a `JBool`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L268)  
```
proc getFields(n: JsonNode; default = initOrderedTable(2)): OrderedTable[string,
    JsonNode] {...}{.raises: [], tags: [].}
```
  Retrieves the key, value pairs of a `JObject JsonNode`.

 Returns `default` if `n` is not a `JObject`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L275)  
```
proc getElems(n: JsonNode; default: seq[JsonNode] = @[]): seq[JsonNode] {...}{.
    raises: [], tags: [].}
```
  Retrieves the array of a `JArray JsonNode`.

 Returns `default` if `n` is not a `JArray`, or if `n` is nil.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L284)  
```
proc add(father, child: JsonNode) {...}{.raises: [], tags: [].}
```
  Adds `child` to a JArray node `father`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L291)  
```
proc add(obj: JsonNode; key: string; val: JsonNode) {...}{.raises: [], tags: [].}
```
  Sets a field from a `JObject`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L296)  
```
proc `%`(s: string): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JString JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L301)  
```
proc `%`(n: uint): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JInt JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L305)  
```
proc `%`(n: int): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JInt JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L312)  
```
proc `%`(n: BiggestUInt): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JInt JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L316)  
```
proc `%`(n: BiggestInt): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JInt JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L323)  
```
proc `%`(n: float): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JFloat JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L327)  
```
proc `%`(b: bool): JsonNode {...}{.raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JBool JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L331)  
```
proc `%`(keyVals: openArray[tuple[key: string, val: JsonNode]]): JsonNode {...}{.
    raises: [], tags: [].}
```
  Generic constructor for JSON data. Creates a new `JObject JsonNode` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L335)  
```
proc `%`[T](elements: openArray[T]): JsonNode
```
  Generic constructor for JSON data. Creates a new `JArray JsonNode` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L343)  
```
proc `%`[T](table: Table[string, T] | OrderedTable[string, T]): JsonNode
```
  Generic constructor for JSON data. Creates a new `JObject JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L348)  
```
proc `%`[T](opt: Option[T]): JsonNode
```
  Generic constructor for JSON data. Creates a new `JNull JsonNode` if `opt` is empty, otherwise it delegates to the underlying value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L353)  
```
proc `[]=`(obj: JsonNode; key: string; val: JsonNode) {...}{.inline, raises: [],
    tags: [].}
```
  Sets a field from a `JObject`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L371)  
```
proc `%`[T: object](o: T): JsonNode
```
  Construct JsonNode from tuples and objects. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L376)  
```
proc `%`(o: ref object): JsonNode
```
  Generic constructor for JSON data. Creates a new `JObject JsonNode` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L381)  
```
proc `%`(o: enum): JsonNode
```
  Construct a JsonNode that represents the specified enum value as a string. Creates a new `JString JsonNode`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L388)  
```
proc `==`(a, b: JsonNode): bool {...}{.raises: [KeyError], tags: [].}
```
  Check two nodes for equality [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L424)  
```
proc hash(n: JsonNode): Hash {...}{.raises: [Exception], tags: [RootEffect].}
```
  Compute the hash for a JSON node [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L456)  
```
proc hash(n: OrderedTable[string, JsonNode]): Hash {...}{.noSideEffect,
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L474)  
```
proc len(n: JsonNode): int {...}{.raises: [], tags: [].}
```
  If `n` is a `JArray`, it returns the number of elements. If `n` is a `JObject`, it returns the number of pairs. Else it returns 0. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L479)  
```
proc `[]`(node: JsonNode; name: string): JsonNode {...}{.inline, raises: [KeyError],
    tags: [].}
```
  Gets a field from a `JObject`, which must not be nil. If the value at `name` does not exist, raises KeyError. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L488)  
```
proc `[]`(node: JsonNode; index: int): JsonNode {...}{.inline, raises: [], tags: [].}
```
  Gets the node at `index` in an Array. Result is undefined if `index` is out of bounds, but as long as array bound checks are enabled it will result in an exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L497)  
```
proc hasKey(node: JsonNode; key: string): bool {...}{.raises: [], tags: [].}
```
  Checks if `key` exists in `node`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L505)  
```
proc contains(node: JsonNode; key: string): bool {...}{.raises: [], tags: [].}
```
  Checks if `key` exists in `node`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L510)  
```
proc contains(node: JsonNode; val: JsonNode): bool {...}{.raises: [KeyError],
    tags: [].}
```
  Checks if `val` exists in array `node`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L515)  
```
proc `{}`(node: JsonNode; keys: varargs[string]): JsonNode {...}{.raises: [],
    tags: [].}
```
  Traverses the node and gets the given value. If any of the keys do not exist, returns `nil`. Also returns `nil` if one of the intermediate data structures is not an object.

 This proc can be used to create tree structures on the fly (sometimes called autovivification): 

 **Example:**

 
```
var myjson = %* {"parent": {"child": {"grandchild": 1}}}
doAssert myjson{"parent", "child", "grandchild"} == newJInt(1)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L520)  
```
proc `{}`(node: JsonNode; index: varargs[int]): JsonNode {...}{.raises: [], tags: [].}
```
  Traverses the node and gets the given value. If any of the indexes do not exist, returns `nil`. Also returns `nil` if one of the intermediate data structures is not an array. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L538)  
```
proc getOrDefault(node: JsonNode; key: string): JsonNode {...}{.raises: [], tags: [].}
```
  Gets a field from a `node`. If `node` is nil or not an object or value at `key` does not exist, returns nil [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L548)  
```
proc `{}`(node: JsonNode; key: string): JsonNode {...}{.raises: [], tags: [].}
```
  Gets a field from a `node`. If `node` is nil or not an object or value at `key` does not exist, returns nil [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L554)  
```
proc `{}=`(node: JsonNode; keys: varargs[string]; value: JsonNode) {...}{.
    raises: [KeyError], tags: [].}
```
  Traverses the node and tries to set the value at the given location to `value`. If any of the keys are missing, they are added. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L559)  
```
proc delete(obj: JsonNode; key: string) {...}{.raises: [KeyError], tags: [].}
```
  Deletes `obj[key]`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L569)  
```
proc copy(p: JsonNode): JsonNode {...}{.raises: [], tags: [].}
```
  Performs a deep copy of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L576)  
```
proc escapeJsonUnquoted(s: string; result: var string) {...}{.raises: [], tags: [].}
```
  Converts a string `s` to its JSON representation without quotes. Appends to `result`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L611)  
```
proc escapeJsonUnquoted(s: string): string {...}{.raises: [], tags: [].}
```
  Converts a string `s` to its JSON representation without quotes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L628)  
```
proc escapeJson(s: string; result: var string) {...}{.raises: [], tags: [].}
```
  Converts a string `s` to its JSON representation with quotes. Appends to `result`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L633)  
```
proc escapeJson(s: string): string {...}{.raises: [], tags: [].}
```
  Converts a string `s` to its JSON representation with quotes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L640)  
```
proc pretty(node: JsonNode; indent = 2): string {...}{.raises: [], tags: [].}
```
  Returns a JSON Representation of `node`, with indentation and on multiple lines.

 Similar to prettyprint in Python.

 **Example:**

 
```
let j = %* {"name": "Isaac", "books": ["Robot Dreams"],
            "details": {"age": 35, "pi": 3.1415}}
doAssert pretty(j) == """
{
  "name": "Isaac",
  "books": [
    "Robot Dreams"
  ],
  "details": {
    "age": 35,
    "pi": 3.1415
  }
}"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L707)  
```
proc toUgly(result: var string; node: JsonNode) {...}{.raises: [], tags: [].}
```
  Converts `node` to its JSON Representation, without regard for human readability. Meant to improve `$` string conversion performance.

 JSON representation is stored in the passed `result`

 This provides higher efficiency than the `pretty` procedure as it does **not** attempt to format the resulting JSON to make it human readable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L729) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L729)  
```
proc `$`(node: JsonNode): string {...}{.raises: [], tags: [].}
```
  Converts `node` to its JSON Representation on one line. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L772)  
```
proc parseJson(s: Stream; filename: string = ""; rawIntegers = false;
               rawFloats = false): JsonNode {...}{.raises: [IOError, OSError,
    IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  Parses from a stream `s` into a `JsonNode`. `filename` is only needed for nice error messages. If `s` contains extra data, it will raise `JsonParsingError`. This closes the stream `s` after it's done. If `rawIntegers` is true, integer literals will not be converted to a `JInt` field but kept as raw numbers via `JString`. If `rawFloats` is true, floating point literals will not be converted to a `JFloat` field but kept as raw numbers via `JString`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L889) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L889)  
```
proc parseJson(buffer: string; rawIntegers = false; rawFloats = false): JsonNode {...}{.
    raises: [IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  Parses JSON from `buffer`. If `buffer` contains extra data, it will raise `JsonParsingError`. If `rawIntegers` is true, integer literals will not be converted to a `JInt` field but kept as raw numbers via `JString`. If `rawFloats` is true, floating point literals will not be converted to a `JFloat` field but kept as raw numbers via `JString`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L984) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L984)  
```
proc parseFile(filename: string): JsonNode {...}{.
    raises: [IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  Parses `file` into a `JsonNode`. If `file` contains extra data, it will raise `JsonParsingError`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L993) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L993)  
```
proc to[T](node: JsonNode; t: typedesc[T]): T
```
  Unmarshals the specified node into the object type specified.

 Known limitations:

 
> 
> * Heterogeneous arrays are not supported.
> * Sets in object variants are not supported.
> * Not nil annotations are not supported.
> 
>  

 **Example:**

 
```
let jsonNode = parseJson("""
        {
          "person": {
            "name": "Nimmer",
            "age": 21
          },
          "list": [1, 2, 3, 4]
        }
      """)

type
  Person = object
    name: string
    age: int

  Data = object
    person: Person
    list: seq[int]

var data = to(jsonNode, Data)
doAssert data.person.name == "Nimmer"
doAssert data.person.age == 21
doAssert data.list == @[1, 2, 3, 4]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L1268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L1268)   Iterators
---------

  
```
iterator items(node: JsonNode): JsonNode {...}{.raises: [], tags: [].}
```
  Iterator for the items of `node`. `node` has to be a JArray. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L777) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L777)  
```
iterator mitems(node: var JsonNode): var JsonNode {...}{.raises: [], tags: [].}
```
  Iterator for the items of `node`. `node` has to be a JArray. Items can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L783) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L783)  
```
iterator pairs(node: JsonNode): tuple[key: string, val: JsonNode] {...}{.raises: [],
    tags: [].}
```
  Iterator for the child elements of `node`. `node` has to be a JObject. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L790) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L790)  
```
iterator keys(node: JsonNode): string {...}{.raises: [], tags: [].}
```
  Iterator for the keys in `node`. `node` has to be a JObject. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L796)  
```
iterator mpairs(node: var JsonNode): tuple[key: string, val: var JsonNode] {...}{.
    raises: [], tags: [].}
```
  Iterator for the child elements of `node`. `node` has to be a JObject. Values can be modified [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L802) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L802)  
```
iterator parseJsonFragments(s: Stream; filename: string = "";
                            rawIntegers = false; rawFloats = false): JsonNode {...}{.raises: [
    IOError, OSError, IOError, OSError, JsonParsingError, ValueError, Exception],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  Parses from a stream `s` into `JsonNodes`. `filename` is only needed for nice error messages. The JSON fragments are separated by whitespace. This can be substantially faster than the comparable loop `for x in splitWhitespace(s): yield parseJson(x)`. This closes the stream `s` after it's done. If `rawIntegers` is true, integer literals will not be converted to a `JInt` field but kept as raw numbers via `JString`. If `rawFloats` is true, floating point literals will not be converted to a `JFloat` field but kept as raw numbers via `JString`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L869) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L869)   Macros
------

  
```
macro `%*`(x: untyped): untyped
```
  Convert an expression to a JsonNode directly, without having to specify `%` for every element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L419)  
```
macro isRefSkipDistinct(arg: typed): untyped
```
  internal only, do not use [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L1017)   Templates
---------

  
```
template `%`(j: JsonNode): JsonNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/json.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/json.nim#L341)   Exports
-------

  [$](tables#%24,Table%5BA,B%5D), [$](tables#%24,TableRef%5BA,B%5D), [$](tables#%24,OrderedTable%5BA,B%5D), [$](tables#%24,OrderedTableRef%5BA,B%5D), [$](tables#%24,CountTable%5BA%5D), [$](tables#%24,CountTableRef%5BA%5D), [JsonEventKind](parsejson#JsonEventKind), [JsonError](parsejson#JsonError), [JsonParser](parsejson#JsonParser), [JsonKindError](parsejson#JsonKindError), [open](io#open,File,string,FileMode,int), [open](io#open,File,FileHandle,FileMode), [open](lexbase#open,BaseLexer,Stream,int,set%5Bchar%5D), [open](io#open,string,FileMode,int), [open](parsejson#open,JsonParser,Stream,string), [close](lexbase#close,BaseLexer), [close](streams#close,Stream), [close](io#close,File), [close](parsejson#close,JsonParser), [str](parsejson#str,JsonParser), [getInt](parsejson#getInt,JsonParser), [getFloat](parsejson#getFloat,JsonParser), [kind](macros#kind,NimNode), [kind](parsejson#kind,JsonParser), [getColumn](parsejson#getColumn,JsonParser), [getLine](parsejson#getLine,JsonParser), [getFilename](parsejson#getFilename,JsonParser), [errorMsg](parsejson#errorMsg,JsonParser), [errorMsgExpected](parsejson#errorMsgExpected,JsonParser,string), [next](parsejson#next,JsonParser), [JsonParsingError](parsejson#JsonParsingError), [raiseParseErr](parsejson#raiseParseErr,JsonParser,string), [nimIdentNormalize](strutils#nimIdentNormalize,string) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/json.html>

lexbase
=======

 This module implements a base object of a lexer with efficient buffer handling. Only at line endings checks are necessary if the buffer needs refilling.

 Imports
-------

  <strutils>, <streams>  Types
-----

  
```
BaseLexer = object of RootObj
  bufpos*: int               ## the current position within the buffer
  buf*: string               ## the buffer itself
  input: Stream              ## the input stream
  lineNumber*: int           ## the current line number
  sentinel: int
  lineStart: int
  offsetBase*: int
  refillChars: set[char]
```
  the base lexer. Inherit your lexer from this object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L28)   Consts
------

  
```
EndOfFile = '\x00'
```
  end of file marker [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L18)  
```
NewLines = {'\c', '\n'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L19)   Procs
-----

  
```
proc close(L: var BaseLexer) {...}{.raises: [Exception, IOError, OSError],
                               tags: [WriteIOEffect].}
```
  closes the base lexer. This closes `L`'s associated stream too. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L39)  
```
proc handleCR(L: var BaseLexer; pos: int): int {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  Call this if you scanned over 'c' in the buffer; it returns the position to continue the scanning from. `pos` must be the position of the 'c'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L103)  
```
proc handleLF(L: var BaseLexer; pos: int): int {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  Call this if you scanned over 'L' in the buffer; it returns the position to continue the scanning from. `pos` must be the position of the 'L'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L114)  
```
proc handleRefillChar(L: var BaseLexer; pos: int): int {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Call this if a terminator character other than a new line is scanned at `pos`; it returns the position to continue the scanning from. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L123)  
```
proc open(L: var BaseLexer; input: Stream; bufLen: int = 8192;
          refillChars: set[char] = NewLines) {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  inits the BaseLexer with a stream to read from. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L134)  
```
proc getColNumber(L: BaseLexer; pos: int): int {...}{.raises: [], tags: [].}
```
  retrieves the current column. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L150)  
```
proc getCurrentLine(L: BaseLexer; marker: bool = true): string {...}{.raises: [],
    tags: [].}
```
  retrieves the current line. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/lexbase.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/lexbase.nim#L154)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/lexbase.html>

parsecfg
========


The `parsecfg` module implements a high performance configuration file parser. The configuration file's syntax is similar to the Windows `.ini` format, but much more powerful, as it is not a line based parser. String literals, raw string literals and triple quoted string literals are supported as in the Nim programming language.

 Example of how a configuration file may look like:

 
```
# This is a comment.
; this too.

[Common]
cc=gcc     # '=' and ':' are the same
--foo="bar"   # '--cc' and 'cc' are the same, 'bar' and '"bar"' are the same (except for '#')
macrosym: "#"  # Note that '#' is interpreted as a comment without the quotation
--verbose

[Windows]
isConsoleApplication=False ; another comment

[Posix]
isConsoleApplication=True

key1: "in this string backslash escapes are interpreted\n"
key2: r"in this string not"
key3: """triple quotes strings
are also supported. They may span
multiple lines."""

--"long option with spaces": r"c:\myfiles\test.txt"
```
 Here is an example of how to use the configuration file parser:

 
```
import os, parsecfg, strutils, streams

var f = newFileStream(paramStr(1), fmRead)
if f != nil:
  var p: CfgParser
  open(p, f, paramStr(1))
  while true:
    var e = next(p)
    case e.kind
    of cfgEof: break
    of cfgSectionStart:   ## a ``[section]`` has been parsed
      echo("new section: " & e.section)
    of cfgKeyValuePair:
      echo("key-value-pair: " & e.key & ": " & e.value)
    of cfgOption:
      echo("command: " & e.key & ": " & e.value)
    of cfgError:
      echo(e.msg)
  close(p)
else:
  echo("cannot open: " & paramStr(1))
```
 Examples
--------

 ### Configuration file example



```
charset = "utf-8"
[Package]
name = "hello"
--threads:on
[Author]
name = "lihf8515"
qq = "10214028"
email = "lihaifeng@wxm.com"
```
 ### Creating a configuration file



```
import parsecfg
var dict=newConfig()
dict.setSectionKey("","charset","utf-8")
dict.setSectionKey("Package","name","hello")
dict.setSectionKey("Package","--threads","on")
dict.setSectionKey("Author","name","lihf8515")
dict.setSectionKey("Author","qq","10214028")
dict.setSectionKey("Author","email","lihaifeng@wxm.com")
dict.writeConfig("config.ini")
```
 ### Reading a configuration file



```
import parsecfg
var dict = loadConfig("config.ini")
var charset = dict.getSectionValue("","charset")
var threads = dict.getSectionValue("Package","--threads")
var pname = dict.getSectionValue("Package","name")
var name = dict.getSectionValue("Author","name")
var qq = dict.getSectionValue("Author","qq")
var email = dict.getSectionValue("Author","email")
echo pname & "\n" & name & "\n" & qq & "\n" & email
```
 ### Modifying a configuration file



```
import parsecfg
var dict = loadConfig("config.ini")
dict.setSectionKey("Author","name","lhf")
dict.writeConfig("config.ini")
```
 ### Deleting a section key in a configuration file



```
import parsecfg
var dict = loadConfig("config.ini")
dict.delSectionKey("Author","email")
dict.writeConfig("config.ini")
```
 Imports
-------

  <strutils>, <lexbase>, <streams>, <tables>  Types
-----

  
```
CfgEventKind = enum
  cfgEof,                   ## end of file reached
  cfgSectionStart,          ## a ``[section]`` has been parsed
  cfgKeyValuePair,          ## a ``key=value`` pair has been detected
  cfgOption,                ## a ``--key=value`` command line option
  cfgError                   ## an error occurred during parsing
```
  enumeration of all events that may occur when parsing [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L117)  
```
CfgEvent = object of RootObj
  case kind*: CfgEventKind   ## the kind of the event
  of cfgEof:
    nil
  of cfgSectionStart:
      section*: string       ## `section` contains the name of the
                             ## parsed section start (syntax: ``[section]``)
    
  of cfgKeyValuePair, cfgOption:
      key*, value*: string   ## contains the (key, value) pair if an option
                             ## of the form ``--key: value`` or an ordinary
                             ## ``key= value`` pair has been parsed.
                             ## ``value==""`` if it was not specified in the
                             ## configuration file.
    
  of cfgError:              ## the parser encountered an error: `msg`
      msg*: string           ## contains the error message. No exceptions
                             ## are thrown if a parse error occurs.
```
  describes a parsing event [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L124)  
```
CfgParser = object of BaseLexer
  tok: Token
  filename: string
```
  the parser object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L147)  
```
Config = OrderedTableRef[string, OrderedTableRef[string, string]]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L442)   Procs
-----

  
```
proc open(c: var CfgParser; input: Stream; filename: string; lineOffset = 0) {...}{.
    gcsafe, extern: "npc$1", raises: [IOError, OSError, Exception],
    tags: [ReadIOEffect, RootEffect].}
```
  initializes the parser with an input stream. `Filename` is only used for nice error messages. `lineOffset` can be used to influence the line number information in the generated error messages. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L158)  
```
proc close(c: var CfgParser) {...}{.gcsafe, extern: "npc$1",
                               raises: [Exception, IOError, OSError],
                               tags: [WriteIOEffect].}
```
  closes the parser `c` and its associated input stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L170)  
```
proc getColumn(c: CfgParser): int {...}{.gcsafe, extern: "npc$1", raises: [],
                                    tags: [].}
```
  get the current column the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L174)  
```
proc getLine(c: CfgParser): int {...}{.gcsafe, extern: "npc$1", raises: [], tags: [].}
```
  get the current line the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L178)  
```
proc getFilename(c: CfgParser): string {...}{.gcsafe, extern: "npc$1", raises: [],
    tags: [].}
```
  get the filename of the file that the parser processes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L182)  
```
proc errorStr(c: CfgParser; msg: string): string {...}{.gcsafe, extern: "npc$1",
    raises: [ValueError], tags: [].}
```
  returns a properly formatted error message containing current line and column information. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L369)  
```
proc warningStr(c: CfgParser; msg: string): string {...}{.gcsafe, extern: "npc$1",
    raises: [ValueError], tags: [].}
```
  returns a properly formatted warning message containing current line and column information. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L375)  
```
proc ignoreMsg(c: CfgParser; e: CfgEvent): string {...}{.gcsafe, extern: "npc$1",
    raises: [ValueError], tags: [].}
```
  returns a properly formatted warning message containing that an entry is ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L381)  
```
proc next(c: var CfgParser): CfgEvent {...}{.gcsafe, extern: "npc$1",
                                        raises: [IOError, OSError, ValueError],
                                        tags: [ReadIOEffect].}
```
  retrieves the first/next event. This controls the parser. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L412)  
```
proc newConfig(): Config {...}{.raises: [], tags: [].}
```
  Create a new configuration table. Useful when wanting to create a configuration file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L444)  
```
proc loadConfig(stream: Stream; filename: string = "[stream]"): Config {...}{.
    raises: [IOError, OSError, Exception, ValueError, KeyError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Load the specified configuration from stream into a new Config instance. `filename` parameter is only used for nicer error messages. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L449)  
```
proc loadConfig(filename: string): Config {...}{.
    raises: [IOError, Exception, OSError, ValueError, KeyError],
    tags: [WriteIOEffect, ReadIOEffect, RootEffect].}
```
  Load the specified configuration file into a new Config instance. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L482) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L482)  
```
proc writeConfig(dict: Config; stream: Stream) {...}{.raises: [IOError, OSError],
    tags: [WriteIOEffect].}
```
  Writes the contents of the table to the specified stream

 **Note:** Comment statement will be ignored.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L507)  
```
proc `$`(dict: Config): string {...}{.raises: [Exception, IOError, OSError],
                                 tags: [WriteIOEffect].}
```
  Writes the contents of the table to string. Note: Comment statement will be ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L547)  
```
proc writeConfig(dict: Config; filename: string) {...}{.raises: [IOError, OSError],
    tags: [WriteIOEffect].}
```
  Writes the contents of the table to the specified configuration file. Note: Comment statement will be ignored. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L555)  
```
proc getSectionValue(dict: Config; section, key: string; defaultVal = ""): string {...}{.
    raises: [KeyError], tags: [].}
```
  Gets the key value of the specified Section. Returns the specified default value if the specified key does not exist. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L563)  
```
proc setSectionKey(dict: var Config; section, key, value: string) {...}{.
    raises: [KeyError], tags: [].}
```
  Sets the Key value of the specified Section. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L574)  
```
proc delSection(dict: var Config; section: string) {...}{.raises: [], tags: [].}
```
  Deletes the specified section and all of its sub keys. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L582)  
```
proc delSectionKey(dict: var Config; section, key: string) {...}{.raises: [KeyError],
    tags: [].}
```
  Delete the key of the specified section. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecfg.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecfg.nim#L586)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parsecfg.html>

parsecsv
========

 This module implements a simple high performance CSV (comma separated value) parser. 


Basic usage
-----------



```
import parsecsv
from os import paramStr
from streams import newFileStream

var s = newFileStream(paramStr(1), fmRead)
if s == nil:
  quit("cannot open the file" & paramStr(1))

var x: CsvParser
open(x, s, paramStr(1))
while readRow(x):
  echo "new row: "
  for val in items(x.row):
    echo "##", val, "##"
close(x)
```

For CSV files with a header row, the header can be read and then used as a reference for item access with [rowEntry](#rowEntry,CsvParser,string):

 
```
import parsecsv

# Prepare a file
let content = """One,Two,Three,Four
1,2,3,4
10,20,30,40
100,200,300,400
"""
writeFile("temp.csv", content)

var p: CsvParser
p.open("temp.csv")
p.readHeaderRow()
while p.readRow():
  echo "new row: "
  for col in items(p.headers):
    echo "##", col, ":", p.rowEntry(col), "##"
p.close()
```
 See also
--------


* [streams module](streams) for using [open proc](#open,CsvParser,Stream,string,char,char,char) and other stream processing (like [close proc](streams#close,Stream))
* [parseopt module](parseopt) for a command line parser
* [parsecfg module](parsecfg) for a configuration file parser
* [parsexml module](parsexml) for a XML / HTML parser
* [parsesql module](parsesql) for a SQL parser
* [other parsers](lib#pure-libraries-parsers) for other parsers

 Imports
-------

  <lexbase>, <streams>, <os>  Types
-----

  
```
CsvRow = seq[string]
```
  A row in a CSV file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L72)  
```
CsvParser = object of BaseLexer
  row*: CsvRow
  filename: string
  sep, quote, esc: char
  skipWhite: bool
  currRow: int
  headers*: seq[string]
```
  The parser object.

 It consists of two public fields:

 * `row` is the current row
* `headers` are the columns that are defined in the csv file (read using [readHeaderRow](#readHeaderRow,CsvParser)). Used with [rowEntry](#rowEntry,CsvParser,string)).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L73)  
```
CsvError = object of IOError
```
  An exception that is raised if a parsing error occurs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L87)   Procs
-----

  
```
proc open(my: var CsvParser; input: Stream; filename: string; separator = ',';
          quote = '\"'; escape = '\x00'; skipInitialSpace = false) {...}{.
    raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  Initializes the parser with an input stream. `Filename` is only used for nice error messages. The parser's behaviour can be controlled by the diverse optional parameters:* `separator`: character used to separate fields
* `quote`: Used to quote fields containing special characters like `separator`, `quote` or new-line characters. '\0' disables the parsing of quotes.
* `escape`: removes any special meaning from the following character; '\0' disables escaping; if escaping is disabled and `quote` is not '\0', two `quote` characters are parsed one literal `quote` character.
* `skipInitialSpace`: If true, whitespace immediately following the `separator` is ignored.

 See also:

 * [open proc](#open,CsvParser,string,char,char,char) which creates the file stream for you

 **Example:**

 
```
import streams
var strm = newStringStream("One,Two,Three\n1,2,3\n10,20,30")
var parser: CsvParser
parser.open(strm, "tmp.csv")
parser.close()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L103)  
```
proc open(my: var CsvParser; filename: string; separator = ','; quote = '\"';
          escape = '\x00'; skipInitialSpace = false) {...}{.
    raises: [CsvError, IOError, OSError], tags: [ReadIOEffect].}
```
  Similar to the [other open proc](#open,CsvParser,Stream,string,char,char,char), but creates the file stream for you. **Example:**

 
```
from os import removeFile
writeFile("tmp.csv", "One,Two,Three\n1,2,3\n10,20,300")
var parser: CsvParser
parser.open("tmp.csv")
parser.close()
removeFile("tmp.csv")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L139)  
```
proc processedRows(my: var CsvParser): int {...}{.raises: [], tags: [].}
```
  Returns number of the processed rows.

 But even if [readRow](#readRow,CsvParser,int) arrived at EOF then processed rows counter is incremented.

 **Example:**

 
```
import streams

var strm = newStringStream("One,Two,Three\n1,2,3")
var parser: CsvParser
parser.open(strm, "tmp.csv")
doAssert parser.readRow()
doAssert parser.processedRows() == 1
doAssert parser.readRow()
doAssert parser.processedRows() == 2
## Even if `readRow` arrived at EOF then `processedRows` is incremented.
doAssert parser.readRow() == false
doAssert parser.processedRows() == 3
doAssert parser.readRow() == false
doAssert parser.processedRows() == 4
parser.close()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L200)  
```
proc readRow(my: var CsvParser; columns = 0): bool {...}{.
    raises: [IOError, OSError, CsvError], tags: [ReadIOEffect].}
```
  Reads the next row; if `columns` > 0, it expects the row to have exactly this many columns. Returns false if the end of the file has been encountered else true.

 Blank lines are skipped.

 **Example:**

 
```
import streams
var strm = newStringStream("One,Two,Three\n1,2,3\n\n10,20,30")
var parser: CsvParser
parser.open(strm, "tmp.csv")
doAssert parser.readRow()
doAssert parser.row == @["One", "Two", "Three"]
doAssert parser.readRow()
doAssert parser.row == @["1", "2", "3"]
## Blank lines are skipped.
doAssert parser.readRow()
doAssert parser.row == @["10", "20", "30"]

var emptySeq: seq[string]
doAssert parser.readRow() == false
doAssert parser.row == emptySeq
doAssert parser.readRow() == false
doAssert parser.row == emptySeq

parser.close()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L225)  
```
proc close(my: var CsvParser) {...}{.inline, raises: [Exception, IOError, OSError],
                                tags: [WriteIOEffect].}
```
  Closes the parser `my` and its associated input stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L290)  
```
proc readHeaderRow(my: var CsvParser) {...}{.raises: [IOError, OSError, CsvError],
                                        tags: [ReadIOEffect].}
```
  Reads the first row and creates a look-up table for column numbers See also:* [rowEntry proc](#rowEntry,CsvParser,string)

 **Example:**

 
```
import streams

var strm = newStringStream("One,Two,Three\n1,2,3")
var parser: CsvParser
parser.open(strm, "tmp.csv")

parser.readHeaderRow()
doAssert parser.headers == @["One", "Two", "Three"]
doAssert parser.row == @["One", "Two", "Three"]

doAssert parser.readRow()
doAssert parser.headers == @["One", "Two", "Three"]
doAssert parser.row == @["1", "2", "3"]

parser.close()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L294)  
```
proc rowEntry(my: var CsvParser; entry: string): var string {...}{.
    raises: [KeyError], tags: [].}
```
  Accesses a specified `entry` from the current row.

 Assumes that [readHeaderRow](#readHeaderRow,CsvParser) has already been called.

 If specified `entry` does not exist, raises KeyError.

 **Example:**

 
```
import streams
var strm = newStringStream("One,Two,Three\n1,2,3\n\n10,20,30")
var parser: CsvParser
parser.open(strm, "tmp.csv")
## Requires calling `readHeaderRow`.
parser.readHeaderRow()
doAssert parser.readRow()
doAssert parser.rowEntry("One") == "1"
doAssert parser.rowEntry("Two") == "2"
doAssert parser.rowEntry("Three") == "3"
doAssertRaises(KeyError):
  discard parser.rowEntry("NonexistentEntry")
parser.close()
strm.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsecsv.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsecsv.nim#L320)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parsecsv.html>

parseopt
========

 This module provides the standard Nim command line parser. It supports one convenience iterator over all command line options and some lower-level features. 


Supported Syntax
----------------


The following syntax is supported when arguments for the `shortNoVal` and `longNoVal` parameters, which are [described later](#shortnoval-and-longnoval), are not provided:

 1. Short options: `-abcd`, `-e:5`, `-e=5`
2. Long options: `--foo:bar`, `--foo=bar`, `--foo`
3. Arguments: everything that does not start with a `-`

 These three kinds of tokens are enumerated in the [CmdLineKind enum](#CmdLineKind).

 When option values begin with ':' or '=', they need to be doubled up (as in `--delim::`) or alternated (as in `--delim=:`).

 The `--` option, commonly used to denote that every token that follows is an argument, is interpreted as a long option, and its name is the empty string.

 Parsing
-------


Use an [OptParser](#OptParser) to parse command line options. It can be created with [initOptParser](#initOptParser,string,set%5Bchar%5D,seq%5Bstring%5D), and [next](#next,OptParser) advances the parser by one token.

 For each token, the parser's `kind`, `key`, and `val` fields give information about that token. If the token is a long or short option, `key` is the option's name, and `val` is either the option's value, if provided, or the empty string. For arguments, the `key` field contains the argument itself, and `val` is unused. To check if the end of the command line has been reached, check if `kind` is equal to `cmdEnd`.

 Here is an example:

 
```
import parseopt

var p = initOptParser("-ab -e:5 --foo --bar=20 file.txt")
while true:
  p.next()
  case p.kind
  of cmdEnd: break
  of cmdShortOption, cmdLongOption:
    if p.val == "":
      echo "Option: ", p.key
    else:
      echo "Option and value: ", p.key, ", ", p.val
  of cmdArgument:
    echo "Argument: ", p.key

# Output:
# Option: a
# Option: b
# Option and value: e, 5
# Option: foo
# Option and value: bar, 20
# Argument: file.txt
```

The [getopt iterator](#getopt.i,OptParser), which is provided for convenience, can be used to iterate through all command line options as well.

 
`shortNoVal` and `longNoVal`
-----------------------------


The optional `shortNoVal` and `longNoVal` parameters present in [initOptParser](#initOptParser,string,set%5Bchar%5D,seq%5Bstring%5D) are for specifying which short and long options do not accept values.

 When `shortNoVal` is non-empty, users are not required to separate short options and their values with a ':' or '=' since the parser knows which options accept values and which ones do not. This behavior also applies for long options if `longNoVal` is non-empty. For short options, `-j4` becomes supported syntax, and for long options, `--foo bar` becomes supported. This is in addition to the [previously mentioned syntax](#supported-syntax). Users can still separate options and their values with ':' or '=', but that becomes optional.

 As more options which do not accept values are added to your program, remember to amend `shortNoVal` and `longNoVal` accordingly.

 The following example illustrates the difference between having an empty `shortNoVal` and `longNoVal`, which is the default, and providing arguments for those two parameters:

 
```
import parseopt

proc printToken(kind: CmdLineKind, key: string, val: string) =
  case kind
  of cmdEnd: doAssert(false)  # Doesn't happen with getopt()
  of cmdShortOption, cmdLongOption:
    if val == "":
      echo "Option: ", key
    else:
      echo "Option and value: ", key, ", ", val
  of cmdArgument:
    echo "Argument: ", key

let cmdLine = "-j4 --first bar"

var emptyNoVal = initOptParser(cmdLine)
for kind, key, val in emptyNoVal.getopt():
  printToken(kind, key, val)

# Output:
# Option: j
# Option: 4
# Option: first
# Argument: bar

var withNoVal = initOptParser(cmdLine, shortNoVal = {'c'},
                              longNoVal = @["second"])
for kind, key, val in withNoVal.getopt():
  printToken(kind, key, val)

# Output:
# Option and value: j, 4
# Option and value: first, bar
```
 See also
--------


* [os module](os) for lower-level command line parsing procs
* [parseutils module](parseutils) for helpers that parse tokens, numbers, identifiers, etc.
* [strutils module](strutils) for common string handling operations
* [json module](json) for a JSON parser
* [parsecfg module](parsecfg) for a configuration file parser
* [parsecsv module](parsecsv) for a simple CSV (comma separated value) parser
* [parsexml module](parsexml) for a XML / HTML parser
* [other parsers](lib#pure-libraries-parsers) for more parsers

 Imports
-------

  <os>  Types
-----

  
```
CmdLineKind = enum
  cmdEnd,                   ## End of command line reached
  cmdArgument,              ## An argument such as a filename
  cmdLongOption,            ## A long option such as --option
  cmdShortOption             ## A short option such as -c
```
  The detected command line token. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L157)  
```
OptParser = object of RootObj
  pos*: int
  inShortState: bool
  allowWhitespaceAfterColon: bool
  shortNoVal: set[char]
  longNoVal: seq[string]
  cmds: seq[string]
  idx: int
  kind*: CmdLineKind         ## The detected command line token
  key*, val*: TaintedString  ## Key and value pair; the key is the option
                             ## or the argument, and the value is not "" if
                             ## the option was given a value
```
   Implementation of the command line parser.

 To initialize it, use the [initOptParser proc](#initOptParser,string,set%5Bchar%5D,seq%5Bstring%5D).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L162)   Procs
-----

  
```
proc initOptParser(cmdline = ""; shortNoVal: set[char] = {};
                   longNoVal: seq[string] = @[];
                   allowWhitespaceAfterColon = true): OptParser {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  Initializes the command line parser.

 If `cmdline == ""`, the real command line as provided by the `os` module is retrieved instead.

 `shortNoVal` and `longNoVal` are used to specify which options do not take values. See the [documentation about these parameters](#shortnoval-and-longnoval) for more information on how this affects parsing.

 See also:

 * [getopt iterator](#getopt.i,OptParser)

 **Example:**

 
```
var p = initOptParser()
p = initOptParser("--left --debug:3 -l -r:2")
p = initOptParser("--left --debug:3 -l -r:2",
                  shortNoVal = {'l'}, longNoVal = @["left"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L199)  
```
proc initOptParser(cmdline: seq[TaintedString]; shortNoVal: set[char] = {};
                   longNoVal: seq[string] = @[];
                   allowWhitespaceAfterColon = true): OptParser {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  Initializes the command line parser.

 If `cmdline.len == 0`, the real command line as provided by the `os` module is retrieved instead. Behavior of the other parameters remains the same as in [initOptParser(string, ...)](#initOptParser,string,set%5Bchar%5D,seq%5Bstring%5D).

 See also:

 * [getopt iterator](#getopt.i,seq%5BTaintedString%5D,set%5Bchar%5D,seq%5Bstring%5D)

 **Example:**

 
```
var p = initOptParser()
p = initOptParser(@["--left", "--debug:3", "-l", "-r:2"])
p = initOptParser(@["--left", "--debug:3", "-l", "-r:2"],
                  shortNoVal = {'l'}, longNoVal = @["left"])
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L237)  
```
proc next(p: var OptParser) {...}{.gcsafe, extern: "npo$1", raises: [], tags: [].}
```
  Parses the next token.

 `p.kind` describes what kind of token has been parsed. `p.key` and `p.val` are set accordingly.

 **Example:**

 
```
var p = initOptParser("--left -r:2 file.txt")
p.next()
doAssert p.kind == cmdLongOption and p.key == "left"
p.next()
doAssert p.kind == cmdShortOption and p.key == "r" and p.val == "2"
p.next()
doAssert p.kind == cmdArgument and p.key == "file.txt"
p.next()
doAssert p.kind == cmdEnd
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L299)  
```
proc cmdLineRest(p: OptParser): TaintedString {...}{.gcsafe, extern: "npo$1",
    raises: [], tags: [].}
```
  Retrieves the rest of the command line that has not been parsed yet.

 See also:

 * [remainingArgs proc](#remainingArgs,OptParser)

 **Examples:**

 
```
var p = initOptParser("--left -r:2 -- foo.txt bar.txt")
while true:
  p.next()
  if p.kind == cmdLongOption and p.key == "":  # Look for "--"
    break
  else: continue
doAssert p.cmdLineRest == "foo.txt bar.txt"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L369)  
```
proc remainingArgs(p: OptParser): seq[TaintedString] {...}{.gcsafe, extern: "npo$1",
    raises: [], tags: [].}
```
  Retrieves a sequence of the arguments that have not been parsed yet.

 See also:

 * [cmdLineRest proc](#cmdLineRest,OptParser)

 **Examples:**

 
```
var p = initOptParser("--left -r:2 -- foo.txt bar.txt")
while true:
  p.next()
  if p.kind == cmdLongOption and p.key == "":  # Look for "--"
    break
  else: continue
doAssert p.remainingArgs == @["foo.txt", "bar.txt"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L387)   Iterators
---------

  
```
iterator getopt(p: var OptParser): tuple[kind: CmdLineKind,
    key, val: TaintedString] {...}{.raises: [], tags: [].}
```
  Convenience iterator for iterating over the given [OptParser](#OptParser).

 There is no need to check for `cmdEnd` while iterating.

 See also:

 * [initOptParser proc](#initOptParser,string,set%5Bchar%5D,seq%5Bstring%5D)

 **Examples:**

 
```
# these are placeholders, of course
proc writeHelp() = discard
proc writeVersion() = discard

var filename: string
var p = initOptParser("--left --debug:3 -l -r:2")

for kind, key, val in p.getopt():
  case kind
  of cmdArgument:
    filename = key
  of cmdLongOption, cmdShortOption:
    case key
    of "help", "h": writeHelp()
    of "version", "v": writeVersion()
  of cmdEnd: assert(false) # cannot happen
if filename == "":
  # no filename has been given, so we show the help
  writeHelp()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L406)  
```
iterator getopt(cmdline: seq[TaintedString] = commandLineParams();
                shortNoVal: set[char] = {}; longNoVal: seq[string] = @[]): tuple[
    kind: CmdLineKind, key, val: TaintedString] {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  Convenience iterator for iterating over command line arguments.

 This creates a new [OptParser](#OptParser). If no command line arguments are provided, the real command line as provided by the `os` module is retrieved instead.

 `shortNoVal` and `longNoVal` are used to specify which options do not take values. See the [documentation about these parameters](#shortnoval-and-longnoval) for more information on how this affects parsing.

 There is no need to check for `cmdEnd` while iterating.

 See also:

 * [initOptParser proc](#initOptParser,seq%5BTaintedString%5D,set%5Bchar%5D,seq%5Bstring%5D)

 **Examples:**

 
```
# these are placeholders, of course
proc writeHelp() = discard
proc writeVersion() = discard

var filename: string
let params = @["--left", "--debug:3", "-l", "-r:2"]

for kind, key, val in getopt(params):
  case kind
  of cmdArgument:
    filename = key
  of cmdLongOption, cmdShortOption:
    case key
    of "help", "h": writeHelp()
    of "version", "v": writeVersion()
  of cmdEnd: assert(false) # cannot happen
if filename == "":
  # no filename has been written, so we show the help
  writeHelp()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parseopt.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parseopt.nim#L446)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parseopt.html>

parsesql
========


The `parsesql` module implements a high performance SQL file parser. It parses PostgreSQL syntax and the SQL ANSI standard.

 Unstable API.

 Imports
-------

  <strutils>, <lexbase>, <streams>  Types
-----

  
```
SqlLexer = object of BaseLexer
  filename: string
```
  the parser object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L47)  
```
SqlNodeKind = enum
  nkNone, nkIdent, nkQuotedIdent, nkStringLit, nkBitStringLit, nkHexStringLit,
  nkIntegerLit, nkNumericLit, nkPrimaryKey, nkForeignKey, nkNotNull, nkNull,
  nkStmtList, nkDot, nkDotDot, nkPrefix, nkInfix, nkCall, nkPrGroup,
  nkColumnReference, nkReferences, nkDefault, nkCheck, nkConstraint, nkUnique,
  nkIdentity, nkColumnDef,  ## name, datatype, constraints
  nkInsert, nkUpdate, nkDelete, nkSelect, nkSelectDistinct, nkSelectColumns,
  nkSelectPair, nkAsgn, nkFrom, nkFromItemPair, nkGroup, nkLimit, nkHaving,
  nkOrder, nkJoin, nkDesc, nkUnion, nkIntersect, nkExcept, nkColumnList,
  nkValueList, nkWhere, nkCreateTable, nkCreateTableIfNotExists, nkCreateType,
  nkCreateTypeIfNotExists, nkCreateIndex, nkCreateIndexIfNotExists, nkEnumDef
```
  kind of SQL abstract syntax tree [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L480)  
```
SqlParseError = object of ValueError
```
  Invalid SQL encountered [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L546)  
```
SqlNode = ref SqlNodeObj
```
  an SQL abstract syntax tree node [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L547)  
```
SqlNodeObj = object
  case kind*: SqlNodeKind    ## kind of syntax tree
  of LiteralNodes:
      strVal*: string        ## AST leaf: the identifier, numeric literal
                             ## string literal, etc.
    
  else:
      sons*: seq[SqlNode]    ## the node's children
```
  an SQL abstract syntax tree node [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L548)  
```
SqlParser = object of SqlLexer
  tok: Token
```
  SQL parser object [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L556)   Procs
-----

  
```
proc newNode(k: SqlNodeKind): SqlNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L559)  
```
proc newNode(k: SqlNodeKind; s: string): SqlNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L569)  
```
proc newNode(k: SqlNodeKind; sons: seq[SqlNode]): SqlNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L573)  
```
proc len(n: SqlNode): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L577)  
```
proc `[]`(n: SqlNode; i: int): SqlNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L583) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L583)  
```
proc `[]`(n: SqlNode; i: BackwardsIndex): SqlNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L584)  
```
proc add(father, n: SqlNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L586)  
```
proc renderSQL(n: SqlNode; upperCase = false): string {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Converts an SQL abstract syntax tree to its string representation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L1451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L1451)  
```
proc `$`(n: SqlNode): string {...}{.raises: [Exception], tags: [RootEffect].}
```
  an alias for `renderSQL`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L1459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L1459)  
```
proc treeRepr(s: SqlNode): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L1475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L1475)  
```
proc parseSQL(input: Stream; filename: string): SqlNode {...}{.raises: [IOError,
    OSError, IOError, OSError, ValueError, SqlParseError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  parses the SQL from `input` into an AST and returns the AST. `filename` is only used for error messages. Syntax errors raise an `SqlParseError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L1493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L1493)  
```
proc parseSQL(input: string; filename = ""): SqlNode {...}{.
    raises: [IOError, OSError, ValueError, SqlParseError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  parses the SQL from `input` into an AST and returns the AST. `filename` is only used for error messages. Syntax errors raise an `SqlParseError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsesql.nim#L1504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsesql.nim#L1504)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parsesql.html>

parsexml
========

 This module implements a simple high performance XML / HTML parser. The only encoding that is supported is UTF-8. The parser has been designed to be somewhat error correcting, so that even most "wild HTML" found on the web can be parsed with it. **Note:** This parser does not check that each `<tag>` has a corresponding `</tag>`! These checks have do be implemented by the client code for various reasons:


* Old HTML contains tags that have no end tag: `<br>` for example.
* HTML tags are case insensitive, XML tags are case sensitive. Since this library can parse both, only the client knows which comparison is to be used.
* Thus the checks would have been very difficult to implement properly with little benefit, especially since they are simple to implement in the client. The client should use the `errorMsgExpected` proc to generate a nice error message that fits the other error messages this library creates.

 Example 1: Retrieve HTML title
------------------------------


The file `examples/htmltitle.nim` demonstrates how to use the XML parser to accomplish a simple task: To determine the title of an HTML document.

 
```
# Example program to show the parsexml module
# This program reads an HTML file and writes its title to stdout.
# Errors and whitespace are ignored.

import os, streams, parsexml, strutils

if paramCount() < 1:
  quit("Usage: htmltitle filename[.html]")

var filename = addFileExt(paramStr(1), "html")
var s = newFileStream(filename, fmRead)
if s == nil: quit("cannot open the file " & filename)
var x: XmlParser
open(x, s, filename)
while true:
  x.next()
  case x.kind
  of xmlElementStart:
    if cmpIgnoreCase(x.elementName, "title") == 0:
      var title = ""
      x.next()  # skip "<title>"
      while x.kind == xmlCharData:
        title.add(x.charData)
        x.next()
      if x.kind == xmlElementEnd and cmpIgnoreCase(x.elementName, "title") == 0:
        echo("Title: " & title)
        quit(0) # Success!
      else:
        echo(x.errorMsgExpected("/title"))
  
  of xmlEof: break # end of file reached
  else: discard # ignore other events

x.close()
quit("Could not determine title!")
```
 Example 2: Retrieve all HTML links
----------------------------------


The file `examples/htmlrefs.nim` demonstrates how to use the XML parser to accomplish another simple task: To determine all the links an HTML document contains.

 
```
# Example program to show the new parsexml module
# This program reads an HTML file and writes all its used links to stdout.
# Errors and whitespace are ignored.

import os, streams, parsexml, strutils

proc `=?=` (a, b: string): bool =
  # little trick: define our own comparator that ignores case
  return cmpIgnoreCase(a, b) == 0

if paramCount() < 1:
  quit("Usage: htmlrefs filename[.html]")

var links = 0 # count the number of links
var filename = addFileExt(paramStr(1), "html")
var s = newFileStream(filename, fmRead)
if s == nil: quit("cannot open the file " & filename)
var x: XmlParser
open(x, s, filename)
next(x) # get first event
block mainLoop:
  while true:
    case x.kind
    of xmlElementOpen:
      # the <a href = "xyz"> tag we are interested in always has an attribute,
      # thus we search for ``xmlElementOpen`` and not for ``xmlElementStart``
      if x.elementName =?= "a":
        x.next()
        if x.kind == xmlAttribute:
          if x.attrKey =?= "href":
            var link = x.attrValue
            inc(links)
            # skip until we have an ``xmlElementClose`` event
            while true:
              x.next()
              case x.kind
              of xmlEof: break mainLoop
              of xmlElementClose: break
              else: discard
            x.next() # skip ``xmlElementClose``
            # now we have the description for the ``a`` element
            var desc = ""
            while x.kind == xmlCharData:
              desc.add(x.charData)
              x.next()
            echo(desc & ": " & link)
      else:
        x.next()
    of xmlEof: break # end of file reached
    of xmlError:
      echo(errorMsg(x))
      x.next()
    else: x.next() # skip other events

echo($links & " link(s) found!")
x.close()
```
 Imports
-------

  <strutils>, <lexbase>, <streams>, <unicode>, <os>  Types
-----

  
```
XmlEventKind = enum
  xmlError,                 ## an error occurred during parsing
  xmlEof,                   ## end of file reached
  xmlCharData,              ## character data
  xmlWhitespace,            ## whitespace has been parsed
  xmlComment,               ## a comment has been parsed
  xmlPI,                    ## processing instruction (``<?name something ?>``)
  xmlElementStart,          ## ``<elem>``
  xmlElementEnd,            ## ``</elem>``
  xmlElementOpen,           ## ``<elem
  xmlAttribute,             ## ``key = "value"`` pair
  xmlElementClose,          ## ``>``
  xmlCData,                 ## ``<![CDATA[`` ... data ... ``]]>``
  xmlEntity,                ## &entity;
  xmlSpecial                 ## ``<! ... data ... >``
```
  enumeration of all events that may occur when parsing [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L157)  
```
XmlErrorKind = enum
  errNone,                  ## no error
  errEndOfCDataExpected,    ## ``]]>`` expected
  errNameExpected,          ## name expected
  errSemicolonExpected,     ## ``;`` expected
  errQmGtExpected,          ## ``?>`` expected
  errGtExpected,            ## ``>`` expected
  errEqExpected,            ## ``=`` expected
  errQuoteExpected,         ## ``"`` or ``'`` expected
  errEndOfCommentExpected,  ## ``-->`` expected
  errAttributeValueExpected  ## non-empty attribute value expected
```
  enumeration that lists all errors that can occur [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L173)  
```
XmlParseOption = enum
  reportWhitespace,         ## report whitespace
  reportComments,           ## report comments
  allowUnquotedAttribs,     ## allow unquoted attribute values (for HTML)
  allowEmptyAttribs          ## allow empty attributes (without explicit value)
```
  options for the XML parser [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L188)  
```
XmlParser = object of BaseLexer
  a, b, c: string
  kind: XmlEventKind
  err: XmlErrorKind
  state: ParserState
  cIsEmpty: bool
  filename: string
  options: set[XmlParseOption]
```
  the parser object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L194)   Procs
-----

  
```
proc open(my: var XmlParser; input: Stream; filename: string;
          options: set[XmlParseOption] = {}) {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  initializes the parser with an input stream. `Filename` is only used for nice error messages. The parser's behaviour can be controlled by the `options` parameter: If `options` contains `reportWhitespace` a whitespace token is reported as an `xmlWhitespace` event. If `options` contains `reportComments` a comment token is reported as an `xmlComment` event. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L217)  
```
proc close(my: var XmlParser) {...}{.inline, raises: [Exception, IOError, OSError],
                                tags: [WriteIOEffect].}
```
  closes the parser `my` and its associated input stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L235)  
```
proc kind(my: XmlParser): XmlEventKind {...}{.inline, raises: [], tags: [].}
```
  returns the current event type for the XML parser [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L239)  
```
proc rawData(my: var XmlParser): lent string {...}{.inline, raises: [], tags: [].}
```
  returns the underlying 'data' string by reference. This is only used for speed hacks. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L302)  
```
proc rawData2(my: var XmlParser): lent string {...}{.inline, raises: [], tags: [].}
```
  returns the underlying second 'data' string by reference. This is only used for speed hacks. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L307)  
```
proc getColumn(my: XmlParser): int {...}{.inline, raises: [], tags: [].}
```
  get the current column the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L312)  
```
proc getLine(my: XmlParser): int {...}{.inline, raises: [], tags: [].}
```
  get the current line the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L316)  
```
proc getFilename(my: XmlParser): string {...}{.inline, raises: [], tags: [].}
```
  get the filename of the file that the parser processes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L320)  
```
proc errorMsg(my: XmlParser): string {...}{.raises: [ValueError], tags: [].}
```
  returns a helpful error message for the event `xmlError` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L324)  
```
proc errorMsgExpected(my: XmlParser; tag: string): string {...}{.
    raises: [ValueError], tags: [].}
```
  returns an error message "<tag> expected" in the same format as the other error messages [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L330)  
```
proc errorMsg(my: XmlParser; msg: string): string {...}{.raises: [ValueError],
    tags: [].}
```
  returns an error message with text `msg` in the same format as the other error messages [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L336)  
```
proc next(my: var XmlParser) {...}{.raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  retrieves the first/next event. This controls the parser. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L754)   Templates
---------

  
```
template charData(my: XmlParser): string
```
  returns the character data for the events: `xmlCharData`, `xmlWhitespace`, `xmlComment`, `xmlCData`, `xmlSpecial` Raises an assertion in debug mode if `my.kind` is not one of those events. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L243)  
```
template elementName(my: XmlParser): string
```
  returns the element name for the events: `xmlElementStart`, `xmlElementEnd`, `xmlElementOpen` Raises an assertion in debug mode if `my.kind` is not one of those events. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L253)  
```
template entityName(my: XmlParser): string
```
  returns the entity name for the event: `xmlEntity` Raises an assertion in debug mode if `my.kind` is not `xmlEntity`. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L262)  
```
template attrKey(my: XmlParser): string
```
  returns the attribute key for the event `xmlAttribute` Raises an assertion in debug mode if `my.kind` is not `xmlAttribute`. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L270)  
```
template attrValue(my: XmlParser): string
```
  returns the attribute value for the event `xmlAttribute` Raises an assertion in debug mode if `my.kind` is not `xmlAttribute`. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L278)  
```
template piName(my: XmlParser): string
```
  returns the processing instruction name for the event `xmlPI` Raises an assertion in debug mode if `my.kind` is not `xmlPI`. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L286)  
```
template piRest(my: XmlParser): string
```
  returns the rest of the processing instruction for the event `xmlPI` Raises an assertion in debug mode if `my.kind` is not `xmlPI`. In release mode, this will not trigger an error but the value returned will not be valid. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsexml.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsexml.nim#L294)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parsexml.html>

highlite
========


Source highlighter for programming or markup languages. Currently only few languages are supported, other languages may be added. The interface supports one language nested in another.

 **Note:** Import `packages/docutils/highlite` to use this module

 You can use this to build your own syntax highlighting, check this example:

 
```
let code = """for x in $int.high: echo x.ord mod 2 == 0"""
var toknizr: GeneralTokenizer
initGeneralTokenizer(toknizr, code)
while true:
  getNextToken(toknizr, langNim)
  case toknizr.kind
  of gtEof: break  # End Of File (or string)
  of gtWhitespace:
    echo gtWhitespace # Maybe you want "visible" whitespaces?.
    echo substr(code, toknizr.start, toknizr.length + toknizr.start - 1)
  of gtOperator:
    echo gtOperator # Maybe you want Operators to use a specific color?.
    echo substr(code, toknizr.start, toknizr.length + toknizr.start - 1)
  # of gtSomeSymbol: syntaxHighlight("Comic Sans", "bold", "99px", "pink")
  else:
    echo toknizr.kind # All the kinds of tokens can be processed here.
    echo substr(code, toknizr.start, toknizr.length + toknizr.start - 1)
```

The proc `getSourceLanguage` can get the language `enum` from a string:

 
```
for l in ["C", "c++", "jAvA", "Nim", "c#"]: echo getSourceLanguage(l)
```
 Types
-----

  
```
TokenClass = enum
  gtEof, gtNone, gtWhitespace, gtDecNumber, gtBinNumber, gtHexNumber,
  gtOctNumber, gtFloatNumber, gtIdentifier, gtKeyword, gtStringLit,
  gtLongStringLit, gtCharLit, gtEscapeSequence, gtOperator, gtPunctuation,
  gtComment, gtLongComment, gtRegularExpression, gtTagStart, gtTagEnd, gtKey,
  gtValue, gtRawData, gtAssembler, gtPreprocessor, gtDirective, gtCommand,
  gtRule, gtHyperlink, gtLabel, gtReference, gtOther
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L48)  
```
GeneralTokenizer = object of RootObj
  kind*: TokenClass
  start*, length*: int
  buf: cstring
  pos: int
  state: TokenClass
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L56)  
```
SourceLanguage = enum
  langNone, langNim, langCpp, langCsharp, langC, langJava, langYaml
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L63)   Consts
------

  
```
sourceLanguageToStr: array[SourceLanguage, string] = ["none", "Nim", "C++",
    "C#", "C", "Java", "Yaml"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L68)  
```
tokenClassToStr: array[TokenClass, string] = ["Eof", "None", "Whitespace",
    "DecNumber", "BinNumber", "HexNumber", "OctNumber", "FloatNumber",
    "Identifier", "Keyword", "StringLit", "LongStringLit", "CharLit",
    "EscapeSequence", "Operator", "Punctuation", "Comment", "LongComment",
    "RegularExpression", "TagStart", "TagEnd", "Key", "Value", "RawData",
    "Assembler", "Preprocessor", "Directive", "Command", "Rule", "Hyperlink",
    "Label", "Reference", "Other"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L70)   Procs
-----

  
```
proc getSourceLanguage(name: string): SourceLanguage {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L92)  
```
proc initGeneralTokenizer(g: var GeneralTokenizer; buf: cstring) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L98)  
```
proc initGeneralTokenizer(g: var GeneralTokenizer; buf: string) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L108)  
```
proc deinitGeneralTokenizer(g: var GeneralTokenizer) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L111)  
```
proc getNextToken(g: var GeneralTokenizer; lang: SourceLanguage) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/highlite.nim#L889) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/highlite.nim#L889)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/highlite.html>

rst
===


This module implements a reStructuredText parser. A large subset is implemented. Some features of the markdown wiki syntax are also supported.

 **Note:** Import `packages/docutils/rst` to use this module

 Imports
-------

  <rstast>  Types
-----

  
```
RstParseOption = enum
  roSkipPounds,             ## skip ``#`` at line beginning (documentation
                             ## embedded in Nim comments)
  roSupportSmilies,         ## make the RST parser support smilies like ``:)``
  roSupportRawDirective,    ## support the ``raw`` directive (don't support
                             ## it for sandboxing)
  roSupportMarkdown          ## support additional features of markdown
```
  options for the RST parser [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L20)  
```
RstParseOptions = set[RstParseOption]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L28)  
```
MsgClass = enum
  mcHint = "Hint", mcWarning = "Warning", mcError = "Error"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L30)  
```
MsgKind = enum
  meCannotOpenFile, meExpected, meGridTableNotImplemented, meNewSectionExpected,
  meGeneralParseError, meInvalidDirective, mwRedefinitionOfLabel,
  mwUnknownSubstitution, mwUnsupportedLanguage, mwUnsupportedField
```
  the possible messages [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L35)  
```
MsgHandler = proc (filename: string; line, col: int; msgKind: MsgKind;
                   arg: string) {...}{.closure, gcsafe.}
```
  what to do in case of an error [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L47)  
```
FindFileHandler = proc (filename: string): string {...}{.closure, gcsafe.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L49)  
```
EParseError = object of ValueError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L297)   Procs
-----

  
```
proc whichMsgClass(k: MsgKind): MsgClass {...}{.raises: [], tags: [].}
```
  returns which message class `k` belongs to. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L299)  
```
proc defaultMsgHandler(filename: string; line, col: int; msgkind: MsgKind;
                       arg: string) {...}{.raises: [ValueError, EParseError, IOError],
                                      tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L307)  
```
proc defaultFindFile(filename: string): string {...}{.raises: [],
    tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L315)  
```
proc addNodes(n: PRstNode): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L372)  
```
proc rstnodeToRefname(n: PRstNode): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L427)  
```
proc getFieldValue(n: PRstNode): string {...}{.raises: [], tags: [].}
```
  Returns the value of a specific `rnField` node.

 This proc will assert if the node is not of the expected type. The empty string will be returned as a minimum. Any value in the rst will be stripped form leading/trailing whitespace.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L987) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L987)  
```
proc getFieldValue(n: PRstNode; fieldname: string): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L999) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L999)  
```
proc getArgument(n: PRstNode): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L1013)  
```
proc rstParse(text, filename: string; line, column: int; hasToc: var bool;
              options: RstParseOptions; findFile: FindFileHandler = nil;
              msgHandler: MsgHandler = nil): PRstNode {...}{.raises: [Exception],
    tags: [ReadEnvEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rst.nim#L1818) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rst.nim#L1818)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rst.html>

rstast
======


This module implements an AST for the reStructuredText parser.

 **Note:** Import `packages/docutils/rstast` to use this module

 Types
-----

  
```
RstNodeKind = enum
  rnInner, rnHeadline, rnOverline, rnTransition, rnParagraph, rnBulletList,
  rnBulletItem, rnEnumList, rnEnumItem, rnDefList, rnDefItem, rnDefName,
  rnDefBody, rnFieldList, rnField, rnFieldName, rnFieldBody, rnOptionList,
  rnOptionListItem, rnOptionGroup, rnOption, rnOptionString, rnOptionArgument,
  rnDescription, rnLiteralBlock, rnQuotedLiteralBlock, rnLineBlock,
  rnLineBlockItem, rnBlockQuote, rnTable, rnGridTable, rnTableRow,
  rnTableHeaderCell, rnTableDataCell, rnLabel, rnFootnote, rnCitation,
  rnStandaloneHyperlink, rnHyperlink, rnRef, rnDirective, rnDirArg, rnRaw,
  rnTitle, rnContents, rnImage, rnFigure, rnCodeBlock, rnRawHtml, rnRawLatex,
  rnContainer, rnIndex, rnSubstitutionDef, rnGeneralRole, rnSub, rnSup, rnIdx,
  rnEmphasis, rnStrongEmphasis, rnTripleEmphasis, rnInterpretedText,
  rnInlineLiteral, rnSubstitutionReferences, rnSmiley, rnLeaf
```
  the possible node kinds of an PRstNode [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L17)  
```
PRstNode = ref RstNode
```
  an RST node [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L67)  
```
RstNodeSeq = seq[PRstNode]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L68)  
```
RstNode {...}{.acyclic, final.} = object
  kind*: RstNodeKind         ## the node's kind
  text*: string              ## valid for leafs in the AST; and the title of
                             ## the document or the section
  level*: int                ## valid for some node kinds
  sons*: RstNodeSeq          ## the node's sons
```
  an RST node's description [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L69)   Procs
-----

  
```
proc len(n: PRstNode): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L76)  
```
proc newRstNode(kind: RstNodeKind): PRstNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L79)  
```
proc newRstNode(kind: RstNodeKind; s: string): PRstNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L84)  
```
proc lastSon(n: PRstNode): PRstNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L88)  
```
proc add(father, son: PRstNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L91)  
```
proc add(father: PRstNode; s: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L94)  
```
proc addIfNotNil(father, son: PRstNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L97)  
```
proc renderRstToRst(n: PRstNode; result: var string) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  renders `n` into its string representation and appends to `result`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L290)  
```
proc renderRstToJson(node: PRstNode): string {...}{.raises: [], tags: [].}
```
  Writes the given RST node as JSON that is in the form
```
{
  "kind":string node.kind,
  "text":optional string node.text,
  "level":optional int node.level,
  "sons":optional node array
}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstast.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstast.nim#L309)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rstast.html>

rstgen
======


This module implements a generator of HTML/Latex from reStructuredText (see <http://docutils.sourceforge.net/rst.html> for information on this markup syntax) and is used by the compiler's [docgen tools](https://nim-lang.org/docs/docgen.html).

 You can generate HTML output through the convenience proc `rstToHtml`, which provided an input string with rst markup returns a string with the generated HTML. The final output is meant to be embedded inside a full document you provide yourself, so it won't contain the usual `<header>` or `<body>` parts.

 You can also create a `RstGenerator` structure and populate it with the other lower level methods to finally build complete documents. This requires many options and tweaking, but you are not limited to snippets and can generate [LaTeX documents](https://en.wikipedia.org/wiki/LaTeX) too.

 **Note:** Import `packages/docutils/rstgen` to use this module

 Imports
-------

  <rstast>, <rst>, <highlite>  Types
-----

  
```
OutputTarget = enum
  outHtml, outLatex
```
  which document type to generate [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L38)  
```
MetaEnum = enum
  metaNone, metaTitle, metaSubtitle, metaAuthor, metaVersion
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L46)  
```
RstGenerator = object of RootObj
  target*: OutputTarget
  config*: StringTableRef
  splitAfter*: int
  listingCounter*: int
  tocPart*: seq[TocEntry]
  hasToc*: bool
  theIndex: string
  options*: RstParseOptions
  findFile*: FindFileHandler
  msgHandler*: MsgHandler
  outDir*: string            ## output directory, initialized by docgen.nim
  destFile*: string          ## output (HTML) file, initialized by docgen.nim
  filename*: string          ## source Nim or Rst file
  meta*: array[MetaEnum, string]
  currentSection: string ## \
                         ## Stores the empty string or the last headline/overline found in the rst
                         ## document, so it can be used as a prettier name for term index generation.
  seenIndexTerms: Table[string, int] ## \
                                     ## Keeps count of same text index terms to generate different identifiers
                                     ## for hyperlinks. See renderIndexTerm proc for details.
  id*: int                   ## A counter useful for generating IDs.
  onTestSnippet*: proc (d: var RstGenerator; filename, cmd: string; status: int;
                        content: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L49)   Consts
------

  
```
IndexExt = ".idx"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L35)   Procs
-----

  
```
proc prettyLink(file: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L85)  
```
proc initRstGenerator(g: var RstGenerator; target: OutputTarget;
                      config: StringTableRef; filename: string;
                      options: RstParseOptions; findFile: FindFileHandler = nil;
                      msgHandler: MsgHandler = nil) {...}{.raises: [ValueError],
    tags: [].}
```
  Initializes a `RstGenerator`.

 You need to call this before using a `RstGenerator` with any other procs in this module. Pass a non `nil` `StringTableRef` value as `config` with parameters used by the HTML output generator. If you don't know what to use, pass the results of the `defaultConfig() <#defaultConfig>_` proc.

 The `filename` parameter will be used for error reporting and creating index hyperlinks to the file, but you can pass an empty string here if you are parsing a stream in memory. If `filename` ends with the `.nim` extension, the title for the document will be set by default to `Module filename`. This default title can be overridden by the embedded rst, but it helps to prettify the generated index if no title is found.

 The `RstParseOptions`, `FindFileHandler` and `MsgHandler` types are defined in the the [packages/docutils/rst module](rst). `options` selects the behaviour of the rst parser.

 `findFile` is a proc used by the rst `include` directive among others. The purpose of this proc is to mangle or filter paths. It receives paths specified in the rst document and has to return a valid path to existing files or the empty string otherwise. If you pass `nil`, a default proc will be used which given a path returns the input path only if the file exists. One use for this proc is to transform relative paths found in the document to absolute path, useful if the rst file and the resources it references are not in the same directory as the current working directory.

 The `msgHandler` is a proc used for user error reporting. It will be called with the filename, line, col, and type of any error found during parsing. If you pass `nil`, a default message handler will be used which writes the messages to the standard output.

 Example:

 
```
import packages/docutils/rstgen

var gen: RstGenerator
gen.initRstGenerator(outHtml, defaultConfig(), "filename", {})
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L94)  
```
proc writeIndexFile(g: var RstGenerator; outfile: string) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  Writes the current index buffer to the specified output file.

 You previously need to add entries to the index with the [setIndexTerm()](#setIndexTerm,RstGenerator,string,string,string,string,string) proc. If the index is empty the file won't be created.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L160)  
```
proc escChar(target: OutputTarget; dest: var string; c: char) {...}{.inline,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L201)  
```
proc nextSplitPoint(s: string; start: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L211)  
```
proc esc(target: OutputTarget; s: string; splitAfter = -1): string {...}{.raises: [],
    tags: [].}
```
  Escapes the HTML. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L223)  
```
proc setIndexTerm(d: var RstGenerator; htmlFile, id, term: string;
                  linkTitle, linkDesc = "") {...}{.raises: [], tags: [].}
```
  Adds a `term` to the index using the specified hyperlink identifier.

 A new entry will be added to the index using the format `term<tab>file#id`. The file part will come from the `htmlFile` parameter.

 The `id` will be appended with a hash character only if its length is not zero, otherwise no specific anchor will be generated. In general you should only pass an empty `id` value for the title of standalone rst documents (they are special for the [mergeIndexes()](#mergeIndexes,string) proc, see [Index (idx) file format](https://nim-lang.org/docs/docgen.html#index-idx-file-format) for more information). Unlike other index terms, title entries are inserted at the beginning of the accumulated buffer to maintain a logical order of entries.

 If `linkTitle` or `linkDesc` are not the empty string, two additional columns with their contents will be added.

 The index won't be written to disk unless you call [writeIndexFile()](#writeIndexFile,RstGenerator,string). The purpose of the index is documented in the [docgen tools guide](https://nim-lang.org/docs/docgen.html#related-options-index-switch).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L308)  
```
proc renderIndexTerm(d: PDoc; n: PRstNode; result: var string) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Renders the string decorated within `foobar`:idx: markers.

 Additionally adds the enclosed text to the index as a term. Since we are interested in different instances of the same term to have different entries, a table is used to keep track of the amount of times a term has previously appeared to give a different identifier value for each.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L359)  
```
proc mergeIndexes(dir: string): string {...}{.raises: [OSError, IOError, ValueError],
    tags: [ReadDirEffect, ReadIOEffect].}
```
  Merges all index files in `dir` and returns the generated index as HTML.

 This proc will first scan `dir` for index files with the `.idx` extension previously created by commands like `nim doc|rst2html` which use the `--index:on` switch. These index files are the result of calls to [setIndexTerm()](#setIndexTerm,RstGenerator,string,string,string,string,string) and [writeIndexFile()](#writeIndexFile,RstGenerator,string), so they are simple tab separated files.

 As convention this proc will split index files into two categories: documentation and API. API indices will be all joined together into a single big sorted index, making the bulk of the final index. This is good for API documentation because many symbols are repeated in different modules. On the other hand, documentation indices are essentially table of contents plus a few special markers. These documents will be rendered in a separate section which tries to maintain the order and hierarchy of the symbols in the index file.

 To differentiate between a documentation and API file a convention is used: indices which contain one entry without the HTML hash character (#) will be considered `documentation`, since this hash-less entry is the explicit title of the document. Indices without this explicit entry will be considered `generated API` extracted out of a source `.nim` file.

 Returns the merged and sorted indices into a single HTML block which can be further embedded into nimdoc templates.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L656)  
```
proc renderTocEntries(d: var RstGenerator; j: var int; lvl: int;
                      result: var string) {...}{.raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L794)  
```
proc renderRstToOut(d: var RstGenerator; n: PRstNode; result: var string) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Writes into `result` the rst ast `n` using the `d` configuration.

 Before using this proc you need to initialise a `RstGenerator` with `initRstGenerator` and parse a rst file with `rstParse` from the [packages/docutils/rst module](rst). Example:

 
```
# ...configure gen and rst vars...
var generatedHtml = ""
renderRstToOut(gen, rst, generatedHtml)
echo generatedHtml
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L1031) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L1031)  
```
proc formatNamedVars(frmt: string; varnames: openArray[string];
                     varvalues: openArray[string]): string {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L1194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L1194)  
```
proc defaultConfig(): StringTableRef {...}{.raises: [], tags: [].}
```
  Returns a default configuration for embedded HTML generation.

 The returned `StringTableRef` contains the parameters used by the HTML engine to build the final output. For information on what these parameters are and their purpose, please look up the file `config/nimdoc.cfg` bundled with the compiler.

 The only difference between the contents of that file and the values provided by this proc is the `doc.file` variable. The `doc.file` variable of the configuration file contains HTML to build standalone pages, while this proc returns just the content for procs like `rstToHtml` to generate the bare minimum HTML.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L1255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L1255)  
```
proc rstToHtml(s: string; options: RstParseOptions; config: StringTableRef): string {...}{.
    raises: [ValueError, EParseError, IOError, Exception],
    tags: [WriteIOEffect, ReadEnvEffect, RootEffect].}
```
  Converts an input rst string into embeddable HTML.

 This convenience proc parses any input string using rst markup (it doesn't have to be a full document!) and returns an embeddable piece of HTML. The proc is meant to be used in *online* environments without access to a meaningful filesystem, and therefore rst `include` like directives won't work. For an explanation of the `config` parameter see the `initRstGenerator` proc. Example:

 
```
import packages/docutils/rstgen, strtabs

echo rstToHtml("*Hello* **world**!", {},
  newStringTable(modeStyleInsensitive))
# --> <em>Hello</em> <strong>world</strong>!
```

If you need to allow the rst `include` directive or tweak the generated output you have to create your own `RstGenerator` with `initRstGenerator` and related procs.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L1323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L1323)  
```
proc rstToLatex(rstSource: string; options: RstParseOptions): string {...}{.inline,
    raises: [ValueError, Exception], tags: [RootEffect, ReadEnvEffect].}
```
  Convenience proc for `renderRstToOut` and `initRstGenerator`. **Example:**

 
```
doAssert rstToLatex("*Hello* **world**", {}) == """\emph{Hello} \textbf{world}"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/packages/docutils/rstgen.nim#L1359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/packages/docutils/rstgen.nim#L1359)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rstgen.html>

xmltree
=======

 A simple XML tree generator. 


**Example:**

 
```
var g = newElement("myTag")
g.add newText("some text")
g.add newComment("this is comment")

var h = newElement("secondTag")
h.add newEntity("some entity")

let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
let k = newXmlTree("treeTag", [g, h], att)

doAssert $k == """<treeTag key1="first value" key2="second value">
  <myTag>some text<!-- this is comment --></myTag>
  <secondTag>&some entity;</secondTag>
</treeTag>"""
```

**See also:*** [xmlparser module](xmlparser) for high-level XML parsing
* [parsexml module](parsexml) for low-level XML parsing
* [htmlgen module](htmlgen) for html code generator

 Imports
-------

  <since>, <macros>, <strtabs>, <strutils>  Types
-----

  
```
XmlNode = ref XmlNodeObj
```
  An XML tree consisting of XML nodes.

 Use [newXmlTree proc](#newXmlTree,string,openArray%5BXmlNode%5D,XmlAttributes) for creating a new tree.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L37)  
```
XmlNodeKind = enum
  xnText,                   ## a text element
  xnVerbatimText, xnElement, ## an element with 0 or more children
  xnCData,                  ## a CDATA node
  xnEntity,                 ## an entity (like ``&thing;``)
  xnComment                  ## an XML comment
```
  Different kinds of XML nodes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L42)  
```
XmlAttributes = StringTableRef
```
  An alias for a string to string mapping.

 Use [toXmlAttributes proc](#toXmlAttributes,varargs%5Btuple%5Bstring,string%5D%5D) to create `XmlAttributes`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L50)   Consts
------

  
```
xmlHeader = "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n"
```
  Header to use for complete XML output. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L66)   Procs
-----

  
```
proc newElement(tag: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnElement` with the given `tag`.

 See also:

 * [newXmlTree proc](#newXmlTree,string,openArray%5BXmlNode%5D,XmlAttributes)
* [<> macro](#<>.m,untyped)

 **Example:**

 
```
var a = newElement("firstTag")
a.add newElement("childTag")
assert a.kind == xnElement
assert $a == """<firstTag>
  <childTag />
</firstTag>"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L73)  
```
proc newText(text: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnText` with the text `text`. **Example:**

 
```
var b = newText("my text")
assert b.kind == xnText
assert $b == "my text"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L92)  
```
proc newVerbatimText(text: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnVerbatimText` with the text `text`. **Since**: Version 1.3. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L102)  
```
proc newComment(comment: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnComment` with the text `comment`. **Example:**

 
```
var c = newComment("my comment")
assert c.kind == xnComment
assert $c == "<!-- my comment -->"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L108)  
```
proc newCData(cdata: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnCData` with the text `cdata`. **Example:**

 
```
var d = newCData("my cdata")
assert d.kind == xnCData
assert $d == "<![CDATA[my cdata]]>"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L118)  
```
proc newEntity(entity: string): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new `XmlNode` of kind `xnEntity` with the text `entity`. **Example:**

 
```
var e = newEntity("my entity")
assert e.kind == xnEntity
assert $e == "&my entity;"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L128)  
```
proc newXmlTree(tag: string; children: openArray[XmlNode];
                attributes: XmlAttributes = nil): XmlNode {...}{.raises: [], tags: [].}
```
  Creates a new XML tree with `tag`, `children` and `attributes`.

 See also:

 * [newElement proc](#newElement,string)
* [<> macro](#<>.m,untyped)

 **Example:**

 
```
var g = newElement("myTag")
g.add newText("some text")
g.add newComment("this is comment")
var h = newElement("secondTag")
h.add newEntity("some entity")
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
let k = newXmlTree("treeTag", [g, h], att)

doAssert $k == """<treeTag key1="first value" key2="second value">
  <myTag>some text<!-- this is comment --></myTag>
  <secondTag>&some entity;</secondTag>
</treeTag>"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L138)  
```
proc text(n: XmlNode): string {...}{.inline, raises: [], tags: [].}
```
  Gets the associated text with the node `n`.

 `n` can be a CDATA, Text, comment, or entity node.

 See also:

 * [text= proc](#text=,XmlNode,string) for text setter
* [tag proc](#tag,XmlNode) for tag getter
* [tag= proc](#tag=,XmlNode,string) for tag setter
* [innerText proc](#innerText,XmlNode)

 **Example:**

 
```
var c = newComment("my comment")
assert $c == "<!-- my comment -->"
assert c.text == "my comment"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L166)  
```
proc text=(n: XmlNode; text: string) {...}{.inline, raises: [], tags: [].}
```
  Sets the associated text with the node `n`.

 `n` can be a CDATA, Text, comment, or entity node.

 See also:

 * [text proc](#text,XmlNode) for text getter
* [tag proc](#tag,XmlNode) for tag getter
* [tag= proc](#tag=,XmlNode,string) for tag setter

 **Example:**

 
```
var e = newEntity("my entity")
assert $e == "&my entity;"
e.text = "a new entity text"
assert $e == "&a new entity text;"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L184)  
```
proc tag(n: XmlNode): string {...}{.inline, raises: [], tags: [].}
```
  Gets the tag name of `n`.

 `n` has to be an `xnElement` node.

 See also:

 * [text proc](#text,XmlNode) for text getter
* [text= proc](#text=,XmlNode,string) for text setter
* [tag= proc](#tag=,XmlNode,string) for tag setter
* [innerText proc](#innerText,XmlNode)

 **Example:**

 
```
var a = newElement("firstTag")
a.add newElement("childTag")
assert $a == """<firstTag>
  <childTag />
</firstTag>"""
assert a.tag == "firstTag"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L202)  
```
proc tag=(n: XmlNode; tag: string) {...}{.inline, raises: [], tags: [].}
```
  Sets the tag name of `n`.

 `n` has to be an `xnElement` node.

 See also:

 * [text proc](#text,XmlNode) for text getter
* [text= proc](#text=,XmlNode,string) for text setter
* [tag proc](#tag,XmlNode) for tag getter

 **Example:**

 
```
var a = newElement("firstTag")
a.add newElement("childTag")
assert $a == """<firstTag>
  <childTag />
</firstTag>"""
a.tag = "newTag"
assert $a == """<newTag>
  <childTag />
</newTag>"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L223)  
```
proc rawText(n: XmlNode): string {...}{.inline, raises: [], tags: [].}
```
  Returns the underlying 'text' string by reference.

 This is only used for speed hacks.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L246)  
```
proc rawTag(n: XmlNode): string {...}{.inline, raises: [], tags: [].}
```
  Returns the underlying 'tag' string by reference.

 This is only used for speed hacks.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L255)  
```
proc innerText(n: XmlNode): string {...}{.raises: [], tags: [].}
```
  Gets the inner text of `n`:* If `n` is `xnText` or `xnEntity`, returns its content.
* If `n` is `xnElement`, runs recursively on each child node and concatenates the results.
* Otherwise returns an empty string.

 See also:

 * [text proc](#text,XmlNode)

 **Example:**

 
```
var f = newElement("myTag")
f.add newText("my text")
f.add newComment("my comment")
f.add newEntity("my entity")
assert $f == "<myTag>my text<!-- my comment -->&my entity;</myTag>"
assert innerText(f) == "my textmy entity"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L264)  
```
proc add(father, son: XmlNode) {...}{.inline, raises: [], tags: [].}
```
  Adds the child `son` to `father`.

 See also:

 * [insert proc](#insert,XmlNode,XmlNode,int)
* [delete proc](#delete,XmlNode,Natural)

 **Example:**

 
```
var f = newElement("myTag")
f.add newText("my text")
f.add newElement("sonTag")
f.add newEntity("my entity")
assert $f == "<myTag>my text<sonTag />&my entity;</myTag>"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L295)  
```
proc insert(father, son: XmlNode; index: int) {...}{.inline, raises: [], tags: [].}
```
  Inserts the child `son` to a given position in `father`.

 `father` and `son` must be of `xnElement` kind.

 See also:

 * [add proc](#add,XmlNode,XmlNode)
* [delete proc](#delete,XmlNode,Natural)

 **Example:**

 
```
var f = newElement("myTag")
f.add newElement("first")
f.insert(newElement("second"), 0)
assert $f == """<myTag>
  <second />
  <first />
</myTag>"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L309)  
```
proc delete(n: XmlNode; i: Natural) {...}{.raises: [], tags: [].}
```
  Deletes the `i`'th child of `n`.

 See also:

 * [add proc](#add,XmlNode,XmlNode)
* [insert proc](#insert,XmlNode,XmlNode,int)

 **Example:**

 
```
var f = newElement("myTag")
f.add newElement("first")
f.insert(newElement("second"), 0)
f.delete(0)
assert $f == """<myTag>
  <first />
</myTag>"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L332)  
```
proc len(n: XmlNode): int {...}{.inline, raises: [], tags: [].}
```
  Returns the number of `n`'s children. **Example:**

 
```
var f = newElement("myTag")
f.add newElement("first")
f.insert(newElement("second"), 0)
assert len(f) == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L350)  
```
proc kind(n: XmlNode): XmlNodeKind {...}{.inline, raises: [], tags: [].}
```
  Returns `n`'s kind. **Example:**

 
```
var a = newElement("firstTag")
assert a.kind == xnElement
var b = newText("my text")
assert b.kind == xnText
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L359)  
```
proc `[]`(n: XmlNode; i: int): XmlNode {...}{.inline, raises: [], tags: [].}
```
  Returns the `i`'th child of `n`. **Example:**

 
```
var f = newElement("myTag")
f.add newElement("first")
f.insert(newElement("second"), 0)
assert $f[1] == "<first />"
assert $f[0] == "<second />"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L368)  
```
proc `[]`(n: var XmlNode; i: int): var XmlNode {...}{.inline, raises: [], tags: [].}
```
  Returns the `i`'th child of `n` so that it can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L380)  
```
proc clear(n: var XmlNode) {...}{.raises: [], tags: [].}
```
  Recursively clears all children of an XmlNode. **Example:**

 
```
var g = newElement("myTag")
g.add newText("some text")
g.add newComment("this is comment")

var h = newElement("secondTag")
h.add newEntity("some entity")

let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
var k = newXmlTree("treeTag", [g, h], att)

doAssert $k == """<treeTag key1="first value" key2="second value">
  <myTag>some text<!-- this is comment --></myTag>
  <secondTag>&some entity;</secondTag>
</treeTag>"""

clear(k)
doAssert $k == """<treeTag key1="first value" key2="second value" />"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L385)  
```
proc toXmlAttributes(keyValuePairs: varargs[tuple[key, val: string]]): XmlAttributes {...}{.
    raises: [], tags: [].}
```
  Converts `{key: value}` pairs into `XmlAttributes`. **Example:**

 
```
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
var j = newElement("myTag")
j.attrs = att

doAssert $j == """<myTag key1="first value" key2="second value" />"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L442)  
```
proc attrs(n: XmlNode): XmlAttributes {...}{.inline, raises: [], tags: [].}
```
  Gets the attributes belonging to `n`.

 Returns `nil` if attributes have not been initialised for this node.

 See also:

 * [attrs= proc](#attrs=,XmlNode,XmlAttributes) for XmlAttributes setter
* [attrsLen proc](#attrsLen,XmlNode) for number of attributes
* [attr proc](#attr,XmlNode,string) for finding an attribute

 **Example:**

 
```
var j = newElement("myTag")
assert j.attrs == nil
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
j.attrs = att
assert j.attrs == att
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L455)  
```
proc attrs=(n: XmlNode; attr: XmlAttributes) {...}{.inline, raises: [], tags: [].}
```
  Sets the attributes belonging to `n`.

 See also:

 * [attrs proc](#attrs,XmlNode) for XmlAttributes getter
* [attrsLen proc](#attrsLen,XmlNode) for number of attributes
* [attr proc](#attr,XmlNode,string) for finding an attribute

 **Example:**

 
```
var j = newElement("myTag")
assert j.attrs == nil
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
j.attrs = att
assert j.attrs == att
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L474)  
```
proc attrsLen(n: XmlNode): int {...}{.inline, raises: [], tags: [].}
```
  Returns the number of `n`'s attributes.

 See also:

 * [attrs proc](#attrs,XmlNode) for XmlAttributes getter
* [attrs= proc](#attrs=,XmlNode,XmlAttributes) for XmlAttributes setter
* [attr proc](#attr,XmlNode,string) for finding an attribute

 **Example:**

 
```
var j = newElement("myTag")
assert j.attrsLen == 0
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
j.attrs = att
assert j.attrsLen == 2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L491)  
```
proc attr(n: XmlNode; name: string): string {...}{.raises: [], tags: [].}
```
  Finds the first attribute of `n` with a name of `name`. Returns "" on failure.

 See also:

 * [attrs proc](#attrs,XmlNode) for XmlAttributes getter
* [attrs= proc](#attrs=,XmlNode,XmlAttributes) for XmlAttributes setter
* [attrsLen proc](#attrsLen,XmlNode) for number of attributes

 **Example:**

 
```
var j = newElement("myTag")
let att = {"key1": "first value", "key2": "second value"}.toXmlAttributes
j.attrs = att
assert j.attr("key1") == "first value"
assert j.attr("key2") == "second value"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L508)  
```
proc clientData(n: XmlNode): int {...}{.inline, raises: [], tags: [].}
```
  Gets the client data of `n`.

 The client data field is used by the HTML parser and generator.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L527)  
```
proc clientData=(n: XmlNode; data: int) {...}{.inline, raises: [], tags: [].}
```
  Sets the client data of `n`.

 The client data field is used by the HTML parser and generator.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L533)  
```
proc addEscaped(result: var string; s: string) {...}{.raises: [], tags: [].}
```
  The same as [result.add(escape(s))](#escape,string), but more efficient. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L539)  
```
proc escape(s: string): string {...}{.raises: [], tags: [].}
```
  Escapes `s` for inclusion into an XML document.

 Escapes these characters:

 

| char | is converted to |
| --- | --- |
| `<` | `&lt;` |
| `>` | `&gt;` |
| `&` | `&amp;` |
| `"` | `&quot;` |
| `'` | `&apos;` |


You can also use [addEscaped proc](#addEscaped,string,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L550)  
```
proc add(result: var string; n: XmlNode; indent = 0; indWidth = 2;
         addNewLines = true) {...}{.raises: [], tags: [].}
```
  Adds the textual representation of `n` to string `result`. **Example:**

 
```
var
  a = newElement("firstTag")
  b = newText("my text")
  c = newComment("my comment")
  s = ""
s.add(c)
s.add(a)
s.add(b)
assert s == "<!-- my comment --><firstTag />my text"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L575)  
```
proc `$`(n: XmlNode): string {...}{.raises: [], tags: [].}
```
  Converts `n` into its string representation.

 No `<$xml ...$>` declaration is produced, so that the produced XML fragments are composable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L663)  
```
proc child(n: XmlNode; name: string): XmlNode {...}{.raises: [], tags: [].}
```
  Finds the first child element of `n` with a name of `name`. Returns `nil` on failure. **Example:**

 
```
var f = newElement("myTag")
f.add newElement("firstSon")
f.add newElement("secondSon")
f.add newElement("thirdSon")
assert $(f.child("secondSon")) == "<secondSon />"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L671)  
```
proc findAll(n: XmlNode; tag: string; result: var seq[XmlNode];
             caseInsensitive = false) {...}{.raises: [], tags: [].}
```
  Iterates over all the children of `n` returning those matching `tag`.

 Found nodes satisfying the condition will be appended to the `result` sequence.

 **Example:**

 
```
var
  b = newElement("good")
  c = newElement("bad")
  d = newElement("BAD")
  e = newElement("GOOD")
b.add newText("b text")
c.add newText("c text")
d.add newText("d text")
e.add newText("e text")
let a = newXmlTree("father", [b, c, d, e])
var s = newSeq[XmlNode]()
a.findAll("good", s)
assert $s == "@[<good>b text</good>]"
s.setLen(0)
a.findAll("good", s, caseInsensitive = true)
assert $s == "@[<good>b text</good>, <GOOD>e text</GOOD>]"
s.setLen(0)
a.findAll("BAD", s)
assert $s == "@[<BAD>d text</BAD>]"
s.setLen(0)
a.findAll("BAD", s, caseInsensitive = true)
assert $s == "@[<bad>c text</bad>, <BAD>d text</BAD>]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L687)  
```
proc findAll(n: XmlNode; tag: string; caseInsensitive = false): seq[XmlNode] {...}{.
    raises: [], tags: [].}
```
  A shortcut version to assign in let blocks. **Example:**

 
```
var
  b = newElement("good")
  c = newElement("bad")
  d = newElement("BAD")
  e = newElement("GOOD")
b.add newText("b text")
c.add newText("c text")
d.add newText("d text")
e.add newText("e text")
let a = newXmlTree("father", [b, c, d, e])
assert $(a.findAll("good")) == "@[<good>b text</good>]"
assert $(a.findAll("BAD")) == "@[<BAD>d text</BAD>]"
assert $(a.findAll("good", caseInsensitive = true)) == "@[<good>b text</good>, <GOOD>e text</GOOD>]"
assert $(a.findAll("BAD", caseInsensitive = true)) == "@[<bad>c text</bad>, <BAD>d text</BAD>]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L726)   Iterators
---------

  
```
iterator items(n: XmlNode): XmlNode {...}{.inline, raises: [], tags: [].}
```
  Iterates over all direct children of `n`. **Example:**

 
```
var g = newElement("myTag")
g.add newText("some text")
g.add newComment("this is comment")

var h = newElement("secondTag")
h.add newEntity("some entity")
g.add h

assert $g == "<myTag>some text<!-- this is comment --><secondTag>&some entity;</secondTag></myTag>"

# for x in g: # the same as `for x in items(g):`
#   echo x

# some text
# <!-- this is comment -->
# <secondTag>&some entity;<![CDATA[some cdata]]></secondTag>
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L413)  
```
iterator mitems(n: var XmlNode): var XmlNode {...}{.inline, raises: [], tags: [].}
```
  Iterates over all direct children of `n` so that they can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L437)   Macros
------

  
```
macro `<>`(x: untyped): untyped
```
  Constructor macro for XML. Example usage:
```
<>a(href="http://nim-lang.org", newText("Nim rules."))
```

Produces an XML tree for:



```
<a href="http://nim-lang.org">Nim rules.</a>
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmltree.nim#L771) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmltree.nim#L771)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/xmltree.html>

xmlparser
=========

 This module parses an XML document and creates its XML tree representation.

 Imports
-------

  <streams>, <parsexml>, <strtabs>, <xmltree>, <os>  Types
-----

  
```
XmlError = object of ValueError
  errors*: seq[string]       ## All detected parsing errors.
```
  Exception that is raised for invalid XML. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L15)   Procs
-----

  
```
proc parseXml(s: Stream; filename: string; errors: var seq[string];
              options: set[XmlParseOption] = {reportComments}): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the XML from stream `s` and returns a `XmlNode`. Every occurred parsing error is added to the `errors` sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L101)  
```
proc parseXml(s: Stream; options: set[XmlParseOption] = {reportComments}): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception, XmlError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the XML from stream `s` and returns a `XmlNode`. All parsing errors are turned into an `XmlError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L121)  
```
proc parseXml(str: string; options: set[XmlParseOption] = {reportComments}): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception, XmlError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Parses the XML from string `str` and returns a `XmlNode`. All parsing errors are turned into an `XmlError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L128)  
```
proc loadXml(path: string; errors: var seq[string];
             options: set[XmlParseOption] = {reportComments}): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Loads and parses XML from file specified by `path`, and returns a `XmlNode`. Every occurred parsing error is added to the `errors` sequence. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L133)  
```
proc loadXml(path: string; options: set[XmlParseOption] = {reportComments}): XmlNode {...}{.
    raises: [IOError, OSError, ValueError, Exception, XmlError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect].}
```
  Loads and parses XML from file specified by `path`, and returns a `XmlNode`. All parsing errors are turned into an `XmlError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/xmlparser.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/xmlparser.nim#L141)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/xmlparser.html>

htmlgen
=======


Do yourself a favor and import the module as `from htmlgen import nil` and then fully qualify the macros.

 *Note*: The Karax project (`nimble install karax`) has a better way to achieve the same, see <https://github.com/pragmagic/karax/blob/master/tests/nativehtmlgen.nim> for an example.

 This module implements a simple XML and HTML code generator. Each commonly used HTML tag has a corresponding macro that generates a string with its HTML representation.

 MathML
------


[MathML](https://wikipedia.org/wiki/MathML) is supported, MathML is part of HTML5. [MathML](https://wikipedia.org/wiki/MathML) is an Standard ISO/IEC 40314 from year 2015. MathML allows you to [draw advanced math on the web](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math#Examples), [visually similar to Latex math.](https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics#Example)

 Examples
--------



```
var nim = "Nim"
echo h1(a(href="https://nim-lang.org", nim))
```

Writes the string:



```
<h1><a href="https://nim-lang.org">Nim</a></h1>
```
 **Example:**

 
```
let nim = "Nim"
assert h1(a(href = "https://nim-lang.org", nim)) ==
  """<h1><a href="https://nim-lang.org">Nim</a></h1>"""
assert form(action = "test", `accept-charset` = "Content-Type") ==
  """<form action="test" accept-charset="Content-Type"></form>"""


assert math(
  semantics(
    mrow(
      msup(
        mi("x"),
        mn("42")
      )
    )
  )
) == "<math><semantics><mrow><msup><mi>x</mi><mn>42</mn></msup></mrow></semantics></math>"

assert math(
  semantics(
    annotation(encoding = "application/x-tex", title = "Latex on Web", r"x^{2} + y")
  )
) == """<math><semantics><annotation encoding="application/x-tex" title="Latex on Web">x^{2} + y</annotation></semantics></math>"""
```
 Imports
-------

  <macros>, <strutils>  Consts
------

  
```
coreAttr = " accesskey class contenteditable dir hidden id lang spellcheck style tabindex title translate "
```
  HTML DOM Core Attributes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L46)  
```
eventAttr = "onabort onblur oncancel oncanplay oncanplaythrough onchange onclick oncuechange ondblclick ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onresize onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate ontoggle onvolumechange onwaiting "
```
  HTML DOM Event Attributes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L48)  
```
ariaAttr = " role "
```
  HTML DOM Aria Attributes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L56)  
```
commonAttr = " accesskey class contenteditable dir hidden id lang spellcheck style tabindex title translate onabort onblur oncancel oncanplay oncanplaythrough onchange onclick oncuechange ondblclick ondurationchange onemptied onended onerror onfocus oninput oninvalid onkeydown onkeypress onkeyup onload onloadeddata onloadedmetadata onloadstart onmousedown onmouseenter onmouseleave onmousemove onmouseout onmouseover onmouseup onmousewheel onpause onplay onplaying onprogress onratechange onreset onresize onscroll onseeked onseeking onselect onshow onstalled onsubmit onsuspend ontimeupdate ontoggle onvolumechange onwaiting  role "
```
  HTML DOM Common Attributes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L57)   Procs
-----

  
```
proc xmlCheckedTag(argsList: NimNode; tag: string; optAttr = ""; reqAttr = "";
                   isLeaf = false): NimNode {...}{.compileTime, raises: [], tags: [].}
```
  use this procedure to define a new XML tag [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L77)   Macros
------

  
```
macro a(e: varargs[untyped]): untyped
```
  Generates the HTML `a` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L121)  
```
macro abbr(e: varargs[untyped]): untyped
```
  Generates the HTML `abbr` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L126)  
```
macro address(e: varargs[untyped]): untyped
```
  Generates the HTML `address` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L130)  
```
macro area(e: varargs[untyped]): untyped
```
  Generates the HTML `area` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L134)  
```
macro article(e: varargs[untyped]): untyped
```
  Generates the HTML `article` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L139)  
```
macro aside(e: varargs[untyped]): untyped
```
  Generates the HTML `aside` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L143)  
```
macro audio(e: varargs[untyped]): untyped
```
  Generates the HTML `audio` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L147)  
```
macro b(e: varargs[untyped]): untyped
```
  Generates the HTML `b` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L152)  
```
macro base(e: varargs[untyped]): untyped
```
  Generates the HTML `base` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L156)  
```
macro bdi(e: varargs[untyped]): untyped
```
  Generates the HTML `bdi` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L160)  
```
macro bdo(e: varargs[untyped]): untyped
```
  Generates the HTML `bdo` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L164)  
```
macro big(e: varargs[untyped]): untyped
```
  Generates the HTML `big` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L168)  
```
macro blockquote(e: varargs[untyped]): untyped
```
  Generates the HTML `blockquote` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L172)  
```
macro body(e: varargs[untyped]): untyped
```
  Generates the HTML `body` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L176)  
```
macro br(e: varargs[untyped]): untyped
```
  Generates the HTML `br` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L182)  
```
macro button(e: varargs[untyped]): untyped
```
  Generates the HTML `button` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L186)  
```
macro canvas(e: varargs[untyped]): untyped
```
  Generates the HTML `canvas` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L192)  
```
macro caption(e: varargs[untyped]): untyped
```
  Generates the HTML `caption` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L196)  
```
macro center(e: varargs[untyped]): untyped
```
  Generates the HTML `center` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L200)  
```
macro cite(e: varargs[untyped]): untyped
```
  Generates the HTML `cite` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L204)  
```
macro code(e: varargs[untyped]): untyped
```
  Generates the HTML `code` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L208)  
```
macro col(e: varargs[untyped]): untyped
```
  Generates the HTML `col` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L212)  
```
macro colgroup(e: varargs[untyped]): untyped
```
  Generates the HTML `colgroup` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L216)  
```
macro data(e: varargs[untyped]): untyped
```
  Generates the HTML `data` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L220)  
```
macro datalist(e: varargs[untyped]): untyped
```
  Generates the HTML `datalist` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L224)  
```
macro dd(e: varargs[untyped]): untyped
```
  Generates the HTML `dd` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L228)  
```
macro del(e: varargs[untyped]): untyped
```
  Generates the HTML `del` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L232)  
```
macro details(e: varargs[untyped]): untyped
```
  Generates the HTML `details` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L236)  
```
macro dfn(e: varargs[untyped]): untyped
```
  Generates the HTML `dfn` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L240)  
```
macro dialog(e: varargs[untyped]): untyped
```
  Generates the HTML `dialog` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L244)  
```
macro `div`(e: varargs[untyped]): untyped
```
  Generates the HTML `div` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L248)  
```
macro dl(e: varargs[untyped]): untyped
```
  Generates the HTML `dl` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L252)  
```
macro dt(e: varargs[untyped]): untyped
```
  Generates the HTML `dt` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L256)  
```
macro em(e: varargs[untyped]): untyped
```
  Generates the HTML `em` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L260)  
```
macro embed(e: varargs[untyped]): untyped
```
  Generates the HTML `embed` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L264)  
```
macro fieldset(e: varargs[untyped]): untyped
```
  Generates the HTML `fieldset` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L269)  
```
macro figure(e: varargs[untyped]): untyped
```
  Generates the HTML `figure` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L273)  
```
macro figcaption(e: varargs[untyped]): untyped
```
  Generates the HTML `figcaption` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L277)  
```
macro footer(e: varargs[untyped]): untyped
```
  Generates the HTML `footer` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L281)  
```
macro form(e: varargs[untyped]): untyped
```
  Generates the HTML `form` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L285)  
```
macro h1(e: varargs[untyped]): untyped
```
  Generates the HTML `h1` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L290)  
```
macro h2(e: varargs[untyped]): untyped
```
  Generates the HTML `h2` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L294)  
```
macro h3(e: varargs[untyped]): untyped
```
  Generates the HTML `h3` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L298)  
```
macro h4(e: varargs[untyped]): untyped
```
  Generates the HTML `h4` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L302)  
```
macro h5(e: varargs[untyped]): untyped
```
  Generates the HTML `h5` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L306)  
```
macro h6(e: varargs[untyped]): untyped
```
  Generates the HTML `h6` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L310)  
```
macro head(e: varargs[untyped]): untyped
```
  Generates the HTML `head` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L314)  
```
macro header(e: varargs[untyped]): untyped
```
  Generates the HTML `header` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L318)  
```
macro html(e: varargs[untyped]): untyped
```
  Generates the HTML `html` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L322)  
```
macro hr(): untyped
```
  Generates the HTML `hr` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L326)  
```
macro i(e: varargs[untyped]): untyped
```
  Generates the HTML `i` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L330)  
```
macro iframe(e: varargs[untyped]): untyped
```
  Generates the HTML `iframe` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L334)  
```
macro img(e: varargs[untyped]): untyped
```
  Generates the HTML `img` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L339)  
```
macro input(e: varargs[untyped]): untyped
```
  Generates the HTML `input` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L344)  
```
macro ins(e: varargs[untyped]): untyped
```
  Generates the HTML `ins` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L352)  
```
macro kbd(e: varargs[untyped]): untyped
```
  Generates the HTML `kbd` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L356)  
```
macro keygen(e: varargs[untyped]): untyped
```
  Generates the HTML `keygen` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L360)  
```
macro label(e: varargs[untyped]): untyped
```
  Generates the HTML `label` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L365)  
```
macro legend(e: varargs[untyped]): untyped
```
  Generates the HTML `legend` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L369)  
```
macro li(e: varargs[untyped]): untyped
```
  Generates the HTML `li` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L373)  
```
macro link(e: varargs[untyped]): untyped
```
  Generates the HTML `link` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L377)  
```
macro main(e: varargs[untyped]): untyped
```
  Generates the HTML `main` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L382)  
```
macro map(e: varargs[untyped]): untyped
```
  Generates the HTML `map` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L386)  
```
macro mark(e: varargs[untyped]): untyped
```
  Generates the HTML `mark` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L390)  
```
macro marquee(e: varargs[untyped]): untyped
```
  Generates the HTML `marquee` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L394)  
```
macro meta(e: varargs[untyped]): untyped
```
  Generates the HTML `meta` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L400)  
```
macro meter(e: varargs[untyped]): untyped
```
  Generates the HTML `meter` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L405)  
```
macro nav(e: varargs[untyped]): untyped
```
  Generates the HTML `nav` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L410)  
```
macro noscript(e: varargs[untyped]): untyped
```
  Generates the HTML `noscript` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L414)  
```
macro `object`(e: varargs[untyped]): untyped
```
  Generates the HTML `object` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L418)  
```
macro ol(e: varargs[untyped]): untyped
```
  Generates the HTML `ol` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L423)  
```
macro optgroup(e: varargs[untyped]): untyped
```
  Generates the HTML `optgroup` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L427)  
```
macro option(e: varargs[untyped]): untyped
```
  Generates the HTML `option` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L431)  
```
macro output(e: varargs[untyped]): untyped
```
  Generates the HTML `output` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L436)  
```
macro p(e: varargs[untyped]): untyped
```
  Generates the HTML `p` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L440)  
```
macro param(e: varargs[untyped]): untyped
```
  Generates the HTML `param` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L444)  
```
macro picture(e: varargs[untyped]): untyped
```
  Generates the HTML `picture` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L448)  
```
macro pre(e: varargs[untyped]): untyped
```
  Generates the HTML `pre` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L452)  
```
macro progress(e: varargs[untyped]): untyped
```
  Generates the HTML `progress` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L456)  
```
macro q(e: varargs[untyped]): untyped
```
  Generates the HTML `q` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L460)  
```
macro rb(e: varargs[untyped]): untyped
```
  Generates the HTML `rb` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L464)  
```
macro rp(e: varargs[untyped]): untyped
```
  Generates the HTML `rp` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L468)  
```
macro rt(e: varargs[untyped]): untyped
```
  Generates the HTML `rt` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L472)  
```
macro rtc(e: varargs[untyped]): untyped
```
  Generates the HTML `rtc` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L476)  
```
macro ruby(e: varargs[untyped]): untyped
```
  Generates the HTML `ruby` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L480)  
```
macro s(e: varargs[untyped]): untyped
```
  Generates the HTML `s` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L484)  
```
macro samp(e: varargs[untyped]): untyped
```
  Generates the HTML `samp` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L488)  
```
macro script(e: varargs[untyped]): untyped
```
  Generates the HTML `script` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L492)  
```
macro section(e: varargs[untyped]): untyped
```
  Generates the HTML `section` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L497)  
```
macro select(e: varargs[untyped]): untyped
```
  Generates the HTML `select` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L501)  
```
macro slot(e: varargs[untyped]): untyped
```
  Generates the HTML `slot` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L506)  
```
macro small(e: varargs[untyped]): untyped
```
  Generates the HTML `small` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L510)  
```
macro source(e: varargs[untyped]): untyped
```
  Generates the HTML `source` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L514)  
```
macro span(e: varargs[untyped]): untyped
```
  Generates the HTML `span` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L518)  
```
macro strong(e: varargs[untyped]): untyped
```
  Generates the HTML `strong` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L522)  
```
macro style(e: varargs[untyped]): untyped
```
  Generates the HTML `style` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L526)  
```
macro sub(e: varargs[untyped]): untyped
```
  Generates the HTML `sub` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L530)  
```
macro summary(e: varargs[untyped]): untyped
```
  Generates the HTML `summary` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L534)  
```
macro sup(e: varargs[untyped]): untyped
```
  Generates the HTML `sup` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L538)  
```
macro table(e: varargs[untyped]): untyped
```
  Generates the HTML `table` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L542)  
```
macro tbody(e: varargs[untyped]): untyped
```
  Generates the HTML `tbody` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L546)  
```
macro td(e: varargs[untyped]): untyped
```
  Generates the HTML `td` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L550)  
```
macro `template`(e: varargs[untyped]): untyped
```
  Generates the HTML `template` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L554)  
```
macro textarea(e: varargs[untyped]): untyped
```
  Generates the HTML `textarea` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L558)  
```
macro tfoot(e: varargs[untyped]): untyped
```
  Generates the HTML `tfoot` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L564)  
```
macro th(e: varargs[untyped]): untyped
```
  Generates the HTML `th` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L568)  
```
macro thead(e: varargs[untyped]): untyped
```
  Generates the HTML `thead` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L573)  
```
macro time(e: varargs[untyped]): untyped
```
  Generates the HTML `time` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L577)  
```
macro title(e: varargs[untyped]): untyped
```
  Generates the HTML `title` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L581)  
```
macro tr(e: varargs[untyped]): untyped
```
  Generates the HTML `tr` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L585)  
```
macro track(e: varargs[untyped]): untyped
```
  Generates the HTML `track` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L589)  
```
macro tt(e: varargs[untyped]): untyped
```
  Generates the HTML `tt` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L594) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L594)  
```
macro u(e: varargs[untyped]): untyped
```
  Generates the HTML `u` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L598)  
```
macro ul(e: varargs[untyped]): untyped
```
  Generates the HTML `ul` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L602)  
```
macro `var`(e: varargs[untyped]): untyped
```
  Generates the HTML `var` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L606)  
```
macro video(e: varargs[untyped]): untyped
```
  Generates the HTML `video` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L610)  
```
macro wbr(e: varargs[untyped]): untyped
```
  Generates the HTML `wbr` element. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L615)  
```
macro math(e: varargs[untyped]): untyped
```
  Generates the HTML `math` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/math#Examples> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L620)  
```
macro maction(e: varargs[untyped]): untyped
```
  Generates the HTML `maction` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/maction> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L625) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L625)  
```
macro menclose(e: varargs[untyped]): untyped
```
  Generates the HTML `menclose` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/menclose> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L630)  
```
macro merror(e: varargs[untyped]): untyped
```
  Generates the HTML `merror` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/merror> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L635)  
```
macro mfenced(e: varargs[untyped]): untyped
```
  Generates the HTML `mfenced` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfenced> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L640)  
```
macro mfrac(e: varargs[untyped]): untyped
```
  Generates the HTML `mfrac` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mfrac> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L645)  
```
macro mglyph(e: varargs[untyped]): untyped
```
  Generates the HTML `mglyph` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mglyph> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L650)  
```
macro mi(e: varargs[untyped]): untyped
```
  Generates the HTML `mi` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mi> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L655)  
```
macro mlabeledtr(e: varargs[untyped]): untyped
```
  Generates the HTML `mlabeledtr` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mlabeledtr> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L660)  
```
macro mmultiscripts(e: varargs[untyped]): untyped
```
  Generates the HTML `mmultiscripts` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mmultiscripts> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L665) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L665)  
```
macro mn(e: varargs[untyped]): untyped
```
  Generates the HTML `mn` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mn> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L670)  
```
macro mo(e: varargs[untyped]): untyped
```
  Generates the HTML `mo` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mo> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L675)  
```
macro mover(e: varargs[untyped]): untyped
```
  Generates the HTML `mover` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mover> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L681)  
```
macro mpadded(e: varargs[untyped]): untyped
```
  Generates the HTML `mpadded` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mpadded> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L686)  
```
macro mphantom(e: varargs[untyped]): untyped
```
  Generates the HTML `mphantom` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mphantom> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L691)  
```
macro mroot(e: varargs[untyped]): untyped
```
  Generates the HTML `mroot` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mroot> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L696)  
```
macro mrow(e: varargs[untyped]): untyped
```
  Generates the HTML `mrow` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mrow> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L701)  
```
macro ms(e: varargs[untyped]): untyped
```
  Generates the HTML `ms` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/ms> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L706) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L706)  
```
macro mspace(e: varargs[untyped]): untyped
```
  Generates the HTML `mspace` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mspace> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L711)  
```
macro msqrt(e: varargs[untyped]): untyped
```
  Generates the HTML `msqrt` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msqrt> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L716)  
```
macro mstyle(e: varargs[untyped]): untyped
```
  Generates the HTML `mstyle` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mstyle> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L721) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L721)  
```
macro msub(e: varargs[untyped]): untyped
```
  Generates the HTML `msub` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msub> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L727)  
```
macro msubsup(e: varargs[untyped]): untyped
```
  Generates the HTML `msubsup` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msubsup> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L732) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L732)  
```
macro msup(e: varargs[untyped]): untyped
```
  Generates the HTML `msup` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/msup> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L737)  
```
macro mtable(e: varargs[untyped]): untyped
```
  Generates the HTML `mtable` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtable> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L742)  
```
macro mtd(e: varargs[untyped]): untyped
```
  Generates the HTML `mtd` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtd> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L750)  
```
macro mtext(e: varargs[untyped]): untyped
```
  Generates the HTML `mtext` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/mtext> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L756) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L756)  
```
macro munder(e: varargs[untyped]): untyped
```
  Generates the HTML `munder` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munder> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L761) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L761)  
```
macro munderover(e: varargs[untyped]): untyped
```
  Generates the HTML `munderover` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/munderover> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L766)  
```
macro semantics(e: varargs[untyped]): untyped
```
  Generates the HTML `semantics` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L771) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L771)  
```
macro annotation(e: varargs[untyped]): untyped
```
  Generates the HTML `annotation` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L776) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L776)  
```
macro annotation-xml(e: varargs[untyped]): untyped
```
  Generates the HTML `annotation-xml` element. MathML <https://wikipedia.org/wiki/MathML> <https://developer.mozilla.org/en-US/docs/Web/MathML/Element/semantics> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/htmlgen.nim#L781) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/htmlgen.nim#L781)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/htmlgen.html>

base64
======


This module implements a base64 encoder and decoder.

 Unstable API.

 Base64 is an encoding and decoding technique used to convert binary data to an ASCII string format. Each Base64 digit represents exactly 6 bits of data. Three 8-bit bytes (i.e., a total of 24 bits) can therefore be represented by four 6-bit Base64 digits.

 Basic usage
-----------

 ### Encoding data



```
import base64
let encoded = encode("Hello World")
assert encoded == "SGVsbG8gV29ybGQ="
```

Apart from strings you can also encode lists of integers or characters:

 
```
import base64
let encodedInts = encode([1,2,3])
assert encodedInts == "AQID"
let encodedChars = encode(['h','e','y'])
assert encodedChars == "aGV5"
```
 ### Decoding data



```
import base64
let decoded = decode("SGVsbG8gV29ybGQ=")
assert decoded == "Hello World"
```
 ### URL Safe Base64



```
import base64
doAssert encode("c\xf7>", safe = true) == "Y_c-"
doAssert encode("c\xf7>", safe = false) == "Y/c+"
```
 See also
--------


* [hashes module](hashes) for efficient computations of hash values for diverse Nim types
* [md5 module](md5) implements the MD5 checksum algorithm
* [sha1 module](sha1) implements a sha1 encoder and decoder

 Procs
-----

  
```
proc encode[T: SomeInteger | char](s: openArray[T]; safe = false): string
```
  Encodes `s` into base64 representation.

 This procedure encodes an openarray (array or sequence) of either integers or characters.

 If `safe` is `true` then it will encode using the URL-Safe and Filesystem-safe standard alphabet characters, which substitutes `-` instead of `+` and `_` instead of `/`.

 * <https://en.wikipedia.org/wiki/Base64#URL_applications>
* <https://tools.ietf.org/html/rfc4648#page-7>

 **See also:**

 * [encode proc](#encode,string) for encoding a string
* [decode proc](#decode,string) for decoding a string

 **Example:**

 
```
assert encode(['n', 'i', 'm']) == "bmlt"
assert encode(@['n', 'i', 'm']) == "bmlt"
assert encode([1, 2, 3, 4, 5]) == "AQIDBAU="
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/base64.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/base64.nim#L146)  
```
proc encode(s: string; safe = false): string {...}{.raises: [], tags: [].}
```
  Encodes `s` into base64 representation.

 This procedure encodes a string.

 If `safe` is `true` then it will encode using the URL-Safe and Filesystem-safe standard alphabet characters, which substitutes `-` instead of `+` and `_` instead of `/`.

 * <https://en.wikipedia.org/wiki/Base64#URL_applications>
* <https://tools.ietf.org/html/rfc4648#page-7>

 **See also:**

 * [encode proc](#encode,openArray%5BT%5D) for encoding an openarray
* [decode proc](#decode,string) for decoding a string

 **Example:**

 
```
assert encode("Hello World") == "SGVsbG8gV29ybGQ="
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/base64.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/base64.nim#L167)  
```
proc encodeMime(s: string; lineLen = 75; newLine = "\c\n"): string {...}{.raises: [],
    tags: [].}
```
  Encodes `s` into base64 representation as lines. Used in email MIME format, use `lineLen` and `newline`.

 This procedure encodes a string according to MIME spec.

 **See also:**

 * [encode proc](#encode,string) for encoding a string
* [decode proc](#decode,string) for decoding a string

 **Example:**

 
```
assert encodeMime("Hello World", 4, "\n") == "SGVs\nbG8g\nV29y\nbGQ="
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/base64.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/base64.nim#L185)  
```
proc initDecodeTable(): array[256, char] {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/base64.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/base64.nim#L201)  
```
proc decode(s: string): string {...}{.raises: [ValueError], tags: [].}
```
  Decodes string `s` in base64 representation back into its original form. The initial whitespace is skipped.

 **See also:**

 * [encode proc](#encode,openArray%5BT%5D) for encoding an openarray
* [encode proc](#encode,string) for encoding a string

 **Example:**

 
```
assert decode("SGVsbG8gV29ybGQ=") == "Hello World"
assert decode("  SGVsbG8gV29ybGQ=") == "Hello World"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/base64.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/base64.nim#L216)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/base64.html>

hashes
======

 This module implements efficient computations of hash values for diverse Nim types. All the procs are based on these two building blocks:


* [!& proc](#!&,Hash,int) used to start or mix a hash value, and
* [!$ proc](#!%24,Hash) used to *finish* the hash value.

 If you want to implement hash procs for your custom types, you will end up writing the following kind of skeleton of code:

 
```
proc hash(x: Something): Hash =
  ## Computes a Hash from `x`.
  var h: Hash = 0
  # Iterate over parts of `x`.
  for xAtom in x:
    # Mix the atom with the partial hash.
    h = h !& xAtom
  # Finish the hash.
  result = !$h
```

If your custom types contain fields for which there already is a hash proc, like for example objects made up of `strings`, you can simply hash together the hash value of the individual fields:

 
```
proc hash(x: Something): Hash =
  ## Computes a Hash from `x`.
  var h: Hash = 0
  h = h !& hash(x.foo)
  h = h !& hash(x.bar)
  result = !$h
```

**See also:**

 * [md5 module](md5) for MD5 checksum algorithm
* [base64 module](base64) for a base64 encoder and decoder
* [std/sha1 module](sha1) for a sha1 encoder and decoder
* [tables module](tables) for hash tables

 Imports
-------

  <since>  Types
-----

  
```
Hash = int
```
  A hash value. Hash tables using these values should always have a size of a power of two and can use the `and` operator instead of `mod` for truncation of the hash value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L50)   Procs
-----

  
```
proc `!&`(h: Hash; val: int): Hash {...}{.inline, raises: [], tags: [].}
```
  Mixes a hash value `h` with `val` to produce a new hash value.

 This is only needed if you need to implement a hash proc for a new datatype.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L54)  
```
proc `!$`(h: Hash): Hash {...}{.inline, raises: [], tags: [].}
```
  Finishes the computation of the hash value.

 This is only needed if you need to implement a hash proc for a new datatype.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L65)  
```
proc hashWangYi1(x: int64 | uint64 | Hash): Hash {...}{.inline.}
```
  Wang Yi's hash\_v1 for 8B int. <https://github.com/rurban/smhasher> has more details. This passed all scrambling tests in Spring 2019 and is simple. NOTE: It's ok to define `proc(x: int16): Hash = hashWangYi1(Hash(x))`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L109)  
```
proc hashData(data: pointer; size: int): Hash {...}{.raises: [], tags: [].}
```
  Hashes an array of bytes of size `size`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L138)  
```
proc hash(x: pointer): Hash {...}{.inline, raises: [], tags: [].}
```
  Efficient hashing of pointers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L157)  
```
proc hash[T: proc](x: T): Hash {...}{.inline.}
```
  Efficient hashing of proc vars. Closures are supported too. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L173)  
```
proc hashIdentity[T: Ordinal | enum](x: T): Hash {...}{.inline.}
```
  The identity hash. I.e. `hashIdentity(x) = x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L180)  
```
proc hash[T: Ordinal | enum](x: T): Hash {...}{.inline.}
```
  Efficient hashing of integers. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L189)  
```
proc hash(x: float): Hash {...}{.inline, raises: [], tags: [].}
```
  Efficient hashing of floats. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L193)  
```
proc hash(x: string): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of strings.

 See also:

 * [hashIgnoreStyle](#hashIgnoreStyle,string)
* [hashIgnoreCase](#hashIgnoreCase,string)

 **Example:**

 
```
doAssert hash("abracadabra") != hash("AbracadabrA")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L285)  
```
proc hash(x: cstring): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of null-terminated strings. **Example:**

 
```
doAssert hash(cstring"abracadabra") == hash("abracadabra")
doAssert hash(cstring"AbracadabrA") == hash("AbracadabrA")
doAssert hash(cstring"abracadabra") != hash(cstring"AbracadabrA")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L305)  
```
proc hash(sBuf: string; sPos, ePos: int): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of a string buffer, from starting position `sPos` to ending position `ePos` (included).

 `hash(myStr, 0, myStr.high)` is equivalent to `hash(myStr)`.

 **Example:**

 
```
var a = "abracadabra"
doAssert hash(a, 0, 3) == hash(a, 7, 10)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L326)  
```
proc hashIgnoreStyle(x: string): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of strings; style is ignored.

 **Note:** This uses different hashing algorithm than `hash(string)`.

 See also:

 * [hashIgnoreCase](#hashIgnoreCase,string)

 **Example:**

 
```
doAssert hashIgnoreStyle("aBr_aCa_dAB_ra") == hashIgnoreStyle("abracadabra")
doAssert hashIgnoreStyle("abcdefghi") != hash("abcdefghi")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L343)  
```
proc hashIgnoreStyle(sBuf: string; sPos, ePos: int): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of a string buffer, from starting position `sPos` to ending position `ePos` (included); style is ignored.

 **Note:** This uses different hashing algorithm than `hash(string)`.

 `hashIgnoreStyle(myBuf, 0, myBuf.high)` is equivalent to `hashIgnoreStyle(myBuf)`.

 **Example:**

 
```
var a = "ABracada_b_r_a"
doAssert hashIgnoreStyle(a, 0, 3) == hashIgnoreStyle(a, 7, a.high)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L368)  
```
proc hashIgnoreCase(x: string): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of strings; case is ignored.

 **Note:** This uses different hashing algorithm than `hash(string)`.

 See also:

 * [hashIgnoreStyle](#hashIgnoreStyle,string)

 **Example:**

 
```
doAssert hashIgnoreCase("ABRAcaDABRA") == hashIgnoreCase("abRACAdabra")
doAssert hashIgnoreCase("abcdefghi") != hash("abcdefghi")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L393) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L393)  
```
proc hashIgnoreCase(sBuf: string; sPos, ePos: int): Hash {...}{.raises: [], tags: [].}
```
  Efficient hashing of a string buffer, from starting position `sPos` to ending position `ePos` (included); case is ignored.

 **Note:** This uses different hashing algorithm than `hash(string)`.

 `hashIgnoreCase(myBuf, 0, myBuf.high)` is equivalent to `hashIgnoreCase(myBuf)`.

 **Example:**

 
```
var a = "ABracadabRA"
doAssert hashIgnoreCase(a, 0, 3) == hashIgnoreCase(a, 7, 10)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L412)  
```
proc hash[T: tuple](x: T): Hash
```
  Efficient hashing of tuples. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L433)  
```
proc hash[A](x: openArray[A]): Hash
```
  Efficient hashing of arrays and sequences. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L440)  
```
proc hash[A](aBuf: openArray[A]; sPos, ePos: int): Hash
```
  Efficient hashing of portions of arrays and sequences, from starting position `sPos` to ending position `ePos` (included).

 `hash(myBuf, 0, myBuf.high)` is equivalent to `hash(myBuf)`.

 **Example:**

 
```
let a = [1, 2, 5, 1, 2, 6]
doAssert hash(a, 0, 1) == hash(a, 3, 4)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L454)  
```
proc hash[A](x: set[A]): Hash
```
  Efficient hashing of sets. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/hashes.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/hashes.nim#L478)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/hashes.html>

md5
===


Module for computing [MD5 checksums](https://en.wikipedia.org/wiki/MD5).

 **See also:**

 * [base64 module](base64) implements a base64 encoder and decoder
* [std/sha1 module](sha1) for a sha1 encoder and decoder
* [hashes module](hashes) for efficient computations of hash values for diverse Nim types

 Types
-----

  
```
MD5Digest = array[0 .. 15, uint8]
```
  MD5 checksum of a string, obtained with [toMD5 proc](#toMD5,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L25)  
```
MD5Context {...}{.final.} = object
  state: MD5State
  count: array[0 .. 1, uint32]
  buffer: MD5Buffer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L28)   Procs
-----

  
```
proc toMD5(s: string): MD5Digest {...}{.raises: [], tags: [].}
```
  Computes the `MD5Digest` value for a string `s`.

 See also:

 * [getMD5 proc](#getMD5,string) which returns a string representation of the `MD5Digest`
* [$ proc](#%24,MD5Digest) for converting MD5Digest to string

 **Example:**

 
```
assert $toMD5("abc") == "900150983cd24fb0d6963f7d28e17f72"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L180)  
```
proc `$`(d: MD5Digest): string {...}{.raises: [], tags: [].}
```
  Converts a `MD5Digest` value into its string representation. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L195)  
```
proc getMD5(s: string): string {...}{.raises: [], tags: [].}
```
  Computes an MD5 value of `s` and returns its string representation. .. note:: available at compile time

 See also:

 * [toMD5 proc](#toMD5,string) which returns the `MD5Digest` of a string

 **Example:**

 
```
assert getMD5("abc") == "900150983cd24fb0d6963f7d28e17f72"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L203)  
```
proc `==`(D1, D2: MD5Digest): bool {...}{.raises: [], tags: [].}
```
  Checks if two `MD5Digest` values are identical. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L221)  
```
proc md5Init(c: var MD5Context) {...}{.raises: [], tags: [], gcsafe.}
```
  Initializes a `MD5Context`.

 If you use [toMD5 proc](#toMD5,string) there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L228)  
```
proc md5Update(c: var MD5Context; input: cstring; len: int) {...}{.raises: [],
    tags: [], gcsafe.}
```
  Updates the `MD5Context` with the `input` data of length `len`.

 If you use [toMD5 proc](#toMD5,string) there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L241)  
```
proc md5Final(c: var MD5Context; digest: var MD5Digest) {...}{.raises: [], tags: [],
    gcsafe.}
```
  Finishes the `MD5Context` and stores the result in `digest`.

 If you use [toMD5 proc](#toMD5,string) there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/md5.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/md5.nim#L263)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/md5.html>

oids
====


Nim OID support. An OID is a global ID that consists of a timestamp, a unique counter and a random value. This combination should suffice to produce a globally distributed unique ID. This implementation was extracted from the Mongodb interface and it thus binary compatible with a Mongo OID.

 This implementation calls `math.randomize()` for the first call of `genOid`.

 Imports
-------

  <hashes>, <times>, <endians>  Types
-----

  
```
Oid = object
  time: int32
  fuzz: int32
  count: int32
```
  an OID [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L21)   Procs
-----

  
```
proc `==`(oid1: Oid; oid2: Oid): bool {...}{.raises: [], tags: [].}
```
  Compare two Mongo Object IDs for equality [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L26)  
```
proc hash(oid: Oid): Hash {...}{.raises: [], tags: [].}
```
  Generate hash of Oid for use in hashtables [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L31)  
```
proc hexbyte(hex: char): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L39)  
```
proc parseOid(str: cstring): Oid {...}{.raises: [], tags: [].}
```
  parses an OID. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L46)  
```
proc oidToString(oid: Oid; str: cstring) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L54)  
```
proc `$`(oid: Oid): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L68)  
```
proc genOid(): Oid {...}{.raises: [], tags: [TimeEffect].}
```
  generates a new OID. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L82)  
```
proc generatedTime(oid: Oid): Time {...}{.raises: [], tags: [].}
```
  returns the generated timestamp of the OID. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/oids.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/oids.nim#L91)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/oids.html>

sha1
====


**Note:** Import `std/sha1` to use this module.

 [SHA-1 (Secure Hash Algorithm 1)](https://en.wikipedia.org/wiki/SHA-1) is a cryptographic hash function which takes an input and produces a 160-bit (20-byte) hash value known as a message digest.

 Basic usage
-----------

 **Example:**

 
```
let accessName = secureHash("John Doe")
assert $accessName == "AE6E4D1209F17B460503904FAD297B31E9CF6362"
```


```
let
  a = secureHashFile("myFile.nim")
  b = parseSecureHash("10DFAEBF6BFDBC7939957068E2EFACEC4972933C")

if a == b:
  echo "Files match"
```
 See also
--------


* [base64 module](base64) implements a Base64 encoder and decoder
* [hashes module](hashes) for efficient computations of hash values for diverse Nim types
* [md5 module](md5) implements the MD5 checksum algorithm

 Imports
-------

  <strutils>, <endians>  Types
-----

  
```
Sha1Digest = array[0 .. 20 - 1, uint8]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L42)  
```
SecureHash = distinct Sha1Digest
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L43)  
```
Sha1State = object
  count: int
  state: array[5, uint32]
  buf: array[64, byte]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L46)   Procs
-----

  
```
proc newSha1State(): Sha1State {...}{.raises: [], tags: [].}
```
  Creates a `Sha1State`.

 If you use the [secureHash proc](#secureHash,openArray%5Bchar%5D), there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L54)  
```
proc update(ctx: var Sha1State; data: openArray[char]) {...}{.raises: [], tags: [].}
```
  Updates the `Sha1State` with `data`.

 If you use the [secureHash proc](#secureHash,openArray%5Bchar%5D), there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L151)  
```
proc finalize(ctx: var Sha1State): Sha1Digest {...}{.raises: [], tags: [].}
```
  Finalizes the `Sha1State` and returns a `Sha1Digest`.

 If you use the [secureHash proc](#secureHash,openArray%5Bchar%5D), there's no need to call this function explicitly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L186)  
```
proc secureHash(str: openArray[char]): SecureHash {...}{.raises: [], tags: [].}
```
  Generates a `SecureHash` from `str`.

 **See also:**

 * [secureHashFile proc](#secureHashFile,string) for generating a `SecureHash` from a file
* [parseSecureHash proc](#parseSecureHash,string) for converting a string `hash` to `SecureHash`

 **Example:**

 
```
let hash = secureHash("Hello World")
assert hash == parseSecureHash("0A4D55A8D778E5022FAB701977C5D840BBC486D0")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L208)  
```
proc secureHashFile(filename: string): SecureHash {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  Generates a `SecureHash` from a file.

 **See also:**

 * [secureHash proc](#secureHash,openArray%5Bchar%5D) for generating a `SecureHash` from a string
* [parseSecureHash proc](#parseSecureHash,string) for converting a string `hash` to `SecureHash`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L222)  
```
proc `$`(self: SecureHash): string {...}{.raises: [], tags: [].}
```
  Returns the string representation of a `SecureHash`.

 **See also:**

 * [secureHash proc](#secureHash,openArray%5Bchar%5D) for generating a `SecureHash` from a string

 **Example:**

 
```
let hash = secureHash("Hello World")
assert $hash == "0A4D55A8D778E5022FAB701977C5D840BBC486D0"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L245)  
```
proc parseSecureHash(hash: string): SecureHash {...}{.raises: [ValueError], tags: [].}
```
  Converts a string `hash` to a `SecureHash`.

 **See also:**

 * [secureHash proc](#secureHash,openArray%5Bchar%5D) for generating a `SecureHash` from a string
* [secureHashFile proc](#secureHashFile,string) for generating a `SecureHash` from a file

 **Example:**

 
```
let
  hashStr = "0A4D55A8D778E5022FAB701977C5D840BBC486D0"
  secureHash = secureHash("Hello World")
assert secureHash == parseSecureHash(hashStr)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L258)  
```
proc `==`(a, b: SecureHash): bool {...}{.raises: [], tags: [].}
```
  Checks if two `SecureHash` values are identical. **Example:**

 
```
let
  a = secureHash("Hello World")
  b = secureHash("Goodbye World")
  c = parseSecureHash("0A4D55A8D778E5022FAB701977C5D840BBC486D0")
assert a != b
assert a == c
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/sha1.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/sha1.nim#L273)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sha1.html>

browsers
========


This module implements a simple proc for opening URLs with the user's default browser.

 Unstable API.

 Imports
-------

  <since>, <strutils>, <os>, <osproc>  Consts
------

  
```
osOpenCmd = "xdg-open"
```
  Alias for the operating system specific *"open"* command, `"open"` on OSX, MacOS and Windows, `"xdg-open"` on Linux, BSD, etc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/browsers.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/browsers.nim#L25)   Procs
-----

  
```
proc openDefaultBrowser(url: string) {...}{.raises: [ValueError, OSError, Exception], tags: [
    ExecIOEffect, ReadEnvEffect, RootEffect].}
```
  Opens `url` with the user's default browser. This does not block. The URL must not be empty string, to open on a blank page see `openDefaultBrowser()`.

 Under Windows, `ShellExecute` is used. Under Mac OS X the `open` command is used. Under Unix, it is checked if `xdg-open` exists and used if it does. Otherwise the environment variable `BROWSER` is used to determine the default browser to use.

 This proc doesn't raise an exception on error, beware.

 
```
block: openDefaultBrowser("https://nim-lang.org")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/browsers.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/browsers.nim#L54)  
```
proc openDefaultBrowser() {...}{.raises: [ValueError, OSError, Exception],
                            tags: [ExecIOEffect, ReadEnvEffect, RootEffect].}
```
  Opens the user's default browser without any `url` (blank page). This does not block. Implements IETF RFC-6694 Section 3, "about:blank" must be reserved for a blank page.

 Under Windows, `ShellExecute` is used. Under Mac OS X the `open` command is used. Under Unix, it is checked if `xdg-open` exists and used if it does. Otherwise the environment variable `BROWSER` is used to determine the default browser to use.

 This proc doesn't raise an exception on error, beware.

 **See also:**

 * <https://tools.ietf.org/html/rfc6694#section-3>

 
```
block: openDefaultBrowser()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/browsers.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/browsers.nim#L70)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/browsers.html>

colors
======

 This module implements color handling for Nim.

 Imports
-------

  <strutils>, <algorithm>  Types
-----

  
```
Color = distinct int
```
  A color stored as RGB, e.g. `0xff00cc`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L15)   Consts
------

  
```
colAliceBlue = 15792383
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L147)  
```
colAntiqueWhite = 16444375
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L148)  
```
colAqua = 65535
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L149)  
```
colAquamarine = 8388564
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L150)  
```
colAzure = 15794175
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L151)  
```
colBeige = 16119260
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L152)  
```
colBisque = 16770244
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L153)  
```
colBlack = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L154)  
```
colBlanchedAlmond = 16772045
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L155)  
```
colBlue = 255
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L156)  
```
colBlueViolet = 9055202
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L157)  
```
colBrown = 10824234
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L158)  
```
colBurlyWood = 14596231
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L159)  
```
colCadetBlue = 6266528
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L160)  
```
colChartreuse = 8388352
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L161)  
```
colChocolate = 13789470
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L162)  
```
colCoral = 16744272
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L163)  
```
colCornflowerBlue = 6591981
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L164)  
```
colCornsilk = 16775388
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L165)  
```
colCrimson = 14423100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L166)  
```
colCyan = 65535
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L167)  
```
colDarkBlue = 139
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L168)  
```
colDarkCyan = 35723
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L169)  
```
colDarkGoldenRod = 12092939
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L170)  
```
colDarkGray = 11119017
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L171)  
```
colDarkGreen = 25600
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L172)  
```
colDarkKhaki = 12433259
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L173)  
```
colDarkMagenta = 9109643
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L174)  
```
colDarkOliveGreen = 5597999
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L175)  
```
colDarkorange = 16747520
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L176)  
```
colDarkOrchid = 10040012
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L177)  
```
colDarkRed = 9109504
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L178)  
```
colDarkSalmon = 15308410
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L179)  
```
colDarkSeaGreen = 9419919
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L180)  
```
colDarkSlateBlue = 4734347
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L181)  
```
colDarkSlateGray = 3100495
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L182)  
```
colDarkTurquoise = 52945
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L183)  
```
colDarkViolet = 9699539
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L184)  
```
colDeepPink = 16716947
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L185)  
```
colDeepSkyBlue = 49151
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L186)  
```
colDimGray = 6908265
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L187)  
```
colDodgerBlue = 2003199
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L188)  
```
colFireBrick = 11674146
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L189)  
```
colFloralWhite = 16775920
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L190)  
```
colForestGreen = 2263842
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L191)  
```
colFuchsia = 16711935
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L192)  
```
colGainsboro = 14474460
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L193)  
```
colGhostWhite = 16316671
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L194)  
```
colGold = 16766720
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L195)  
```
colGoldenRod = 14329120
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L196)  
```
colGray = 8421504
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L197)  
```
colGreen = 32768
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L198)  
```
colGreenYellow = 11403055
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L199)  
```
colHoneyDew = 15794160
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L200)  
```
colHotPink = 16738740
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L201)  
```
colIndianRed = 13458524
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L202)  
```
colIndigo = 4915330
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L203)  
```
colIvory = 16777200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L204)  
```
colKhaki = 15787660
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L205)  
```
colLavender = 15132410
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L206)  
```
colLavenderBlush = 16773365
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L207)  
```
colLawnGreen = 8190976
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L208)  
```
colLemonChiffon = 16775885
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L209)  
```
colLightBlue = 11393254
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L210)  
```
colLightCoral = 15761536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L211)  
```
colLightCyan = 14745599
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L212)  
```
colLightGoldenRodYellow = 16448210
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L213)  
```
colLightGrey = 13882323
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L214)  
```
colLightGreen = 9498256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L215)  
```
colLightPink = 16758465
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L216)  
```
colLightSalmon = 16752762
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L217)  
```
colLightSeaGreen = 2142890
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L218)  
```
colLightSkyBlue = 8900346
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L219)  
```
colLightSlateGray = 7833753
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L220)  
```
colLightSteelBlue = 11584734
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L221)  
```
colLightYellow = 16777184
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L222)  
```
colLime = 65280
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L223)  
```
colLimeGreen = 3329330
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L224)  
```
colLinen = 16445670
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L225)  
```
colMagenta = 16711935
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L226)  
```
colMaroon = 8388608
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L227)  
```
colMediumAquaMarine = 6737322
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L228)  
```
colMediumBlue = 205
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L229)  
```
colMediumOrchid = 12211667
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L230)  
```
colMediumPurple = 9662680
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L231)  
```
colMediumSeaGreen = 3978097
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L232)  
```
colMediumSlateBlue = 8087790
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L233)  
```
colMediumSpringGreen = 64154
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L234)  
```
colMediumTurquoise = 4772300
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L235)  
```
colMediumVioletRed = 13047173
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L236)  
```
colMidnightBlue = 1644912
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L237)  
```
colMintCream = 16121850
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L238)  
```
colMistyRose = 16770273
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L239)  
```
colMoccasin = 16770229
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L240)  
```
colNavajoWhite = 16768685
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L241)  
```
colNavy = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L242)  
```
colOldLace = 16643558
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L243)  
```
colOlive = 8421376
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L244)  
```
colOliveDrab = 7048739
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L245)  
```
colOrange = 16753920
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L246)  
```
colOrangeRed = 16729344
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L247)  
```
colOrchid = 14315734
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L248)  
```
colPaleGoldenRod = 15657130
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L249)  
```
colPaleGreen = 10025880
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L250)  
```
colPaleTurquoise = 11529966
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L251)  
```
colPaleVioletRed = 14184595
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L252)  
```
colPapayaWhip = 16773077
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L253)  
```
colPeachPuff = 16767673
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L254)  
```
colPeru = 13468991
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L255)  
```
colPink = 16761035
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L256)  
```
colPlum = 14524637
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L257)  
```
colPowderBlue = 11591910
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L258)  
```
colPurple = 8388736
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L259)  
```
colRed = 16711680
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L260)  
```
colRosyBrown = 12357519
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L261)  
```
colRoyalBlue = 4286945
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L262)  
```
colSaddleBrown = 9127187
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L263)  
```
colSalmon = 16416882
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L264)  
```
colSandyBrown = 16032864
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L265)  
```
colSeaGreen = 3050327
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L266)  
```
colSeaShell = 16774638
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L267)  
```
colSienna = 10506797
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L268)  
```
colSilver = 12632256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L269)  
```
colSkyBlue = 8900331
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L270)  
```
colSlateBlue = 6970061
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L271)  
```
colSlateGray = 7372944
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L272)  
```
colSnow = 16775930
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L273)  
```
colSpringGreen = 65407
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L274)  
```
colSteelBlue = 4620980
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L275)  
```
colTan = 13808780
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L276)  
```
colTeal = 32896
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L277)  
```
colThistle = 14204888
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L278)  
```
colTomato = 16737095
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L279)  
```
colTurquoise = 4251856
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L280)  
```
colViolet = 15631086
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L281)  
```
colWheat = 16113331
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L282)  
```
colWhite = 16777215
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L283)  
```
colWhiteSmoke = 16119285
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L284)  
```
colYellow = 16776960
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L285)  
```
colYellowGreen = 10145074
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L286)   Procs
-----

  
```
proc `==`(a, b: Color): bool {...}{.borrow.}
```
  Compares two colors.
```
var
  a = Color(0xff_00_ff)
  b = colFuchsia
  c = Color(0x00_ff_cc)
assert a == b
assert not a == c
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L17)  
```
proc `+`(a, b: Color): Color {...}{.raises: [], tags: [].}
```
  Adds two colors.

 This uses saturated arithmetic, so that each color component cannot overflow (255 is used as a maximum). 

 **Example:**

 
```
var
  a = Color(0xaa_00_ff)
  b = Color(0x11_cc_cc)
assert a + b == Color(0xbb_cc_ff)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L49)  
```
proc `-`(a, b: Color): Color {...}{.raises: [], tags: [].}
```
  Subtracts two colors.

 This uses saturated arithmetic, so that each color component cannot underflow (0 is used as a minimum). 

 **Example:**

 
```
var
  a = Color(0xff_33_ff)
  b = Color(0x11_ff_cc)
assert a - b == Color(0xee_00_33)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L63)  
```
proc extractRGB(a: Color): tuple[r, g, b: range[0 .. 255]] {...}{.raises: [],
    tags: [].}
```
  Extracts the red/green/blue components of the color `a`. **Example:**

 
```
var
  a = Color(0xff_00_ff)
  b = Color(0x00_ff_cc)
type
  Col = range[0..255]
# assert extractRGB(a) == (r: 255.Col, g: 0.Col, b: 255.Col)
# assert extractRGB(b) == (r: 0.Col, g: 255.Col, b: 204.Col)
echo extractRGB(a)
echo typeof(extractRGB(a))
echo extractRGB(b)
echo typeof(extractRGB(b))
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L77)  
```
proc intensity(a: Color; f: float): Color {...}{.raises: [], tags: [].}
```
  Returns `a` with intensity `f`. `f` should be a float from 0.0 (completely dark) to 1.0 (full color intensity). **Example:**

 
```
var
  a = Color(0xff_00_ff)
  b = Color(0x00_42_cc)
assert a.intensity(0.5) == Color(0x80_00_80)
assert b.intensity(0.5) == Color(0x00_21_66)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L97)  
```
proc `$`(c: Color): string {...}{.raises: [], tags: [].}
```
  Converts a color into its textual representation. **Example:**

 
```
assert $colFuchsia == "#FF00FF"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L430) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L430)  
```
proc parseColor(name: string): Color {...}{.raises: [ValueError], tags: [].}
```
  Parses `name` to a color value.

 If no valid color could be parsed `ValueError` is raised. Case insensitive. 

 **Example:**

 
```
var
  a = "silver"
  b = "#0179fc"
  c = "#zzmmtt"
assert parseColor(a) == Color(0xc0_c0_c0)
assert parseColor(b) == Color(0x01_79_fc)
doAssertRaises(ValueError): discard parseColor(c)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L440)  
```
proc isColor(name: string): bool {...}{.raises: [], tags: [].}
```
  Returns true if `name` is a known color name or a hexadecimal color prefixed with `#`. Case insensitive. **Example:**

 
```
var
  a = "silver"
  b = "#0179fc"
  c = "#zzmmtt"
assert a.isColor
assert b.isColor
assert not c.isColor
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L462)  
```
proc rgb(r, g, b: range[0 .. 255]): Color {...}{.raises: [], tags: [].}
```
  Constructs a color from RGB values. **Example:**

 
```
assert rgb(0, 255, 128) == Color(0x00_ff_80)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L483)   Templates
---------

  
```
template mix(a, b: Color; fn: untyped): untyped
```
  Uses `fn` to mix the colors `a` and `b`.

 `fn` is invoked for each component R, G, and B. If `fn`'s result is not in the `range[0..255]`, it will be saturated to be so. 

 **Example:**

 
```
var
  a = Color(0x0a2814)
  b = Color(0x050a03)

proc myMix(x, y: int): int =
  2 * x - 3 * y

assert mix(a, b, myMix) == Color(0x05_32_1f)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/colors.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/colors.nim#L116)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/colors.html>

coro
====

 Nim coroutines implementation, supports several context switching methods:




|  |  |
| --- | --- |
| ucontext | available on unix and alike (default) |
| setjmp | available on unix and alike (x86/64 only) |
| fibers | available and required on windows. |




|  |  |
| --- | --- |
| -d:nimCoroutines | Required to build this module. |
| -d:nimCoroutinesUcontext | Use ucontext backend. |
| -d:nimCoroutinesSetjmp | Use setjmp backend. |
| -d:nimCoroutinesSetjmpBundled | Use bundled setjmp implementation. |


Unstable API.

 Timer support for the realtime GC. Based on <https://github.com/jckarter/clay/blob/master/compiler/hirestimer.cpp> Imports
-------

  <os>, <lists>  Types
-----

  
```
CoroutineRef = ref object
  coro: CoroutinePtr
```
  CoroutineRef holds a pointer to actual coroutine object. Public API always returns CoroutineRef instead of CoroutinePtr in order to allow holding a reference to coroutine object while it can be safely deallocated by coroutine scheduler loop. In this case Coroutine.reference.coro is set to nil. Public API checks for it being nil and gracefully fails if it is nil. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L158)   Procs
-----

  
```
proc suspend(sleepTime: float = 0) {...}{.raises: [], tags: [].}
```
  Stops coroutine execution and resumes no sooner than after `sleeptime` seconds. Until then other coroutines are executed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L224)  
```
proc start(c: proc (); stacksize: int = defaultStackSize): CoroutineRef {...}{.
    discardable, raises: [], tags: [RootEffect].}
```
  Schedule coroutine for execution. It does not run immediately. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L258)  
```
proc run() {...}{.raises: [], tags: [TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L288)  
```
proc alive(c: CoroutineRef): bool {...}{.raises: [], tags: [].}
```
  Returns `true` if coroutine has not returned, `false` otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L328)  
```
proc wait(c: CoroutineRef; interval = 0.01) {...}{.raises: [], tags: [].}
```
  Returns only after coroutine `c` has returned. `interval` is time in seconds how often. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/coro.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/coro.nim#L331)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/coro.html>

logging
=======


This module implements a simple logger.

 It has been designed to be as simple as possible to avoid bloat. If this library does not fulfill your needs, write your own.

 Basic usage
-----------


To get started, first create a logger:

 
```
import logging

var logger = newConsoleLogger()
```

The logger that was created above logs to the console, but this module also provides loggers that log to files, such as the [FileLogger](#FileLogger). Creating custom loggers is also possible by inheriting from the [Logger](#Logger) type.

 Once a logger has been created, call its [log proc](#log.e,ConsoleLogger,Level,varargs%5Bstring,%5D) to log a message:

 
```
logger.log(lvlInfo, "a log message")
# Output: INFO a log message
```

The `INFO` within the output is the result of a format string being prepended to the message, and it will differ depending on the message's level. Format strings are [explained in more detail here](#basic-usage-format-strings).

 There are six logging levels: debug, info, notice, warn, error, and fatal. They are described in more detail within the [Level enum's documentation](#Level). A message is logged if its level is at or above both the logger's `levelThreshold` field and the global log filter. The latter can be changed with the [setLogFilter proc](#setLogFilter,Level).

 **Warning:**

 * For loggers that log to a console or to files, only error and fatal messages will cause their output buffers to be flushed immediately. Use the [flushFile proc](io#flushFile,File) to flush the buffer manually if needed.

 ### Handlers


When using multiple loggers, calling the log proc for each logger can become repetitive. Instead of doing that, register each logger that will be used with the [addHandler proc](#addHandler,Logger), which is demonstrated in the following example:

 
```
import logging

var consoleLog = newConsoleLogger()
var fileLog = newFileLogger("errors.log", levelThreshold=lvlError)
var rollingLog = newRollingFileLogger("rolling.log")

addHandler(consoleLog)
addHandler(fileLog)
addHandler(rollingLog)
```

After doing this, use either the [log template](#log.t,Level,varargs%5Bstring,%5D) or one of the level-specific templates, such as the [error template](#error.t,varargs%5Bstring,%5D), to log messages to all registered handlers at once.

 
```
# This example uses the loggers created above
log(lvlError, "an error occurred")
error("an error occurred")  # Equivalent to the above line
info("something normal happened")  # Will not be written to errors.log
```

Note that a message's level is still checked against each handler's `levelThreshold` and the global log filter.

 ### Format strings


Log messages are prefixed with format strings. These strings contain placeholders for variables, such as `$time`, that are replaced with their corresponding values, such as the current time, before they are prepended to a log message. Characters that are not part of variables are unaffected.

 The format string used by a logger can be specified by providing the `fmtStr` argument when creating the logger or by setting its `fmtStr` field afterward. If not specified, the [default format string](#defaultFmtStr) is used.

 The following variables, which must be prefixed with a dollar sign (`$`), are available:

 

| Variable | Output |
| --- | --- |
| $date | Current date |
| $time | Current time |
| $datetime | $dateT$time |
| $app | [os.getAppFilename()](os#getAppFilename) |
| $appname | Base name of `$app` |
| $appdir | Directory name of `$app` |
| $levelid | First letter of log level |
| $levelname | Log level name |


Note that `$app`, `$appname`, and `$appdir` are not supported when using the JavaScript backend.

 The following example illustrates how to use format strings:

 
```
import logging

var logger = newConsoleLogger(fmtStr="[$time] - $levelname: ")
logger.log(lvlInfo, "this is a message")
# Output: [19:50:13] - INFO: this is a message
```
 ### Notes when using multiple threads


There are a few details to keep in mind when using this module within multiple threads:

 * The global log filter is actually a thread-local variable, so it needs to be set in each thread that uses this module.
* The list of registered handlers is also a thread-local variable. If a handler will be used in multiple threads, it needs to be registered in each of those threads.

 See also
--------


* [strutils module](strutils) for common string functions
* [strformat module](strformat) for string interpolation and formatting
* [strscans module](strscans) for `scanf` and `scanp` macros, which offer easier substring extraction than regular expressions

 Imports
-------

  <strutils>, <times>, <os>  Types
-----

  
```
Level = enum
  lvlAll,                   ## All levels active
  lvlDebug,                 ## Debug level and above are active
  lvlInfo,                  ## Info level and above are active
  lvlNotice,                ## Notice level and above are active
  lvlWarn,                  ## Warn level and above are active
  lvlError,                 ## Error level and above are active
  lvlFatal,                 ## Fatal level and above are active
  lvlNone                    ## No levels active; nothing is logged
```
   Enumeration of logging levels.

 Debug messages represent the lowest logging level, and fatal error messages represent the highest logging level. `lvlAll` can be used to enable all messages, while `lvlNone` can be used to disable all messages.

 Typical usage for each logging level, from lowest to highest, is described below:

 * **Debug** - debugging information helpful only to developers
* **Info** - anything associated with normal operation and without any particular importance
* **Notice** - more important information that users should be notified about
* **Warn** - impending problems that require some attention
* **Error** - error conditions that the application can recover from
* **Fatal** - fatal errors that prevent the application from continuing

 It is completely up to the application how to utilize each level.

 Individual loggers have a `levelThreshold` field that filters out any messages with a level lower than the threshold. There is also a global filter that applies to all log messages, and it can be changed using the [setLogFilter proc](#setLogFilter,Level).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L150)  
```
Logger = ref object of RootObj
  levelThreshold*: Level     ## Only messages that are at or above this
                             ## threshold will be logged
  fmtStr*: string            ## Format string to prepend to each log message;
                             ## defaultFmtStr is the default
```
  The abstract base type of all loggers.

 Custom loggers should inherit from this type. They should also provide their own implementation of the [log method](#log.e,Logger,Level,varargs%5Bstring,%5D).

 See also:

 * [ConsoleLogger](#ConsoleLogger)
* [FileLogger](#FileLogger)
* [RollingFileLogger](#RollingFileLogger)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L202)  
```
ConsoleLogger = ref object of Logger
  useStderr*: bool           ## If true, writes to stderr; otherwise, writes to stdout
```
  A logger that writes log messages to the console.

 Create a new `ConsoleLogger` with the [newConsoleLogger proc](#newConsoleLogger).

 See also:

 * [FileLogger](#FileLogger)
* [RollingFileLogger](#RollingFileLogger)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L218)  
```
FileLogger = ref object of Logger
  file*: File                ## The wrapped file
```
  A logger that writes log messages to a file.

 Create a new `FileLogger` with the [newFileLogger proc](#newFileLogger,File).

 **Note:** This logger is not available for the JavaScript backend.

 See also:

 * [ConsoleLogger](#ConsoleLogger)
* [RollingFileLogger](#RollingFileLogger)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L231)  
```
RollingFileLogger = ref object of FileLogger
  maxLines: int
  curLine: int
  baseName: string
  baseMode: FileMode
  logFiles: int
  bufSize: int
```
  A logger that writes log messages to a file while performing log rotation.

 Create a new `RollingFileLogger` with the [newRollingFileLogger proc](#newRollingFileLogger,FileMode,int,int).

 **Note:** This logger is not available for the JavaScript backend.

 See also:

 * [ConsoleLogger](#ConsoleLogger)
* [FileLogger](#FileLogger)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L244)   Consts
------

  
```
LevelNames: array[Level, string] = ["DEBUG", "DEBUG", "INFO", "NOTICE", "WARN",
                                    "ERROR", "FATAL", "NONE"]
```
  Array of strings representing each logging level. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L186)  
```
defaultFmtStr = "$levelname "
```
  The default format string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L190)  
```
verboseFmtStr = "$levelid, [$datetime] -- $appname: "
```
   A more verbose format string.

 This string can be passed as the `frmStr` argument to procs that create new loggers, such as the [newConsoleLogger proc](#newConsoleLogger).

 If a different format string is preferred, refer to the [documentation about format strings](#basic-usage-format-strings) for more information, including a list of available variables.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L191)   Procs
-----

  
```
proc substituteLog(frmt: string; level: Level; args: varargs[string, `$`]): string {...}{.
    raises: [], tags: [ReadIOEffect, TimeEffect].}
```
  Formats a log message at the specified level with the given format string.

 The [format variables](#basic-usage-format-strings) present within `frmt` will be replaced with the corresponding values before being prepended to `args` and returned.

 Unless you are implementing a custom logger, there is little need to call this directly. Use either a logger's log method or one of the logging templates.

 See also:

 * [log method](#log.e,ConsoleLogger,Level,varargs%5Bstring,%5D) for the ConsoleLogger
* [log method](#log.e,FileLogger,Level,varargs%5Bstring,%5D) for the FileLogger
* [log method](#log.e,RollingFileLogger,Level,varargs%5Bstring,%5D) for the RollingFileLogger
* [log template](#log.t,Level,varargs%5Bstring,%5D)

 **Example:**

 
```
doAssert substituteLog(defaultFmtStr, lvlInfo, "a message") == "INFO a message"
doAssert substituteLog("$levelid - ", lvlError, "an error") == "E - an error"
doAssert substituteLog("$levelid", lvlDebug, "error") == "Derror"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L267)  
```
proc newConsoleLogger(levelThreshold = lvlAll; fmtStr = defaultFmtStr;
                      useStderr = false): ConsoleLogger {...}{.raises: [], tags: [].}
```
  Creates a new [ConsoleLogger](#ConsoleLogger).

 By default, log messages are written to `stdout`. If `useStderr` is true, they are written to `stderr` instead.

 For the JavaScript backend, log messages are written to the console, and `useStderr` is ignored.

 See also:

 * [newFileLogger proc](#newFileLogger,File) that uses a file handle
* [newFileLogger proc](#newFileLogger,FileMode,int) that accepts a filename
* [newRollingFileLogger proc](#newRollingFileLogger,FileMode,int,int)

 **Examples:**

 
```
var normalLog = newConsoleLogger()
var formatLog = newConsoleLogger(fmtStr=verboseFmtStr)
var errorLog = newConsoleLogger(levelThreshold=lvlError, useStderr=true)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L384)  
```
proc defaultFilename(): string {...}{.raises: [], tags: [ReadIOEffect].}
```
  Returns the filename that is used by default when naming log files.

 **Note:** This proc is not available for the JavaScript backend.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L445)  
```
proc newFileLogger(file: File; levelThreshold = lvlAll; fmtStr = defaultFmtStr): FileLogger {...}{.
    raises: [], tags: [].}
```
  Creates a new [FileLogger](#FileLogger) that uses the given file handle.

 **Note:** This proc is not available for the JavaScript backend.

 See also:

 * [newConsoleLogger proc](#newConsoleLogger)
* [newFileLogger proc](#newFileLogger,FileMode,int) that accepts a filename
* [newRollingFileLogger proc](#newRollingFileLogger,FileMode,int,int)

 **Examples:**

 
```
var messages = open("messages.log", fmWrite)
var formatted = open("formatted.log", fmWrite)
var errors = open("errors.log", fmWrite)

var normalLog = newFileLogger(messages)
var formatLog = newFileLogger(formatted, fmtStr=verboseFmtStr)
var errorLog = newFileLogger(errors, levelThreshold=lvlError)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L452)  
```
proc newFileLogger(filename = defaultFilename(); mode: FileMode = fmAppend;
                   levelThreshold = lvlAll; fmtStr = defaultFmtStr;
                   bufSize: int = -1): FileLogger {...}{.raises: [IOError], tags: [].}
```
  Creates a new [FileLogger](#FileLogger) that logs to a file with the given filename.

 `bufSize` controls the size of the output buffer that is used when writing to the log file. The following values can be provided:

 * `-1` - use system defaults
* `0` - unbuffered
* `> 0` - fixed buffer size

 **Note:** This proc is not available for the JavaScript backend.

 See also:

 * [newConsoleLogger proc](#newConsoleLogger)
* [newFileLogger proc](#newFileLogger,File) that uses a file handle
* [newRollingFileLogger proc](#newRollingFileLogger,FileMode,int,int)

 **Examples:**

 
```
var normalLog = newFileLogger("messages.log")
var formatLog = newFileLogger("formatted.log", fmtStr=verboseFmtStr)
var errorLog = newFileLogger("errors.log", levelThreshold=lvlError)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L480)  
```
proc newRollingFileLogger(filename = defaultFilename();
                          mode: FileMode = fmReadWrite; levelThreshold = lvlAll;
                          fmtStr = defaultFmtStr; maxLines: Positive = 1000;
                          bufSize: int = -1): RollingFileLogger {...}{.
    raises: [IOError, OSError], tags: [ReadDirEffect, ReadIOEffect].}
```
  Creates a new [RollingFileLogger](#RollingFileLogger).

 Once the current log file being written to contains `maxLines` lines, a new log file will be created, and the old log file will be renamed.

 `bufSize` controls the size of the output buffer that is used when writing to the log file. The following values can be provided:

 * `-1` - use system defaults
* `0` - unbuffered
* `> 0` - fixed buffer size

 **Note:** This proc is not available in the JavaScript backend.

 See also:

 * [newConsoleLogger proc](#newConsoleLogger)
* [newFileLogger proc](#newFileLogger,File) that uses a file handle
* [newFileLogger proc](#newFileLogger,FileMode,int) that accepts a filename

 **Examples:**

 
```
var normalLog = newRollingFileLogger("messages.log")
var formatLog = newRollingFileLogger("formatted.log", fmtStr=verboseFmtStr)
var shortLog = newRollingFileLogger("short.log", maxLines=200)
var errorLog = newRollingFileLogger("errors.log", levelThreshold=lvlError)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L535)  
```
proc addHandler(handler: Logger) {...}{.raises: [], tags: [].}
```
  Adds a logger to the list of registered handlers.

 **Warning:** The list of handlers is a thread-local variable. If the given handler will be used in multiple threads, this proc should be called in each of those threads.

 See also:

 * [getHandlers proc](#getHandlers)

 **Example:**

 
```
var logger = newConsoleLogger()
addHandler(logger)
doAssert logger in getHandlers()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L794)  
```
proc getHandlers(): seq[Logger] {...}{.raises: [], tags: [].}
```
  Returns a list of all the registered handlers.

 See also:

 * [addHandler proc](#addHandler,Logger)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L809) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L809)  
```
proc setLogFilter(lvl: Level) {...}{.raises: [], tags: [].}
```
  Sets the global log filter.

 Messages below the provided level will not be logged regardless of an individual logger's `levelThreshold`. By default, all messages are logged.

 **Warning:** The global log filter is a thread-local variable. If logging is being performed in multiple threads, this proc should be called in each thread unless it is intended that different threads should log at different logging levels.

 See also:

 * [getLogFilter proc](#getLogFilter)

 **Example:**

 
```
setLogFilter(lvlError)
doAssert getLogFilter() == lvlError
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L816)  
```
proc getLogFilter(): Level {...}{.raises: [], tags: [].}
```
  Gets the global log filter.

 See also:

 * [setLogFilter proc](#setLogFilter,Level)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L835) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L835)   Methods
-------

  
```
method log(logger: Logger; level: Level; args: varargs[string, `$`]) {...}{.
    raises: [Exception], gcsafe, tags: [RootEffect], base.}
```
  Override this method in custom loggers. The default implementation does nothing.

 See also:

 * [log method](#log.e,ConsoleLogger,Level,varargs%5Bstring,%5D) for the ConsoleLogger
* [log method](#log.e,FileLogger,Level,varargs%5Bstring,%5D) for the FileLogger
* [log method](#log.e,RollingFileLogger,Level,varargs%5Bstring,%5D) for the RollingFileLogger
* [log template](#log.t,Level,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L322)  
```
method log(logger: ConsoleLogger; level: Level; args: varargs[string, `$`]) {...}{.
    raises: [], tags: [ReadIOEffect, TimeEffect, WriteIOEffect].}
```
  Logs to the console with the given [ConsoleLogger](#ConsoleLogger) only.

 This method ignores the list of registered handlers.

 Whether the message is logged depends on both the ConsoleLogger's `levelThreshold` field and the global log filter set using the [setLogFilter proc](#setLogFilter,Level).

 **Note:** Only error and fatal messages will cause the output buffer to be flushed immediately. Use the [flushFile proc](io#flushFile,File) to flush the buffer manually if needed.

 See also:

 * [log method](#log.e,FileLogger,Level,varargs%5Bstring,%5D) for the FileLogger
* [log method](#log.e,RollingFileLogger,Level,varargs%5Bstring,%5D) for the RollingFileLogger
* [log template](#log.t,Level,varargs%5Bstring,%5D)

 **Examples:**

 
```
var consoleLog = newConsoleLogger()
consoleLog.log(lvlInfo, "this is a message")
consoleLog.log(lvlError, "error code is: ", 404)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L338)  
```
method log(logger: FileLogger; level: Level; args: varargs[string, `$`]) {...}{.
    raises: [IOError], tags: [WriteIOEffect, ReadIOEffect, TimeEffect].}
```
  Logs a message at the specified level using the given [FileLogger](#FileLogger) only.

 This method ignores the list of registered handlers.

 Whether the message is logged depends on both the FileLogger's `levelThreshold` field and the global log filter set using the [setLogFilter proc](#setLogFilter,Level).

 **Notes:**

 * Only error and fatal messages will cause the output buffer to be flushed immediately. Use the [flushFile proc](io#flushFile,File) to flush the buffer manually if needed.
* This method is not available for the JavaScript backend.

 See also:

 * [log method](#log.e,ConsoleLogger,Level,varargs%5Bstring,%5D) for the ConsoleLogger
* [log method](#log.e,RollingFileLogger,Level,varargs%5Bstring,%5D) for the RollingFileLogger
* [log template](#log.t,Level,varargs%5Bstring,%5D)

 **Examples:**

 
```
var fileLog = newFileLogger("messages.log")
fileLog.log(lvlInfo, "this is a message")
fileLog.log(lvlError, "error code is: ", 404)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L412)  
```
method log(logger: RollingFileLogger; level: Level; args: varargs[string, `$`]) {...}{.
    raises: [OSError, IOError, Exception],
    tags: [ReadIOEffect, WriteIOEffect, TimeEffect].}
```
  Logs a message at the specified level using the given [RollingFileLogger](#RollingFileLogger) only.

 This method ignores the list of registered handlers.

 Whether the message is logged depends on both the RollingFileLogger's `levelThreshold` field and the global log filter set using the [setLogFilter proc](#setLogFilter,Level).

 **Notes:**

 * Only error and fatal messages will cause the output buffer to be flushed immediately. Use the [flushFile proc](io#flushFile,File) to flush the buffer manually if needed.
* This method is not available for the JavaScript backend.

 See also:

 * [log method](#log.e,ConsoleLogger,Level,varargs%5Bstring,%5D) for the ConsoleLogger
* [log method](#log.e,FileLogger,Level,varargs%5Bstring,%5D) for the FileLogger
* [log template](#log.t,Level,varargs%5Bstring,%5D)

 **Examples:**

 
```
var rollingLog = newRollingFileLogger("messages.log")
rollingLog.log(lvlInfo, "this is a message")
rollingLog.log(lvlError, "error code is: ", 404)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L590)   Templates
---------

  
```
template log(level: Level; args: varargs[string, `$`])
```
  Logs a message at the specified level to all registered handlers.

 Whether the message is logged depends on both the FileLogger's `levelThreshold` field and the global log filter set using the [setLogFilter proc](#setLogFilter,Level).

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

log(lvlInfo, "This is an example.")
```

See also:

 * [debug template](#debug.t,varargs%5Bstring,%5D)
* [info template](#info.t,varargs%5Bstring,%5D)
* [notice template](#notice.t,varargs%5Bstring,%5D)
* [warn template](#warn.t,varargs%5Bstring,%5D)
* [error template](#error.t,varargs%5Bstring,%5D)
* [fatal template](#fatal.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L639)  
```
template debug(args: varargs[string, `$`])
```
  Logs a debug message to all registered handlers.

 Debug messages are typically useful to the application developer only, and they are usually disabled in release builds, although this template does not make that distinction.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

debug("myProc called with arguments: foo, 5")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [info template](#info.t,varargs%5Bstring,%5D)
* [notice template](#notice.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L668)  
```
template info(args: varargs[string, `$`])
```
  Logs an info message to all registered handlers.

 Info messages are typically generated during the normal operation of an application and are of no particular importance. It can be useful to aggregate these messages for later analysis.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

info("Application started successfully.")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [debug template](#debug.t,varargs%5Bstring,%5D)
* [notice template](#notice.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L689)  
```
template notice(args: varargs[string, `$`])
```
  Logs an notice to all registered handlers.

 Notices are semantically very similar to info messages, but they are meant to be messages that the user should be actively notified about, depending on the application.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

notice("An important operation has completed.")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [debug template](#debug.t,varargs%5Bstring,%5D)
* [info template](#info.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L710)  
```
template warn(args: varargs[string, `$`])
```
  Logs a warning message to all registered handlers.

 A warning is a non-error message that may indicate impending problems or degraded performance.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

warn("The previous operation took too long to process.")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [error template](#error.t,varargs%5Bstring,%5D)
* [fatal template](#fatal.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L731)  
```
template error(args: varargs[string, `$`])
```
  Logs an error message to all registered handlers.

 Error messages are for application-level error conditions, such as when some user input generated an exception. Typically, the application will continue to run, but with degraded functionality or loss of data, and these effects might be visible to users.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

error("An exception occurred while processing the form.")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [warn template](#warn.t,varargs%5Bstring,%5D)
* [fatal template](#fatal.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L751)  
```
template fatal(args: varargs[string, `$`])
```
  Logs a fatal error message to all registered handlers.

 Fatal error messages usually indicate that the application cannot continue to run and will exit due to a fatal condition. This template only logs the message, and it is the application's responsibility to exit properly.

 **Examples:**

 
```
var logger = newConsoleLogger()
addHandler(logger)

fatal("Can't open database -- exiting.")
```

See also:

 * [log template](#log.t,Level,varargs%5Bstring,%5D)
* [warn template](#warn.t,varargs%5Bstring,%5D)
* [error template](#error.t,varargs%5Bstring,%5D)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/logging.nim#L773) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/logging.nim#L773)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/logging.html>

segfaults
=========


This modules registers a signal handler that turns access violations / segfaults into a `NilAccessDefect` exception. To be able to catch a NilAccessDefect all you have to do is to import this module.

 Tested on these OSes: Linux, Windows, OSX

 Imports
-------

  <posix> 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/segfaults.html>

sugar
=====

 This module implements nice syntactic sugar based on Nim's macro system.

 Imports
-------

  <since>, <macros>, <underscored_calls>, <algorithm>, <random>, <sets>, <tables>, <strutils>  Macros
------

  
```
macro `=>`(p, b: untyped): untyped
```
  Syntax sugar for anonymous procedures. It also supports pragmas. **Example:**

 
```
proc passTwoAndTwo(f: (int, int) -> int): int =
  f(2, 2)

doAssert passTwoAndTwo((x, y) => x + y) == 4

type
  Bot = object
    call: proc (): string {.nosideEffect.}

var myBot = Bot()

myBot.call = () {.nosideEffect.} => "I'm a bot."
doAssert myBot.call() == "I'm a bot."
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L58)  
```
macro `->`(p, b: untyped): untyped
```
  Syntax sugar for procedure types.
```
proc pass2(f: (float, float) -> float): float =
  f(2, 2)

# is the same as:

proc pass2(f: proc (x, y: float): float): float =
  f(2, 2)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L146)  
```
macro dump(x: untyped): untyped
```
  Dumps the content of an expression, useful for debugging. It accepts any expression and prints a textual representation of the tree representing the expression - as it would appear in source code - together with the value of the expression.

 As an example,

 
```
let
  x = 10
  y = 20
dump(x + y)
```

will print `x + y = 30`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L161)  
```
macro capture(locals: varargs[typed]; body: untyped): untyped
```
  Useful when creating a closure in a loop to capture some local loop variables by their current iteration values. Example:
```
import strformat, sequtils, sugar
var myClosure : proc()
for i in 5..7:
  for j in 7..9:
    if i * j == 42:
      capture i, j:
        myClosure = proc () = echo fmt"{i} * {j} = 42"
myClosure() # output: 6 * 7 == 42
let m = @[proc (s: string): string = "to " & s, proc (s: string): string = "not to " & s]
var l = m.mapIt(capture(it, proc (s: string): string = it(s)))
let r = l.mapIt(it("be"))
echo r[0] & ", or " & r[1] # output: to be, or not to be
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L197)  
```
macro dup[T](arg: T; calls: varargs[untyped]): T
```
  Turns an in-place algorithm into one that works on a copy and returns this copy, without modifying its input.

 This macro also allows for (otherwise in-place) function chaining.

 **Since**: Version 1.2.

 **Example:**

 
```
import algorithm

var a = @[1, 2, 3, 4, 5, 6, 7, 8, 9]
doAssert a.dup(sort) == sorted(a)
# Chaining:
var aCopy = a
aCopy.insert(10)

doAssert a.dup(insert(10), sort) == sorted(aCopy)

var s1 = "abc"
var s2 = "xyz"
doAssert s1 & s2 == s1.dup(&= s2)

proc makePalindrome(s: var string) =
  for i in countdown(s.len-2, 0):
    s.add(s[i])

var c = "xyz"

# An underscore (_) can be used to denote the place of the argument you're passing:
doAssert "".dup(addQuoted(_, "foo")) == "\"foo\""
# but `_` is optional here since the substitution is in 1st position:
doAssert "".dup(addQuoted("foo")) == "\"foo\""

# chaining:
# b = "xyz"
var d = dup c:
  makePalindrome # xyzyx
  sort(_, SortOrder.Descending) # zyyxx
  makePalindrome # zyyxxxyyz

doAssert d == "zyyxxxyyz"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L228)  
```
macro collect(init, body: untyped): untyped
```
  Comprehension for seq/set/table collections. `init` is the init call, and so custom collections are supported.

 The last statement of `body` has special syntax that specifies the collection's add operation. Use `{e}` for set's `incl`, `{k: v}` for table's `[]=` and `e` for seq's `add`.

 The `init` proc can be called with any number of arguments, i.e. `initTable(initialSize)`.

 **Example:**

 
```
import sets, tables
let data = @["bird", "word"]
## seq:
let k = collect(newSeq):
  for i, d in data.pairs:
    if i mod 2 == 0: d

assert k == @["bird"]
## seq with initialSize:
let x = collect(newSeqOfCap(4)):
  for i, d in data.pairs:
    if i mod 2 == 0: d

assert x == @["bird"]
## HashSet:
let y = initHashSet.collect:
  for d in data.items: {d}

assert y == data.toHashSet
## Table:
let z = collect(initTable(2)):
  for i, d in data.pairs: {i: d}

assert z == {0: "bird", 1: "word"}.toTable
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/sugar.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/sugar.nim#L314)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sugar.html>

unittest
========


**Note**: Instead of `unittest.nim`, please consider to use the `testament` tool which offers process isolation for your tests. Also `when isMainModule: doAssert conditionHere` is usually a much simpler solution for testing purposes.

 This module implements boilerplate to make unit testing easy.

 The test status and name is printed after any output or traceback.

 Tests can be nested, however failure of a nested test will not mark the parent test as failed. Setup and teardown are inherited. Setup can be overridden locally.

 Compiled test files as well as `nim c -r <testfile.nim>` exit with 0 for success (no failed tests) or 1 for failure.

 Running a single test
---------------------


Specify the test name as a command line argument.

 
```
nim c -r test "my test name" "another test"
```

Multiple arguments can be used.

 Running a single test suite
---------------------------


Specify the suite name delimited by `"::"`.

 
```
nim c -r test "my test name::"
```
 Selecting tests by pattern
--------------------------


A single `"*"` can be used for globbing.

 Delimit the end of a suite name with `"::"`.

 Tests matching **any** of the arguments are executed.

 
```
nim c -r test fast_suite::mytest1 fast_suite::mytest2
nim c -r test "fast_suite::mytest*"
nim c -r test "auth*::" "crypto::hashing*"
# Run suites starting with 'bug #' and standalone tests starting with '#'
nim c -r test 'bug #*::' '::#*'
```
 Examples
--------



```
suite "description for this stuff":
  echo "suite setup: run once before the tests"
  
  setup:
    echo "run before each test"
  
  teardown:
    echo "run after each test"
  
  test "essential truths":
    # give up and stop if this fails
    require(true)
  
  test "slightly less obvious stuff":
    # print a nasty message and move on, skipping
    # the remainder of this block
    check(1 != 1)
    check("asd"[2] == 'd')
  
  test "out of bounds error is thrown on bad access":
    let v = @[1, 2, 3]  # you can do initialization here
    expect(IndexDefect):
      discard v[4]
  
  echo "suite teardown: run once after the tests"
```
 Limitations/Bugs
----------------


Since `check` will rewrite some expressions for supporting checkpoints (namely assigns expressions to variables), some type conversions are not supported. For example `check 4.0 == 2 + 2` won't work. But `doAssert 4.0 == 2 + 2` works. Make sure both sides of the operator (such as `==`, `>=` and so on) have the same type. 

 Imports
-------

  <since>, <exitprocs>, <macros>, <strutils>, <streams>, <times>, <sets>, <sequtils>, <os>, <terminal>  Types
-----

  
```
TestStatus = enum
  OK, FAILED, SKIPPED
```
  The status of a test when it is done. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L119)  
```
OutputLevel = enum
  PRINT_ALL,                ## Print as much as possible.
  PRINT_FAILURES,           ## Print only the failed tests.
  PRINT_NONE                 ## Print nothing.
```
  The output verbosity of the tests. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L124)  
```
TestResult = object
  suiteName*: string ## Name of the test suite that contains this test case.
                     ## Can be ``nil`` if the test case is not in a suite.
  testName*: string          ## Name of the test case
  status*: TestStatus
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L129)  
```
OutputFormatter = ref object of RootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L137)  
```
ConsoleOutputFormatter = ref object of OutputFormatter
  colorOutput: bool          ## Have test results printed in color.
                             ## Default is true for the non-js target,
                             ## for which ``stdout`` is a tty.
                             ## Setting the environment variable
                             ## ``NIMTEST_COLOR`` to ``always`` or
                             ## ``never`` changes the default for the
                             ## non-js target to true or false respectively.
                             ## The deprecated environment variable
                             ## ``NIMTEST_NO_COLOR``, when set,
                             ## changes the default to true, if
                             ## ``NIMTEST_COLOR`` is undefined.
  outputLevel: OutputLevel   ## Set the verbosity of test results.
                             ## Default is ``PRINT_ALL``, unless
                             ## the ``NIMTEST_OUTPUT_LVL`` environment
                             ## variable is set for the non-js target.
  isInSuite: bool
  isInTest: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L139)  
```
JUnitOutputFormatter = ref object of OutputFormatter
  stream: Stream
  testErrors: seq[string]
  testStartTime: float
  testStackTrace: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L160)   Vars
----

  
```
abortOnError: bool
```
  Set to true in order to quit immediately on fail. Default is false, unless the `NIMTEST_ABORT_ON_ERROR` environment variable is set for the non-js target. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L167)   Procs
-----

  
```
proc addOutputFormatter(formatter: OutputFormatter) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L195)  
```
proc delOutputFormatter(formatter: OutputFormatter) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L198)  
```
proc resetOutputFormatters() {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L202)  
```
proc newConsoleOutputFormatter(outputLevel: OutputLevel = OutputLevel.PRINT_ALL;
                               colorOutput = true): ConsoleOutputFormatter {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L205)  
```
proc defaultConsoleFormatter(): ConsoleOutputFormatter {...}{.raises: [],
    tags: [ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L212)  
```
proc newJUnitOutputFormatter(stream: Stream): JUnitOutputFormatter {...}{.
    raises: [IOError, OSError], tags: [WriteIOEffect].}
```
  Creates a formatter that writes report to the specified stream in JUnit format. The `stream` is NOT closed automatically when the test are finished, because the formatter has no way to know when all tests are finished. You should invoke formatter.close() to finalize the report. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L295)  
```
proc close(formatter: JUnitOutputFormatter) {...}{.
    raises: [IOError, OSError, Exception], tags: [WriteIOEffect].}
```
  Completes the report and closes the underlying stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L310)  
```
proc checkpoint(msg: string) {...}{.raises: [], tags: [].}
```
  Set a checkpoint identified by `msg`. Upon test failure all checkpoints encountered so far are printed out. Example:
```
checkpoint("Checkpoint A")
check((42, "the Answer to life and everything") == (1, "a"))
checkpoint("Checkpoint B")
```

outputs "Checkpoint A" once it fails.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L545)  
```
proc disableParamFiltering() {...}{.raises: [], tags: [].}
```
  disables filtering tests with the command line params [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L749)   Methods
-------

  
```
method suiteStarted(formatter: OutputFormatter; suiteName: string) {...}{.base,
    gcsafe, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L181)  
```
method testStarted(formatter: OutputFormatter; testName: string) {...}{.base, gcsafe,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L183)  
```
method failureOccurred(formatter: OutputFormatter; checkpoints: seq[string];
                       stackTrace: string) {...}{.base, gcsafe, raises: [], tags: [].}
```
  `stackTrace` is provided only if the failure occurred due to an exception. `checkpoints` is never `nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L185)  
```
method testEnded(formatter: OutputFormatter; testResult: TestResult) {...}{.base,
    gcsafe, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L190)  
```
method suiteEnded(formatter: OutputFormatter) {...}{.base, gcsafe, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L192)  
```
method suiteStarted(formatter: ConsoleOutputFormatter; suiteName: string) {...}{.
    raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L236)  
```
method testStarted(formatter: ConsoleOutputFormatter; testName: string) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L245)  
```
method failureOccurred(formatter: ConsoleOutputFormatter;
                       checkpoints: seq[string]; stackTrace: string) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L248)  
```
method testEnded(formatter: ConsoleOutputFormatter; testResult: TestResult) {...}{.
    raises: [IOError, ValueError], tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L256)  
```
method suiteEnded(formatter: ConsoleOutputFormatter) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L277)  
```
method suiteStarted(formatter: JUnitOutputFormatter; suiteName: string) {...}{.
    raises: [IOError, OSError, ValueError], tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L315)  
```
method testStarted(formatter: JUnitOutputFormatter; testName: string) {...}{.
    raises: [], tags: [TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L318)  
```
method failureOccurred(formatter: JUnitOutputFormatter;
                       checkpoints: seq[string]; stackTrace: string) {...}{.
    raises: [], tags: [].}
```
  `stackTrace` is provided only if the failure occurred due to an exception. `checkpoints` is never `nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L323)  
```
method testEnded(formatter: JUnitOutputFormatter; testResult: TestResult) {...}{.
    raises: [IOError, OSError, ValueError], tags: [TimeEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L331)  
```
method suiteEnded(formatter: JUnitOutputFormatter) {...}{.raises: [IOError, OSError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L372)   Macros
------

  
```
macro check(conditions: untyped): untyped
```
  Verify if a statement or a list of statements is true. A helpful error message and set checkpoints are printed out on failure (if `outputLevel` is not `PRINT_NONE`). Example:
```
import strutils

check("AKB48".toLowerAscii() == "akb48")

let teams = {'A', 'K', 'B', '4', '8'}

check:
  "AKB48".toLowerAscii() == "akb48"
  'C' in teams
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L607) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L607)  
```
macro expect(exceptions: varargs[typed]; body: untyped): untyped
```
  Test if `body` raises an exception found in the passed `exceptions`. The test passes if the raised exception is part of the acceptable exceptions. Otherwise, it fails. Example:
```
import math, random
proc defectiveRobot() =
  randomize()
  case rand(1..4)
  of 1: raise newException(OSError, "CANNOT COMPUTE!")
  of 2: discard parseInt("Hello World!")
  of 3: raise newException(IOError, "I can't do that Dave.")
  else: assert 2 + 2 == 5

expect IOError, OSError, ValueError, AssertionDefect:
  defectiveRobot()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L710)   Templates
---------

  
```
template suite(name, body) {...}{.dirty.}
```
  Declare a test suite identified by `name` with optional `setup` and/or `teardown` section.

 A test suite is a series of one or more related tests sharing a common fixture (`setup`, `teardown`). The fixture is executed for EACH test.

 
```
suite "test suite for addition":
  setup:
    let result = 4
  
  test "2 + 2 = 4":
    check(2+2 == result)
  
  test "(2 + -2) != 4":
    check(2 + -2 != result)
  
  # No teardown needed
```

The suite will run the individual test cases in the order in which they were listed. With default global settings the above code prints:

 
```
[Suite] test suite for addition
  [OK] 2 + 2 = 4
  [OK] (2 + -2) != 4
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L444)  
```
template test(name, body) {...}{.dirty.}
```
  Define a single test case identified by `name`.
```
test "roses are red":
  let roses = "red"
  check(roses == "red")
```

The above code outputs:

 
```
[OK] roses are red
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L496)  
```
template fail()
```
  Print out the checkpoints encountered so far and quit if `abortOnError` is true. Otherwise, erase the checkpoints and indicate the test has failed (change exit code and test status). This template is useful for debugging, but is otherwise mostly used internally. Example:
```
checkpoint("Checkpoint A")
complicatedProcInThread()
fail()
```

outputs "Checkpoint A" before quitting.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L559)  
```
template skip()
```
  Mark the test as skipped. Should be used directly in case when it is not possible to perform test for reasons depending on outer environment, or certain application logic conditions or configurations. The test code is still executed.
```
if not isGLContextCreated():
  skip()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L591)  
```
template require(conditions: untyped)
```
  Same as `check` except any failed test causes the program to quit immediately. Any teardown statements are not executed and the failed test output is not generated. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/unittest.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/unittest.nim#L700)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/unittest.html>

varints
=======


A variable length integer encoding implementation inspired by SQLite.

 Unstable API.

 Consts
------

  
```
maxVarIntLen = 9
```
  the maximal number of bytes a varint can take [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/varints.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/varints.nim#L16)   Procs
-----

  
```
proc readVu64(z: openArray[byte]; pResult: var uint64): int {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/varints.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/varints.nim#L18)  
```
proc writeVu64(z: var openArray[byte]; x: uint64): int {...}{.raises: [], tags: [].}
```
  Write a varint into z. The buffer z must be at least 9 characters long to accommodate the largest possible varint. Returns the number of bytes used. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/varints.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/varints.nim#L57)  
```
proc encodeZigzag(x: int64): uint64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/varints.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/varints.nim#L116)  
```
proc decodeZigzag(x: uint64): int64 {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/varints.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/varints.nim#L119)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/varints.html>

asyncjs
=======


This module implements types and macros for writing asynchronous code for the JS backend. It provides tools for interaction with JavaScript async API-s and libraries, writing async procedures in Nim and converting callback-based code to promises.

 A Nim procedure is asynchronous when it includes the `{.async.}` pragma. It should always have a `Future[T]` return type or not have a return type at all. A `Future[void]` return type is assumed by default.

 This is roughly equivalent to the `async` keyword in JavaScript code.

 
```
proc loadGame(name: string): Future[Game] {.async.} =
  # code
```

should be equivalent to

 
```
async function loadGame(name) {
  // code
}
```

A call to an asynchronous procedure usually needs `await` to wait for the completion of the `Future`.

 
```
var game = await loadGame(name)
```

Often, you might work with callback-based API-s. You can wrap them with asynchronous procedures using promises and `newPromise`:

 
```
proc loadGame(name: string): Future[Game] =
  var promise = newPromise() do (resolve: proc(response: Game)):
    cbBasedLoadGame(name) do (game: Game):
      resolve(game)
  return promise
```

Forward definitions work properly, you just need to always add the `{.async.}` pragma:

 
```
proc loadGame(name: string): Future[Game] {.async.}
```
 JavaScript compatibility
------------------------


Nim currently generates `async/await` JavaScript code which is supported in modern EcmaScript and most modern versions of browsers, Node.js and Electron. If you need to use this module with older versions of JavaScript, you can use a tool that backports the resulting JavaScript code, as babel.

 Imports
-------

  <jsffi>, <macros>  Types
-----

  
```
Future[T] = ref object
  future*: T
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/asyncjs.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/asyncjs.nim#L67)  
```
PromiseJs {...}{.importcpp: "Promise".} = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/asyncjs.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/asyncjs.nim#L71)   Procs
-----

  
```
proc newPromise[T](handler: proc (resolve: proc (response: T))): Future[T] {...}{.
    importcpp: "(new Promise(#))".}
```
  A helper for wrapping callback-based functions into promises and async procedures [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/asyncjs.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/asyncjs.nim#L150)  
```
proc newPromise(handler: proc (resolve: proc ())): Future[void] {...}{.
    importcpp: "(new Promise(#))".}
```
  A helper for wrapping callback-based functions into promises and async procedures [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/asyncjs.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/asyncjs.nim#L154)   Macros
------

  
```
macro async(arg: untyped): untyped
```
  Macro which converts normal procedures into javascript-compatible async procedures [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/asyncjs.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/asyncjs.nim#L140)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncjs.html>

jsconsole
=========

 Wrapper for the `console` object for the [JavaScript backend](backends#backends-the-javascript-target).

 Types
-----

  
```
Console = ref object of RootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L16)   Vars
----

  
```
console: Console
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L70)   Procs
-----

  
```
proc log(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/log> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L18)  
```
proc debug(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/debug> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L21)  
```
proc info(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/info> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L24)  
```
proc error(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/error> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L27)  
```
proc trace(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/trace> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L34)  
```
proc warn(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/warn> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L37)  
```
proc clear(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/clear> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L40)  
```
proc count(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/count> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L43)  
```
proc countReset(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/countReset> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L46)  
```
proc group(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/group> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L49)  
```
proc groupCollapsed(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Console/groupCollapsed> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L52)  
```
proc groupEnd(console: Console) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/groupEnd> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L55)  
```
proc time(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/time> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L58)  
```
proc timeEnd(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/timeEnd> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L61)  
```
proc timeLog(console: Console; label = "".cstring) {...}{.importcpp.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/timeLog> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L64)  
```
proc table(console: Console) {...}{.importcpp, varargs.}
```
  <https://developer.mozilla.org/docs/Web/API/Console/table> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L67)   Templates
---------

  
```
template exception(console: Console; args: varargs[untyped])
```
  Alias for `console.error()`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsconsole.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsconsole.nim#L30)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/jsconsole.html>

jscore
======


This module wraps core JavaScript functions.

 Unless your application has very specific requirements and solely targets JavaScript, you should be using the relevant functions in the `math`, `json`, and `times` stdlib modules instead.

 Types
-----

  
```
MathLib = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L21)  
```
JsonLib = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L22)  
```
DateLib = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L23)  
```
DateTime = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L24)   Vars
----

  
```
Math: MathLib
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L27)  
```
Date: DateLib
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L28)  
```
JSON: JsonLib
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L29)   Procs
-----

  
```
proc abs(m: MathLib; a: SomeNumber): SomeNumber {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L32)  
```
proc acos(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L33)  
```
proc acosh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L34)  
```
proc asin(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L35)  
```
proc asinh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L36)  
```
proc atan(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L37)  
```
proc atan2(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L38)  
```
proc atanh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L39)  
```
proc cbrt(m: MathLib; f: SomeFloat): SomeFloat {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L40)  
```
proc ceil(m: MathLib; f: SomeFloat): SomeFloat {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L41)  
```
proc clz32(m: MathLib; f: SomeInteger): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L42)  
```
proc cos(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L43)  
```
proc cosh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L44)  
```
proc exp(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L45)  
```
proc expm1(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L46)  
```
proc floor(m: MathLib; f: SomeFloat): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L47)  
```
proc fround(m: MathLib; f: SomeFloat): float32 {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L48)  
```
proc hypot(m: MathLib; args: varargs[distinct SomeNumber]): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L49)  
```
proc imul(m: MathLib; a, b: int32): int32 {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L50)  
```
proc log(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L51)  
```
proc log10(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L52)  
```
proc log1p(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L53)  
```
proc log2(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L54)  
```
proc max(m: MathLib; a, b: SomeNumber): SomeNumber {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L55)  
```
proc min[T: SomeNumber | JsRoot](m: MathLib; a, b: T): T {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L56)  
```
proc pow(m: MathLib; a, b: distinct SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L57)  
```
proc random(m: MathLib): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L58)  
```
proc round(m: MathLib; f: SomeFloat): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L59)  
```
proc sign(m: MathLib; f: SomeNumber): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L60)  
```
proc sin(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L61)  
```
proc sinh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L62)  
```
proc sqrt(m: MathLib; f: SomeFloat): SomeFloat {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L63)  
```
proc tan(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L64)  
```
proc tanh(m: MathLib; a: SomeNumber): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L65)  
```
proc trunc(m: MathLib; f: SomeFloat): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L66)  
```
proc now(d: DateLib): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L69)  
```
proc UTC(d: DateLib): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L70)  
```
proc parse(d: DateLib; s: cstring): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L71)  
```
proc newDate(): DateTime {...}{.importcpp: "new Date()".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L73)  
```
proc newDate(date: int | int64 | string): DateTime {...}{.importcpp: "new Date(#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L76)  
```
proc newDate(year, month, day, hours, minutes, seconds, milliseconds: int): DateTime {...}{.
    importcpp: "new Date(#,#,#,#,#,#,#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L79)  
```
proc getDay(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L83)  
```
proc getFullYear(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L84)  
```
proc getHours(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L85)  
```
proc getMilliseconds(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L86)  
```
proc getMinutes(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L87)  
```
proc getMonth(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L88)  
```
proc getSeconds(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L89)  
```
proc getYear(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L90)  
```
proc getTime(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L91)  
```
proc toString(d: DateTime): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L92)  
```
proc getUTCDate(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L93)  
```
proc getUTCFullYear(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L94)  
```
proc getUTCHours(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L95)  
```
proc getUTCMilliseconds(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L96)  
```
proc getUTCMinutes(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L97)  
```
proc getUTCMonth(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L98)  
```
proc getUTCSeconds(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L99)  
```
proc getUTCDay(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L100)  
```
proc getTimezoneOffset(d: DateTime): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L101)  
```
proc setFullYear(d: DateTime; year: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L102)  
```
proc stringify(l: JsonLib; s: JsRoot): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L105)  
```
proc parse(l: JsonLib; s: cstring): JsRoot {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jscore.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jscore.nim#L106)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/jscore.html>

jsffi
=====

 This Module implements types and macros to facilitate the wrapping of, and interaction with JavaScript libraries. Using the provided types `JsObject` and `JsAssoc` together with the provided macros allows for smoother interfacing with JavaScript, allowing for example quick and easy imports of JavaScript variables:



```
# Here, we are using jQuery for just a few calls and do not want to wrap the
# whole library:

# import the document object and the console
var document {.importc, nodecl.}: JsObject
var console {.importc, nodecl.}: JsObject
# import the "$" function
proc jq(selector: JsObject): JsObject {.importcpp: "$$(#)".}

# Use jQuery to make the following code run, after the document is ready.
# This uses an experimental ``.()`` operator for ``JsObject``, to emit
# JavaScript calls, when no corresponding proc exists for ``JsObject``.
proc main =
  jq(document).ready(proc() =
    console.log("Hello JavaScript!")
  )
```
 Imports
-------

  <macros>, <tables>  Types
-----

  
```
JsKey = concept atypeof(T)
    cstring.toJsKey(T) is T
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L85)  
```
JsObject = ref object of JsRoot
```
  Dynamically typed wrapper around a JavaScript object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L88)  
```
JsAssoc[K; V] = ref object of JsRoot
```
  Statically typed wrapper around a JavaScript object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L90)  
```
js = JsObject
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L93)  
```
JsError {...}{.importc: "Error".} = object of JsRoot
  message*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L115)  
```
JsEvalError {...}{.importc: "EvalError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L117)  
```
JsRangeError {...}{.importc: "RangeError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L118)  
```
JsReferenceError {...}{.importc: "ReferenceError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L119)  
```
JsSyntaxError {...}{.importc: "SyntaxError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L120)  
```
JsTypeError {...}{.importc: "TypeError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L121)  
```
JsURIError {...}{.importc: "URIError".} = object of JsError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L122)   Vars
----

  
```
jsArguments: JsObject
```
  JavaScript's arguments pseudo-variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L96)  
```
jsNull: JsObject
```
  JavaScript's null literal [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L98)  
```
jsUndefined: JsObject
```
  JavaScript's undefined literal [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L100)  
```
jsDirname: cstring
```
  JavaScript's \_\_dirname pseudo-variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L102)  
```
jsFilename: cstring
```
  JavaScript's \_\_filename pseudo-variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L104)   Procs
-----

  
```
proc toJsKey[T: SomeInteger](text: cstring; t: type T): T {...}{.
    importcpp: "parseInt(#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L74)  
```
proc toJsKey[T: enum](text: cstring; t: type T): T
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L76)  
```
proc toJsKey(text: cstring; t: type cstring): cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L79)  
```
proc toJsKey[T: SomeFloat](text: cstring; t: type T): T {...}{.
    importcpp: "parseFloat(#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L82)  
```
proc isNull[T](x: T): bool {...}{.noSideEffect, importcpp: "(# === null)".}
```
  check if a value is exactly null [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L107)  
```
proc isUndefined[T](x: T): bool {...}{.noSideEffect, importcpp: "(# === undefined)".}
```
  check if a value is exactly undefined [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L110)  
```
proc newJsObject(): JsObject {...}{.importcpp: "{@}".}
```
  Creates a new empty JsObject [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L125)  
```
proc newJsAssoc[K: JsKey; V](): JsAssoc[K, V] {...}{.importcpp: "{@}".}
```
  Creates a new empty JsAssoc with key type `K` and value type `V`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L128)  
```
proc hasOwnProperty(x: JsObject; prop: cstring): bool {...}{.
    importcpp: "#.hasOwnProperty(#)".}
```
  Checks, whether `x` has a property of name `prop`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L132)  
```
proc jsTypeOf(x: JsObject): cstring {...}{.importcpp: "typeof(#)".}
```
  Returns the name of the JsObject's JavaScript type as a cstring. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L136)  
```
proc jsNew(x: auto): JsObject {...}{.importcpp: "(new #)".}
```
  Turns a regular function call into an invocation of the JavaScript's `new` operator [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L139)  
```
proc jsDelete(x: auto): JsObject {...}{.importcpp: "(delete #)".}
```
  JavaScript's `delete` operator [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L143)  
```
proc require(module: cstring): JsObject {...}{.importc.}
```
  JavaScript's `require` function [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L146)  
```
proc to(x: JsObject; T: typedesc): T:type {...}{.importcpp: "(#)".}
```
  Converts a JsObject `x` to type `T`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L150)  
```
proc toJs[T](val: T): JsObject {...}{.importcpp: "(#)".}
```
  Converts a value of any type to type JsObject [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L153)  
```
proc `&`(a, b: cstring): cstring {...}{.importcpp: "(# + #)".}
```
  Concatenation operator for JavaScript strings [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L164)  
```
proc `+`(x, y: JsObject): JsObject {...}{.importcpp: "(# + #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L167)  
```
proc `-`(x, y: JsObject): JsObject {...}{.importcpp: "(# - #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L168)  
```
proc `*`(x, y: JsObject): JsObject {...}{.importcpp: "(# * #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L169)  
```
proc `/`(x, y: JsObject): JsObject {...}{.importcpp: "(# / #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L170)  
```
proc `%`(x, y: JsObject): JsObject {...}{.importcpp: "(# % #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L171)  
```
proc `+=`(x, y: JsObject): JsObject {...}{.importcpp: "(# += #)", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L172)  
```
proc `-=`(x, y: JsObject): JsObject {...}{.importcpp: "(# -= #)", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L173)  
```
proc `*=`(x, y: JsObject): JsObject {...}{.importcpp: "(# *= #)", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L174)  
```
proc `/=`(x, y: JsObject): JsObject {...}{.importcpp: "(# /= #)", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L175)  
```
proc `%=`(x, y: JsObject): JsObject {...}{.importcpp: "(# %= #)", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L176)  
```
proc `++`(x: JsObject): JsObject {...}{.importcpp: "(++#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L177)  
```
proc `--`(x: JsObject): JsObject {...}{.importcpp: "(--#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L178)  
```
proc `>`(x, y: JsObject): JsObject {...}{.importcpp: "(# > #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L179)  
```
proc `<`(x, y: JsObject): JsObject {...}{.importcpp: "(# < #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L180)  
```
proc `>=`(x, y: JsObject): JsObject {...}{.importcpp: "(# >= #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L181)  
```
proc `<=`(x, y: JsObject): JsObject {...}{.importcpp: "(# <= #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L182)  
```
proc `and`(x, y: JsObject): JsObject {...}{.importcpp: "(# && #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L183)  
```
proc `or`(x, y: JsObject): JsObject {...}{.importcpp: "(# || #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L184)  
```
proc `not`(x: JsObject): JsObject {...}{.importcpp: "(!#)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L185)  
```
proc `in`(x, y: JsObject): JsObject {...}{.importcpp: "(# in #)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L186)  
```
proc `[]`(obj: JsObject; field: cstring): JsObject {...}{.importcpp: "#[#]".}
```
  Return the value of a property of name `field` from a JsObject `obj`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L188)  
```
proc `[]`(obj: JsObject; field: int): JsObject {...}{.importcpp: "#[#]".}
```
  Return the value of a property of name `field` from a JsObject `obj`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L191)  
```
proc `[]=`[T](obj: JsObject; field: cstring; val: T) {...}{.importcpp: "#[#] = #".}
```
  Set the value of a property of name `field` in a JsObject `obj` to `v`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L194)  
```
proc `[]=`[T](obj: JsObject; field: int; val: T) {...}{.importcpp: "#[#] = #".}
```
  Set the value of a property of name `field` in a JsObject `obj` to `v`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L197)  
```
proc `[]`[K: JsKey; V](obj: JsAssoc[K, V]; field: K): V {...}{.importcpp: "#[#]".}
```
  Return the value of a property of name `field` from a JsAssoc `obj`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L200)  
```
proc `[]=`[K: JsKey; V](obj: JsAssoc[K, V]; field: K; val: V) {...}{.
    importcpp: "#[#] = #".}
```
  Set the value of a property of name `field` in a JsAssoc `obj` to `v`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L204)  
```
proc `[]`[V](obj: JsAssoc[cstring, V]; field: string): V
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L208)  
```
proc `[]=`[V](obj: JsAssoc[cstring, V]; field: string; val: V)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L211)  
```
proc `==`(x, y: JsRoot): bool {...}{.importcpp: "(# === #)".}
```
  Compare two JsObjects or JsAssocs. Be careful though, as this is comparison like in JavaScript, so if your JsObjects are in fact JavaScript Objects, and not strings or numbers, this is a *comparison of references*. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L214)   Iterators
---------

  
```
iterator pairs(obj: JsObject): (cstring, JsObject) {...}{.raises: [], tags: [].}
```
  Yields tuples of type `(cstring, JsObject)`, with the first entry being the `name` of a fields in the JsObject and the second being its value wrapped into a JsObject. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L347)  
```
iterator items(obj: JsObject): JsObject {...}{.raises: [], tags: [].}
```
  Yields the `values` of each field in a JsObject, wrapped into a JsObject. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L359)  
```
iterator keys(obj: JsObject): cstring {...}{.raises: [], tags: [].}
```
  Yields the `names` of each field in a JsObject. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L368)  
```
iterator pairs[K: JsKey; V](assoc: JsAssoc[K, V]): (K, V)
```
  Yields tuples of type `(K, V)`, with the first entry being a `key` in the JsAssoc and the second being its corresponding value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L376)  
```
iterator items[K, V](assoc: JsAssoc[K, V]): V
```
  Yields the `values` in a JsAssoc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L387)  
```
iterator keys[K: JsKey; V](assoc: JsAssoc[K, V]): K
```
  Yields the `keys` in a JsAssoc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L396)   Macros
------

  
```
macro jsFromAst(n: untyped): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L158)  
```
macro `.`(obj: JsObject; field: untyped): JsObject
```
  Experimental dot accessor (get) for type JsObject. Returns the value of a property of name `field` from a JsObject `x`.

 Example:

 
```
let obj = newJsObject()
obj.a = 20
console.log(obj.a) # puts 20 onto the console.
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L220)  
```
macro `.=`(obj: JsObject; field, value: untyped): untyped
```
  Experimental dot accessor (set) for type JsObject. Sets the value of a property of name `field` in a JsObject `x` to `value`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L246)  
```
macro `.()`(obj: JsObject; field: untyped; args: varargs[JsObject, jsFromAst]): JsObject
```
  Experimental "method call" operator for type JsObject. Takes the name of a method of the JavaScript object (`field`) and calls it with `args` as arguments, returning a JsObject (which may be discarded, and may be `undefined`, if the method does not return anything, so be careful when using this.)

 Example:

 
```
# Let's get back to the console example:
var console {.importc, nodecl.}: JsObject
let res = console.log("I return undefined!")
console.log(res) # This prints undefined, as console.log always returns
                 # undefined. Thus one has to be careful, when using
                 # JsObject calls.
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L264)  
```
macro `.`[K: cstring; V](obj: JsAssoc[K, V]; field: untyped): V
```
  Experimental dot accessor (get) for type JsAssoc. Returns the value of a property of name `field` from a JsObject `x`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L299)  
```
macro `.=`[K: cstring; V](obj: JsAssoc[K, V]; field: untyped; value: V): untyped
```
  Experimental dot accessor (set) for type JsAssoc. Sets the value of a property of name `field` in a JsObject `x` to `value`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L315)  
```
macro `.()`[K: cstring; V: proc](obj: JsAssoc[K, V]; field: untyped;
                                 args: varargs[untyped]): auto
```
  Experimental "method call" operator for type JsAssoc. Takes the name of a method of the JavaScript object (`field`) and calls it with `args` as arguments. Here, everything is typechecked, so you do not have to worry about `undefined` return values. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L332)  
```
macro `{}`(typ: typedesc; xs: varargs[untyped]): auto
```
  Takes a `typedesc` as its first argument, and a series of expressions of type `key: value`, and returns a value of the specified type with each field `key` set to `value`, as specified in the arguments of `{}`.

 Example:

 
```
# Let's say we have a type with a ton of fields, where some fields do not
# need to be set, and we do not want those fields to be set to ``nil``:
type
  ExtremelyHugeType = ref object
    a, b, c, d, e, f, g: int
    h, i, j, k, l: cstring
    # And even more fields ...

let obj = ExtremelyHugeType{ a: 1, k: "foo".cstring, d: 42 }

# This generates roughly the same JavaScript as:
{.emit: "var obj = {a: 1, k: "foo", d: 42};".}
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L406)  
```
macro bindMethod(procedure: typed): auto
```
  Takes the name of a procedure and wraps it into a lambda missing the first argument, which passes the JavaScript builtin `this` as the first argument to the procedure. Returns the resulting lambda.

 Example:

 We want to generate roughly this JavaScript:

 
```
var obj = {a: 10};
obj.someMethod = function() {
  return this.a + 42;
};
```

We can achieve this using the `bindMethod` macro:

 
```
let obj = JsObject{ a: 10 }
proc someMethodImpl(that: JsObject): int =
  that.a.to(int) + 42
obj.someMethod = bindMethod someMethodImpl

# Alternatively:
obj.someMethod = bindMethod
  proc(that: JsObject): int = that.a.to(int) + 42
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L469)   Templates
---------

  
```
template toJs(s: string): JsObject
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/jsffi.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/jsffi.nim#L156)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/jsffi.html>

re
==


Regular expression support for Nim.

 This module is implemented by providing a wrapper around the [PCRE (Perl-Compatible Regular Expressions)](http://www.pcre.org) C library. This means that your application will depend on the PCRE library's licence when using this module, which should not be a problem though. PCRE's licence follows:

 Licence of the PCRE library
---------------------------


PCRE is a library of functions to support regular expressions whose syntax and semantics are as close as possible to those of the Perl 5 language.

 Written by Philip Hazel  
Copyright (c) 1997-2005 University of Cambridge  





---

 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

 * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
* Neither the name of the University of Cambridge nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

 Regular expression syntax and semantics
---------------------------------------


As the regular expressions supported by this module are enormous, the reader is referred to <http://perldoc.perl.org/perlre.html> for the full documentation of Perl's regular expressions.

 Because the backslash `\` is a meta character both in the Nim programming language and in regular expressions, it is strongly recommended that one uses the *raw* strings of Nim, so that backslashes are interpreted by the regular expression engine:



```
r"\S"  # matches any character that is not whitespace
```
 A regular expression is a pattern that is matched against a subject string from left to right. Most characters stand for themselves in a pattern, and match the corresponding characters in the subject. As a trivial example, the pattern:



```
The quick brown fox
```
 matches a portion of a subject string that is identical to itself. The power of regular expressions comes from the ability to include alternatives and repetitions in the pattern. These are encoded in the pattern by the use of metacharacters, which do not stand for themselves but instead are interpreted in some special way.

 There are two different sets of metacharacters: those that are recognized anywhere in the pattern except within square brackets, and those that are recognized in square brackets. Outside square brackets, the metacharacters are as follows:

 

| meta character | meaning |
| --- | --- |
| `\` | general escape character with several uses |
| `^` | assert start of string (or line, in multiline mode) |
| `$` | assert end of string (or line, in multiline mode) |
| `.` | match any character except newline (by default) |
| `[` | start character class definition |
| `|` | start of alternative branch |
| `(` | start subpattern |
| `)` | end subpattern |
| `{` | start min/max quantifier |
| `?` | extends the meaning of `(`also 0 or 1 quantifier (equal to `{0,1}`)also quantifier minimizer |
| `*` | 0 or more quantifier (equal to `{0,}`) |
| `+` | 1 or more quantifier (equal to `{1,}`)also "possessive quantifier" |


Part of a pattern that is in square brackets is called a "character class". In a character class the only metacharacters are:

 

| meta character | meaning |
| --- | --- |
| `\` | general escape character |
| `^` | negate the class, but only if the first character |
| `-` | indicates character range |
| `[` | POSIX character class (only if followed by POSIX syntax) |
| `]` | terminates the character class |


The following sections describe the use of each of the metacharacters.

 ### Backslash


The backslash character has several uses. Firstly, if it is followed by a non-alphanumeric character, it takes away any special meaning that character may have. This use of backslash as an escape character applies both inside and outside character classes.

 For example, if you want to match a `*` character, you write `\*` in the pattern. This escaping action applies whether or not the following character would otherwise be interpreted as a metacharacter, so it is always safe to precede a non-alphanumeric with backslash to specify that it stands for itself. In particular, if you want to match a backslash, you write `\\`.

 ### Non-printing characters


A second use of backslash provides a way of encoding non-printing characters in patterns in a visible manner. There is no restriction on the appearance of non-printing characters, apart from the binary zero that terminates a pattern, but when a pattern is being prepared by text editing, it is usually easier to use one of the following escape sequences than the binary character it represents::

 

| character | meaning |
| --- | --- |
| `\a` | alarm, that is, the BEL character (hex 07) |
| `\e` | escape (hex 1B) |
| `\f` | formfeed (hex 0C) |
| `\n` | newline (hex 0A) |
| `\r` | carriage return (hex 0D) |
| `\t` | tab (hex 09) |
| `\ddd` | character with octal code ddd, or backreference |
| `\xhh` | character with hex code hh |


After `\x`, from zero to two hexadecimal digits are read (letters can be in upper or lower case). In UTF-8 mode, any number of hexadecimal digits may appear between `\x{` and `}`, but the value of the character code must be less than 2\*\*31 (that is, the maximum hexadecimal value is 7FFFFFFF). If characters other than hexadecimal digits appear between `\x{` and `}`, or if there is no terminating `}`, this form of escape is not recognized. Instead, the initial `\x` will be interpreted as a basic hexadecimal escape, with no following digits, giving a character whose value is zero.

 After `\0` up to two further octal digits are read. In both cases, if there are fewer than two digits, just those that are present are used. Thus the sequence `\0\x\07` specifies two binary zeros followed by a BEL character (code value 7). Make sure you supply two digits after the initial zero if the pattern character that follows is itself an octal digit.

 The handling of a backslash followed by a digit other than 0 is complicated. Outside a character class, PCRE reads it and any following digits as a decimal number. If the number is less than 10, or if there have been at least that many previous capturing left parentheses in the expression, the entire sequence is taken as a back reference. A description of how this works is given later, following the discussion of parenthesized subpatterns.

 Inside a character class, or if the decimal number is greater than 9 and there have not been that many capturing subpatterns, PCRE re-reads up to three octal digits following the backslash, and generates a single byte from the least significant 8 bits of the value. Any subsequent digits stand for themselves. For example:

 

| example | meaning |
| --- | --- |
| `\040` | is another way of writing a space |
| `\40` | is the same, provided there are fewer than 40 previous capturing subpatterns |
| `\7` | is always a back reference |
| `\11` | might be a back reference, or another way of writing a tab |
| `\011` | is always a tab |
| `\0113` | is a tab followed by the character "3" |
| `\113` | might be a back reference, otherwise the character with octal code 113 |
| `\377` | might be a back reference, otherwise the byte consisting entirely of 1 bits |
| `\81` | is either a back reference, or a binary zero followed by the two characters "8" and "1" |


Note that octal values of 100 or greater must not be introduced by a leading zero, because no more than three octal digits are ever read.

 All the sequences that define a single byte value or a single UTF-8 character (in UTF-8 mode) can be used both inside and outside character classes. In addition, inside a character class, the sequence `\b` is interpreted as the backspace character (hex 08), and the sequence `\X` is interpreted as the character "X". Outside a character class, these sequences have different meanings (see below).

 ### Generic character types


The third use of backslash is for specifying generic character types. The following are always recognized:

 

| character type | meaning |
| --- | --- |
| `\d` | any decimal digit |
| `\D` | any character that is not a decimal digit |
| `\s` | any whitespace character |
| `\S` | any character that is not a whitespace character |
| `\w` | any "word" character |
| `\W` | any "non-word" character |


Each pair of escape sequences partitions the complete set of characters into two disjoint sets. Any given character matches one, and only one, of each pair.

 These character type sequences can appear both inside and outside character classes. They each match one character of the appropriate type. If the current matching point is at the end of the subject string, all of them fail, since there is no character to match.

 For compatibility with Perl, `\s` does not match the VT character (code 11). This makes it different from the the POSIX "space" class. The `\s` characters are HT (9), LF (10), FF (12), CR (13), and space (32).

 A "word" character is an underscore or any character less than 256 that is a letter or digit. The definition of letters and digits is controlled by PCRE's low-valued character tables, and may vary if locale-specific matching is taking place (see "Locale support" in the pcreapi page). For example, in the "fr\_FR" (French) locale, some character codes greater than 128 are used for accented letters, and these are matched by `\w`.

 In UTF-8 mode, characters with values greater than 128 never match `\d`, `\s`, or `\w`, and always match `\D`, `\S`, and `\W`. This is true even when Unicode character property support is available.

 ### Simple assertions


The fourth use of backslash is for certain simple assertions. An assertion specifies a condition that has to be met at a particular point in a match, without consuming any characters from the subject string. The use of subpatterns for more complicated assertions is described below. The backslashed assertions are::

 

| assertion | meaning |
| --- | --- |
| `\b` | matches at a word boundary |
| `\B` | matches when not at a word boundary |
| `\A` | matches at start of subject |
| `\Z` | matches at end of subject or before newline at end |
| `\z` | matches at end of subject |
| `\G` | matches at first matching position in subject |


These assertions may not appear in character classes (but note that `\b` has a different meaning, namely the backspace character, inside a character class).

 A word boundary is a position in the subject string where the current character and the previous character do not both match `\w` or `\W` (i.e. one matches `\w` and the other matches `\W`), or the start or end of the string if the first or last character matches `\w`, respectively.

 The `\A`, `\Z`, and `\z` assertions differ from the traditional circumflex and dollar in that they only ever match at the very start and end of the subject string, whatever options are set. The difference between `\Z` and `\z` is that `\Z` matches before a newline that is the last character of the string as well as at the end of the string, whereas `\z` matches only at the end.

 **Example:**

 
```
## Unless specified otherwise, `start` parameter in each proc indicates
## where the scan starts, but outputs are relative to the start of the input
## string, not to `start`:
doAssert find("uxabc", re"(?<=x|y)ab", start = 1) == 2 # lookbehind assertion
doAssert find("uxabc", re"ab", start = 3) == -1 # we're past `start` => not found
doAssert not match("xabc", re"^abc$", start = 1)
  # can't match start of string since we're starting at 1
```
 Imports
-------

  <pcre>, <strutils>, <rtarrays>  Types
-----

  
```
RegexFlag = enum
  reIgnoreCase = 0,         ## do caseless matching
  reMultiLine = 1,          ## ``^`` and ``$`` match newlines within data
  reDotAll = 2,             ## ``.`` matches anything including NL
  reExtended = 3,           ## ignore whitespace and ``#`` comments
  reStudy = 4                ## study the expression (may be omitted if the
                             ## expression will be used only once)
```
  options for regular expressions [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L43)  
```
Regex = ref RegexDesc
```
  a compiled regular expression [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L55)  
```
RegexError = object of ValueError
```
  is raised if the pattern is no valid regular expression. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L57)   Consts
------

  
```
MaxSubpatterns = 20
```
  defines the maximum number of subpatterns that can be captured. This limit still exists for `replacef` and `parallelReplace`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L38)   Procs
-----

  
```
proc re(s: string; flags = {reStudy}): Regex {...}{.raises: [RegexError], tags: [].}
```
  Constructor of regular expressions.

 Note that Nim's extended raw string literals support the syntax `re"[abc]"` as a short form for `re(r"[abc]")`. Also note that since this compiles the regular expression, which is expensive, you should avoid putting it directly in the arguments of the functions like the examples show below if you plan to use it a lot of times, as this will hurt performance immensely. (e.g. outside a loop, ...)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L88)  
```
proc rex(s: string; flags = {reStudy, reExtended}): Regex {...}{.
    raises: [RegexError], tags: [].}
```
  Constructor for extended regular expressions.

 The extended means that comments starting with `#` and whitespace are ignored.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L113)  
```
proc findBounds(buf: cstring; pattern: Regex; matches: var openArray[string];
                start = 0; bufSize: int): tuple[first, last: int] {...}{.raises: [],
    tags: [].}
```
  returns the starting position and end position of `pattern` in `buf` (where `buf` has length `bufSize` and is not necessarily `'\0'` terminated), and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `(-1,0)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L144)  
```
proc findBounds(s: string; pattern: Regex; matches: var openArray[string];
                start = 0): tuple[first, last: int] {...}{.inline, raises: [],
    tags: [].}
```
  returns the starting position and end position of `pattern` in `s` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `(-1,0)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L164)  
```
proc findBounds(buf: cstring; pattern: Regex;
                matches: var openArray[tuple[first, last: int]]; start = 0;
                bufSize = 0): tuple[first, last: int] {...}{.raises: [], tags: [].}
```
  returns the starting position and end position of `pattern` in `buf` (where `buf` has length `bufSize` and is not necessarily `'\0'` terminated), and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `(-1,0)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L172)  
```
proc findBounds(s: string; pattern: Regex;
                matches: var openArray[tuple[first, last: int]]; start = 0): tuple[
    first, last: int] {...}{.inline, raises: [], tags: [].}
```
  returns the starting position and end position of `pattern` in `s` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `(-1,0)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L193)  
```
proc findBounds(buf: cstring; pattern: Regex; start = 0; bufSize: int): tuple[
    first, last: int] {...}{.raises: [], tags: [].}
```
  returns the `first` and `last` position of `pattern` in `buf`, where `buf` has length `bufSize` (not necessarily `'\0'` terminated). If it does not match, `(-1,0)` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L202)  
```
proc findBounds(s: string; pattern: Regex; start = 0): tuple[first, last: int] {...}{.
    inline, raises: [], tags: [].}
```
  returns the `first` and `last` position of `pattern` in `s`. If it does not match, `(-1,0)` is returned.

 Note: there is a speed improvement if the matches do not need to be captured.

 **Example:**

 
```
assert findBounds("01234abc89", re"abc") == (5,7)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L215)  
```
proc matchLen(s: string; pattern: Regex; matches: var openArray[string];
              start = 0): int {...}{.inline, raises: [], tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, `-1` is returned. Note that a match length of zero can happen. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L234)  
```
proc matchLen(buf: cstring; pattern: Regex; matches: var openArray[string];
              start = 0; bufSize: int): int {...}{.inline, raises: [], tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, `-1` is returned. Note that a match length of zero can happen. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L241)  
```
proc matchLen(s: string; pattern: Regex; start = 0): int {...}{.inline, raises: [],
    tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, `-1` is returned. Note that a match length of zero can happen. **Example:**

 
```
doAssert matchLen("abcdefg", re"cde", 2) == 3
doAssert matchLen("abcdefg", re"abcde") == 5
doAssert matchLen("abcdefg", re"cde") == -1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L248)  
```
proc matchLen(buf: cstring; pattern: Regex; start = 0; bufSize: int): int {...}{.
    inline, raises: [], tags: [].}
```
  the same as `match`, but it returns the length of the match, if there is no match, `-1` is returned. Note that a match length of zero can happen. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L259)  
```
proc match(s: string; pattern: Regex; start = 0): bool {...}{.inline, raises: [],
    tags: [].}
```
  returns `true` if `s[start..]` matches the `pattern`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L265)  
```
proc match(s: string; pattern: Regex; matches: var openArray[string]; start = 0): bool {...}{.
    inline, raises: [], tags: [].}
```
  returns `true` if `s[start..]` matches the `pattern` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `false` is returned. **Example:**

 
```
import sequtils
var matches: array[2, string]
if match("abcdefg", re"c(d)ef(g)", matches, 2):
  doAssert toSeq(matches) == @["d", "g"]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L269)  
```
proc match(buf: cstring; pattern: Regex; matches: var openArray[string];
           start = 0; bufSize: int): bool {...}{.inline, raises: [], tags: [].}
```
  returns `true` if `buf[start..<bufSize]` matches the `pattern` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `false` is returned. `buf` has length `bufSize` (not necessarily `'\0'` terminated). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L283)  
```
proc find(buf: cstring; pattern: Regex; matches: var openArray[string];
          start = 0; bufSize = 0): int {...}{.raises: [], tags: [].}
```
  returns the starting position of `pattern` in `buf` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `-1` is returned. `buf` has length `bufSize` (not necessarily `'\0'` terminated). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L292)  
```
proc find(s: string; pattern: Regex; matches: var openArray[string]; start = 0): int {...}{.
    inline, raises: [], tags: [].}
```
  returns the starting position of `pattern` in `s` and the captured substrings in the array `matches`. If it does not match, nothing is written into `matches` and `-1` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L311)  
```
proc find(buf: cstring; pattern: Regex; start = 0; bufSize: int): int {...}{.
    raises: [], tags: [].}
```
  returns the starting position of `pattern` in `buf`, where `buf` has length `bufSize` (not necessarily `'\0'` terminated). If it does not match, `-1` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L318)  
```
proc find(s: string; pattern: Regex; start = 0): int {...}{.inline, raises: [],
    tags: [].}
```
  returns the starting position of `pattern` in `s`. If it does not match, `-1` is returned. We start the scan at `start`. **Example:**

 
```
doAssert find("abcdefg", re"cde") == 2
doAssert find("abcdefg", re"abc") == 0
doAssert find("abcdefg", re"zz") == -1 # not found
doAssert find("abcdefg", re"cde", start = 2) == 2 # still 2
doAssert find("abcdefg", re"cde", start = 3) == -1 # we're past the start position
doAssert find("xabc", re"(?<=x|y)abc", start = 1) == 1
  # lookbehind assertion `(?<=x|y)` can look behind `start`
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L330)  
```
proc findAll(s: string; pattern: Regex; start = 0): seq[string] {...}{.inline,
    raises: [], tags: [].}
```
  returns all matching `substrings` of `s` that match `pattern`. If it does not match, @[] is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L383)  
```
proc contains(s: string; pattern: Regex; start = 0): bool {...}{.inline, raises: [],
    tags: [].}
```
  same as `find(s, pattern, start) >= 0` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L413)  
```
proc contains(s: string; pattern: Regex; matches: var openArray[string];
              start = 0): bool {...}{.inline, raises: [], tags: [].}
```
  same as `find(s, pattern, matches, start) >= 0` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L417)  
```
proc startsWith(s: string; prefix: Regex): bool {...}{.inline, raises: [], tags: [].}
```
  returns true if `s` starts with the pattern `prefix` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L422)  
```
proc endsWith(s: string; suffix: Regex): bool {...}{.inline, raises: [], tags: [].}
```
  returns true if `s` ends with the pattern `suffix` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L426)  
```
proc replace(s: string; sub: Regex; by = ""): string {...}{.raises: [], tags: [].}
```
  Replaces `sub` in `s` by the string `by`. Captures cannot be accessed in `by`. **Example:**

 
```
doAssert "var1=key; var2=key2".replace(re"(\w+)=(\w+)") == "; "
doAssert "var1=key; var2=key2".replace(re"(\w+)=(\w+)", "?") == "?; ?"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L431)  
```
proc replacef(s: string; sub: Regex; by: string): string {...}{.raises: [ValueError],
    tags: [].}
```
  Replaces `sub` in `s` by the string `by`. Captures can be accessed in `by` with the notation `$i` and `$#` (see strutils.`%`). **Example:**

 
```
doAssert "var1=key; var2=key2".replacef(re"(\w+)=(\w+)", "$1<-$2$2") ==
  "var1<-keykey; var2<-key2key2"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L448)  
```
proc multiReplace(s: string;
                  subs: openArray[tuple[pattern: Regex, repl: string]]): string {...}{.
    raises: [ValueError], tags: [].}
```
  Returns a modified copy of `s` with the substitutions in `subs` applied in parallel. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L466)  
```
proc transformFile(infile, outfile: string;
                   subs: openArray[tuple[pattern: Regex, repl: string]]) {...}{.
    raises: [IOError, ValueError], tags: [ReadIOEffect, WriteIOEffect].}
```
  reads in the file `infile`, performs a parallel replacement (calls `parallelReplace`) and writes back to `outfile`. Raises `IOError` if an error occurs. This is supposed to be used for quick scripting. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L486)  
```
proc split(s: string; sep: Regex; maxsplit = -1): seq[string] {...}{.inline,
    raises: [], tags: [].}
```
  Splits the string `s` into a seq of substrings.

 The portion matched by `sep` is not returned.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L524)  
```
proc escapeRe(s: string): string {...}{.raises: [], tags: [].}
```
  escapes `s` so that it is matched verbatim when used as a regular expression. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L531)   Iterators
---------

  
```
iterator findAll(s: string; pattern: Regex; start = 0): string {...}{.raises: [],
    tags: [].}
```
  Yields all matching *substrings* of `s` that match `pattern`.

 Note that since this is an iterator you should not modify the string you are iterating over: bad things could happen.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L343)  
```
iterator findAll(buf: cstring; pattern: Regex; start = 0; bufSize: int): string {...}{.
    raises: [], tags: [].}
```
  Yields all matching `substrings` of `s` that match `pattern`.

 Note that since this is an iterator you should not modify the string you are iterating over: bad things could happen.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L362)  
```
iterator split(s: string; sep: Regex; maxsplit = -1): string {...}{.raises: [],
    tags: [].}
```
  Splits the string `s` into substrings.

 Substrings are separated by the regular expression `sep` (and the portion matched by `sep` is not returned).

 **Example:**

 
```
import sequtils
doAssert toSeq(split("00232this02939is39an22example111", re"\d+")) ==
  @["", "this", "is", "an", "example", ""]
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L494)   Templates
---------

  
```
template `=~`(s: string; pattern: Regex): untyped
```
  This calls `match` with an implicit declared `matches` array that can be used in the scope of the `=~` call: **Example:**

 
```
proc parse(line: string): string =
  if line =~ re"\s*(\w+)\s*\=\s*(\w+)": # matches a key=value pair:
    result = $(matches[0], matches[1])
  elif line =~ re"\s*(\#.*)": # matches a comment
    # note that the implicit ``matches`` array is different from 1st branch
    result = $(matches[0],)
  else: doAssert false
  doAssert not declared(matches)
doAssert parse("NAME = LENA") == """("NAME", "LENA")"""
doAssert parse("   # comment ... ") == """("# comment ... ",)"""
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/re.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/re.nim#L392)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/re.html>

db\_postgres
============


A higher level PostgreSQL database wrapper. This interface is implemented for other databases also.

 See also: <db_odbc>, <db_sqlite>, <db_mysql>.

 Parameter substitution
----------------------


All `db_*` modules support the same form of parameter substitution. That is, using the `?` (question mark) to signify the place where a value should be placed. For example:

 
```
sql"INSERT INTO myTable (colA, colB, colC) VALUES (?, ?, ?)"
```

**Note**: There are two approaches to parameter substitution support by this module.

 1. `SqlQuery` using `?, ?, ?, ...` (same as all the `db_*` modules)

 2. `SqlPrepared` using `$1, $2, $3, ...`

 
```
prepare(db, "myExampleInsert",
        sql"""INSERT INTO myTable
              (colA, colB, colC)
              VALUES ($1, $2, $3)""",
        3)
```
 Unix Socket
-----------


Using Unix sockets instead of TCP connection can [improve performance up to 30% ~ 175% for some operations](https://momjian.us/main/blogs/pgblog/2012.html#June_6_2012).

 To use Unix sockets with `db_postgres`, change the server address to the socket file path:

 
```
import db_postgres ## Change "localhost" or "127.0.0.1" to the socket file path
let db = db_postgres.open("/run/postgresql", "user", "password", "database")
echo db.getAllRows(sql"SELECT version();")
db.close()
```

The socket file path is operating system specific and distribution specific, additional configuration may or may not be needed on your `postgresql.conf`. The Postgres server must be on the same computer and only works for Unix-like operating systems.

 Examples
--------

 ### Opening a connection to a database



```
import db_postgres
let db = open("localhost", "user", "password", "dbname")
db.close()
```
 ### Creating a table



```
db.exec(sql"DROP TABLE IF EXISTS myTable")
db.exec(sql("""CREATE TABLE myTable (
                 id integer,
                 name varchar(50) not null)"""))
```
 ### Inserting data



```
db.exec(sql"INSERT INTO myTable (id, name) VALUES (0, ?)",
        "Dominik")
```
 Imports
-------

  <strutils>, <postgres>, <db_common>, <since>  Types
-----

  
```
DbConn = PPGconn
```
  encapsulates a database connection [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L94)  
```
Row = seq[string]
```
  a row of a dataset. NULL database values will be converted to nil. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L95)  
```
InstantRow = object
  res: PPGresult             ## used to get a row's
  line: int                  ## column text on demand
```
  a handle that can be [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L97)  
```
SqlPrepared = distinct string
```
  a identifier for the prepared queries [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L100)   Procs
-----

  
```
proc dbError(db: DbConn) {...}{.noreturn, raises: [DbError], tags: [].}
```
  raises a DbError exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L102)  
```
proc dbQuote(s: string): string {...}{.raises: [], tags: [].}
```
  DB quotes the string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L109)  
```
proc tryExec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  tries to execute the query and returns true if successful, false otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L134)  
```
proc tryExec(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  tries to execute the query and returns true if successful, false otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L142)  
```
proc exec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]) {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  executes the query and raises EDB if not successful. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L153)  
```
proc exec(db: DbConn; stmtName: SqlPrepared; args: varargs[string]) {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L161)  
```
proc prepare(db: DbConn; stmtName: string; query: SqlQuery; nParams: int): SqlPrepared {...}{.
    raises: [DbError], tags: [].}
```
  Creates a new `SqlPrepared` statement. Parameter substitution is done via `$1`, `$2`, `$3`, etc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L187)  
```
proc `[]`(row: InstantRow; col: int): string {...}{.inline, raises: [], tags: [].}
```
  returns text for given column of the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L404)  
```
proc unsafeColumnAt(row: InstantRow; index: int): cstring {...}{.inline, raises: [],
    tags: [].}
```
  Return cstring of given column of the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L408)  
```
proc len(row: InstantRow): int {...}{.inline, raises: [], tags: [].}
```
  returns number of columns in the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L412)  
```
proc getRow(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  retrieves a single row. If the query doesn't return any rows, this proc will return a Row with empty strings for each column. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L416)  
```
proc getRow(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L427)  
```
proc getAllRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): seq[
    Row] {...}{.tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and returns the whole result dataset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L436)  
```
proc getAllRows(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): seq[
    Row] {...}{.tags: [ReadDbEffect], raises: [DbError].}
```
  executes the prepared query and returns the whole result dataset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L444)  
```
proc getValue(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): string {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and returns the first column of the first row of the result dataset. Returns "" if the dataset contains no rows or the database value is NULL. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L462)  
```
proc getValue(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): string {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and returns the first column of the first row of the result dataset. Returns "" if the dataset contains no rows or the database value is NULL. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L475)  
```
proc tryInsertID(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [DbError, ValueError].}
```
  executes the query (typically "INSERT") and returns the generated ID for the row or -1 in case of an error. For Postgre this adds `RETURNING id` to the query, so it only works if your primary key is named `id`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L488)  
```
proc insertID(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [DbError, ValueError].}
```
  executes the query (typically "INSERT") and returns the generated ID for the row. For Postgre this adds `RETURNING id` to the query, so it only works if your primary key is named `id`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L502)  
```
proc tryInsert(db: DbConn; query: SqlQuery; pkName: string;
               args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [DbError, ValueError].}
```
  executes the query (typically "INSERT") and returns the generated ID for the row or -1 in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L512)  
```
proc insert(db: DbConn; query: SqlQuery; pkName: string;
            args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [DbError, ValueError].}
```
  executes the query (typically "INSERT") and returns the generated ID [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L524)  
```
proc execAffectedRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError, ValueError].}
```
  executes the query (typically "UPDATE") and returns the number of affected rows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L532)  
```
proc execAffectedRows(db: DbConn; stmtName: SqlPrepared;
                      args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError, ValueError].}
```
  executes the query (typically "UPDATE") and returns the number of affected rows. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L543)  
```
proc close(db: DbConn) {...}{.tags: [DbEffect], raises: [].}
```
  closes the database connection. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L556)  
```
proc open(connection, user, password, database: string): DbConn {...}{.
    tags: [DbEffect], raises: [DbError].}
```
  opens a database connection. Raises `EDb` if the connection could not be established.

 Clients can also use Postgres keyword/value connection strings to connect.

 Example:

 
```
con = open("", "", "", "host=localhost port=5432 dbname=mydb")
```

See <http://www.postgresql.org/docs/current/static/libpq-connect.html#LIBPQ-CONNSTRING> for more information.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L560)  
```
proc setEncoding(connection: DbConn; encoding: string): bool {...}{.tags: [DbEffect],
    raises: [].}
```
  sets the encoding of a database connection, returns true for success, false for failure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L585)   Iterators
---------

  
```
iterator fastRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and iterates over the result dataset. This is very fast, but potentially dangerous: If the for-loop-body executes another query, the results can be undefined. For Postgres it is safe though. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L206)  
```
iterator fastRows(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the prepared query and iterates over the result dataset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L219)  
```
iterator instantRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  same as fastRows but returns a handle that can be used to get column text on demand using []. Returned handle is valid only within iterator body. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L230)  
```
iterator instantRows(db: DbConn; stmtName: SqlPrepared;
                     args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  same as fastRows but returns a handle that can be used to get column text on demand using []. Returned handle is valid only within iterator body. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L240)  
```
iterator instantRows(db: DbConn; columns: var DbColumns; query: SqlQuery;
                     args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L395)  
```
iterator rows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  same as `fastRows`, but slower and safe. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L452)  
```
iterator rows(db: DbConn; stmtName: SqlPrepared; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  same as `fastRows`, but slower and safe. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_postgres.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_postgres.nim#L457)   Exports
-------

  [DbTypeKind](db_common#DbTypeKind), [sql](db_common#sql.t,string), [DbType](db_common#DbType), [SqlQuery](db_common#SqlQuery), [DbColumn](db_common#DbColumn), [ReadDbEffect](db_common#ReadDbEffect), [DbError](db_common#DbError), [WriteDbEffect](db_common#WriteDbEffect), [dbError](db_common#dbError,string), [DbColumns](db_common#DbColumns), [DbEffect](db_common#DbEffect) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/db_postgres.html>

db\_mysql
=========


A higher level mySQL database wrapper. The same interface is implemented for other databases too.

 See also: <db_odbc>, <db_sqlite>, <db_postgres>.

 Parameter substitution
----------------------


All `db_*` modules support the same form of parameter substitution. That is, using the `?` (question mark) to signify the place where a value should be placed. For example:

 
```
sql"INSERT INTO myTable (colA, colB, colC) VALUES (?, ?, ?)"
```
 Examples
--------

 ### Opening a connection to a database



```
import db_mysql
let db = open("localhost", "user", "password", "dbname")
db.close()
```
 ### Creating a table



```
db.exec(sql"DROP TABLE IF EXISTS myTable")
db.exec(sql("""CREATE TABLE myTable (
                 id integer,
                 name varchar(50) not null)"""))
```
 ### Inserting data



```
db.exec(sql"INSERT INTO myTable (id, name) VALUES (0, ?)",
        "Dominik")
```
 ### Larger example



```
import db_mysql, math

let theDb = open("localhost", "nim", "nim", "test")

theDb.exec(sql"Drop table if exists myTestTbl")
theDb.exec(sql("create table myTestTbl (" &
    " Id    INT(11)     NOT NULL AUTO_INCREMENT PRIMARY KEY, " &
    " Name  VARCHAR(50) NOT NULL, " &
    " i     INT(11), " &
    " f     DECIMAL(18,10))"))

theDb.exec(sql"START TRANSACTION")
for i in 1..1000:
  theDb.exec(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
        "Item#" & $i, i, sqrt(i.float))
theDb.exec(sql"COMMIT")

for x in theDb.fastRows(sql"select * from myTestTbl"):
  echo x

let id = theDb.tryInsertId(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
        "Item#1001", 1001, sqrt(1001.0))
echo "Inserted item: ", theDb.getValue(sql"SELECT name FROM myTestTbl WHERE id=?", id)

theDb.close()
```
 Imports
-------

  <strutils>, <mysql>, <db_common>, <since>  Types
-----

  
```
DbConn = distinct PMySQL
```
  encapsulates a database connection [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L94)  
```
Row = seq[string]
```
  a row of a dataset. NULL database values will be converted to nil. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L95)  
```
InstantRow = object
  row: cstringArray
  len: int
```
  a handle that can be used to get a row's column text on demand [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L97)   Procs
-----

  
```
proc dbError(db: DbConn) {...}{.noreturn, raises: [DbError], tags: [].}
```
  raises a DbError exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L102)  
```
proc dbQuote(s: string): string {...}{.raises: [], tags: [].}
```
  DB quotes the string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L119)  
```
proc tryExec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  tries to execute the query and returns true if successful, false otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L149)  
```
proc exec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]) {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  executes the query and raises EDB if not successful. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L159)  
```
proc `[]`(row: InstantRow; col: int): string {...}{.inline, raises: [], tags: [].}
```
  Returns text for given column of the row. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L299)  
```
proc unsafeColumnAt(row: InstantRow; index: int): cstring {...}{.inline, raises: [],
    tags: [].}
```
  Return cstring of given column of the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L303)  
```
proc len(row: InstantRow): int {...}{.inline, raises: [], tags: [].}
```
  Returns number of columns in the row. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L307)  
```
proc getRow(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  Retrieves a single row. If the query doesn't return any rows, this proc will return a Row with empty strings for each column. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L311)  
```
proc getAllRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): seq[
    Row] {...}{.tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and returns the whole result dataset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L327)  
```
proc getValue(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): string {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and returns the first column of the first row of the result dataset. Returns "" if the dataset contains no rows or the database value is NULL. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L352)  
```
proc tryInsertId(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [].}
```
  executes the query (typically "INSERT") and returns the generated ID for the row or -1 in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L359)  
```
proc insertId(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [DbError].}
```
  executes the query (typically "INSERT") and returns the generated ID for the row. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L369)  
```
proc tryInsert(db: DbConn; query: SqlQuery; pkName: string;
               args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [].}
```
  same as tryInsertID [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L376)  
```
proc insert(db: DbConn; query: SqlQuery; pkName: string;
            args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [DbError].}
```
  same as insertId [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L382)  
```
proc execAffectedRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  runs the query (typically "UPDATE") and returns the number of affected rows [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L389)  
```
proc close(db: DbConn) {...}{.tags: [DbEffect], raises: [].}
```
  closes the database connection. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L397)  
```
proc open(connection, user, password, database: string): DbConn {...}{.
    tags: [DbEffect], raises: [DbError, ValueError].}
```
  opens a database connection. Raises `EDb` if the connection could not be established. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L401)  
```
proc setEncoding(connection: DbConn; encoding: string): bool {...}{.tags: [DbEffect],
    raises: [].}
```
  sets the encoding of a database connection, returns true for success, false for failure. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L420)   Iterators
---------

  
```
iterator fastRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  executes the query and iterates over the result dataset.

 This is very fast, but potentially dangerous. Use this iterator only if you require **ALL** the rows.

 Breaking the fastRows() iterator during a loop will cause the next database query to raise an [EDb] exception `Commands out of sync`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L174)  
```
iterator instantRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  Same as fastRows but returns a handle that can be used to get column text on demand using []. Returned handle is valid only within the iterator body. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L201)  
```
iterator instantRows(db: DbConn; columns: var DbColumns; query: SqlQuery;
                     args: varargs[string, `$`]): InstantRow {...}{.
    raises: [DbError], tags: [].}
```
  Same as fastRows but returns a handle that can be used to get column text on demand using []. Returned handle is valid only within the iterator body. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L282)  
```
iterator rows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  same as `fastRows`, but slower and safe. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_mysql.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_mysql.nim#L347)   Exports
-------

  [DbTypeKind](db_common#DbTypeKind), [sql](db_common#sql.t,string), [DbType](db_common#DbType), [SqlQuery](db_common#SqlQuery), [DbColumn](db_common#DbColumn), [ReadDbEffect](db_common#ReadDbEffect), [DbError](db_common#DbError), [WriteDbEffect](db_common#WriteDbEffect), [dbError](db_common#dbError,string), [DbColumns](db_common#DbColumns), [DbEffect](db_common#DbEffect) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/db_mysql.html>

db\_sqlite
==========

 A higher level SQLite database wrapper. This interface is implemented for other databases too. 


Basic usage
-----------


The basic flow of using this module is:

 1. Open database connection
2. Execute SQL query
3. Close database connection

 ### Parameter substitution


All `db_*` modules support the same form of parameter substitution. That is, using the `?` (question mark) to signify the place where a value should be placed. For example:

 
```
sql"INSERT INTO my_table (colA, colB, colC) VALUES (?, ?, ?)"
```
 ### Opening a connection to a database



```
import db_sqlite

# user, password, database name can be empty.
# These params are not used on db_sqlite module.
let db = open("mytest.db", "", "", "")
db.close()
```
 ### Creating a table



```
db.exec(sql"DROP TABLE IF EXISTS my_table")
db.exec(sql"""CREATE TABLE my_table (
                 id   INTEGER,
                 name VARCHAR(50) NOT NULL
              )""")
```
 ### Inserting data



```
db.exec(sql"INSERT INTO my_table (id, name) VALUES (0, ?)",
        "Jack")
```
 ### Larger example



```
import db_sqlite, math

let db = open("mytest.db", "", "", "")

db.exec(sql"DROP TABLE IF EXISTS my_table")
db.exec(sql"""CREATE TABLE my_table (
                 id    INTEGER PRIMARY KEY,
                 name  VARCHAR(50) NOT NULL,
                 i     INT(11),
                 f     DECIMAL(18, 10)
              )""")

db.exec(sql"BEGIN")
for i in 1..1000:
  db.exec(sql"INSERT INTO my_table (name, i, f) VALUES (?, ?, ?)",
          "Item#" & $i, i, sqrt(i.float))
db.exec(sql"COMMIT")

for x in db.fastRows(sql"SELECT * FROM my_table"):
  echo x

let id = db.tryInsertId(sql"""INSERT INTO my_table (name, i, f)
                              VALUES (?, ?, ?)""",
                        "Item#1001", 1001, sqrt(1001.0))
echo "Inserted item: ", db.getValue(sql"SELECT name FROM my_table WHERE id=?", id)

db.close()
```
 Note
----


This module does not implement any ORM features such as mapping the types from the schema. Instead, a `seq[string]` is returned for each row.

 The reasoning is as follows:

 1. it's close to what many DBs offer natively (char\*\*)
2. it hides the number of types that the DB supports

 (int? int64? decimal up to 10 places? geo coords?)

 3. it's convenient when all you do is to forward the data to somewhere else (echo, log, put the data into a new query)

 See also
--------


* [db\_odbc module](db_odbc) for ODBC database wrapper
* [db\_mysql module](db_mysql) for MySQL database wrapper
* [db\_postgres module](db_postgres) for PostgreSQL database wrapper

 Imports
-------

  <sqlite3>, <macros>, <db_common>, <since>  Types
-----

  
```
DbConn = PSqlite3
```
  Encapsulates a database connection. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L126)  
```
Row = seq[string]
```
  A row of a dataset. `NULL` database values will be converted to an empty string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L127)  
```
InstantRow = PStmt
```
  A handle that can be used to get a row's column text on demand. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L129)  
```
SqlPrepared = distinct PStmt
```
  a identifier for the prepared queries [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L131)   Procs
-----

  
```
proc `[]`(row: InstantRow; col: int32): string {...}{.inline, raises: [], tags: [].}
```
  Returns text for given column of the row.

 See also:

 * [instantRows iterator](#instantRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D) example code

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L412)  
```
proc len(row: InstantRow): int32 {...}{.inline, raises: [], tags: [].}
```
  Returns number of columns in a row.

 See also:

 * [instantRows iterator](#instantRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D) example code

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L428)  
```
proc finalize(sqlPrepared: SqlPrepared) {...}{.discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L726)  
```
proc dbQuote(s: string): string {...}{.raises: [], tags: [].}
```
  Escapes the `'` (single quote) char to `''`. Because single quote is used for defining `VARCHAR` in SQL. **Example:**

 
```
doAssert dbQuote("'") == "''''"
doAssert dbQuote("A Foobar's pen.") == "'A Foobar''s pen.'"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L149)  
```
proc tryExec(db: DbConn; stmtName: SqlPrepared): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L202)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: int32) {...}{.raises: [DbError],
    tags: [].}
```
  Binds a int32 to the specified paramIndex. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L736)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: int64) {...}{.raises: [DbError],
    tags: [].}
```
  Binds a int64 to the specified paramIndex. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L741)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: float64) {...}{.
    raises: [DbError], tags: [].}
```
  Binds a 64bit float to the specified paramIndex. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L753) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L753)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: string; copy = true) {...}{.
    raises: [Exception, DbError], tags: [].}
```
  Binds a string to the specified paramIndex. if copy is true then SQLite makes its own private copy of the data immediately [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L764) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L764)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: openArray[byte]; copy = true) {...}{.
    raises: [Exception, DbError], tags: [].}
```
  binds a blob to the specified paramIndex. if copy is true then SQLite makes its own private copy of the data immediately [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L770) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L770)  
```
proc bindParam(ps: SqlPrepared; paramIdx: int; val: int) {...}{.raises: [DbError],
    tags: [].}
```
  Binds a int to the specified paramIndex. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L746)  
```
proc bindNull(ps: SqlPrepared; paramIdx: int) {...}{.raises: [DbError], tags: [].}
```
  Sets the bindparam at the specified paramIndex to null (default behaviour by sqlite). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L758) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L758)  
```
proc dbError(db: DbConn) {...}{.noreturn, raises: [DbError], tags: [].}
```
  Raises a `DbError` exception.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
if not db.tryExec(sql"SELECT * FROM not_exist_table"):
  dbError(db)
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L133)  
```
proc prepare(db: DbConn; q: string): SqlPrepared {...}{.raises: [DbError], tags: [].}
```
  Creates a new `SqlPrepared` statement. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L172)  
```
proc tryExec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  Tries to execute the query and returns `true` if successful, `false` otherwise.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
if not db.tryExec(sql"SELECT * FROM my_table"):
  dbError(db)
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L178)  
```
proc exec(db: DbConn; query: SqlQuery; args: varargs[string, `$`]) {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query and raises a `DbError` exception if not successful.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
try:
  db.exec(sql"INSERT INTO my_table (id, name) VALUES (?, ?)",
          1, "item#1")
except:
  stderr.writeLine(getCurrentExceptionMsg())
finally:
  db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L211)  
```
proc close(db: DbConn) {...}{.tags: [DbEffect], raises: [DbError].}
```
  Closes the database connection.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L679)  
```
proc open(connection, user, password, database: string): DbConn {...}{.
    tags: [DbEffect], raises: [DbError].}
```
  Opens a database connection. Raises a `DbError` exception if the connection could not be established.

 **Note:** Only the `connection` parameter is used for `sqlite`.

 **Examples:**

 
```
try:
  let db = open("mytest.db", "", "", "")
  ## do something...
  ## db.getAllRows(sql"SELECT * FROM my_table")
  db.close()
except:
  stderr.writeLine(getCurrentExceptionMsg())
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L690)  
```
proc unsafeColumnAt(row: InstantRow; index: int32): cstring {...}{.inline,
    raises: [], tags: [].}
```
  Returns cstring for given column of the row.

 See also:

 * [instantRows iterator](#instantRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D) example code

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L420)  
```
proc getRow(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  Retrieves a single row. If the query doesn't return any rows, this proc will return a `Row` with empty strings for each column.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

doAssert db.getRow(sql"SELECT id, name FROM my_table"
                   ) == Row(@["1", "item#1"])
doAssert db.getRow(sql"SELECT id, name FROM my_table WHERE id = ?",
                   2) == Row(@["2", "item#2"])

# Returns empty.
doAssert db.getRow(sql"INSERT INTO my_table (id, name) VALUES (?, ?)",
                   3, "item#3") == @[]
doAssert db.getRow(sql"DELETE FROM my_table WHERE id = ?", 3) == @[]
doAssert db.getRow(sql"UPDATE my_table SET name = 'ITEM#1' WHERE id = ?",
                   1) == @[]
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L436)  
```
proc getAllRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): seq[
    Row] {...}{.tags: [ReadDbEffect], raises: [DbError].}
```
  Executes the query and returns the whole result dataset.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

doAssert db.getAllRows(sql"SELECT id, name FROM my_table") == @[Row(@["1", "item#1"]), Row(@["2", "item#2"])]
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L472)  
```
proc getAllRows(db: DbConn; stmtName: SqlPrepared): seq[Row] {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L494)  
```
proc getValue(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): string {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  Executes the query and returns the first column of the first row of the result dataset. Returns `""` if the dataset contains no rows or the database value is `NULL`.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

doAssert db.getValue(sql"SELECT name FROM my_table WHERE id = ?",
                     2) == "item#2"
doAssert db.getValue(sql"SELECT id, name FROM my_table") == "1"
doAssert db.getValue(sql"SELECT name, id FROM my_table") == "item#1"

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L531)  
```
proc getValue(db: DbConn; stmtName: SqlPrepared): string {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L567)  
```
proc tryInsertID(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [].}
```
  Executes the query (typically "INSERT") and returns the generated ID for the row or -1 in case of an error.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
db.exec(sql"CREATE TABLE my_table (id INTEGER, name VARCHAR(50) NOT NULL)")

doAssert db.tryInsertID(sql"INSERT INTO not_exist_table (id, name) VALUES (?, ?)",
                        1, "item#1") == -1
db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L580)  
```
proc insertID(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [WriteDbEffect], raises: [DbError].}
```
  Executes the query (typically "INSERT") and returns the generated ID for the row.

 Raises a `DbError` exception when failed to insert row. For Postgre this adds `RETURNING id` to the query, so it only works if your primary key is named `id`.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")
db.exec(sql"CREATE TABLE my_table (id INTEGER, name VARCHAR(50) NOT NULL)")

for i in 0..2:
  let id = db.insertID(sql"INSERT INTO my_table (id, name) VALUES (?, ?)", i, "item#" & $i)
  echo "LoopIndex = ", i, ", InsertID = ", id

# Output:
# LoopIndex = 0, InsertID = 1
# LoopIndex = 1, InsertID = 2
# LoopIndex = 2, InsertID = 3

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L608)  
```
proc tryInsert(db: DbConn; query: SqlQuery; pkName: string;
               args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [].}
```
  same as tryInsertID [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L637)  
```
proc insert(db: DbConn; query: SqlQuery; pkName: string;
            args: varargs[string, `$`]): int64 {...}{.tags: [WriteDbEffect],
    raises: [DbError].}
```
  same as insertId [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L643) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L643)  
```
proc execAffectedRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query (typically "UPDATE") and returns the number of affected rows.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

doAssert db.execAffectedRows(sql"UPDATE my_table SET name = 'TEST'") == 2

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L650)  
```
proc execAffectedRows(db: DbConn; stmtName: SqlPrepared): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L674)  
```
proc setEncoding(connection: DbConn; encoding: string): bool {...}{.tags: [DbEffect],
    raises: [DbError].}
```
  Sets the encoding of a database connection, returns `true` for success, `false` for failure.

 **Note:** The encoding cannot be changed once it's been set. According to SQLite3 documentation, any attempt to change the encoding after the database is created will be silently ignored.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L714)   Iterators
---------

  
```
iterator fastRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError, DbError].}
```
  Executes the query and iterates over the result dataset.

 This is very fast, but potentially dangerous. Use this iterator only if you require **ALL** the rows.

 **Note:** Breaking the `fastRows()` iterator during a loop will cause the next database query to raise a `DbError` exception `unable to close due to ...`.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

for row in db.fastRows(sql"SELECT id, name FROM my_table"):
  echo row

# Output:
# @["1", "item#1"]
# @["2", "item#2"]

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L250)  
```
iterator fastRows(db: DbConn; stmtName: SqlPrepared): Row {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L291)  
```
iterator instantRows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError, DbError].}
```
  Similar to [fastRows iterator](#fastRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D) but returns a handle that can be used to get column text on demand using `[]`. Returned handle is valid only within the iterator body.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

for row in db.instantRows(sql"SELECT * FROM my_table"):
  echo "id:" & row[0]
  echo "name:" & row[1]
  echo "length:" & $len(row)

# Output:
# id:1
# name:item#1
# length:2
# id:2
# name:item#2
# length:2

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L303)  
```
iterator instantRows(db: DbConn; stmtName: SqlPrepared): InstantRow {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L343)  
```
iterator instantRows(db: DbConn; columns: var DbColumns; query: SqlQuery;
                     args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect], raises: [DbError, DbError].}
```
  Similar to [instantRows iterator](#instantRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D), but sets information about columns to `columns`.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

var columns: DbColumns
for row in db.instantRows(columns, sql"SELECT * FROM my_table"):
  discard
echo columns[0]

# Output:
# (name: "id", tableName: "my_table", typ: (kind: dbNull,
# notNull: false, name: "INTEGER", size: 0, maxReprLen: 0, precision: 0,
# scale: 0, min: 0, max: 0, validValues: @[]), primaryKey: false,
# foreignKey: false)

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L374)  
```
iterator rows(db: DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect], raises: [DbError].}
```
  Similar to [fastRows iterator](#fastRows.i,DbConn,SqlQuery,varargs%5Bstring,%5D), but slower and safe.

 **Examples:**

 
```
let db = open("mytest.db", "", "", "")

# Records of my_table:
# | id | name     |
# |----|----------|
# |  1 | item#1   |
# |  2 | item#2   |

for row in db.rows(sql"SELECT id, name FROM my_table"):
  echo row

## Output:
## @["1", "item#1"]
## @["2", "item#2"]

db.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L500)  
```
iterator rows(db: DbConn; stmtName: SqlPrepared): Row {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L527)   Macros
------

  
```
macro bindParams(ps: SqlPrepared; params: varargs[untyped]): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L777) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L777)   Templates
---------

  
```
template dbBindParamError(paramIdx: int; val: varargs[untyped])
```
  Raises a `DbError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L729) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L729)  
```
template exec(db: DbConn; stmtName: SqlPrepared; args: varargs[typed]): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_sqlite.nim#L793) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_sqlite.nim#L793)   Exports
-------

  [DbTypeKind](db_common#DbTypeKind), [sql](db_common#sql.t,string), [DbType](db_common#DbType), [SqlQuery](db_common#SqlQuery), [DbColumn](db_common#DbColumn), [ReadDbEffect](db_common#ReadDbEffect), [DbError](db_common#DbError), [WriteDbEffect](db_common#WriteDbEffect), [dbError](db_common#dbError,string), [DbColumns](db_common#DbColumns), [DbEffect](db_common#DbEffect) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/db_sqlite.html>

winlean
=======

 This module implements a small wrapper for some needed Win API procedures, so that the Nim compiler does not depend on the huge Windows module.

 Imports
-------

  <dynlib>  Types
-----

  
```
WinChar = Utf16Char
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L24)  
```
Handle = int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L29)  
```
LONG = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L30)  
```
ULONG = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L31)  
```
PULONG = ptr int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L32)  
```
WINBOOL = int32
```
  `WINBOOL` uses opposite convention as posix, !=0 meaning success. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L33)  
```
DWORD = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L36)  
```
PDWORD = ptr DWORD
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L37)  
```
LPINT = ptr int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L38)  
```
ULONG_PTR = uint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L39)  
```
PULONG_PTR = ptr uint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L40)  
```
HDC = Handle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L41)  
```
HGLRC = Handle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L42)  
```
SECURITY_ATTRIBUTES {...}{.final, pure.} = object
  nLength*: int32
  lpSecurityDescriptor*: pointer
  bInheritHandle*: WINBOOL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L44)  
```
STARTUPINFO {...}{.final, pure.} = object
  cb*: int32
  lpReserved*: cstring
  lpDesktop*: cstring
  lpTitle*: cstring
  dwX*: int32
  dwY*: int32
  dwXSize*: int32
  dwYSize*: int32
  dwXCountChars*: int32
  dwYCountChars*: int32
  dwFillAttribute*: int32
  dwFlags*: int32
  wShowWindow*: int16
  cbReserved2*: int16
  lpReserved2*: pointer
  hStdInput*: Handle
  hStdOutput*: Handle
  hStdError*: Handle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L49)  
```
PROCESS_INFORMATION {...}{.final, pure.} = object
  hProcess*: Handle
  hThread*: Handle
  dwProcessId*: int32
  dwThreadId*: int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L69)  
```
FILETIME {...}{.final, pure.} = object
  dwLowDateTime*: DWORD
  dwHighDateTime*: DWORD
```
  CANNOT BE int64 BECAUSE OF ALIGNMENT [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L75)  
```
BY_HANDLE_FILE_INFORMATION {...}{.final, pure.} = object
  dwFileAttributes*: DWORD
  ftCreationTime*: FILETIME
  ftLastAccessTime*: FILETIME
  ftLastWriteTime*: FILETIME
  dwVolumeSerialNumber*: DWORD
  nFileSizeHigh*: DWORD
  nFileSizeLow*: DWORD
  nNumberOfLinks*: DWORD
  nFileIndexHigh*: DWORD
  nFileIndexLow*: DWORD
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L79)  
```
OSVERSIONINFO {...}{.final, pure.} = object
  dwOSVersionInfoSize*: DWORD
  dwMajorVersion*: DWORD
  dwMinorVersion*: DWORD
  dwBuildNumber*: DWORD
  dwPlatformId*: DWORD
  szCSDVersion*: array[0 .. 127, WinChar]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L91)  
```
Protoent = object
  p_name*: cstring
  p_aliases*: cstringArray
  p_proto*: cshort
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L99)  
```
WIN32_FIND_DATA {...}{.pure.} = object
  dwFileAttributes*: int32
  ftCreationTime*: FILETIME
  ftLastAccessTime*: FILETIME
  ftLastWriteTime*: FILETIME
  nFileSizeHigh*: int32
  nFileSizeLow*: int32
  dwReserved0: int32
  dwReserved1: int32
  cFileName*: array[0 .. 260 - 1, WinChar]
  cAlternateFileName*: array[0 .. 13, WinChar]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L323)  
```
SocketHandle = distinct int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L458)  
```
WSAData {...}{.importc: "WSADATA", header: "winsock2.h".} = object
  wVersion, wHighVersion: int16
  szDescription: array[0 .. WSADESCRIPTION_LEN, char]
  szSystemStatus: array[0 .. WSASYS_STATUS_LEN, char]
  iMaxSockets, iMaxUdpDg: int16
  lpVendorInfo: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L461)  
```
SockAddr {...}{.importc: "SOCKADDR", header: "winsock2.h".} = object
  sa_family*: uint16
  sa_data*: array[0 .. 13, char]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L468)  
```
InAddr {...}{.importc: "IN_ADDR", header: "winsock2.h".} = object
  s_addr*: uint32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L474)  
```
Sockaddr_in {...}{.importc: "SOCKADDR_IN", header: "winsock2.h".} = object
  sin_family*: uint16
  sin_port*: uint16
  sin_addr*: InAddr
  sin_zero*: array[0 .. 7, char]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L478)  
```
In6_addr {...}{.importc: "IN6_ADDR", header: "winsock2.h".} = object
  bytes* {...}{.importc: "u.Byte".}: array[0 .. 15, char]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L484)  
```
Sockaddr_in6 {...}{.importc: "SOCKADDR_IN6", header: "ws2tcpip.h".} = object
  sin6_family*: uint16
  sin6_port*: uint16
  sin6_flowinfo*: int32
  sin6_addr*: In6_addr
  sin6_scope_id*: int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L488)  
```
Sockaddr_storage {...}{.importc: "SOCKADDR_STORAGE", header: "winsock2.h".} = object
  ss_family*: uint16
  ss_pad1: array[6, byte]
  ss_align: int64
  ss_pad2: array[112, byte]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L496)  
```
Servent = object
  s_name*: cstring
  s_aliases*: cstringArray
  when defined(cpu64):
      s_proto*: cstring
      s_port*: int16

  else:
      s_port*: int16
      s_proto*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L502)  
```
Hostent = object
  h_name*: cstring
  h_aliases*: cstringArray
  h_addrtype*: int16
  h_length*: int16
  h_addr_list*: cstringArray
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L512)  
```
TFdSet = object
  fd_count*: cint
  fd_array*: array[0 .. 64 - 1, SocketHandle]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L519)  
```
AddrInfo = object
  ai_flags*: cint            ## Input flags.
  ai_family*: cint           ## Address family of socket.
  ai_socktype*: cint         ## Socket type.
  ai_protocol*: cint         ## Protocol of socket.
  ai_addrlen*: csize_t       ## Length of socket address.
  ai_canonname*: cstring     ## Canonical name of service location.
  ai_addr*: ptr SockAddr     ## Socket address of socket.
  ai_next*: ptr AddrInfo     ## Pointer to next in list.
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L523)  
```
SockLen = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L533)  
```
Timeval = object
  tv_sec*, tv_usec*: int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L541)  
```
WOHandleArray = array[0 .. 0x00000040 - 1, Handle]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L673)  
```
PWOHandleArray = ptr WOHandleArray
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L674)  
```
WinSizeT = uint64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L770) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L770)  
```
OVERLAPPED {...}{.pure, inheritable.} = object
  internal*: PULONG
  internalHigh*: PULONG
  offset*: DWORD
  offsetHigh*: DWORD
  hEvent*: Handle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L799)  
```
POVERLAPPED = ptr OVERLAPPED
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L806) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L806)  
```
POVERLAPPED_COMPLETION_ROUTINE = proc (para1: DWORD; para2: DWORD;
                                       para3: POVERLAPPED) {...}{.stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L808) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L808)  
```
GUID {...}{.final, pure.} = object
  D1*: int32
  D2*: int16
  D3*: int16
  D4*: array[0 .. 7, int8]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L811)  
```
TWSABuf {...}{.importc: "WSABUF", header: "winsock2.h".} = object
  len*: ULONG
  buf*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L886) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L886)  
```
WSAPROC_ACCEPTEX = proc (sListenSocket: SocketHandle;
                         sAcceptSocket: SocketHandle; lpOutputBuffer: pointer;
                         dwReceiveDataLength: DWORD;
                         dwLocalAddressLength: DWORD;
                         dwRemoteAddressLength: DWORD;
                         lpdwBytesReceived: ptr DWORD; lpOverlapped: POVERLAPPED): bool {...}{.
    stdcall, gcsafe, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L975) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L975)  
```
WSAPROC_CONNECTEX = proc (s: SocketHandle; name: ptr SockAddr; namelen: cint;
                          lpSendBuffer: pointer; dwSendDataLength: DWORD;
                          lpdwBytesSent: ptr DWORD; lpOverlapped: POVERLAPPED): bool {...}{.
    stdcall, gcsafe, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L984) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L984)  
```
WSAPROC_GETACCEPTEXSOCKADDRS = proc (lpOutputBuffer: pointer;
                                     dwReceiveDataLength: DWORD;
                                     dwLocalAddressLength: DWORD;
                                     dwRemoteAddressLength: DWORD;
                                     LocalSockaddr: ptr PSockAddr;
                                     LocalSockaddrLength: ptr cint;
                                     RemoteSockaddr: ptr PSockAddr;
                                     RemoteSockaddrLength: ptr cint) {...}{.stdcall,
    gcsafe, raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L990) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L990)  
```
WAITORTIMERCALLBACK = proc (para1: pointer; para2: int32): void {...}{.stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1026) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1026)  
```
KEY_EVENT_RECORD {...}{.final, pure.} = object
  eventType*: int16
  bKeyDown*: WINBOOL
  wRepeatCount*: int16
  wVirtualKeyCode*: int16
  wVirtualScanCode*: int16
  uChar*: int16
  dwControlKeyState*: DWORD
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1089) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1089)  
```
LPFIBER_START_ROUTINE = proc (param: pointer): void {...}{.stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1108)  
```
LPFILETIME = ptr FILETIME
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1126)   Vars
----

  
```
SOMAXCONN: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L545)  
```
INVALID_SOCKET: SocketHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L546)  
```
SOL_SOCKET: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L547)  
```
SO_DEBUG: cint
```
  turn on debugging info recording [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L548)  
```
SO_ACCEPTCONN: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L549)  
```
SO_REUSEADDR: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L550)  
```
SO_REUSEPORT: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L551)  
```
SO_KEEPALIVE: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L553)  
```
SO_DONTROUTE: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L554)  
```
SO_BROADCAST: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L555)  
```
SO_USELOOPBACK: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L556)  
```
SO_LINGER: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L557)  
```
SO_OOBINLINE: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L558)  
```
SO_DONTLINGER: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L560)  
```
SO_EXCLUSIVEADDRUSE: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L561)  
```
SO_ERROR: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L562)  
```
TCP_NODELAY: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L563)  
```
WSAID_CONNECTEX: GUID = GUID(D1: 0x25A207B9, D2: 0xDDF3'i16, D3: 0x00004660, D4: [
    0x8E'i8, 0xE9'i8, 0x76'i8, 0xE5'i8, 0x8C'i8, 0x74'i8, 0x06'i8, 0x3E'i8])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L872) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L872)  
```
WSAID_ACCEPTEX: GUID = GUID(D1: 0xB5367DF1'i32, D2: 0xCBAC'i16, D3: 0x000011CF, D4: [
    0x95'i8, 0xCA'i8, 0x00'i8, 0x80'i8, 0x5F'i8, 0x48'i8, 0xA1'i8, 0x92'i8])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L874) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L874)  
```
WSAID_GETACCEPTEXSOCKADDRS: GUID = GUID(D1: 0xB5367DF2'i32, D2: 0xCBAC'i16,
                                        D3: 0x000011CF, D4: [0x95'i8, 0xCA'i8,
    0x00'i8, 0x80'i8, 0x5F'i8, 0x48'i8, 0xA1'i8, 0x92'i8])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L876) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L876)   Consts
------

  
```
useWinUnicode = true
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L21)  
```
STARTF_USESHOWWINDOW = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L106)  
```
STARTF_USESTDHANDLES = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L107)  
```
HIGH_PRIORITY_CLASS = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L108)  
```
IDLE_PRIORITY_CLASS = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L109)  
```
NORMAL_PRIORITY_CLASS = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L110)  
```
REALTIME_PRIORITY_CLASS = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L111)  
```
WAIT_OBJECT_0 = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L112)  
```
WAIT_TIMEOUT = 0x00000102'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L113)  
```
WAIT_FAILED = 0xFFFFFFFF'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L114)  
```
INFINITE = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L115)  
```
STILL_ACTIVE = 0x00000103'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L116)  
```
STD_INPUT_HANDLE = -10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L118)  
```
STD_OUTPUT_HANDLE = -11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L119)  
```
STD_ERROR_HANDLE = -12'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L120)  
```
DETACHED_PROCESS = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L122)  
```
SW_SHOWNORMAL = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L124)  
```
INVALID_HANDLE_VALUE = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L125)  
```
CREATE_UNICODE_ENVIRONMENT = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L127)  
```
PIPE_ACCESS_DUPLEX = 0x00000003'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L129)  
```
PIPE_ACCESS_INBOUND = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L130)  
```
PIPE_ACCESS_OUTBOUND = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L131)  
```
PIPE_NOWAIT = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L132)  
```
SYNCHRONIZE = 0x00100000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L133)  
```
CREATE_NO_WINDOW = 0x08000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L135)  
```
HANDLE_FLAG_INHERIT = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L137)  
```
FILE_ATTRIBUTE_READONLY = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L287)  
```
FILE_ATTRIBUTE_HIDDEN = 0x00000002'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L288)  
```
FILE_ATTRIBUTE_SYSTEM = 0x00000004'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L289)  
```
FILE_ATTRIBUTE_DIRECTORY = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L290)  
```
FILE_ATTRIBUTE_ARCHIVE = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L291)  
```
FILE_ATTRIBUTE_DEVICE = 0x00000040'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L292)  
```
FILE_ATTRIBUTE_NORMAL = 0x00000080'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L293)  
```
FILE_ATTRIBUTE_TEMPORARY = 0x00000100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L294)  
```
FILE_ATTRIBUTE_SPARSE_FILE = 0x00000200'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L295)  
```
FILE_ATTRIBUTE_REPARSE_POINT = 0x00000400'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L296)  
```
FILE_ATTRIBUTE_COMPRESSED = 0x00000800'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L297)  
```
FILE_ATTRIBUTE_OFFLINE = 0x00001000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L298)  
```
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED = 0x00002000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L299)  
```
FILE_FLAG_FIRST_PIPE_INSTANCE = 0x00080000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L301)  
```
FILE_FLAG_OPEN_NO_RECALL = 0x00100000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L302)  
```
FILE_FLAG_OPEN_REPARSE_POINT = 0x00200000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L303)  
```
FILE_FLAG_POSIX_SEMANTICS = 0x01000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L304)  
```
FILE_FLAG_BACKUP_SEMANTICS = 0x02000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L305)  
```
FILE_FLAG_DELETE_ON_CLOSE = 0x04000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L306)  
```
FILE_FLAG_SEQUENTIAL_SCAN = 0x08000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L307)  
```
FILE_FLAG_RANDOM_ACCESS = 0x10000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L308)  
```
FILE_FLAG_NO_BUFFERING = 0x20000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L309)  
```
FILE_FLAG_OVERLAPPED = 0x40000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L310)  
```
FILE_FLAG_WRITE_THROUGH = 0x80000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L311)  
```
MAX_PATH = 260
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L313)  
```
MOVEFILE_COPY_ALLOWED = 0x00000002'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L315)  
```
MOVEFILE_CREATE_HARDLINK = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L316)  
```
MOVEFILE_DELAY_UNTIL_REBOOT = 0x00000004'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L317)  
```
MOVEFILE_FAIL_IF_NOT_TRACKABLE = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L318)  
```
MOVEFILE_REPLACE_EXISTING = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L319)  
```
MOVEFILE_WRITE_THROUGH = 0x00000008'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L320)  
```
WSADESCRIPTION_LEN = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L443)  
```
WSASYS_STATUS_LEN = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L444)  
```
FD_SETSIZE = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L445)  
```
MSG_PEEK = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L446)  
```
INADDR_ANY = 0'u32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L448)  
```
INADDR_LOOPBACK = 0x7F000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L449)  
```
INADDR_BROADCAST = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L450)  
```
INADDR_NONE = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L451)  
```
MAXIMUM_WAIT_OBJECTS = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L670)  
```
GENERIC_READ = 0x80000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L684)  
```
GENERIC_WRITE = 0x40000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L685)  
```
GENERIC_ALL = 0x10000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L686)  
```
FILE_SHARE_READ = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L687)  
```
FILE_SHARE_DELETE = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L688)  
```
FILE_SHARE_WRITE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L689)  
```
CREATE_ALWAYS = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L691)  
```
CREATE_NEW = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L692) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L692)  
```
OPEN_EXISTING = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L693)  
```
OPEN_ALWAYS = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L694)  
```
FILE_BEGIN = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L695)  
```
INVALID_SET_FILE_POINTER = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L696)  
```
NO_ERROR = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L697)  
```
PAGE_NOACCESS = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L698)  
```
PAGE_EXECUTE = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L699)  
```
PAGE_EXECUTE_READ = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L700)  
```
PAGE_EXECUTE_READWRITE = 0x00000040'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L701)  
```
PAGE_READONLY = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L702)  
```
PAGE_READWRITE = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L703)  
```
FILE_MAP_READ = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L704)  
```
FILE_MAP_WRITE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L705) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L705)  
```
INVALID_FILE_SIZE = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L706) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L706)  
```
DUPLICATE_SAME_ACCESS = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L708)  
```
FILE_READ_DATA = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L709) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L709)  
```
FILE_WRITE_DATA = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L710)  
```
ERROR_FILE_NOT_FOUND = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L714)  
```
ERROR_PATH_NOT_FOUND = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L715)  
```
ERROR_ACCESS_DENIED = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L716)  
```
ERROR_NO_MORE_FILES = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L717)  
```
ERROR_LOCK_VIOLATION = 33
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L718)  
```
ERROR_HANDLE_EOF = 38
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L719) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L719)  
```
ERROR_BAD_ARGUMENTS = 165
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L720)  
```
ERROR_IO_PENDING = 997
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L818) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L818)  
```
WSAECONNABORTED = 10053
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L819) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L819)  
```
WSAEADDRINUSE = 10048
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L820) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L820)  
```
WSAECONNRESET = 10054
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L821) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L821)  
```
WSAEDISCON = 10101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L822)  
```
WSAENETRESET = 10052
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L823) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L823)  
```
WSAETIMEDOUT = 10060
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L824)  
```
WSANOTINITIALISED = 10093
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L825) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L825)  
```
WSAENOTSOCK = 10038
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L826) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L826)  
```
WSAEINPROGRESS = 10036
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L827) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L827)  
```
WSAEINTR = 10004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L828) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L828)  
```
WSAEWOULDBLOCK = 10035
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L829)  
```
WSAESHUTDOWN = 10058
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L830)  
```
ERROR_NETNAME_DELETED = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L831) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L831)  
```
STATUS_PENDING = 0x00000103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L832)  
```
IOC_OUT = 0x40000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L856) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L856)  
```
IOC_IN = 0x80000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L857) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L857)  
```
IOC_WS2 = 0x08000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L858) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L858)  
```
IOC_INOUT = -1073741824'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L859)  
```
SIO_GET_EXTENSION_FUNCTION_POINTER = -939524090'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L864)  
```
SO_UPDATE_ACCEPT_CONTEXT = 0x0000700B
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L865) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L865)  
```
AI_V4MAPPED = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L866)  
```
AF_UNSPEC = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L867)  
```
AF_INET = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L868)  
```
AF_INET6 = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L869) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L869)  
```
WT_EXECUTEDEFAULT = 0x00000000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1001) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1001)  
```
WT_EXECUTEINIOTHREAD = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1002) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1002)  
```
WT_EXECUTEINUITHREAD = 0x00000002'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1003) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1003)  
```
WT_EXECUTEINWAITTHREAD = 0x00000004'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1004) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1004)  
```
WT_EXECUTEONLYONCE = 0x00000008'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1005) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1005)  
```
WT_EXECUTELONGFUNCTION = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1006) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1006)  
```
WT_EXECUTEINTIMERTHREAD = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1007) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1007)  
```
WT_EXECUTEINPERSISTENTIOTHREAD = 0x00000040'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1008)  
```
WT_EXECUTEINPERSISTENTTHREAD = 0x00000080'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1009) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1009)  
```
WT_TRANSFER_IMPERSONATION = 0x00000100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1010) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1010)  
```
PROCESS_TERMINATE = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1011) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1011)  
```
PROCESS_CREATE_THREAD = 0x00000002'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1012) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1012)  
```
PROCESS_SET_SESSIONID = 0x00000004'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1013)  
```
PROCESS_VM_OPERATION = 0x00000008'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1014) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1014)  
```
PROCESS_VM_READ = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1015) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1015)  
```
PROCESS_VM_WRITE = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1016) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1016)  
```
PROCESS_DUP_HANDLE = 0x00000040'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1017)  
```
PROCESS_CREATE_PROCESS = 0x00000080'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1018) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1018)  
```
PROCESS_SET_QUOTA = 0x00000100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1019) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1019)  
```
PROCESS_SET_INFORMATION = 0x00000200'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1020) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1020)  
```
PROCESS_QUERY_INFORMATION = 0x00000400'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1021)  
```
PROCESS_SUSPEND_RESUME = 0x00000800'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1022) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1022)  
```
PROCESS_QUERY_LIMITED_INFORMATION = 0x00001000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1023) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1023)  
```
PROCESS_SET_LIMITED_INFORMATION = 0x00002000'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1024) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1024)  
```
FD_READ = 0x00000001'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1063) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1063)  
```
FD_WRITE = 0x00000002'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1064) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1064)  
```
FD_OOB = 0x00000004'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1065) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1065)  
```
FD_ACCEPT = 0x00000008'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1066) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1066)  
```
FD_CONNECT = 0x00000010'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1067) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1067)  
```
FD_CLOSE = 0x00000020'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1068) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1068)  
```
FD_QQS = 0x00000040'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1069) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1069)  
```
FD_GROUP_QQS = 0x00000080'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1070) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1070)  
```
FD_ROUTING_INTERFACE_CHANGE = 0x00000100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1071) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1071)  
```
FD_ADDRESS_LIST_CHANGE = 0x00000200'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1072) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1072)  
```
FD_ALL_EVENTS = 0x000003FF'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1073) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1073)  
```
FIBER_FLAG_FLOAT_SWITCH = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1111)   Procs
-----

  
```
proc getVersionExW(lpVersionInfo: ptr OSVERSIONINFO): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "GetVersionExW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L139)  
```
proc getVersionExA(lpVersionInfo: ptr OSVERSIONINFO): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "GetVersionExA", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L141)  
```
proc getVersion(): DWORD {...}{.stdcall, dynlib: "kernel32", importc: "GetVersion",
                           sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L144)  
```
proc closeHandle(hObject: Handle): WINBOOL {...}{.stdcall, dynlib: "kernel32",
    importc: "CloseHandle".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L146)  
```
proc readFile(hFile: Handle; buffer: pointer; nNumberOfBytesToRead: int32;
              lpNumberOfBytesRead: ptr int32; lpOverlapped: pointer): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "ReadFile", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L149)  
```
proc writeFile(hFile: Handle; buffer: pointer; nNumberOfBytesToWrite: int32;
               lpNumberOfBytesWritten: ptr int32; lpOverlapped: pointer): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "WriteFile", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L153)  
```
proc createPipe(hReadPipe, hWritePipe: var Handle;
                lpPipeAttributes: var SECURITY_ATTRIBUTES; nSize: int32): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "CreatePipe", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L158)  
```
proc createNamedPipe(lpName: WideCString; dwOpenMode, dwPipeMode, nMaxInstances,
    nOutBufferSize, nInBufferSize, nDefaultTimeOut: int32;
                     lpSecurityAttributes: ptr SECURITY_ATTRIBUTES): Handle {...}{.
    stdcall, dynlib: "kernel32", importc: "CreateNamedPipeW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L163)  
```
proc peekNamedPipe(hNamedPipe: Handle; lpBuffer: pointer = nil;
                   nBufferSize: int32 = 0; lpBytesRead: ptr int32 = nil;
                   lpTotalBytesAvail: ptr int32 = nil;
                   lpBytesLeftThisMessage: ptr int32 = nil): bool {...}{.stdcall,
    dynlib: "kernel32", importc: "PeekNamedPipe".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L169)  
```
proc createProcessW(lpApplicationName, lpCommandLine: WideCString;
                    lpProcessAttributes: ptr SECURITY_ATTRIBUTES;
                    lpThreadAttributes: ptr SECURITY_ATTRIBUTES;
                    bInheritHandles: WINBOOL; dwCreationFlags: int32;
                    lpEnvironment, lpCurrentDirectory: WideCString;
                    lpStartupInfo: var STARTUPINFO;
                    lpProcessInformation: var PROCESS_INFORMATION): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "CreateProcessW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L177)  
```
proc suspendThread(hThread: Handle): int32 {...}{.stdcall, dynlib: "kernel32",
    importc: "SuspendThread", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L197)  
```
proc resumeThread(hThread: Handle): int32 {...}{.stdcall, dynlib: "kernel32",
    importc: "ResumeThread", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L199)  
```
proc waitForSingleObject(hHandle: Handle; dwMilliseconds: int32): int32 {...}{.
    stdcall, dynlib: "kernel32", importc: "WaitForSingleObject", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L202)  
```
proc terminateProcess(hProcess: Handle; uExitCode: int): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "TerminateProcess", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L205)  
```
proc getExitCodeProcess(hProcess: Handle; lpExitCode: var int32): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetExitCodeProcess".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L208)  
```
proc getStdHandle(nStdHandle: int32): Handle {...}{.stdcall, dynlib: "kernel32",
    importc: "GetStdHandle".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L211)  
```
proc setStdHandle(nStdHandle: int32; hHandle: Handle): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "SetStdHandle", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L213)  
```
proc flushFileBuffers(hFile: Handle): WINBOOL {...}{.stdcall, dynlib: "kernel32",
    importc: "FlushFileBuffers", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L215)  
```
proc getLastError(): int32 {...}{.importc: "GetLastError", stdcall,
                             dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L218)  
```
proc setLastError(error: int32) {...}{.importc: "SetLastError", stdcall,
                                  dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L221)  
```
proc formatMessageW(dwFlags: int32; lpSource: pointer;
                    dwMessageId, dwLanguageId: int32; lpBuffer: pointer;
                    nSize: int32; arguments: pointer): int32 {...}{.
    importc: "FormatMessageW", stdcall, dynlib: "kernel32".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L225)  
```
proc localFree(p: pointer) {...}{.importc: "LocalFree", stdcall, dynlib: "kernel32".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L237)  
```
proc getCurrentDirectoryW(nBufferLength: int32; lpBuffer: WideCString): int32 {...}{.
    importc: "GetCurrentDirectoryW", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L241)  
```
proc setCurrentDirectoryW(lpPathName: WideCString): int32 {...}{.
    importc: "SetCurrentDirectoryW", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L244)  
```
proc createDirectoryW(pathName: WideCString; security: pointer = nil): int32 {...}{.
    importc: "CreateDirectoryW", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L246)  
```
proc removeDirectoryW(lpPathName: WideCString): int32 {...}{.
    importc: "RemoveDirectoryW", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L248)  
```
proc setEnvironmentVariableW(lpName, lpValue: WideCString): int32 {...}{.stdcall,
    dynlib: "kernel32", importc: "SetEnvironmentVariableW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L250)  
```
proc getModuleFileNameW(handle: Handle; buf: WideCString; size: int32): int32 {...}{.
    importc: "GetModuleFileNameW", dynlib: "kernel32", stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L253)  
```
proc createSymbolicLinkW(lpSymlinkFileName, lpTargetFileName: WideCString;
                         flags: DWORD): int32 {...}{.importc: "CreateSymbolicLinkW",
    dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L272)  
```
proc createHardLinkW(lpFileName, lpExistingFileName: WideCString;
                     security: pointer = nil): int32 {...}{.
    importc: "CreateHardLinkW", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L275)  
```
proc findFirstFileW(lpFileName: WideCString; lpFindFileData: var WIN32_FIND_DATA): Handle {...}{.
    stdcall, dynlib: "kernel32", importc: "FindFirstFileW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L336)  
```
proc findNextFileW(hFindFile: Handle; lpFindFileData: var WIN32_FIND_DATA): int32 {...}{.
    stdcall, dynlib: "kernel32", importc: "FindNextFileW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L339)  
```
proc findClose(hFindFile: Handle) {...}{.stdcall, dynlib: "kernel32",
                                    importc: "FindClose".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L350)  
```
proc getFullPathNameW(lpFileName: WideCString; nBufferLength: int32;
                      lpBuffer: WideCString; lpFilePart: var WideCString): int32 {...}{.
    stdcall, dynlib: "kernel32", importc: "GetFullPathNameW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L354)  
```
proc getFileAttributesW(lpFileName: WideCString): int32 {...}{.stdcall,
    dynlib: "kernel32", importc: "GetFileAttributesW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L359)  
```
proc setFileAttributesW(lpFileName: WideCString; dwFileAttributes: int32): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "SetFileAttributesW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L362)  
```
proc copyFileW(lpExistingFileName, lpNewFileName: WideCString;
               bFailIfExists: WINBOOL): WINBOOL {...}{.importc: "CopyFileW", stdcall,
    dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L366)  
```
proc moveFileW(lpExistingFileName, lpNewFileName: WideCString): WINBOOL {...}{.
    importc: "MoveFileW", stdcall, dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L370)  
```
proc moveFileExW(lpExistingFileName, lpNewFileName: WideCString; flags: DWORD): WINBOOL {...}{.
    importc: "MoveFileExW", stdcall, dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L372)  
```
proc getEnvironmentStringsW(): WideCString {...}{.stdcall, dynlib: "kernel32",
    importc: "GetEnvironmentStringsW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L376)  
```
proc freeEnvironmentStringsW(para1: WideCString): int32 {...}{.stdcall,
    dynlib: "kernel32", importc: "FreeEnvironmentStringsW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L378)  
```
proc getCommandLineW(): WideCString {...}{.importc: "GetCommandLineW", stdcall,
                                      dynlib: "kernel32", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L381)  
```
proc rdFileTime(f: FILETIME): int64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L414)  
```
proc rdFileSize(f: WIN32_FIND_DATA): int64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L417)  
```
proc getSystemTimeAsFileTime(lpSystemTimeAsFileTime: var FILETIME) {...}{.
    importc: "GetSystemTimeAsFileTime", dynlib: "kernel32", stdcall, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L420)  
```
proc sleep(dwMilliseconds: int32) {...}{.stdcall, dynlib: "kernel32",
                                    importc: "Sleep", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L423)  
```
proc shellExecuteW(hwnd: Handle;
                   lpOperation, lpFile, lpParameters, lpDirectory: WideCString;
                   nShowCmd: int32): Handle {...}{.stdcall, dynlib: "shell32.dll",
    importc: "ShellExecuteW", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L427)  
```
proc getFileInformationByHandle(hFile: Handle; lpFileInformation: ptr BY_HANDLE_FILE_INFORMATION): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetFileInformationByHandle",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L438)  
```
proc wsaGetLastError(): cint {...}{.importc: "WSAGetLastError", dynlib: ws2dll,
                               sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L455)  
```
proc `==`(x, y: SocketHandle): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L565)  
```
proc getservbyname(name, proto: cstring): ptr Servent {...}{.stdcall,
    importc: "getservbyname", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L567)  
```
proc getservbyport(port: cint; proto: cstring): ptr Servent {...}{.stdcall,
    importc: "getservbyport", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L570)  
```
proc gethostbyaddr(ip: ptr InAddr; len: cuint; theType: cint): ptr Hostent {...}{.
    stdcall, importc: "gethostbyaddr", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L573)  
```
proc gethostbyname(name: cstring): ptr Hostent {...}{.stdcall,
    importc: "gethostbyname", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L576)  
```
proc gethostname(hostname: cstring; len: cint): cint {...}{.stdcall,
    importc: "gethostname", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L579)  
```
proc getprotobyname(name: cstring): ptr Protoent {...}{.stdcall,
    importc: "getprotobyname", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L582)  
```
proc getprotobynumber(proto: cint): ptr Protoent {...}{.stdcall,
    importc: "getprotobynumber", dynlib: ws2dll, sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L586)  
```
proc socket(af, typ, protocol: cint): SocketHandle {...}{.stdcall, importc: "socket",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L590)  
```
proc closesocket(s: SocketHandle): cint {...}{.stdcall, importc: "closesocket",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L593)  
```
proc accept(s: SocketHandle; a: ptr SockAddr; addrlen: ptr SockLen): SocketHandle {...}{.
    stdcall, importc: "accept", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L596)  
```
proc bindSocket(s: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint {...}{.
    stdcall, importc: "bind", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L598)  
```
proc connect(s: SocketHandle; name: ptr SockAddr; namelen: SockLen): cint {...}{.
    stdcall, importc: "connect", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L600) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L600)  
```
proc getsockname(s: SocketHandle; name: ptr SockAddr; namelen: ptr SockLen): cint {...}{.
    stdcall, importc: "getsockname", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L602)  
```
proc getpeername(s: SocketHandle; name: ptr SockAddr; namelen: ptr SockLen): cint {...}{.
    stdcall, importc, dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L605)  
```
proc getsockopt(s: SocketHandle; level, optname: cint; optval: pointer;
                optlen: ptr SockLen): cint {...}{.stdcall, importc: "getsockopt",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L608)  
```
proc setsockopt(s: SocketHandle; level, optname: cint; optval: pointer;
                optlen: SockLen): cint {...}{.stdcall, importc: "setsockopt",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L611)  
```
proc listen(s: SocketHandle; backlog: cint): cint {...}{.stdcall, importc: "listen",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L615)  
```
proc recv(s: SocketHandle; buf: pointer; len, flags: cint): cint {...}{.stdcall,
    importc: "recv", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L617)  
```
proc recvfrom(s: SocketHandle; buf: cstring; len, flags: cint;
              fromm: ptr SockAddr; fromlen: ptr SockLen): cint {...}{.stdcall,
    importc: "recvfrom", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L619)  
```
proc select(nfds: cint; readfds, writefds, exceptfds: ptr TFdSet;
            timeout: ptr Timeval): cint {...}{.stdcall, importc: "select",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L622)  
```
proc send(s: SocketHandle; buf: pointer; len, flags: cint): cint {...}{.stdcall,
    importc: "send", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L625) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L625)  
```
proc sendto(s: SocketHandle; buf: pointer; len, flags: cint; to: ptr SockAddr;
            tolen: SockLen): cint {...}{.stdcall, importc: "sendto", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L627)  
```
proc shutdown(s: SocketHandle; how: cint): cint {...}{.stdcall, importc: "shutdown",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L631)  
```
proc getnameinfo(a1: ptr SockAddr; a2: SockLen; a3: cstring; a4: SockLen;
                 a5: cstring; a6: SockLen; a7: cint): cint {...}{.stdcall,
    importc: "getnameinfo", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L634)  
```
proc inet_addr(cp: cstring): uint32 {...}{.stdcall, importc: "inet_addr",
                                      dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L639)  
```
proc FD_ISSET(socket: SocketHandle; set: var TFdSet): cint {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L645)  
```
proc FD_SET(socket: SocketHandle; s: var TFdSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L648)  
```
proc FD_ZERO(s: var TFdSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L653)  
```
proc wsaStartup(wVersionRequired: int16; WSData: ptr WSAData): cint {...}{.stdcall,
    importc: "WSAStartup", dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L656)  
```
proc getaddrinfo(nodename, servname: cstring; hints: ptr AddrInfo;
                 res: var ptr AddrInfo): cint {...}{.stdcall, importc: "getaddrinfo",
    dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L659)  
```
proc freeaddrinfo(ai: ptr AddrInfo) {...}{.stdcall, importc: "freeaddrinfo",
                                      dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L663)  
```
proc inet_ntoa(i: InAddr): cstring {...}{.stdcall, importc, dynlib: ws2dll.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L666)  
```
proc waitForMultipleObjects(nCount: DWORD; lpHandles: PWOHandleArray;
                            bWaitAll: WINBOOL; dwMilliseconds: DWORD): DWORD {...}{.
    stdcall, dynlib: "kernel32", importc: "WaitForMultipleObjects".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L676)  
```
proc duplicateHandle(hSourceProcessHandle: Handle; hSourceHandle: Handle;
                     hTargetProcessHandle: Handle; lpTargetHandle: ptr Handle;
                     dwDesiredAccess: DWORD; bInheritHandle: WINBOOL;
                     dwOptions: DWORD): WINBOOL {...}{.stdcall, dynlib: "kernel32",
    importc: "DuplicateHandle".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L722)  
```
proc getHandleInformation(hObject: Handle; lpdwFlags: ptr DWORD): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetHandleInformation".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L729) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L729)  
```
proc setHandleInformation(hObject: Handle; dwMask: DWORD; dwFlags: DWORD): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "SetHandleInformation".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L732) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L732)  
```
proc getCurrentProcess(): Handle {...}{.stdcall, dynlib: "kernel32",
                                   importc: "GetCurrentProcess".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L736)  
```
proc createFileW(lpFileName: WideCString; dwDesiredAccess, dwShareMode: DWORD;
                 lpSecurityAttributes: pointer;
                 dwCreationDisposition, dwFlagsAndAttributes: DWORD;
                 hTemplateFile: Handle): Handle {...}{.stdcall, dynlib: "kernel32",
    importc: "CreateFileW".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L739)  
```
proc deleteFileW(pathName: WideCString): int32 {...}{.importc: "DeleteFileW",
    dynlib: "kernel32", stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L744)  
```
proc createFileA(lpFileName: cstring; dwDesiredAccess, dwShareMode: DWORD;
                 lpSecurityAttributes: pointer;
                 dwCreationDisposition, dwFlagsAndAttributes: DWORD;
                 hTemplateFile: Handle): Handle {...}{.stdcall, dynlib: "kernel32",
    importc: "CreateFileA".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L746)  
```
proc deleteFileA(pathName: cstring): int32 {...}{.importc: "DeleteFileA",
    dynlib: "kernel32", stdcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L751)  
```
proc setEndOfFile(hFile: Handle): WINBOOL {...}{.stdcall, dynlib: "kernel32",
    importc: "SetEndOfFile".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L754)  
```
proc setFilePointer(hFile: Handle; lDistanceToMove: LONG;
                    lpDistanceToMoveHigh: ptr LONG; dwMoveMethod: DWORD): DWORD {...}{.
    stdcall, dynlib: "kernel32", importc: "SetFilePointer".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L757) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L757)  
```
proc getFileSize(hFile: Handle; lpFileSizeHigh: ptr DWORD): DWORD {...}{.stdcall,
    dynlib: "kernel32", importc: "GetFileSize".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L762) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L762)  
```
proc mapViewOfFileEx(hFileMappingObject: Handle; dwDesiredAccess: DWORD;
                     dwFileOffsetHigh, dwFileOffsetLow: DWORD;
                     dwNumberOfBytesToMap: WinSizeT; lpBaseAddress: pointer): pointer {...}{.
    stdcall, dynlib: "kernel32", importc: "MapViewOfFileEx".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L772)  
```
proc createFileMappingW(hFile: Handle; lpFileMappingAttributes: pointer;
                        flProtect, dwMaximumSizeHigh: DWORD;
                        dwMaximumSizeLow: DWORD; lpName: pointer): Handle {...}{.
    stdcall, dynlib: "kernel32", importc: "CreateFileMappingW".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L778) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L778)  
```
proc unmapViewOfFile(lpBaseAddress: pointer): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "UnmapViewOfFile".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L792)  
```
proc flushViewOfFile(lpBaseAddress: pointer; dwNumberOfBytesToFlush: DWORD): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "FlushViewOfFile".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L795) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L795)  
```
proc createIoCompletionPort(FileHandle: Handle; ExistingCompletionPort: Handle;
                            CompletionKey: ULONG_PTR;
                            NumberOfConcurrentThreads: DWORD): Handle {...}{.stdcall,
    dynlib: "kernel32", importc: "CreateIoCompletionPort".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L834)  
```
proc getQueuedCompletionStatus(CompletionPort: Handle;
                               lpNumberOfBytesTransferred: PDWORD;
                               lpCompletionKey: PULONG_PTR;
                               lpOverlapped: ptr POVERLAPPED;
                               dwMilliseconds: DWORD): WINBOOL {...}{.stdcall,
    dynlib: "kernel32", importc: "GetQueuedCompletionStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L839)  
```
proc getOverlappedResult(hFile: Handle; lpOverlapped: POVERLAPPED;
                         lpNumberOfBytesTransferred: var DWORD; bWait: WINBOOL): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetOverlappedResult".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L845)  
```
proc WSAIoctl(s: SocketHandle; dwIoControlCode: DWORD; lpvInBuffer: pointer;
              cbInBuffer: DWORD; lpvOutBuffer: pointer; cbOutBuffer: DWORD;
              lpcbBytesReturned: PDWORD; lpOverlapped: POVERLAPPED;
              lpCompletionRoutine: POVERLAPPED_COMPLETION_ROUTINE): cint {...}{.
    stdcall, importc: "WSAIoctl", dynlib: "Ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L879) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L879)  
```
proc WSARecv(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
             bytesReceived, flags: PDWORD; lpOverlapped: POVERLAPPED;
             completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {...}{.stdcall,
    importc: "WSARecv", dynlib: "Ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L890)  
```
proc WSARecvFrom(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
                 bytesReceived: PDWORD; flags: PDWORD; name: ptr SockAddr;
                 namelen: ptr cint; lpOverlapped: POVERLAPPED;
                 completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {...}{.
    stdcall, importc: "WSARecvFrom", dynlib: "Ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L895) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L895)  
```
proc WSASend(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
             bytesSent: PDWORD; flags: DWORD; lpOverlapped: POVERLAPPED;
             completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {...}{.stdcall,
    importc: "WSASend", dynlib: "Ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L901) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L901)  
```
proc WSASendTo(s: SocketHandle; buf: ptr TWSABuf; bufCount: DWORD;
               bytesSent: PDWORD; flags: DWORD; name: ptr SockAddr;
               namelen: cint; lpOverlapped: POVERLAPPED;
               completionProc: POVERLAPPED_COMPLETION_ROUTINE): cint {...}{.stdcall,
    importc: "WSASendTo", dynlib: "Ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L906) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L906)  
```
proc get_osfhandle(fd: FileHandle): Handle {...}{.importc: "_get_osfhandle",
    header: "<io.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L912) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L912)  
```
proc getSystemTimes(lpIdleTime, lpKernelTime, lpUserTime: var FILETIME): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetSystemTimes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L915) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L915)  
```
proc getProcessTimes(hProcess: Handle; lpCreationTime, lpExitTime, lpKernelTime,
                                       lpUserTime: var FILETIME): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "GetProcessTimes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L919) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L919)  
```
proc inet_ntop(family: cint; paddr: pointer; pStringBuffer: cstring;
               stringBufSize: int32): cstring {...}{.stdcall, raises: [Exception],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L960)  
```
proc postQueuedCompletionStatus(CompletionPort: Handle;
                                dwNumberOfBytesTransferred: DWORD;
                                dwCompletionKey: ULONG_PTR;
                                lpOverlapped: pointer): bool {...}{.stdcall,
    dynlib: "kernel32", importc: "PostQueuedCompletionStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1028) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1028)  
```
proc registerWaitForSingleObject(phNewWaitObject: ptr Handle; hObject: Handle;
                                 Callback: WAITORTIMERCALLBACK;
                                 Context: pointer; dwMilliseconds: ULONG;
                                 dwFlags: ULONG): bool {...}{.stdcall,
    dynlib: "kernel32", importc: "RegisterWaitForSingleObject".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1034) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1034)  
```
proc unregisterWait(WaitHandle: Handle): DWORD {...}{.stdcall, dynlib: "kernel32",
    importc: "UnregisterWait".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1041) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1041)  
```
proc openProcess(dwDesiredAccess: DWORD; bInheritHandle: WINBOOL;
                 dwProcessId: DWORD): Handle {...}{.stdcall, dynlib: "kernel32",
    importc: "OpenProcess".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1044) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1044)  
```
proc createEvent(lpEventAttributes: ptr SECURITY_ATTRIBUTES;
                 bManualReset: DWORD; bInitialState: DWORD;
                 lpName: ptr Utf16Char): Handle {...}{.stdcall, dynlib: "kernel32",
    importc: "CreateEventW".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1054) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1054)  
```
proc setEvent(hEvent: Handle): cint {...}{.stdcall, dynlib: "kernel32",
                                      importc: "SetEvent".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1059)  
```
proc wsaEventSelect(s: SocketHandle; hEventObject: Handle; lNetworkEvents: clong): cint {...}{.
    stdcall, importc: "WSAEventSelect", dynlib: "ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1075) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1075)  
```
proc wsaCreateEvent(): Handle {...}{.stdcall, importc: "WSACreateEvent",
                                dynlib: "ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1079) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1079)  
```
proc wsaCloseEvent(hEvent: Handle): bool {...}{.stdcall, importc: "WSACloseEvent",
    dynlib: "ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1082) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1082)  
```
proc wsaResetEvent(hEvent: Handle): bool {...}{.stdcall, importc: "WSAResetEvent",
    dynlib: "ws2_32.dll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1085) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1085)  
```
proc readConsoleInput(hConsoleInput: Handle; lpBuffer: pointer; nLength: cint;
                      lpNumberOfEventsRead: ptr cint): cint {...}{.stdcall,
    dynlib: "kernel32", importc: "ReadConsoleInputW".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1103)  
```
proc CreateFiber(stackSize: int; fn: LPFIBER_START_ROUTINE; param: pointer): pointer {...}{.
    stdcall, discardable, dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1113)  
```
proc CreateFiberEx(stkCommit: int; stkReserve: int; flags: int32;
                   fn: LPFIBER_START_ROUTINE; param: pointer): pointer {...}{.
    stdcall, discardable, dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1114)  
```
proc ConvertThreadToFiber(param: pointer): pointer {...}{.stdcall, discardable,
    dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1115)  
```
proc ConvertThreadToFiberEx(param: pointer; flags: int32): pointer {...}{.stdcall,
    discardable, dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1116)  
```
proc DeleteFiber(fiber: pointer): void {...}{.stdcall, discardable,
    dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1117)  
```
proc SwitchToFiber(fiber: pointer): void {...}{.stdcall, discardable,
    dynlib: "kernel32", importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1118)  
```
proc GetCurrentFiber(): pointer {...}{.stdcall, importc, header: "windows.h".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1119)  
```
proc toFILETIME(t: int64): FILETIME {...}{.raises: [], tags: [].}
```
  Convert the Windows file time timestamp `t` to `FILETIME`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1121)  
```
proc setFileTime(hFile: Handle; lpCreationTime: LPFILETIME;
                 lpLastAccessTime: LPFILETIME; lpLastWriteTime: LPFILETIME): WINBOOL {...}{.
    stdcall, dynlib: "kernel32", importc: "SetFileTime".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L1128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L1128)   Templates
---------

  
```
template hasOverlappedIoCompleted(lpOverlapped): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L852) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L852)  
```
template WSAIORW(x, y): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/winlean.nim#L861) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/winlean.nim#L861)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/winlean.html>

dom
===

 Declaration of the Document Object Model for the [JavaScript backend](backends#backends-the-javascript-target).

 Imports
-------

  <since>  Types
-----

  
```
EventTarget = ref EventTargetObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L20)  
```
DomEvent {...}{.pure.} = enum
  Abort = "abort", BeforeInput = "beforeinput", Blur = "blur", Click = "click",
  CompositionEnd = "compositionend", CompositionStart = "compositionstart",
  CompositionUpdate = "compositionupdate", DblClick = "dblclick",
  Error = "error", Focus = "focus", FocusIn = "focusin", FocusOut = "focusout",
  Input = "input", KeyDown = "keydown", KeyPress = "keypress", KeyUp = "keyup",
  Load = "load", MouseDown = "mousedown", MouseEnter = "mouseenter",
  MouseLeave = "mouseleave", MouseMove = "mousemove", MouseOut = "mouseout",
  MouseOver = "mouseover", MouseUp = "mouseup", Resize = "resize",
  Scroll = "scroll", Select = "select", Unload = "unload", Wheel = "wheel"
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/Events) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L46)  
```
PerformanceMemory {...}{.importc.} = ref object
  jsHeapSizeLimit*: float
  totalJSHeapSize*: float
  usedJSHeapSize*: float
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L78)  
```
PerformanceTiming {...}{.importc.} = ref object
  connectStart*: float
  domComplete*: float
  domContentLoadedEventEnd*: float
  domContentLoadedEventStart*: float
  domInteractive*: float
  domLoading*: float
  domainLookupEnd*: float
  domainLookupStart*: float
  fetchStart*: float
  loadEventEnd*: float
  loadEventStart*: float
  navigationStart*: float
  redirectEnd*: float
  redirectStart*: float
  requestStart*: float
  responseEnd*: float
  responseStart*: float
  secureConnectionStart*: float
  unloadEventEnd*: float
  unloadEventStart*: float
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L83)  
```
Performance {...}{.importc.} = ref object
  memory*: PerformanceMemory
  timing*: PerformanceTiming
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L105)  
```
Range {...}{.importc.} = ref object
  collapsed*: bool
  commonAncestorContainer*: Node
  endContainer*: Node
  endOffset*: int
  startContainer*: Node
  startOffset*: int
```
  see [docs{https://developer.mozilla.org/en-US/docs/Web/API/Range}](#docs-httpscolonslashslashdeveloperdotmozilladotorgslashenminususslashdocsslashwebslashapislashrange) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L109)  
```
Selection {...}{.importc.} = ref object
  anchorNode*: Node
  anchorOffset*: int
  focusNode*: Node
  focusOffset*: int
  isCollapsed*: bool
  rangeCount*: int
  `type`*: cstring
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/Selection) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L118)  
```
LocalStorage {...}{.importc.} = ref object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L128)  
```
Window = ref WindowObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L130)  
```
Frame = ref FrameObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L159)  
```
ClassList = ref ClassListObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L162)  
```
NodeType = enum
  ElementNode = 1, AttributeNode, TextNode, CDATANode, EntityRefNode,
  EntityNode, ProcessingInstructionNode, CommentNode, DocumentNode,
  DocumentTypeNode, DocumentFragmentNode, NotationNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L165)  
```
Node = ref NodeObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L179)  
```
Document = ref DocumentObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L204)  
```
Element = ref ElementObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L230)  
```
ValidityState = ref ValidityStateObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/ValidityState) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L252)  
```
Blob = ref BlobObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/Blob) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L266)  
```
File = ref FileObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/File) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L271)  
```
TextAreaElement = ref TextAreaElementObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L276)  
```
InputElement = ref InputElementObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L283)  
```
LinkElement = ref LinkObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L336)  
```
EmbedElement = ref EmbedObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L343)  
```
AnchorElement = ref AnchorObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L352)  
```
OptionElement = ref OptionObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L357)  
```
FormElement = ref FormObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormElement) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L365)  
```
ImageElement = ref ImageObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L378)  
```
Style = ref StyleObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L389)  
```
EventPhase = enum
  None = 0, CapturingPhase, AtTarget, BubblingPhase
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L760)  
```
Event = ref EventObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/Event) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L766)  
```
UIEvent = ref UIEventObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/UIEvent) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L779)  
```
KeyboardEvent = ref KeyboardEventObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L784) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L784)  
```
KeyboardEventKey {...}{.pure.} = enum
  Alt, AltGraph, CapsLock, Control, Fn, FnLock, Hyper, Meta, NumLock,
  ScrollLock, Shift, Super, Symbol, SymbolLock, ArrowDown, ArrowLeft,
  ArrowRight, ArrowUp, End, Home, PageDown, PageUp, Backspace, Clear, Copy,
  CrSel, Cut, Delete, EraseEof, ExSel, Insert, Paste, Redo, Undo, Accept, Again,
  Attn, Cancel, ContextMenu, Escape, Execute, Find, Finish, Help, Pause, Play,
  Props, Select, ZoomIn, ZoomOut, BrigtnessDown, BrigtnessUp, Eject, LogOff,
  Power, PowerOff, PrintScreen, Hibernate, Standby, WakeUp, AllCandidates,
  Alphanumeric, CodeInput, Compose, Convert, Dead, FinalMode, GroupFirst,
  GroupLast, GroupNext, GroupPrevious, ModeChange, NextCandidate, NonConvert,
  PreviousCandidate, Process, SingleCandidate, HangulMode, HanjaMode, JunjaMode,
  Eisu, Hankaku, Hiragana, HiraganaKatakana, KanaMode, KanjiMode, Katakana,
  Romaji, Zenkaku, ZenkakuHanaku, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11,
  F12, F13, F14, F15, F16, F17, F18, F19, F20, Soft1, Soft2, Soft3, Soft4,
  AppSwitch, Call, Camera, CameraFocus, EndCall, GoBack, GoHome, HeadsetHook,
  LastNumberRedial, Notification, MannerMode, VoiceDial, ChannelDown, ChannelUp,
  MediaFastForward, MediaPause, MediaPlay, MediaPlayPause, MediaRecord,
  MediaRewind, MediaStop, MediaTrackNext, MediaTrackPrevious, AudioBalanceLeft,
  AudioBalanceRight, AudioBassDown, AudioBassBoostDown, AudioBassBoostToggle,
  AudioBassBoostUp, AudioBassUp, AudioFaderFront, AudioFaderRear,
  AudioSurroundModeNext, AudioTrebleDown, AudioTrebleUp, AudioVolumeDown,
  AUdioVolumeMute, AudioVolumeUp, MicrophoneToggle, MicrophoneVolumeDown,
  MicrophoneVolumeMute, MicrophoneVolumeUp, TV, TV3DMode, TVAntennaCable,
  TVAudioDescription, TVAudioDescriptionMixDown, TVAudioDescriptionMixUp,
  TVContentsMenu, TVDataService, TVInput, TVInputComponent1, TVInputComponent2,
  TVInputComposite1, TVInputComposite2, TVInputHDMI1, TVInputHDMI2,
  TVInputHDMI3, TVInputHDMI4, TVInputVGA1, TVMediaContext, TVNetwork,
  TVNumberEntry, TVPower, TVRadioService, TVSatellite, TVSatelliteBS,
  TVSatelliteCS, TVSatelliteToggle, TVTerrestrialAnalog, TVTerrestrialDigital,
  TVTimer, AVRInput, AVRPower, ColorF0Red, ColorF1Green, ColorF2Yellow,
  ColorF3Blue, ColorF4Grey, ColorF5Brown, ClosedCaptionToggle, Dimmer,
  DisplaySwap, DVR, Exit, FavoriteClear0, FavoriteClear1, FavoriteClear2,
  FavoriteClear3, FavoriteRecall0, FavoriteRecall1, FavoriteRecall2,
  FavoriteRecall3, FavoriteStore0, FavoriteStore1, FavoriteStore2,
  FavoriteStore3, Guide, GuideNextDay, GuidePreviousDay, Info, InstantReplay,
  Link, ListProgram, LiveContent, Lock, MediaApps, MediaAudioTrack, MediaLast,
  MediaSkipBackward, MediaSkipForward, MediaStepBackward, MediaStepForward,
  MediaTopMenu, NavigateIn, NavigateNext, NavigateOut, NavigatePrevious,
  NextFavoriteChannel, NextUserProfile, OnDemand, Pairing, PinPDown, PinPMove,
  PinPUp, PlaySpeedDown, PlaySpeedReset, PlaySpeedUp, RandomToggle,
  RcLowBattery, RecordSpeedNext, RfBypass, ScanChannelsToggle, ScreenModeNext,
  Settings, SplitScreenToggle, STBInput, STBPower, Subtitle, Teletext,
  VideoModeNext, Wink, ZoomToggle, SpeechCorrectionList, SpeechInputToggle,
  Close, New, Open, Print, Save, SpellCheck, MailForward, MailReply, MailSend,
  LaunchCalculator, LaunchCalendar, LaunchContacts, LaunchMail,
  LaunchMediaPlayer, LaunchMusicPlayer, LaunchMyComputer, LaunchPhone,
  LaunchScreenSaver, LaunchSpreadsheet, LaunchWebBrowser, LaunchWebCam,
  LaunchWordProcessor, LaunchApplication1, LaunchApplication2,
  LaunchApplication3, LaunchApplication4, LaunchApplication5,
  LaunchApplication6, LaunchApplication7, LaunchApplication8,
  LaunchApplication9, LaunchApplication10, LaunchApplication11,
  LaunchApplication12, LaunchApplication13, LaunchApplication14,
  LaunchApplication15, LaunchApplication16, BrowserBack, BrowserFavorites,
  BrowserForward, BrowserHome, BrowserRefresh, BrowserSearch, BrowserStop,
  Key11, Key12, Separator
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L793) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L793)  
```
MouseButtons = enum
  NoButton = 0, PrimaryButton = 1, SecondaryButton = 2, AuxilaryButton = 4,
  FourthButton = 8, FifthButton = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1139)  
```
MouseEvent = ref MouseEventObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/MouseEvent) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1147)  
```
DataTransferItemKind {...}{.pure.} = enum
  File = "file", String = "string"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1161)  
```
DataTransferItem = ref DataTransferItemObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1165)  
```
DataTransfer = ref DataTransferObj
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1170)  
```
DataTransferDropEffect {...}{.pure.} = enum
  None = "none", Copy = "copy", Link = "link", Move = "move"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1178)  
```
DataTransferEffectAllowed {...}{.pure.} = enum
  None = "none", Copy = "copy", CopyLink = "copyLink", CopyMove = "copyMove",
  Link = "link", LinkMove = "linkMove", Move = "move", All = "all",
  Uninitialized = "uninitialized"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1184)  
```
DragEventTypes = enum
  Drag = "drag", DragEnd = "dragend", DragEnter = "dragenter",
  DragExit = "dragexit", DragLeave = "dragleave", DragOver = "dragover",
  DragStart = "dragstart", Drop = "drop"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1195)  
```
DragEvent {...}{.importc.} = object of MouseEvent
  dataTransfer*: DataTransfer
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1205)  
```
ClipboardEvent {...}{.importc.} = object of Event
  clipboardData*: DataTransfer
```
  see [docs](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardEvent) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1209)  
```
TouchList {...}{.importc.} = ref object of RootObj
  length*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1213)  
```
Touch = ref TouchObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1216)  
```
TouchEvent = ref TouchEventObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1225)  
```
Location = ref LocationObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1229)  
```
History = ref HistoryObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1241)  
```
Navigator = ref NavigatorObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1245)  
```
Plugin {...}{.importc.} = object of RootObj
  description*: cstring
  filename*: cstring
  name*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1265)  
```
MimeType {...}{.importc.} = object of RootObj
  description*: cstring
  enabledPlugin*: ref Plugin
  suffixes*: seq[cstring]
  `type`*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1270)  
```
LocationBar {...}{.importc.} = object of RootObj
  visible*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1276)  
```
MenuBar = LocationBar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1278)  
```
PersonalBar = LocationBar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1279)  
```
ScrollBars = LocationBar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1280)  
```
ToolBar = LocationBar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1281)  
```
StatusBar = LocationBar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1282)  
```
TimeOut {...}{.importc.} = ref object of RootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1293)  
```
Interval {...}{.importc.} = object of RootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1294)  
```
AddEventListenerOptions = object
  capture*: bool
  once*: bool
  passive*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1296)  
```
FontFaceSetReady {...}{.importc.} = ref object
  then*: proc (cb: proc ())
```
  see: [docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet/ready) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1301)  
```
FontFaceSet {...}{.importc.} = ref object
  ready*: FontFaceSetReady
  onloadingdone*: proc (event: Event)
```
  see: [docs](https://developer.mozilla.org/en-US/docs/Web/API/FontFaceSet) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1305)  
```
DomParser = ref object
```
  DOM Parser object (defined on browser only, may not be on NodeJS).* <https://developer.mozilla.org/en-US/docs/Web/API/DOMParser>

 
```
let prsr = newDomParser()
discard prsr.parseFromString("<html><marquee>Hello World</marquee></html>".cstring, "text/html".cstring)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1312)  
```
DomException = ref DOMExceptionObj
```
  The DOMException interface represents an abnormal event (called an exception) which occurs as a result of calling a method or accessing a property of a web API. Each exception has a name, which is a short "CamelCase" style string identifying the error or abnormal condition. <https://developer.mozilla.org/en-US/docs/Web/API/DOMException> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1320)  
```
FileReader = ref FileReaderObj
```
  The FileReader object lets web applications asynchronously read the contents of files (or raw data buffers) stored on the user's computer, using File or Blob objects to specify the file or data to read. <https://developer.mozilla.org/en-US/docs/Web/API/FileReader> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1329)  
```
FileReaderState = distinct range[0'u16 .. 2'u16]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1337)  
```
RootNodeOptions = object of RootObj
  composed*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1338)  
```
DocumentOrShadowRoot {...}{.importc.} = object of RootObj
  activeElement*: Element
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1340)  
```
ShadowRoot = ref ShadowRootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1343)  
```
ShadowRootInit = object of RootObj
  mode*: cstring
  delegatesFocus*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1349)  
```
HTMLSlotElement = ref HTMLSlotElementObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1353)  
```
SlotOptions = object of RootObj
  flatten*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1356)  
```
BoundingRect {...}{.importc.} = object
  top*, bottom*, left*, right*, x*, y*, width*, height*: float
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1694)   Vars
----

  
```
window: Window
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1669)  
```
navigator: Navigator
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1670)  
```
screen: Screen
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1671)  
```
document: Document
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1674)   Consts
------

  
```
DomApiVersion = 3
```
  the version of DOM API we try to follow. No guarantees though. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L17)  
```
fileReaderEmpty = 0'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1360)  
```
fileReaderLoading = 1'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1361) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1361)  
```
fileReaderDone = 2'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1362)   Procs
-----

  
```
proc id(n: Node): cstring {...}{.importcpp: "#.id", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1364)  
```
proc id=(n: Node; x: cstring) {...}{.importcpp: "#.id = #", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1365)  
```
proc class(n: Node): cstring {...}{.importcpp: "#.className", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1366)  
```
proc class=(n: Node; v: cstring) {...}{.importcpp: "#.className = #", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1367) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1367)  
```
proc value(n: Node): cstring {...}{.importcpp: "#.value", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1369)  
```
proc value=(n: Node; v: cstring) {...}{.importcpp: "#.value = #", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1370)  
```
proc disabled=(n: Node; v: bool) {...}{.importcpp: "#.disabled = #", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1372)  
```
proc len(x: Node): int {...}{.importcpp: "#.childNodes.length".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1450)  
```
proc `[]`(x: Node; idx: int): Element {...}{.importcpp: "#.childNodes[#]".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1451)  
```
proc getElementById(id: cstring): Element {...}{.importc: "document.getElementById",
    nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1452)  
```
proc appendChild(n, child: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1453)  
```
proc removeChild(n, child: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1454)  
```
proc remove(child: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1455)  
```
proc replaceChild(n, newNode, oldNode: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1456)  
```
proc insertBefore(n, newNode, before: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1457)  
```
proc getElementById(d: Document; id: cstring): Element {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1458)  
```
proc createElement(d: Document; identifier: cstring): Element {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1459)  
```
proc createTextNode(d: Document; identifier: cstring): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1460)  
```
proc createComment(d: Document; data: cstring): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1461)  
```
proc setTimeout(action: proc (); ms: int): TimeOut {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1463)  
```
proc clearTimeout(t: TimeOut) {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1464)  
```
proc addEventListener(et: EventTarget; ev: cstring; cb: proc (ev: Event);
                      useCapture: bool = false) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1469)  
```
proc addEventListener(et: EventTarget; ev: cstring; cb: proc (ev: Event);
                      options: AddEventListenerOptions) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1470)  
```
proc dispatchEvent(et: EventTarget; ev: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1471)  
```
proc removeEventListener(et: EventTarget; ev: cstring; cb: proc (ev: Event)) {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1472)  
```
proc alert(w: Window; msg: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1475)  
```
proc back(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1476)  
```
proc blur(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1477)  
```
proc clearInterval(w: Window; interval: ref Interval) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1478)  
```
proc clearTimeout(w: Window; timeout: ref TimeOut) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1479)  
```
proc close(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1480)  
```
proc confirm(w: Window; msg: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1481)  
```
proc disableExternalCapture(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1482) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1482)  
```
proc enableExternalCapture(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1483)  
```
proc find(w: Window; text: cstring; caseSensitive = false; backwards = false) {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1484)  
```
proc focus(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1486)  
```
proc forward(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1487)  
```
proc getComputedStyle(w: Window; e: Node; pe: Node = nil): Style {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1488)  
```
proc handleEvent(w: Window; e: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1489) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1489)  
```
proc home(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1490)  
```
proc moveBy(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1491)  
```
proc moveTo(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1492)  
```
proc open(w: Window; uri, windowname: cstring; properties: cstring = nil): Window {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1493)  
```
proc print(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1495)  
```
proc prompt(w: Window; text, default: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1496)  
```
proc resizeBy(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1497)  
```
proc resizeTo(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1498)  
```
proc routeEvent(w: Window; event: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1499)  
```
proc scrollBy(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1500)  
```
proc scrollTo(w: Window; x, y: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1501)  
```
proc setInterval(w: Window; code: cstring; pause: int): ref Interval {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1502)  
```
proc setInterval(w: Window; function: proc (); pause: int): ref Interval {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1503)  
```
proc setTimeout(w: Window; code: cstring; pause: int): ref TimeOut {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1504)  
```
proc setTimeout(w: Window; function: proc (); pause: int): ref Interval {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1505)  
```
proc stop(w: Window) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1506)  
```
proc requestAnimationFrame(w: Window; function: proc (time: float)): int {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1507)  
```
proc cancelAnimationFrame(w: Window; id: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1508)  
```
proc appendData(n: Node; data: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1511)  
```
proc cloneNode(n: Node; copyContent: bool): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1512)  
```
proc deleteData(n: Node; start, len: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1513)  
```
proc focus(e: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1514)  
```
proc getAttribute(n: Node; attr: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1515)  
```
proc getAttributeNode(n: Node; attr: cstring): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1516)  
```
proc hasAttribute(n: Node; attr: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1517)  
```
proc hasChildNodes(n: Node): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1518)  
```
proc normalize(n: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1519)  
```
proc insertData(n: Node; position: int; data: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1520)  
```
proc removeAttribute(n: Node; attr: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1521)  
```
proc removeAttributeNode(n, attr: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1522)  
```
proc replaceData(n: Node; start, len: int; text: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1523)  
```
proc scrollIntoView(n: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1524)  
```
proc setAttribute(n: Node; name, value: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1525)  
```
proc setAttributeNode(n: Node; attr: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1526)  
```
proc querySelector(n: Node; selectors: cstring): Element {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1527)  
```
proc querySelectorAll(n: Node; selectors: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1528)  
```
proc compareDocumentPosition(n: Node; otherNode: Node): int {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1529)  
```
proc lookupPrefix(n: Node): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1530)  
```
proc lookupNamespaceURI(n: Node): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1531)  
```
proc isDefaultNamespace(n: Node): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1532)  
```
proc contains(n: Node): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1533)  
```
proc isEqualNode(n: Node): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1534)  
```
proc isSameNode(n: Node): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1535)  
```
proc getRootNode(n: Node; options: RootNodeOptions): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1538)  
```
proc getSelection(n: DocumentOrShadowRoot): Selection {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1541)  
```
proc elementFromPoint(n: DocumentOrShadowRoot; x, y: float): Element {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1542)  
```
proc attachShadow(n: Element): ShadowRoot {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1545)  
```
proc assignedNodes(n: HTMLSlotElement; options: SlotOptions): seq[Node] {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1546)  
```
proc assignedElements(n: HTMLSlotElement; options: SlotOptions): seq[Element] {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1547)  
```
proc createAttribute(d: Document; identifier: cstring): Node {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1550)  
```
proc getElementsByName(d: Document; name: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1551)  
```
proc getElementsByTagName(d: Document; name: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1552) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1552)  
```
proc getElementsByClassName(d: Document; name: cstring): seq[Element] {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1553)  
```
proc insertNode(range: Range; node: Node) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1554)  
```
proc getSelection(d: Document): Selection {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1555)  
```
proc handleEvent(d: Document; event: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1556)  
```
proc open(d: Document) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1557)  
```
proc routeEvent(d: Document; event: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1558)  
```
proc write(d: Document; text: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1559)  
```
proc writeln(d: Document; text: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1560)  
```
proc querySelector(d: Document; selectors: cstring): Element {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1561)  
```
proc querySelectorAll(d: Document; selectors: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1562)  
```
proc blur(e: Element) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1565)  
```
proc click(e: Element) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1566)  
```
proc focus(e: Element) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1567)  
```
proc handleEvent(e: Element; event: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1568)  
```
proc select(e: Element) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1569)  
```
proc getElementsByTagName(e: Element; name: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1570)  
```
proc getElementsByClassName(e: Element; name: cstring): seq[Element] {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1571)  
```
proc reset(f: FormElement) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1574)  
```
proc submit(f: FormElement) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1575)  
```
proc checkValidity(e: FormElement): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1576)  
```
proc reportValidity(e: FormElement): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1577)  
```
proc play(e: EmbedElement) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1580)  
```
proc stop(e: EmbedElement) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1581)  
```
proc reload(loc: Location) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1584)  
```
proc replace(loc: Location; s: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1585)  
```
proc back(h: History) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1588)  
```
proc forward(h: History) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1589)  
```
proc go(h: History; pagesToJump: int) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1590)  
```
proc pushState[T](h: History; stateObject: T; title, url: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1591)  
```
proc javaEnabled(h: Navigator): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1594) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1594)  
```
proc canShare(self: Navigator; data: cstring): bool {...}{.importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/canShare> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1596)  
```
proc sendBeacon(self: Navigator; url, data: cstring): bool {...}{.importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/sendBeacon> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1597)  
```
proc vibrate(self: Navigator; pattern: cint): bool {...}{.importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1598)  
```
proc vibrate(self: Navigator; pattern: openArray[cint]): bool {...}{.importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/vibrate> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1599) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1599)  
```
proc registerProtocolHandler(self: Navigator; scheme, url, title: cstring) {...}{.
    importcpp.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/Navigator/registerProtocolHandler> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1600) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1600)  
```
proc add(c: ClassList; class: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1603)  
```
proc remove(c: ClassList; class: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1604)  
```
proc contains(c: ClassList; class: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1605)  
```
proc toggle(c: ClassList; class: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1606)  
```
proc getPropertyValue(s: Style; property: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1609)  
```
proc removeProperty(s: Style; property: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1610)  
```
proc setProperty(s: Style; property, value: cstring; priority = "") {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1611)  
```
proc getPropertyPriority(s: Style; property: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1612)  
```
proc preventDefault(ev: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1615)  
```
proc stopImmediatePropagation(ev: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1616)  
```
proc stopPropagation(ev: Event) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1617)  
```
proc getModifierState(ev: KeyboardEvent; keyArg: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1620)  
```
proc getModifierState(ev: MouseEvent; keyArg: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1623)  
```
proc identifiedTouch(list: TouchList): Touch {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1626)  
```
proc item(list: TouchList; i: int): Touch {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1627)  
```
proc clearData(dt: DataTransfer; format: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1630)  
```
proc getData(dt: DataTransfer; format: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1631)  
```
proc setData(dt: DataTransfer; format: cstring; data: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1632)  
```
proc setDragImage(dt: DataTransfer; img: Element; xOffset: int64; yOffset: int64) {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1633)  
```
proc getAsFile(dti: DataTransferItem): File {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1636)  
```
proc setSelectionRange(e: InputElement; selectionStart: int; selectionEnd: int;
                       selectionDirection: cstring = "none") {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1639)  
```
proc setRangeText(e: InputElement; replacement: cstring; startindex: int = 0;
                  endindex: int = 0; selectionMode: cstring = "preserve") {...}{.
    importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1640)  
```
proc setCustomValidity(e: InputElement; error: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1641)  
```
proc checkValidity(e: InputElement): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1642) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1642)  
```
proc slice(e: Blob; startindex: int = 0; endindex: int = e.size;
           contentType: cstring = "") {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1645)  
```
proc now(p: Performance): float {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1648)  
```
proc removeAllRanges(s: Selection) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1651)  
```
proc deleteFromDocument(s: Selection) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1652) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1652)  
```
proc getRangeAt(s: Selection; index: int): Range {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1653)  
```
proc `$`(s: Selection): string {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1655)  
```
proc getItem(ls: LocalStorage; key: cstring): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1658)  
```
proc setItem(ls: LocalStorage; key, value: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1659)  
```
proc hasItem(ls: LocalStorage; key: cstring): bool {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1660)  
```
proc clear(ls: LocalStorage) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1661)  
```
proc removeItem(ls: LocalStorage; key: cstring) {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1662)  
```
proc setAttr(n: Node; key, val: cstring) {...}{.importcpp: "#.setAttribute(@)".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1666)  
```
proc decodeURI(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1676)  
```
proc encodeURI(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1677)  
```
proc escape(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1679)  
```
proc unescape(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1680)  
```
proc decodeURIComponent(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1682)  
```
proc encodeURIComponent(uri: cstring): cstring {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1683)  
```
proc isFinite(x: BiggestFloat): bool {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1684)  
```
proc isNaN(x: BiggestFloat): bool {...}{.importc, nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1685)  
```
proc newEvent(name: cstring): Event {...}{.importcpp: "new Event(@)", constructor.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1687)  
```
proc getElementsByClass(n: Node; name: cstring): seq[Node] {...}{.
    importcpp: "#.getElementsByClassName(#)", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1689)  
```
proc getBoundingClientRect(e: Node): BoundingRect {...}{.
    importcpp: "getBoundingClientRect", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1697)  
```
proc clientHeight(): int {...}{.importcpp: "(window.innerHeight || document.documentElement.clientHeight)@",
                           nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1699)  
```
proc clientWidth(): int {...}{.importcpp: "(window.innerWidth || document.documentElement.clientWidth)@",
                          nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1701)  
```
proc inViewport(el: Node): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1704)  
```
proc scrollTop(e: Node): int {...}{.importcpp: "#.scrollTop", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1710)  
```
proc scrollTop=(e: Node; value: int) {...}{.importcpp: "#.scrollTop = #", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1711)  
```
proc scrollLeft(e: Node): int {...}{.importcpp: "#.scrollLeft", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1712)  
```
proc scrollHeight(e: Node): int {...}{.importcpp: "#.scrollHeight", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1713)  
```
proc scrollWidth(e: Node): int {...}{.importcpp: "#.scrollWidth", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1714)  
```
proc offsetHeight(e: Node): int {...}{.importcpp: "#.offsetHeight", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1715)  
```
proc offsetWidth(e: Node): int {...}{.importcpp: "#.offsetWidth", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1716)  
```
proc offsetTop(e: Node): int {...}{.importcpp: "#.offsetTop", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1717)  
```
proc offsetLeft(e: Node): int {...}{.importcpp: "#.offsetLeft", nodecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1718)  
```
proc newDomException(): DomException {...}{.importcpp: "new DomException()",
                                       constructor.}
```
  DOM Exception constructor [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1726)  
```
proc message(ex: DomException): cstring {...}{.importcpp: "#.message", nodecl.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/DOMException/message> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1728)  
```
proc name(ex: DomException): cstring {...}{.importcpp: "#.name", nodecl.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/DOMException/name> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1730) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1730)  
```
proc newFileReader(): FileReader {...}{.importcpp: "new FileReader()", constructor.}
```
  File Reader constructor [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1733) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1733)  
```
proc error(f: FileReader): DomException {...}{.importcpp: "#.error", nodecl.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/error> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1735)  
```
proc readyState(f: FileReader): FileReaderState {...}{.importcpp: "#.readyState",
    nodecl.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readyState> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1737)  
```
proc resultAsString(f: FileReader): cstring {...}{.importcpp: "#.result", nodecl.}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/result> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1739)  
```
proc abort(f: FileReader) {...}{.importcpp: "#.abort()".}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/abort> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1741)  
```
proc readAsBinaryString(f: FileReader; b: Blob) {...}{.
    importcpp: "#.readAsBinaryString(#)".}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsBinaryString> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1743) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1743)  
```
proc readAsDataURL(f: FileReader; b: Blob) {...}{.importcpp: "#.readAsDataURL(#)".}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1745)  
```
proc readAsText(f: FileReader; b: Blob; encoding = cstring"UTF-8") {...}{.
    importcpp: "#.readAsText(#, #)".}
```
  <https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsText> [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1747)   Funcs
-----

  
```
func newDomParser(): DomParser {...}{.importcpp: "new DOMParser()".}
```
  DOM Parser constructor. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1721) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1721)  
```
func parseFromString(this: DomParser; str: cstring; mimeType: cstring): Document {...}{.
    importcpp.}
```
  Parse from string to `Document`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1723)   Converters
----------

  
```
converter toString(s: Selection): cstring {...}{.importcpp.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/js/dom.nim#L1654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/js/dom.nim#L1654)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/dom.html>

registry
========

 This module is experimental and its interface may change.

 Imports
-------

  <winlean>, <os>  Types
-----

  
```
HKEY = uint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/registry.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/registry.nim#L15)   Consts
------

  
```
HKEY_LOCAL_MACHINE = 2147483650'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/registry.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/registry.nim#L18)  
```
HKEY_CURRENT_USER = 2147483649'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/registry.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/registry.nim#L19)   Procs
-----

  
```
proc getUnicodeValue(path, key: string; handle: HKEY): string {...}{.
    raises: [OSError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/registry.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/registry.nim#L46)  
```
proc setUnicodeValue(path, key, val: string; handle: HKEY) {...}{.raises: [OSError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/windows/registry.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/windows/registry.nim#L72)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/registry.html>

posix
=====


This is a raw POSIX interface module. It does not not provide any convenience: cstrings are used instead of proper Nim strings and return codes indicate errors. If you want exceptions and a proper Nim-like interface, use the OS module or write a wrapper.

 For high-level wrappers specialized for Linux and BSDs see: <posix_utils>

 Coding conventions: ALL types are named the same as in the POSIX standard except that they start with 'T' or 'P' (if they are pointers) and without the '\_t' suffix to be consistent with Nim conventions. If an identifier is a Nim keyword the `identifier` notation is used.

 This library relies on the header files of your C compiler. The resulting C code will just `#include <XYZ.h>` and *not* define the symbols declared here.

 Types
-----

  
```
DIR {...}{.importc: "DIR", header: "<dirent.h>", incompleteStruct.} = object
```
  A type representing a directory stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L31)  
```
SocketHandle = distinct cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L35)  
```
Time {...}{.importc: "time_t", header: "<time.h>".} = distinct clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L38)  
```
Timespec {...}{.importc: "struct timespec", header: "<time.h>", final, pure.} = object
  tv_sec*: Time              ## Seconds.
  tv_nsec*: clong            ## Nanoseconds.
```
  struct timespec [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L41)  
```
Dirent {...}{.importc: "struct dirent", header: "<dirent.h>", final, pure.} = object
  d_ino*: Ino
  d_off*: Off
  d_reclen*: cushort
  d_type*: int8
  d_name*: array[256, cchar]
```
  dirent\_t struct [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L46)  
```
Tflock {...}{.importc: "struct flock", final, pure, header: "<fcntl.h>".} = object
  l_type*: cshort            ## Type of lock; F_RDLCK, F_WRLCK, F_UNLCK.
  l_whence*: cshort          ## Flag for starting offset.
  l_start*: Off              ## Relative offset in bytes.
  l_len*: Off                ## Size; if 0 then until EOF.
  l_pid*: Pid                ## Process ID of the process holding the lock;
                             ## returned with F_GETLK.
```
  flock type [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L54)  
```
Glob {...}{.importc: "glob_t", header: "<glob.h>", final, pure.} = object
  gl_pathc*: csize_t         ## Count of paths matched by pattern.
  gl_pathv*: cstringArray    ## Pointer to a list of matched pathnames.
  gl_offs*: csize_t          ## Slots to reserve at the beginning of gl_pathv.
  gl_flags*: cint
  gl_closedir*: pointer
  gl_readdir*: pointer
  gl_opendir*: pointer
  gl_lstat*: pointer
  gl_stat*: pointer
```
  glob\_t [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L65)  
```
Group {...}{.importc: "struct group", header: "<grp.h>", final, pure.} = object
  gr_name*: cstring          ## The name of the group.
  gr_passwd*: cstring
  gr_gid*: Gid               ## Numerical group ID.
  gr_mem*: cstringArray      ## Pointer to a null-terminated array of character
                             ## pointers to member names.
```
  struct group [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L77)  
```
Iconv {...}{.importc: "iconv_t", header: "<iconv.h>".} = pointer
```
  Identifies the conversion from one codeset to another. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L84)  
```
Lconv {...}{.importc: "struct lconv", header: "<locale.h>", final, pure.} = object
  decimal_point*: cstring
  thousands_sep*: cstring
  grouping*: cstring
  int_curr_symbol*: cstring
  currency_symbol*: cstring
  mon_decimal_point*: cstring
  mon_thousands_sep*: cstring
  mon_grouping*: cstring
  positive_sign*: cstring
  negative_sign*: cstring
  int_frac_digits*: char
  frac_digits*: char
  p_cs_precedes*: char
  p_sep_by_space*: char
  n_cs_precedes*: char
  n_sep_by_space*: char
  p_sign_posn*: char
  n_sign_posn*: char
  int_p_cs_precedes*: char
  int_p_sep_by_space*: char
  int_n_cs_precedes*: char
  int_n_sep_by_space*: char
  int_p_sign_posn*: char
  int_n_sign_posn*: char
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L88)  
```
Mqd {...}{.importc: "mqd_t", header: "<mqueue.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L114)  
```
MqAttr {...}{.importc: "struct mq_attr", header: "<mqueue.h>", final, pure.} = object
  mq_flags*: clong           ## Message queue flags.
  mq_maxmsg*: clong          ## Maximum number of messages.
  mq_msgsize*: clong         ## Maximum message size.
  mq_curmsgs*: clong         ## Number of messages currently queued.
  pad: array[4, clong]
```
  message queue attribute [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L117)  
```
Passwd {...}{.importc: "struct passwd", header: "<pwd.h>", final, pure.} = object
  pw_name*: cstring          ## User's login name.
  pw_passwd*: cstring
  pw_uid*: Uid               ## Numerical user ID.
  pw_gid*: Gid               ## Numerical group ID.
  pw_gecos*: cstring
  pw_dir*: cstring           ## Initial working directory.
  pw_shell*: cstring         ## Program to use as shell.
```
  struct passwd [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L125)  
```
Blkcnt {...}{.importc: "blkcnt_t", header: "<sys/types.h>".} = clong
```
  used for file block counts [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L134)  
```
Blksize {...}{.importc: "blksize_t", header: "<sys/types.h>".} = clong
```
  used for block sizes [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L136)  
```
Clock {...}{.importc: "clock_t", header: "<sys/types.h>".} = clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L138)  
```
ClockId {...}{.importc: "clockid_t", header: "<sys/types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L139)  
```
Dev {...}{.importc: "dev_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L140)  
```
Fsblkcnt {...}{.importc: "fsblkcnt_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L141)  
```
Fsfilcnt {...}{.importc: "fsfilcnt_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L142)  
```
Gid {...}{.importc: "gid_t", header: "<sys/types.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L143)  
```
Id {...}{.importc: "id_t", header: "<sys/types.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L144)  
```
Ino {...}{.importc: "ino_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L145)  
```
Key {...}{.importc: "key_t", header: "<sys/types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L146)  
```
Mode {...}{.importc: "mode_t", header: "<sys/types.h>".} = uint32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L147)  
```
Nlink {...}{.importc: "nlink_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L148)  
```
Off {...}{.importc: "off_t", header: "<sys/types.h>".} = clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L149)  
```
Pid {...}{.importc: "pid_t", header: "<sys/types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L150)  
```
Pthread_attr {...}{.importc: "pthread_attr_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[56 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L152)  
```
Pthread_barrier {...}{.importc: "pthread_barrier_t", header: "<sys/types.h>", pure,
                  final.} = object
  abi: array[32 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L156)  
```
Pthread_barrierattr {...}{.importc: "pthread_barrierattr_t", header: "<sys/types.h>",
                      pure, final.} = object
  abi: array[4 div 4, cint]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L159)  
```
Pthread_cond {...}{.importc: "pthread_cond_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[48 div 8, clonglong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L163)  
```
Pthread_condattr {...}{.importc: "pthread_condattr_t", header: "<sys/types.h>", pure,
                   final.} = object
  abi: array[4 div 4, cint]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L166)  
```
Pthread_key {...}{.importc: "pthread_key_t", header: "<sys/types.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L168)  
```
Pthread_mutex {...}{.importc: "pthread_mutex_t", header: "<sys/types.h>", pure, final.} = object
  abi: array[48 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L170)  
```
Pthread_mutexattr {...}{.importc: "pthread_mutexattr_t", header: "<sys/types.h>",
                    pure, final.} = object
  abi: array[4 div 4, cint]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L173)  
```
Pthread_once {...}{.importc: "pthread_once_t", header: "<sys/types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L175)  
```
Pthread_rwlock {...}{.importc: "pthread_rwlock_t", header: "<sys/types.h>", pure,
                 final.} = object
  abi: array[56 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L177)  
```
Pthread_rwlockattr {...}{.importc: "pthread_rwlockattr_t", header: "<sys/types.h>".} = object
  abi: array[8 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L180)  
```
Pthread_spinlock {...}{.importc: "pthread_spinlock_t", header: "<sys/types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L183)  
```
Pthread {...}{.importc: "pthread_t", header: "<sys/types.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L184)  
```
Suseconds {...}{.importc: "suseconds_t", header: "<sys/types.h>".} = clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L185)  
```
Timer {...}{.importc: "timer_t", header: "<sys/types.h>".} = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L187)  
```
Uid {...}{.importc: "uid_t", header: "<sys/types.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L188)  
```
Useconds {...}{.importc: "useconds_t", header: "<sys/types.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L189)  
```
Utsname {...}{.importc: "struct utsname", header: "<sys/utsname.h>", final, pure.} = object
  sysname*,                 ## Name of this implementation of the operating system.
  nodename*,                ## Name of this node within the communications
                             ## network to which this node is attached, if any.
  release*,                 ## Current release level of this implementation.
  version*,                 ## Current version level of this release.
  machine*,                 ## Name of the hardware type on which the
                             ## system is running.
  domainname*: array[65, char]
```
  struct utsname [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L193)  
```
Sem {...}{.importc: "sem_t", header: "<semaphore.h>", final, pure.} = object
  abi: array[32 div 8, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L203)  
```
Ipc_perm {...}{.importc: "struct ipc_perm", header: "<sys/ipc.h>", final, pure.} = object
  key: Key
  uid*: Uid                  ## Owner's user ID.
  gid*: Gid                  ## Owner's group ID.
  cuid*: Uid                 ## Creator's user ID.
  cgid*: Gid                 ## Creator's group ID.
  mode*: cshort              ## Read/write permission.
  pad1: cshort
  seq1: cshort
  pad2: cshort
  reserved1: culong
  reserved2: culong
```
  struct ipc\_perm [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L207)  
```
Stat {...}{.importc: "struct stat", header: "<sys/stat.h>", final, pure.} = object
  st_dev*: Dev               ## Device ID of device containing file.
  st_ino*: Ino               ## File serial number.
  st_nlink*: Nlink           ## Number of hard links to the file.
  st_mode*: Mode             ## Mode of file (see below).
  st_uid*: Uid               ## User ID of file.
  st_gid*: Gid               ## Group ID of file.
  pad0 {...}{.importc: "__pad0".}: cint
  st_rdev*: Dev              ## Device ID (if file is character or block special).
  st_size*: Off              ## For regular files, the file size in bytes.
                             ## For symbolic links, the length in bytes of the
                             ## pathname contained in the symbolic link.
                             ## For a shared memory object, the length in bytes.
                             ## For a typed memory object, the length in bytes.
                             ## For other file types, the use of this field is
                             ## unspecified.
  st_blksize*: Blksize       ## A file system-specific preferred I/O block size
                             ## 
                             ## for this object. In some file system types, this
                             ## 
                             ## may vary from file to file.
  st_blocks*: Blkcnt         ## Number of blocks allocated for this object.
  st_atim*: Timespec         ## Time of last access.
  st_mtim*: Timespec         ## Time of last data modification.
  st_ctim*: Timespec         ## Time of last status change.
```
  struct stat [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L221)  
```
Statvfs {...}{.importc: "struct statvfs", header: "<sys/statvfs.h>", final, pure.} = object
  f_bsize*: culong           ## File system block size.
  f_frsize*: culong          ## Fundamental file system block size.
  f_blocks*: Fsblkcnt        ## Total number of blocks on file system
                             ## in units of f_frsize.
  f_bfree*: Fsblkcnt         ## Total number of free blocks.
  f_bavail*: Fsblkcnt        ## Number of free blocks available to
                             ## non-privileged process.
  f_files*: Fsfilcnt         ## Total number of file serial numbers.
  f_ffree*: Fsfilcnt         ## Total number of free file serial numbers.
  f_favail*: Fsfilcnt        ## Number of file serial numbers available to
                             ## non-privileged process.
  f_fsid*: culong            ## File system ID.
  f_flag*: culong            ## Bit mask of f_flag values.
  f_namemax*: culong         ## Maximum filename length.
  f_spare: array[6, cint]
```
  struct statvfs [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L246)  
```
Tm {...}{.importc: "struct tm", header: "<time.h>", final, pure.} = object
  tm_sec*: cint              ## Seconds [0,60].
  tm_min*: cint              ## Minutes [0,59].
  tm_hour*: cint             ## Hour [0,23].
  tm_mday*: cint             ## Day of month [1,31].
  tm_mon*: cint              ## Month of year [0,11].
  tm_year*: cint             ## Years since 1900.
  tm_wday*: cint             ## Day of week [0,6] (Sunday =0).
  tm_yday*: cint             ## Day of year [0,365].
  tm_isdst*: cint            ## Daylight Savings flag.
  tm_gmtoff*: clong
  tm_zone*: cstring
```
  struct tm [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L266)  
```
Itimerspec {...}{.importc: "struct itimerspec", header: "<time.h>", final, pure.} = object
  it_interval*: Timespec     ## Timer period.
  it_value*: Timespec        ## Timer expiration.
```
  struct itimerspec [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L280)  
```
Sig_atomic {...}{.importc: "sig_atomic_t", header: "<signal.h>".} = cint
```
  Possibly volatile-qualified integer type of an object that can be accessed as an atomic entity, even in the presence of asynchronous interrupts. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L284)  
```
Sigset {...}{.importc: "sigset_t", header: "<signal.h>", final, pure.} = object
  abi: array[1024 div 64, culong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L288)  
```
SigEvent {...}{.importc: "struct sigevent", header: "<signal.h>", final, pure.} = object
  sigev_value*: SigVal       ## Signal value.
  sigev_signo*: cint         ## Signal number.
  sigev_notify*: cint        ## Notification type.
  sigev_notify_function*: proc (x: SigVal) {...}{.noconv.} ## Notification func.
  sigev_notify_attributes*: ptr Pthread_attr ## Notification attributes.
  abi: array[12, int]
```
  struct sigevent [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L292)  
```
SigVal {...}{.importc: "union sigval", header: "<signal.h>", final, pure.} = object
  sival_ptr*: pointer        ## pointer signal value;
                             ## integer signal value not defined!
```
  struct sigval [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L301)  
```
Sigaction {...}{.importc: "struct sigaction", header: "<signal.h>", final, pure.} = object
  sa_handler*: proc (x: cint) {...}{.noconv.} ## Pointer to a signal-catching
                                         ## function or one of the macros
                                         ## SIG_IGN or SIG_DFL.
  sa_mask*: Sigset           ## Set of signals to be blocked during execution of
                             ## the signal handling function.
  sa_flags*: cint            ## Special flags.
  sa_sigaction*: proc (x: cint; y: ptr SigInfo; z: pointer) {...}{.noconv.}
```
  struct sigaction [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L305)  
```
Stack {...}{.importc: "stack_t", header: "<signal.h>", final, pure.} = object
  ss_sp*: pointer            ## Stack base or pointer.
  ss_size*: int              ## Stack size.
  ss_flags*: cint            ## Flags.
```
  stack\_t [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L315)  
```
SigStack {...}{.importc: "struct sigstack", header: "<signal.h>", final, pure.} = object
  ss_onstack*: cint          ## Non-zero when signal stack is in use.
  ss_sp*: pointer            ## Signal stack pointer.
```
  struct sigstack [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L321)  
```
SigInfo {...}{.importc: "siginfo_t", header: "<signal.h>", final, pure.} = object
  si_signo*: cint            ## Signal number.
  si_code*: cint             ## Signal code.
  si_errno*: cint            ## If non-zero, an errno value associated with
                             ## this signal, as defined in <errno.h>.
  si_pid*: Pid               ## Sending process ID.
  si_uid*: Uid               ## Real user ID of sending process.
  si_addr*: pointer          ## Address of faulting instruction.
  si_status*: cint           ## Exit value or signal.
  si_band*: int              ## Band event for SIGPOLL.
  si_value*: SigVal          ## Signal value.
  pad {...}{.importc: "_pad".}: array[128 - 56, uint8]
```
  siginfo\_t [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L326)  
```
Nl_item {...}{.importc: "nl_item", header: "<nl_types.h>".} = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L339)  
```
Nl_catd {...}{.importc: "nl_catd", header: "<nl_types.h>".} = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L340)  
```
Sched_param {...}{.importc: "struct sched_param", header: "<sched.h>", final, pure.} = object
  sched_priority*: cint
```
  struct sched\_param [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L344)  
```
Timeval {...}{.importc: "struct timeval", header: "<sys/select.h>", final, pure.} = object
  tv_sec*: Time              ## Seconds.
  tv_usec*: Suseconds        ## Microseconds.
```
  struct timeval [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L348)  
```
TFdSet {...}{.importc: "fd_set", header: "<sys/select.h>", final, pure.} = object
  abi: array[1024 div 64, clong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L352)  
```
Mcontext {...}{.importc: "mcontext_t", header: "<ucontext.h>", final, pure.} = object
  gregs: array[23, clonglong]
  fpregs: pointer
  reserved1: array[8, clonglong]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L356)  
```
Ucontext {...}{.importc: "ucontext_t", header: "<ucontext.h>", final, pure.} = object
  uc_flags: clong
  uc_link*: ptr Ucontext     ## Pointer to the context that is resumed
                             ## when this context returns.
  uc_stack*: Stack           ## The stack used by this context.
  uc_mcontext*: Mcontext     ## A machine-specific representation of the saved
                             ## 
                             ## context.
  uc_sigmask*: Sigset        ## The set of signals that are blocked when this
                             ## context is active.
```
  ucontext\_t [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L362)  
```
Taiocb {...}{.importc: "struct aiocb", header: "<aio.h>", final, pure.} = object
  aio_fildes*: cint          ## File descriptor.
  aio_lio_opcode*: cint      ## Operation to be performed.
  aio_reqprio*: cint         ## Request priority offset.
  aio_buf*: pointer          ## Location of buffer.
  aio_nbytes*: csize_t       ## Length of transfer.
  aio_sigevent*: SigEvent    ## Signal number and value.
  next_prio: pointer
  abs_prio: cint
  policy: cint
  error_Code: cint
  return_value: clong
  aio_offset*: Off           ## File offset.
  reserved: array[32, uint8]
```
  struct aiocb [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L375)  
```
Tposix_spawnattr {...}{.importc: "posix_spawnattr_t", header: "<spawn.h>", final,
                   pure.} = object
  flags: cshort
  pgrp: Pid
  sd: Sigset
  ss: Sigset
  sp: Sched_param
  policy: cint
  pad: array[16, cint]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L394)  
```
Tposix_spawn_file_actions {...}{.importc: "posix_spawn_file_actions_t",
                            header: "<spawn.h>", final, pure.} = object
  allocated: cint
  used: cint
  actions: pointer
  pad: array[16, cint]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L404)  
```
SockLen {...}{.importc: "socklen_t", header: "<sys/socket.h>".} = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L414)  
```
TSa_Family {...}{.importc: "sa_family_t", header: "<sys/socket.h>".} = cushort
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L415)  
```
SockAddr {...}{.importc: "struct sockaddr", header: "<sys/socket.h>", pure, final.} = object
  sa_family*: TSa_Family     ## Address family.
  sa_data*: array[14, char]  ## Socket address (variable-length data).
```
  struct sockaddr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L418)  
```
Sockaddr_un {...}{.importc: "struct sockaddr_un", header: "<sys/un.h>", pure, final.} = object
  sun_family*: TSa_Family    ## Address family.
  sun_path*: array[108, char] ## Socket path
```
  struct sockaddr\_un [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L423)  
```
Sockaddr_storage {...}{.importc: "struct sockaddr_storage", header: "<sys/socket.h>",
                   pure, final.} = object
  ss_family*: TSa_Family     ## Address family.
  ss_padding: array[126 - 8, char]
  ss_align: clong
```
  struct sockaddr\_storage [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L429)  
```
Tif_nameindex {...}{.importc: "struct if_nameindex", final, pure,
                header: "<net/if.h>".} = object
  if_index*: cuint           ## Numeric index of the interface.
  if_name*: cstring          ## Null-terminated name of the interface.
```
  struct if\_nameindex [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L435)  
```
IOVec {...}{.importc: "struct iovec", pure, final, header: "<sys/uio.h>".} = object
  iov_base*: pointer         ## Base address of a memory region for input or output.
  iov_len*: csize_t          ## The size of the memory pointed to by iov_base.
```
  struct iovec [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L441)  
```
Tmsghdr {...}{.importc: "struct msghdr", pure, final, header: "<sys/socket.h>".} = object
  msg_name*: pointer         ## Optional address.
  msg_namelen*: SockLen      ## Size of address.
  msg_iov*: ptr IOVec        ## Scatter/gather array.
  msg_iovlen*: csize_t       ## Members in msg_iov.
  msg_control*: pointer      ## Ancillary data; see below.
  msg_controllen*: csize_t   ## Ancillary data buffer len.
  msg_flags*: cint           ## Flags on received message.
```
  struct msghdr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L446)  
```
Tcmsghdr {...}{.importc: "struct cmsghdr", pure, final, header: "<sys/socket.h>".} = object
  cmsg_len*: csize_t         ## Data byte count, including the cmsghdr.
  cmsg_level*: cint          ## Originating protocol.
  cmsg_type*: cint           ## Protocol-specific type.
```
  struct cmsghdr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L457)  
```
TLinger {...}{.importc: "struct linger", pure, final, header: "<sys/socket.h>".} = object
  l_onoff*: cint             ## Indicates whether linger option is enabled.
  l_linger*: cint            ## Linger time, in seconds.
```
  struct linger [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L463)  
```
InPort = uint16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L468)  
```
InAddrScalar = uint32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L469)  
```
InAddrT {...}{.importc: "in_addr_t", pure, final, header: "<netinet/in.h>".} = uint32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L472)  
```
InAddr {...}{.importc: "struct in_addr", pure, final, header: "<netinet/in.h>".} = object
  s_addr*: InAddrScalar
```
  struct in\_addr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L475)  
```
Sockaddr_in {...}{.importc: "struct sockaddr_in", pure, final,
              header: "<netinet/in.h>".} = object
  sin_family*: TSa_Family    ## AF_INET.
  sin_port*: InPort          ## Port number.
  sin_addr*: InAddr          ## IP address.
  sin_zero: array[12 - 4, uint8]
```
  struct sockaddr\_in [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L479)  
```
In6Addr {...}{.importc: "struct in6_addr", pure, final, header: "<netinet/in.h>".} = object
  s6_addr*: array[0 .. 15, char]
```
  struct in6\_addr [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L486)  
```
Sockaddr_in6 {...}{.importc: "struct sockaddr_in6", pure, final,
               header: "<netinet/in.h>".} = object
  sin6_family*: TSa_Family   ## AF_INET6.
  sin6_port*: InPort         ## Port number.
  sin6_flowinfo*: uint32     ## IPv6 traffic class and flow information.
  sin6_addr*: In6Addr        ## IPv6 address.
  sin6_scope_id*: uint32     ## Set of interfaces for a scope.
```
  struct sockaddr\_in6 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L490)  
```
Tipv6_mreq {...}{.importc: "struct ipv6_mreq", pure, final, header: "<netinet/in.h>".} = object
  ipv6mr_multiaddr*: In6Addr ## IPv6 multicast address.
  ipv6mr_interface*: cuint   ## Interface index.
```
  struct ipv6\_mreq [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L498)  
```
Hostent {...}{.importc: "struct hostent", pure, final, header: "<netdb.h>".} = object
  h_name*: cstring           ## Official name of the host.
  h_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative host names, terminated by a
                             ## null pointer.
  h_addrtype*: cint          ## Address type.
  h_length*: cint            ## The length, in bytes, of the address.
  h_addr_list*: cstringArray ## A pointer to an array of pointers to network
                             ## 
                             ## addresses (in network byte order) for the
                             ## host, 
                             ## terminated by a null pointer.
```
  struct hostent [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L503)  
```
Tnetent {...}{.importc: "struct netent", pure, final, header: "<netdb.h>".} = object
  n_name*: cstring           ## Official, fully-qualified (including the
                             ## domain) name of the host.
  n_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative network names, terminated by a
                             ## null 
                             ## pointer.
  n_addrtype*: cint          ## The address type of the network.
  n_net*: uint32             ## The network number, in host byte order.
```
  struct netent [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L515)  
```
Protoent {...}{.importc: "struct protoent", pure, final, header: "<netdb.h>".} = object
  p_name*: cstring           ## Official name of the protocol.
  p_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative protocol names, terminated by
                             ## a null 
                             ## pointer.
  p_proto*: cint             ## The protocol number.
```
  struct protoent [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L525)  
```
Servent {...}{.importc: "struct servent", pure, final, header: "<netdb.h>".} = object
  s_name*: cstring           ## Official name of the service.
  s_aliases*: cstringArray   ## A pointer to an array of pointers to
                             ## alternative service names, terminated by
                             ## a null pointer.
  s_port*: cint              ## The port number at which the service
                             ## resides, in network byte order.
  s_proto*: cstring          ## The name of the protocol to use when
                             ## contacting the service.
```
  struct servent [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L533)  
```
AddrInfo {...}{.importc: "struct addrinfo", pure, final, header: "<netdb.h>".} = object
  ai_flags*: cint            ## Input flags.
  ai_family*: cint           ## Address family of socket.
  ai_socktype*: cint         ## Socket type.
  ai_protocol*: cint         ## Protocol of socket.
  ai_addrlen*: SockLen       ## Length of socket address.
  ai_addr*: ptr SockAddr     ## Socket address of socket.
  ai_canonname*: cstring     ## Canonical name of service location.
  ai_next*: ptr AddrInfo     ## Pointer to next in list.
```
  struct addrinfo [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L544)  
```
TPollfd {...}{.importc: "struct pollfd", pure, final, header: "<poll.h>".} = object
  fd*: cint                  ## The following descriptor being polled.
  events*: cshort            ## The input event flags (see below).
  revents*: cshort           ## The output event flags (see below).
```
  struct pollfd [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L555)  
```
Tnfds {...}{.importc: "nfds_t", header: "<poll.h>".} = culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L560)  
```
Rusage {...}{.importc: "struct rusage", header: "<sys/resource.h>", bycopy.} = object
  ru_utime*, ru_stime*: Timeval
  ru_maxrss*, ru_ixrss*, ru_idrss*, ru_isrss*, ru_minflt*, ru_majflt*,
  ru_nswap*, ru_inblock*, ru_oublock*, ru_msgsnd*, ru_msgrcv*, ru_nsignals*,
  ru_nvcsw*, ru_nivcsw*: clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L701)  
```
RLimit {...}{.importc: "struct rlimit", header: "<sys/resource.h>", pure, final.} = object
  rlim_cur*: int
  rlim_max*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1099) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1099)   Vars
----

  
```
errno: cint
```
  error variable [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L563)  
```
h_errno: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L564)  
```
daylight: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L565)  
```
timezone: clong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L566)  
```
in6addr_any: In6Addr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L162)  
```
in6addr_loopback: In6Addr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L163)   Consts
------

  
```
MM_NULLLBL = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L66)  
```
MM_NULLSEV = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L67)  
```
MM_NULLMC = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L68)  
```
MM_NULLTXT = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L69)  
```
MM_NULLACT = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L70)  
```
MM_NULLTAG = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L71)  
```
STDERR_FILENO = 2
```
  File number of stderr; [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L73)  
```
STDIN_FILENO = 0
```
  File number of stdin; [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L74)  
```
STDOUT_FILENO = 1
```
  File number of stdout; [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L75)  
```
DT_UNKNOWN = 0
```
  Unknown file type. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L77)  
```
DT_FIFO = 1
```
  Named pipe, or FIFO. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L78)  
```
DT_CHR = 2
```
  Character device. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L79)  
```
DT_DIR = 4
```
  Directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L80)  
```
DT_BLK = 6
```
  Block device. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L81)  
```
DT_REG = 8
```
  Regular file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L82)  
```
DT_LNK = 10
```
  Symbolic link. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L83)  
```
DT_SOCK = 12
```
  UNIX domain socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L84)  
```
DT_WHT = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L85)  
```
StatHasNanoseconds = true
```
  Boolean flag that indicates if the system supports nanosecond time resolution in the fields of `Stat`. Note that the nanosecond based fields (`Stat.st_atim`, `Stat.st_mtim` and `Stat.st_ctim`) can be accessed without checking this flag, because this module defines fallback procs when they are not available. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L90)  
```
Sockaddr_un_path_length = 108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L411) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L411)  
```
AIO_ALLDONE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L5) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L5)  
```
AIO_CANCELED = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L6)  
```
AIO_NOTCANCELED = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L7) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L7)  
```
LIO_NOP = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L8) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L8)  
```
LIO_NOWAIT = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L9) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L9)  
```
LIO_READ = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L10)  
```
LIO_WAIT = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L11)  
```
LIO_WRITE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L12)  
```
RTLD_LAZY = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L15)  
```
RTLD_NOW = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L16)  
```
RTLD_GLOBAL = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L17)  
```
RTLD_LOCAL = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L18)  
```
E2BIG = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L21)  
```
EACCES = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L22)  
```
EADDRINUSE = 98'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L23)  
```
EADDRNOTAVAIL = 99'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L24)  
```
EAFNOSUPPORT = 97'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L25)  
```
EAGAIN = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L26)  
```
EALREADY = 114'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L27)  
```
EBADF = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L28)  
```
EBADMSG = 74'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L29)  
```
EBUSY = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L30)  
```
ECANCELED = 125'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L31)  
```
ECHILD = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L32)  
```
ECONNABORTED = 103'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L33)  
```
ECONNREFUSED = 111'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L34)  
```
ECONNRESET = 104'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L35)  
```
EDEADLK = 35'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L36)  
```
EDESTADDRREQ = 89'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L37)  
```
EDOM = 33'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L38)  
```
EDQUOT = 122'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L39)  
```
EEXIST = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L40)  
```
EFAULT = 14'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L41)  
```
EFBIG = 27'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L42)  
```
EHOSTUNREACH = 113'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L43)  
```
EIDRM = 43'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L44)  
```
EILSEQ = 84'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L45)  
```
EINPROGRESS = 115'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L46)  
```
EINTR = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L47)  
```
EINVAL = 22'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L48)  
```
EIO = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L49)  
```
EISCONN = 106'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L50)  
```
EISDIR = 21'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L51)  
```
ELOOP = 40'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L52)  
```
EMFILE = 24'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L53)  
```
EMLINK = 31'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L54)  
```
EMSGSIZE = 90'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L55)  
```
EMULTIHOP = 72'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L56)  
```
ENAMETOOLONG = 36'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L57)  
```
ENETDOWN = 100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L58)  
```
ENETRESET = 102'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L59)  
```
ENETUNREACH = 101'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L60)  
```
ENFILE = 23'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L61)  
```
ENOBUFS = 105'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L62)  
```
ENODATA = 61'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L63)  
```
ENODEV = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L64)  
```
ENOENT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L65)  
```
ENOEXEC = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L66)  
```
ENOLCK = 37'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L67)  
```
ENOLINK = 67'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L68)  
```
ENOMEM = 12'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L69)  
```
ENOMSG = 42'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L70)  
```
ENOPROTOOPT = 92'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L71)  
```
ENOSPC = 28'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L72)  
```
ENOSR = 63'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L73)  
```
ENOSTR = 60'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L74)  
```
ENOSYS = 38'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L75)  
```
ENOTCONN = 107'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L76)  
```
ENOTDIR = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L77)  
```
ENOTEMPTY = 39'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L78)  
```
ENOTSOCK = 88'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L79)  
```
ENOTSUP = 95'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L80)  
```
ENOTTY = 25'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L81)  
```
ENXIO = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L82)  
```
EOPNOTSUPP = 95'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L83)  
```
EOVERFLOW = 75'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L84)  
```
EPERM = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L85)  
```
EPIPE = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L86)  
```
EPROTO = 71'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L87)  
```
EPROTONOSUPPORT = 93'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L88)  
```
EPROTOTYPE = 91'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L89)  
```
ERANGE = 34'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L90)  
```
EROFS = 30'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L91)  
```
ESPIPE = 29'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L92)  
```
ESRCH = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L93)  
```
ESTALE = 116'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L94)  
```
ETIME = 62'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L95)  
```
ETIMEDOUT = 110'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L96)  
```
ETXTBSY = 26'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L97)  
```
EWOULDBLOCK = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L98)  
```
EXDEV = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L99)  
```
F_DUPFD = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L102)  
```
F_DUPFD_CLOEXEC = 1030'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L103)  
```
F_GETFD = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L104)  
```
F_SETFD = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L105)  
```
F_GETFL = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L106)  
```
F_SETFL = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L107)  
```
F_GETLK = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L108)  
```
F_SETLK = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L109)  
```
F_SETLKW = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L110)  
```
F_GETOWN = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L111)  
```
F_SETOWN = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L112)  
```
FD_CLOEXEC = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L113)  
```
F_RDLCK = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L114)  
```
F_UNLCK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L115)  
```
F_WRLCK = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L116)  
```
O_CREAT = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L117)  
```
O_EXCL = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L118)  
```
O_NOCTTY = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L119)  
```
O_TRUNC = 512'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L120)  
```
O_APPEND = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L121)  
```
O_DSYNC = 4096'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L122)  
```
O_NONBLOCK = 2048'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L123)  
```
O_RSYNC = 1052672'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L124)  
```
O_SYNC = 1052672'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L125)  
```
O_ACCMODE = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L126)  
```
O_RDONLY = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L127)  
```
O_RDWR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L128)  
```
O_WRONLY = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L129)  
```
O_CLOEXEC = 524288'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L130)  
```
O_DIRECT = 16384'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L131)  
```
O_PATH = 2097152'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L132)  
```
O_NOATIME = 262144'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L133)  
```
O_TMPFILE = 4259840'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L134)  
```
POSIX_FADV_NORMAL = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L135)  
```
POSIX_FADV_SEQUENTIAL = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L136)  
```
POSIX_FADV_RANDOM = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L137)  
```
POSIX_FADV_WILLNEED = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L138)  
```
POSIX_FADV_DONTNEED = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L139)  
```
POSIX_FADV_NOREUSE = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L140)  
```
FE_DIVBYZERO = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L143)  
```
FE_INEXACT = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L144)  
```
FE_INVALID = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L145)  
```
FE_OVERFLOW = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L146)  
```
FE_UNDERFLOW = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L147)  
```
FE_ALL_EXCEPT = 61'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L148)  
```
FE_DOWNWARD = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L149)  
```
FE_TONEAREST = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L150)  
```
FE_TOWARDZERO = 3072'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L151)  
```
FE_UPWARD = 2048'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L152)  
```
FE_DFL_ENV = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L153)  
```
MM_HARD = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L156)  
```
MM_SOFT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L157)  
```
MM_FIRM = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L158)  
```
MM_APPL = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L159)  
```
MM_UTIL = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L160)  
```
MM_OPSYS = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L161)  
```
MM_RECOVER = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L162)  
```
MM_NRECOV = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L163)  
```
MM_HALT = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L164)  
```
MM_ERROR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L165)  
```
MM_WARNING = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L166)  
```
MM_INFO = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L167)  
```
MM_NOSEV = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L168)  
```
MM_PRINT = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L169)  
```
MM_CONSOLE = 512'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L170)  
```
MM_OK = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L171)  
```
MM_NOTOK = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L172)  
```
MM_NOMSG = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L173)  
```
MM_NOCON = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L174)  
```
FNM_NOMATCH = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L177)  
```
FNM_PATHNAME = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L178)  
```
FNM_PERIOD = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L179)  
```
FNM_NOESCAPE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L180)  
```
FNM_NOSYS = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L181)  
```
FTW_F = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L184)  
```
FTW_D = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L185)  
```
FTW_DNR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L186)  
```
FTW_DP = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L187)  
```
FTW_NS = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L188)  
```
FTW_SL = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L189)  
```
FTW_SLN = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L190)  
```
FTW_PHYS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L191)  
```
FTW_MOUNT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L192)  
```
FTW_DEPTH = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L193)  
```
FTW_CHDIR = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L194)  
```
GLOB_APPEND = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L197)  
```
GLOB_DOOFFS = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L198)  
```
GLOB_ERR = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L199)  
```
GLOB_MARK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L200)  
```
GLOB_NOCHECK = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L201)  
```
GLOB_NOESCAPE = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L202)  
```
GLOB_NOSORT = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L203)  
```
GLOB_ABORTED = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L204)  
```
GLOB_NOMATCH = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L205)  
```
GLOB_NOSPACE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L206)  
```
GLOB_NOSYS = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L207)  
```
CODESET = 14'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L210)  
```
D_T_FMT = 131112'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L211)  
```
D_FMT = 131113'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L212)  
```
T_FMT = 131114'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L213)  
```
T_FMT_AMPM = 131115'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L214)  
```
AM_STR = 131110'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L215)  
```
PM_STR = 131111'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L216)  
```
DAY_1 = 131079'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L217)  
```
DAY_2 = 131080'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L218)  
```
DAY_3 = 131081'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L219)  
```
DAY_4 = 131082'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L220)  
```
DAY_5 = 131083'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L221)  
```
DAY_6 = 131084'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L222)  
```
DAY_7 = 131085'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L223)  
```
ABDAY_1 = 131072'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L224)  
```
ABDAY_2 = 131073'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L225)  
```
ABDAY_3 = 131074'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L226)  
```
ABDAY_4 = 131075'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L227)  
```
ABDAY_5 = 131076'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L228)  
```
ABDAY_6 = 131077'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L229)  
```
ABDAY_7 = 131078'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L230)  
```
MON_1 = 131098'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L231)  
```
MON_2 = 131099'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L232)  
```
MON_3 = 131100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L233)  
```
MON_4 = 131101'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L234)  
```
MON_5 = 131102'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L235)  
```
MON_6 = 131103'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L236)  
```
MON_7 = 131104'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L237)  
```
MON_8 = 131105'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L238)  
```
MON_9 = 131106'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L239)  
```
MON_10 = 131107'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L240)  
```
MON_11 = 131108'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L241)  
```
MON_12 = 131109'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L242)  
```
ABMON_1 = 131086'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L243)  
```
ABMON_2 = 131087'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L244)  
```
ABMON_3 = 131088'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L245)  
```
ABMON_4 = 131089'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L246)  
```
ABMON_5 = 131090'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L247)  
```
ABMON_6 = 131091'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L248)  
```
ABMON_7 = 131092'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L249)  
```
ABMON_8 = 131093'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L250)  
```
ABMON_9 = 131094'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L251)  
```
ABMON_10 = 131095'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L252)  
```
ABMON_11 = 131096'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L253)  
```
ABMON_12 = 131097'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L254)  
```
ERA = 131116'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L255)  
```
ERA_D_FMT = 131118'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L256)  
```
ERA_D_T_FMT = 131120'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L257)  
```
ERA_T_FMT = 131121'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L258)  
```
ALT_DIGITS = 131119'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L259)  
```
RADIXCHAR = 65536'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L260)  
```
THOUSEP = 65537'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L261)  
```
YESEXPR = 327680'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L262)  
```
NOEXPR = 327681'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L263)  
```
CRNCYSTR = 262159'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L264)  
```
LC_ALL = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L267)  
```
LC_COLLATE = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L268)  
```
LC_CTYPE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L269)  
```
LC_MESSAGES = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L270)  
```
LC_MONETARY = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L271)  
```
LC_NUMERIC = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L272)  
```
LC_TIME = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L273)  
```
IPPORT_RESERVED = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L276)  
```
HOST_NOT_FOUND = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L277)  
```
NO_DATA = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L278)  
```
NO_RECOVERY = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L279)  
```
TRY_AGAIN = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L280)  
```
AI_PASSIVE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L281)  
```
AI_CANONNAME = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L282)  
```
AI_NUMERICHOST = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L283)  
```
AI_NUMERICSERV = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L284)  
```
AI_V4MAPPED = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L285)  
```
AI_ALL = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L286)  
```
AI_ADDRCONFIG = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L287)  
```
NI_NOFQDN = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L288)  
```
NI_NUMERICHOST = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L289)  
```
NI_NAMEREQD = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L290)  
```
NI_NUMERICSERV = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L291)  
```
NI_DGRAM = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L292)  
```
EAI_AGAIN = -3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L293)  
```
EAI_BADFLAGS = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L294)  
```
EAI_FAIL = -4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L295)  
```
EAI_FAMILY = -6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L296)  
```
EAI_MEMORY = -10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L297)  
```
EAI_NONAME = -2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L298)  
```
EAI_SERVICE = -8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L299)  
```
EAI_SOCKTYPE = -7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L300)  
```
EAI_SYSTEM = -11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L301)  
```
EAI_OVERFLOW = -12'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L302)  
```
IF_NAMESIZE = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L305)  
```
IPPROTO_IP = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L308)  
```
IPPROTO_IPV6 = 41'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L309)  
```
IPPROTO_ICMP = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L310)  
```
IPPROTO_ICMPV6 = 58'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L311)  
```
IPPROTO_RAW = 255'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L312)  
```
IPPROTO_TCP = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L313)  
```
IPPROTO_UDP = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L314)  
```
INADDR_ANY = 0'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L315)  
```
INADDR_LOOPBACK = 2130706433'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L316)  
```
INADDR_BROADCAST = 4294967295'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L317)  
```
INET_ADDRSTRLEN = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L318)  
```
INET6_ADDRSTRLEN = 46'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L319)  
```
IPV6_JOIN_GROUP = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L320)  
```
IPV6_LEAVE_GROUP = 21'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L321)  
```
IPV6_MULTICAST_HOPS = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L322)  
```
IPV6_MULTICAST_IF = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L323)  
```
IPV6_MULTICAST_LOOP = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L324)  
```
IPV6_UNICAST_HOPS = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L325)  
```
IPV6_V6ONLY = 26'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L326)  
```
TCP_NODELAY = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L329)  
```
NL_SETD = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L332)  
```
NL_CAT_LOCALE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L333)  
```
POLLIN = 1'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L336)  
```
POLLRDNORM = 64'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L337)  
```
POLLRDBAND = 128'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L338)  
```
POLLPRI = 2'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L339)  
```
POLLOUT = 4'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L340)  
```
POLLWRNORM = 256'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L341)  
```
POLLWRBAND = 512'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L342)  
```
POLLERR = 8'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L343)  
```
POLLHUP = 16'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L344)  
```
POLLNVAL = 32'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L345) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L345)  
```
PTHREAD_BARRIER_SERIAL_THREAD = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L348)  
```
PTHREAD_CANCEL_ASYNCHRONOUS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L349)  
```
PTHREAD_CANCEL_ENABLE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L350)  
```
PTHREAD_CANCEL_DEFERRED = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L351)  
```
PTHREAD_CANCEL_DISABLE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L352)  
```
PTHREAD_CREATE_DETACHED = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L353)  
```
PTHREAD_CREATE_JOINABLE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L354)  
```
PTHREAD_EXPLICIT_SCHED = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L355)  
```
PTHREAD_INHERIT_SCHED = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L356)  
```
PTHREAD_PROCESS_SHARED = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L357)  
```
PTHREAD_PROCESS_PRIVATE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L358)  
```
PTHREAD_SCOPE_PROCESS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L359)  
```
PTHREAD_SCOPE_SYSTEM = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L360)  
```
SCHED_FIFO = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L363)  
```
SCHED_RR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L364)  
```
SCHED_OTHER = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L365)  
```
SEM_FAILED = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L368)  
```
SIGEV_NONE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L371)  
```
SIGEV_SIGNAL = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L372)  
```
SIGEV_THREAD = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L373)  
```
SIGABRT = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L374)  
```
SIGALRM = 14'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L375)  
```
SIGBUS = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L376)  
```
SIGCHLD = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L377)  
```
SIGCONT = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L378)  
```
SIGFPE = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L379)  
```
SIGHUP = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L380)  
```
SIGILL = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L381)  
```
SIGINT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L382)  
```
SIGKILL = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L383)  
```
SIGPIPE = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L384)  
```
SIGQUIT = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L385)  
```
SIGSEGV = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L386)  
```
SIGSTOP = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L387)  
```
SIGTERM = 15'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L388)  
```
SIGTSTP = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L389)  
```
SIGTTIN = 21'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L390)  
```
SIGTTOU = 22'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L391)  
```
SIGUSR1 = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L392)  
```
SIGUSR2 = 12'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L393) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L393)  
```
SIGPOLL = 29'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L394)  
```
SIGPROF = 27'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L395)  
```
SIGSYS = 31'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L396)  
```
SIGTRAP = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L397)  
```
SIGURG = 23'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L398)  
```
SIGVTALRM = 26'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L399)  
```
SIGXCPU = 24'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L400)  
```
SIGXFSZ = 25'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L401)  
```
SA_NOCLDSTOP = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L402)  
```
SIG_BLOCK = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L403)  
```
SIG_UNBLOCK = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L404)  
```
SIG_SETMASK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L405)  
```
SA_ONSTACK = 134217728'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L406)  
```
SA_RESETHAND = -2147483648'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L407)  
```
SA_RESTART = 268435456'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L408)  
```
SA_SIGINFO = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L409)  
```
SA_NOCLDWAIT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L410)  
```
SA_NODEFER = 1073741824'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L411) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L411)  
```
SS_ONSTACK = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L412)  
```
SS_DISABLE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L413)  
```
MINSIGSTKSZ = 2048'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L414)  
```
SIGSTKSZ = 8192'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L415)  
```
SIG_HOLD = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L416)  
```
SIG_DFL = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L417)  
```
SIG_ERR = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L418)  
```
SIG_IGN = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L419)  
```
IPC_CREAT = 512'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L422)  
```
IPC_EXCL = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L423)  
```
IPC_NOWAIT = 2048'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L424)  
```
IPC_PRIVATE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L425)  
```
IPC_RMID = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L426)  
```
IPC_SET = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L427)  
```
IPC_STAT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L428)  
```
PROT_READ = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L431)  
```
PROT_WRITE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L432)  
```
PROT_EXEC = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L433)  
```
PROT_NONE = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L434)  
```
MAP_ANONYMOUS = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L435)  
```
MAP_FIXED_NOREPLACE = 1048576'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L436)  
```
MAP_NORESERVE = 16384'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L437)  
```
MAP_SHARED = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L438)  
```
MAP_PRIVATE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L439)  
```
MAP_FIXED = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L440)  
```
MS_ASYNC = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L441)  
```
MS_SYNC = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L442)  
```
MS_INVALIDATE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L443)  
```
MCL_CURRENT = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L444)  
```
MCL_FUTURE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L445)  
```
MAP_FAILED = 0xFFFFFFFF
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L446)  
```
POSIX_MADV_NORMAL = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L447)  
```
POSIX_MADV_SEQUENTIAL = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L448)  
```
POSIX_MADV_RANDOM = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L449)  
```
POSIX_MADV_WILLNEED = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L450)  
```
POSIX_MADV_DONTNEED = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L451)  
```
MAP_POPULATE = 32768'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L452)  
```
RLIMIT_NOFILE = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L455)  
```
FD_SETSIZE = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L458)  
```
MSG_CTRUNC = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L461)  
```
MSG_DONTROUTE = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L462)  
```
MSG_EOR = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L463)  
```
MSG_OOB = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L464)  
```
SCM_RIGHTS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L465)  
```
SO_ACCEPTCONN = 30'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L466)  
```
SO_BROADCAST = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L467)  
```
SO_DEBUG = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L468)  
```
SO_DONTROUTE = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L469)  
```
SO_ERROR = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L470)  
```
SO_KEEPALIVE = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L471)  
```
SO_LINGER = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L472)  
```
SO_OOBINLINE = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L473)  
```
SO_RCVBUF = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L474)  
```
SO_RCVLOWAT = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L475)  
```
SO_RCVTIMEO = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L476)  
```
SO_REUSEADDR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L477)  
```
SO_SNDBUF = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L478)  
```
SO_SNDLOWAT = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L479)  
```
SO_SNDTIMEO = 21'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L480)  
```
SO_TYPE = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L481)  
```
SOCK_DGRAM = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L482) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L482)  
```
SOCK_RAW = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L483)  
```
SOCK_SEQPACKET = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L484)  
```
SOCK_STREAM = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L485) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L485)  
```
SOCK_CLOEXEC = 524288'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L486)  
```
SOL_SOCKET = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L487)  
```
SOMAXCONN = 4096'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L488)  
```
SO_REUSEPORT = 15'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L489) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L489)  
```
MSG_NOSIGNAL = 16384'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L490)  
```
MSG_PEEK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L491)  
```
MSG_TRUNC = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L492)  
```
MSG_WAITALL = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L493)  
```
AF_INET = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L494)  
```
AF_INET6 = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L495)  
```
AF_UNIX = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L496)  
```
AF_UNSPEC = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L497)  
```
SHUT_RD = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L498)  
```
SHUT_RDWR = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L499)  
```
SHUT_WR = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L500)  
```
S_IFBLK = 24576'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L503)  
```
S_IFCHR = 8192'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L504)  
```
S_IFDIR = 16384'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L505)  
```
S_IFIFO = 4096'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L506)  
```
S_IFLNK = 40960'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L507)  
```
S_IFMT = 61440'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L508)  
```
S_IFREG = 32768'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L509) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L509)  
```
S_IFSOCK = 49152'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L510)  
```
S_IRGRP = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L511)  
```
S_IROTH = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L512)  
```
S_IRUSR = 256'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L513)  
```
S_IRWXG = 56'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L514)  
```
S_IRWXO = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L515)  
```
S_IRWXU = 448'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L516)  
```
S_ISGID = 1024'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L517)  
```
S_ISUID = 2048'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L518)  
```
S_ISVTX = 512'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L519)  
```
S_IWGRP = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L520)  
```
S_IWOTH = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L521)  
```
S_IWUSR = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L522)  
```
S_IXGRP = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L523)  
```
S_IXOTH = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L524)  
```
S_IXUSR = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L525)  
```
ST_RDONLY = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L528)  
```
ST_NOSUID = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L529)  
```
WNOHANG = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L532)  
```
WUNTRACED = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L533)  
```
WEXITED = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L534)  
```
WSTOPPED = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L535)  
```
WCONTINUED = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L536) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L536)  
```
WNOWAIT = 16777216'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L537)  
```
POSIX_SPAWN_RESETIDS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L540)  
```
POSIX_SPAWN_SETPGROUP = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L541)  
```
POSIX_SPAWN_SETSCHEDPARAM = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L542)  
```
POSIX_SPAWN_SETSCHEDULER = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L543)  
```
POSIX_SPAWN_SETSIGDEF = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L544)  
```
POSIX_SPAWN_SETSIGMASK = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L545)  
```
POSIX_SPAWN_USEVFORK = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L546)  
```
IOFBF = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L549)  
```
IONBF = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L550)  
```
CLOCKS_PER_SEC = 1000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L553)  
```
CLOCK_PROCESS_CPUTIME_ID = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L554)  
```
CLOCK_THREAD_CPUTIME_ID = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L555)  
```
CLOCK_REALTIME = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L556)  
```
TIMER_ABSTIME = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L557)  
```
CLOCK_MONOTONIC = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L558)  
```
POSIX_ASYNC_IO = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L561)  
```
F_OK = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L562)  
```
R_OK = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L563)  
```
W_OK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L564)  
```
X_OK = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L565)  
```
CS_PATH = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L566)  
```
CS_POSIX_V6_ILP32_OFF32_CFLAGS = 1116'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L567)  
```
CS_POSIX_V6_ILP32_OFF32_LDFLAGS = 1117'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L568)  
```
CS_POSIX_V6_ILP32_OFF32_LIBS = 1118'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L569)  
```
CS_POSIX_V6_ILP32_OFFBIG_CFLAGS = 1120'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L570)  
```
CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS = 1121'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L571)  
```
CS_POSIX_V6_ILP32_OFFBIG_LIBS = 1122'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L572)  
```
CS_POSIX_V6_LP64_OFF64_CFLAGS = 1124'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L573)  
```
CS_POSIX_V6_LP64_OFF64_LDFLAGS = 1125'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L574)  
```
CS_POSIX_V6_LP64_OFF64_LIBS = 1126'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L575)  
```
CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS = 1128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L576)  
```
CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS = 1129'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L577)  
```
CS_POSIX_V6_LPBIG_OFFBIG_LIBS = 1130'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L578)  
```
CS_POSIX_V6_WIDTH_RESTRICTED_ENVS = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L579)  
```
F_LOCK = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L580)  
```
F_TEST = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L581)  
```
F_TLOCK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L582)  
```
F_ULOCK = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L583) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L583)  
```
PC_2_SYMLINKS = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L584)  
```
PC_ALLOC_SIZE_MIN = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L585)  
```
PC_ASYNC_IO = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L586)  
```
PC_CHOWN_RESTRICTED = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L587) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L587)  
```
PC_FILESIZEBITS = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L588)  
```
PC_LINK_MAX = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L589)  
```
PC_MAX_CANON = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L590)  
```
PC_MAX_INPUT = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L591)  
```
PC_NAME_MAX = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L592)  
```
PC_NO_TRUNC = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L593)  
```
PC_PATH_MAX = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L594) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L594)  
```
PC_PIPE_BUF = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L595)  
```
PC_PRIO_IO = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L596)  
```
PC_REC_INCR_XFER_SIZE = 14'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L597)  
```
PC_REC_MIN_XFER_SIZE = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L598)  
```
PC_REC_XFER_ALIGN = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L599) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L599)  
```
PC_SYMLINK_MAX = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L600) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L600)  
```
PC_SYNC_IO = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L601)  
```
PC_VDISABLE = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L602)  
```
SC_2_C_BIND = 47'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L603)  
```
SC_2_C_DEV = 48'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L604)  
```
SC_2_CHAR_TERM = 95'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L605)  
```
SC_2_FORT_DEV = 49'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L606)  
```
SC_2_FORT_RUN = 50'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L607) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L607)  
```
SC_2_LOCALEDEF = 52'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L608)  
```
SC_2_PBS = 168'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L609)  
```
SC_2_PBS_ACCOUNTING = 169'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L610)  
```
SC_2_PBS_CHECKPOINT = 175'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L611)  
```
SC_2_PBS_LOCATE = 170'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L612)  
```
SC_2_PBS_MESSAGE = 171'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L613) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L613)  
```
SC_2_PBS_TRACK = 172'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L614) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L614)  
```
SC_2_SW_DEV = 51'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L615)  
```
SC_2_UPE = 97'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L616)  
```
SC_2_VERSION = 46'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L617)  
```
SC_ADVISORY_INFO = 132'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L618)  
```
SC_AIO_LISTIO_MAX = 23'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L619)  
```
SC_AIO_MAX = 24'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L620)  
```
SC_AIO_PRIO_DELTA_MAX = 25'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L621) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L621)  
```
SC_ARG_MAX = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L622)  
```
SC_ASYNCHRONOUS_IO = 12'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L623)  
```
SC_ATEXIT_MAX = 87'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L624) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L624)  
```
SC_BARRIERS = 133'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L625) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L625)  
```
SC_BC_BASE_MAX = 36'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L626)  
```
SC_BC_DIM_MAX = 37'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L627)  
```
SC_BC_SCALE_MAX = 38'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L628)  
```
SC_BC_STRING_MAX = 39'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L629) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L629)  
```
SC_CHILD_MAX = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L630)  
```
SC_CLK_TCK = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L631)  
```
SC_CLOCK_SELECTION = 137'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L632)  
```
SC_COLL_WEIGHTS_MAX = 40'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L633)  
```
SC_CPUTIME = 138'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L634)  
```
SC_DELAYTIMER_MAX = 26'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L635)  
```
SC_EXPR_NEST_MAX = 42'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L636)  
```
SC_FSYNC = 15'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L637)  
```
SC_GETGR_R_SIZE_MAX = 69'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L638) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L638)  
```
SC_GETPW_R_SIZE_MAX = 70'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L639)  
```
SC_HOST_NAME_MAX = 180'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L640)  
```
SC_IOV_MAX = 60'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L641)  
```
SC_IPV6 = 235'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L642) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L642)  
```
SC_JOB_CONTROL = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L643) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L643)  
```
SC_LINE_MAX = 43'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L644)  
```
SC_LOGIN_NAME_MAX = 71'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L645)  
```
SC_MAPPED_FILES = 16'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L646)  
```
SC_MEMLOCK = 17'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L647)  
```
SC_MEMLOCK_RANGE = 18'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L648)  
```
SC_MEMORY_PROTECTION = 19'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L649)  
```
SC_MESSAGE_PASSING = 20'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L650)  
```
SC_MONOTONIC_CLOCK = 149'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L651)  
```
SC_MQ_OPEN_MAX = 27'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L652) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L652)  
```
SC_MQ_PRIO_MAX = 28'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L653)  
```
SC_NGROUPS_MAX = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L654)  
```
SC_OPEN_MAX = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L655)  
```
SC_PAGESIZE = 30'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L656)  
```
SC_PRIORITIZED_IO = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L657)  
```
SC_PRIORITY_SCHEDULING = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L658)  
```
SC_RAW_SOCKETS = 236'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L659)  
```
SC_RE_DUP_MAX = 44'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L660)  
```
SC_READER_WRITER_LOCKS = 153'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L661)  
```
SC_REALTIME_SIGNALS = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L662)  
```
SC_REGEXP = 155'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L663)  
```
SC_RTSIG_MAX = 31'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L664) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L664)  
```
SC_SAVED_IDS = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L665) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L665)  
```
SC_SEM_NSEMS_MAX = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L666)  
```
SC_SEM_VALUE_MAX = 33'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L667)  
```
SC_SEMAPHORES = 21'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L668)  
```
SC_SHARED_MEMORY_OBJECTS = 22'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L669)  
```
SC_SHELL = 157'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L670)  
```
SC_SIGQUEUE_MAX = 34'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L671)  
```
SC_SPAWN = 159'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L672)  
```
SC_SPIN_LOCKS = 154'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L673)  
```
SC_SPORADIC_SERVER = 160'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L674)  
```
SC_SS_REPL_MAX = 241'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L675)  
```
SC_STREAM_MAX = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L676)  
```
SC_SYMLOOP_MAX = 173'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L677)  
```
SC_SYNCHRONIZED_IO = 14'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L678)  
```
SC_THREAD_ATTR_STACKADDR = 77'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L679)  
```
SC_THREAD_ATTR_STACKSIZE = 78'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L680)  
```
SC_THREAD_CPUTIME = 139'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L681)  
```
SC_THREAD_DESTRUCTOR_ITERATIONS = 73'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L682)  
```
SC_THREAD_KEYS_MAX = 74'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L683)  
```
SC_THREAD_PRIO_INHERIT = 80'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L684)  
```
SC_THREAD_PRIO_PROTECT = 81'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L685)  
```
SC_THREAD_PRIORITY_SCHEDULING = 79'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L686)  
```
SC_THREAD_PROCESS_SHARED = 82'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L687)  
```
SC_THREAD_SAFE_FUNCTIONS = 68'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L688)  
```
SC_THREAD_SPORADIC_SERVER = 161'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L689)  
```
SC_THREAD_STACK_MIN = 75'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L690)  
```
SC_THREAD_THREADS_MAX = 76'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L691)  
```
SC_THREADS = 67'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L692) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L692)  
```
SC_TIMEOUTS = 164'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L693)  
```
SC_TIMER_MAX = 35'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L694)  
```
SC_TIMERS = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L695)  
```
SC_TRACE = 181'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L696)  
```
SC_TRACE_EVENT_FILTER = 182'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L697)  
```
SC_TRACE_EVENT_NAME_MAX = 242'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L698)  
```
SC_TRACE_INHERIT = 183'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L699)  
```
SC_TRACE_LOG = 184'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L700)  
```
SC_TRACE_NAME_MAX = 243'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L701)  
```
SC_TRACE_SYS_MAX = 244'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L702)  
```
SC_TRACE_USER_EVENT_MAX = 245'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L703)  
```
SC_TTY_NAME_MAX = 72'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L704)  
```
SC_TYPED_MEMORY_OBJECTS = 165'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L705) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L705)  
```
SC_TZNAME_MAX = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L706) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L706)  
```
SC_V6_ILP32_OFF32 = 176'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L707)  
```
SC_V6_ILP32_OFFBIG = 177'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L708)  
```
SC_V6_LP64_OFF64 = 178'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L709) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L709)  
```
SC_V6_LPBIG_OFFBIG = 179'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L710)  
```
SC_VERSION = 29'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L711)  
```
SC_XBS5_ILP32_OFF32 = 125'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L712)  
```
SC_XBS5_ILP32_OFFBIG = 126'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L713)  
```
SC_XBS5_LP64_OFF64 = 127'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L714)  
```
SC_XBS5_LPBIG_OFFBIG = 128'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L715)  
```
SC_XOPEN_CRYPT = 92'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L716)  
```
SC_XOPEN_ENH_I18N = 93'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L717)  
```
SC_XOPEN_LEGACY = 129'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L718)  
```
SC_XOPEN_REALTIME = 130'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L719) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L719)  
```
SC_XOPEN_REALTIME_THREADS = 131'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L720)  
```
SC_XOPEN_SHM = 94'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L721) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L721)  
```
SC_XOPEN_STREAMS = 246'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L722)  
```
SC_XOPEN_UNIX = 91'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L723)  
```
SC_XOPEN_VERSION = 89'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L724)  
```
SC_NPROCESSORS_ONLN = 84'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L725) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L725)  
```
SEEK_SET = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L726)  
```
SEEK_CUR = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L727)  
```
SEEK_END = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64_consts.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64_consts.nim#L728)  
```
RUSAGE_SELF = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L712)  
```
RUSAGE_CHILDREN = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L713)  
```
RUSAGE_THREAD = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L714)  
```
INVALID_SOCKET = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L892) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L892)   Procs
-----

  
```
proc WEXITSTATUS(s: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L572)  
```
proc WTERMSIG(s: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L573)  
```
proc WSTOPSIG(s: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L574)  
```
proc WIFEXITED(s: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L575)  
```
proc WIFSIGNALED(s: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L576)  
```
proc WIFSTOPPED(s: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L577)  
```
proc WIFCONTINUED(s: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_linux_amd64.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_linux_amd64.nim#L578)  
```
proc st_atime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
```
  Second-granularity time of last access. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L116)  
```
proc st_mtime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
```
  Second-granularity time of last data modification. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L119)  
```
proc st_ctime(s: Stat): Time {...}{.inline, raises: [], tags: [].}
```
  Second-granularity time of last status change. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L122)  
```
proc aio_cancel(a1: cint; a2: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L137)  
```
proc aio_error(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L138)  
```
proc aio_fsync(a1: cint; a2: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L139)  
```
proc aio_read(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L140)  
```
proc aio_return(a1: ptr Taiocb): int {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L141)  
```
proc aio_suspend(a1: ptr ptr Taiocb; a2: cint; a3: ptr Timespec): cint {...}{.
    importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L142)  
```
proc aio_write(a1: ptr Taiocb): cint {...}{.importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L144)  
```
proc lio_listio(a1: cint; a2: ptr ptr Taiocb; a3: cint; a4: ptr SigEvent): cint {...}{.
    importc, header: "<aio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L145)  
```
proc htonl(a1: uint32): uint32 {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L149)  
```
proc htons(a1: uint16): uint16 {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L150)  
```
proc ntohl(a1: uint32): uint32 {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L151)  
```
proc ntohs(a1: uint16): uint16 {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L152)  
```
proc inet_addr(a1: cstring): InAddrT {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L154)  
```
proc inet_ntoa(a1: InAddr): cstring {...}{.importc, header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L155)  
```
proc inet_ntop(a1: cint; a2: pointer; a3: cstring; a4: int32): cstring {...}{.
    importc: "(char *)$1", header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L156)  
```
proc inet_pton(a1: cint; a2: cstring; a3: pointer): cint {...}{.importc,
    header: "<arpa/inet.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L158)  
```
proc IN6ADDR_ANY_INIT(): In6Addr {...}{.importc, header: "<netinet/in.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L165)  
```
proc IN6ADDR_LOOPBACK_INIT(): In6Addr {...}{.importc, header: "<netinet/in.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L166)  
```
proc closedir(a1: ptr DIR): cint {...}{.importc, header: "<dirent.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L169)  
```
proc opendir(a1: cstring): ptr DIR {...}{.importc, header: "<dirent.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L170)  
```
proc readdir(a1: ptr DIR): ptr Dirent {...}{.importc, header: "<dirent.h>",
                                        sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L171)  
```
proc readdir_r(a1: ptr DIR; a2: ptr Dirent; a3: ptr ptr Dirent): cint {...}{.importc,
    header: "<dirent.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L172)  
```
proc rewinddir(a1: ptr DIR) {...}{.importc, header: "<dirent.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L174)  
```
proc seekdir(a1: ptr DIR; a2: int) {...}{.importc, header: "<dirent.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L175)  
```
proc telldir(a1: ptr DIR): int {...}{.importc, header: "<dirent.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L176)  
```
proc dlclose(a1: pointer): cint {...}{.importc, header: "<dlfcn.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L179)  
```
proc dlerror(): cstring {...}{.importc, header: "<dlfcn.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L180)  
```
proc dlopen(a1: cstring; a2: cint): pointer {...}{.importc, header: "<dlfcn.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L181)  
```
proc dlsym(a1: pointer; a2: cstring): pointer {...}{.importc, header: "<dlfcn.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L182)  
```
proc creat(a1: cstring; a2: Mode): cint {...}{.importc, header: "<fcntl.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L184)  
```
proc fcntl(a1: cint | SocketHandle; a2: cint): cint {...}{.varargs, importc,
    header: "<fcntl.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L185)  
```
proc open(a1: cstring; a2: cint): cint {...}{.varargs, importc, header: "<fcntl.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L186)  
```
proc posix_fadvise(a1: cint; a2, a3: Off; a4: cint): cint {...}{.importc,
    header: "<fcntl.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L187)  
```
proc posix_fallocate(a1: cint; a2, a3: Off): cint {...}{.importc, header: "<fcntl.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L189)  
```
proc fmtmsg(a1: int; a2: cstring; a3: cint; a4, a5, a6: cstring): cint {...}{.
    importc, header: "<fmtmsg.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L193)  
```
proc fnmatch(a1, a2: cstring; a3: cint): cint {...}{.importc, header: "<fnmatch.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L196)  
```
proc ftw(a1: cstring;
         a2: proc (x1: cstring; x2: ptr Stat; x3: cint): cint {...}{.noconv.};
         a3: cint): cint {...}{.importc, header: "<ftw.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L197)  
```
proc glob(a1: cstring; a2: cint;
          a3: proc (x1: cstring; x2: cint): cint {...}{.noconv.}; a4: ptr Glob): cint {...}{.
    importc, header: "<glob.h>", sideEffect.}
```
  Filename globbing. Use [os.walkPattern()](os#glob_1) and similar. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L207)  
```
proc globfree(a1: ptr Glob) {...}{.importc, header: "<glob.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L212)  
```
proc getgrgid(a1: Gid): ptr Group {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L214)  
```
proc getgrnam(a1: cstring): ptr Group {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L215)  
```
proc getgrgid_r(a1: Gid; a2: ptr Group; a3: cstring; a4: int; a5: ptr ptr Group): cint {...}{.
    importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L216)  
```
proc getgrnam_r(a1: cstring; a2: ptr Group; a3: cstring; a4: int;
                a5: ptr ptr Group): cint {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L218)  
```
proc getgrent(): ptr Group {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L221)  
```
proc endgrent() {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L222)  
```
proc setgrent() {...}{.importc, header: "<grp.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L223)  
```
proc iconv_open(a1, a2: cstring): Iconv {...}{.importc, header: "<iconv.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L226)  
```
proc iconv(a1: Iconv; a2: var cstring; a3: var int; a4: var cstring; a5: var int): int {...}{.
    importc, header: "<iconv.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L227)  
```
proc iconv_close(a1: Iconv): cint {...}{.importc, header: "<iconv.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L229)  
```
proc nl_langinfo(a1: Nl_item): cstring {...}{.importc, header: "<langinfo.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L231)  
```
proc basename(a1: cstring): cstring {...}{.importc, header: "<libgen.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L233)  
```
proc dirname(a1: cstring): cstring {...}{.importc, header: "<libgen.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L234)  
```
proc localeconv(): ptr Lconv {...}{.importc, header: "<locale.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L236)  
```
proc setlocale(a1: cint; a2: cstring): cstring {...}{.importc, header: "<locale.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L237)  
```
proc strfmon(a1: cstring; a2: int; a3: cstring): int {...}{.varargs, importc,
    header: "<monetary.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L240)  
```
proc mq_close(a1: Mqd): cint {...}{.importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L244)  
```
proc mq_getattr(a1: Mqd; a2: ptr MqAttr): cint {...}{.importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L245)  
```
proc mq_notify(a1: Mqd; a2: ptr SigEvent): cint {...}{.importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L247)  
```
proc mq_open(a1: cstring; a2: cint): Mqd {...}{.varargs, importc,
    header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L249)  
```
proc mq_receive(a1: Mqd; a2: cstring; a3: int; a4: var int): int {...}{.importc,
    header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L251)  
```
proc mq_send(a1: Mqd; a2: cstring; a3: int; a4: int): cint {...}{.importc,
    header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L253)  
```
proc mq_setattr(a1: Mqd; a2, a3: ptr MqAttr): cint {...}{.importc,
    header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L255)  
```
proc mq_timedreceive(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): int {...}{.
    importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L258)  
```
proc mq_timedsend(a1: Mqd; a2: cstring; a3: int; a4: int; a5: ptr Timespec): cint {...}{.
    importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L260)  
```
proc mq_unlink(a1: cstring): cint {...}{.importc, header: "<mqueue.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L262)  
```
proc getpwnam(a1: cstring): ptr Passwd {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L265)  
```
proc getpwuid(a1: Uid): ptr Passwd {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L266)  
```
proc getpwnam_r(a1: cstring; a2: ptr Passwd; a3: cstring; a4: int;
                a5: ptr ptr Passwd): cint {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L267)  
```
proc getpwuid_r(a1: Uid; a2: ptr Passwd; a3: cstring; a4: int;
                a5: ptr ptr Passwd): cint {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L269)  
```
proc endpwent() {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L271)  
```
proc getpwent(): ptr Passwd {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L272)  
```
proc setpwent() {...}{.importc, header: "<pwd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L273)  
```
proc uname(a1: var Utsname): cint {...}{.importc, header: "<sys/utsname.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L275)  
```
proc strerror(errnum: cint): cstring {...}{.importc, header: "<string.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L277)  
```
proc pthread_atfork(a1, a2, a3: proc () {...}{.noconv.}): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L279)  
```
proc pthread_attr_destroy(a1: ptr Pthread_attr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L281)  
```
proc pthread_attr_getdetachstate(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L283)  
```
proc pthread_attr_getguardsize(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L285)  
```
proc pthread_attr_getinheritsched(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L287)  
```
proc pthread_attr_getschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L289)  
```
proc pthread_attr_getschedpolicy(a1: ptr Pthread_attr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L291)  
```
proc pthread_attr_getscope(a1: ptr Pthread_attr; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L293)  
```
proc pthread_attr_getstack(a1: ptr Pthread_attr; a2: var pointer; a3: var int): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L295)  
```
proc pthread_attr_getstackaddr(a1: ptr Pthread_attr; a2: var pointer): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L297)  
```
proc pthread_attr_getstacksize(a1: ptr Pthread_attr; a2: var int): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L299)  
```
proc pthread_attr_init(a1: ptr Pthread_attr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L301)  
```
proc pthread_attr_setdetachstate(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L303)  
```
proc pthread_attr_setguardsize(a1: ptr Pthread_attr; a2: int): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L305)  
```
proc pthread_attr_setinheritsched(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L307)  
```
proc pthread_attr_setschedparam(a1: ptr Pthread_attr; a2: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L309)  
```
proc pthread_attr_setschedpolicy(a1: ptr Pthread_attr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L311)  
```
proc pthread_attr_setscope(a1: ptr Pthread_attr; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L313)  
```
proc pthread_attr_setstack(a1: ptr Pthread_attr; a2: pointer; a3: int): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L315)  
```
proc pthread_attr_setstackaddr(a1: ptr Pthread_attr; a2: pointer): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L317)  
```
proc pthread_attr_setstacksize(a1: ptr Pthread_attr; a2: int): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L319)  
```
proc pthread_barrier_destroy(a1: ptr Pthread_barrier): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L321)  
```
proc pthread_barrier_init(a1: ptr Pthread_barrier; a2: ptr Pthread_barrierattr;
                          a3: cint): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L323)  
```
proc pthread_barrier_wait(a1: ptr Pthread_barrier): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L326)  
```
proc pthread_barrierattr_destroy(a1: ptr Pthread_barrierattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L328)  
```
proc pthread_barrierattr_getpshared(a1: ptr Pthread_barrierattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L330)  
```
proc pthread_barrierattr_init(a1: ptr Pthread_barrierattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L333)  
```
proc pthread_barrierattr_setpshared(a1: ptr Pthread_barrierattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L335)  
```
proc pthread_cancel(a1: Pthread): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L337)  
```
proc pthread_cleanup_push(a1: proc (x: pointer) {...}{.noconv.}; a2: pointer) {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L338)  
```
proc pthread_cleanup_pop(a1: cint) {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L340)  
```
proc pthread_cond_broadcast(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L341)  
```
proc pthread_cond_destroy(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L343)  
```
proc pthread_cond_init(a1: ptr Pthread_cond; a2: ptr Pthread_condattr): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L344)  
```
proc pthread_cond_signal(a1: ptr Pthread_cond): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L346)  
```
proc pthread_cond_timedwait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex;
                            a3: ptr Timespec): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L347)  
```
proc pthread_cond_wait(a1: ptr Pthread_cond; a2: ptr Pthread_mutex): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L350)  
```
proc pthread_condattr_destroy(a1: ptr Pthread_condattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L352)  
```
proc pthread_condattr_getclock(a1: ptr Pthread_condattr; a2: var ClockId): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L353)  
```
proc pthread_condattr_getpshared(a1: ptr Pthread_condattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L355)  
```
proc pthread_condattr_init(a1: ptr Pthread_condattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L358)  
```
proc pthread_condattr_setclock(a1: ptr Pthread_condattr; a2: ClockId): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L359)  
```
proc pthread_condattr_setpshared(a1: ptr Pthread_condattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L360)  
```
proc pthread_create(a1: ptr Pthread; a2: ptr Pthread_attr;
                    a3: proc (x: pointer): pointer {...}{.noconv.}; a4: pointer): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L362)  
```
proc pthread_detach(a1: Pthread): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L364)  
```
proc pthread_equal(a1, a2: Pthread): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L365)  
```
proc pthread_exit(a1: pointer) {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L366)  
```
proc pthread_getconcurrency(): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L367) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L367)  
```
proc pthread_getcpuclockid(a1: Pthread; a2: var ClockId): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L368)  
```
proc pthread_getschedparam(a1: Pthread; a2: var cint; a3: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L369)  
```
proc pthread_getspecific(a1: Pthread_key): pointer {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L371)  
```
proc pthread_join(a1: Pthread; a2: ptr pointer): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L372)  
```
proc pthread_key_create(a1: ptr Pthread_key; a2: proc (x: pointer) {...}{.noconv.}): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L373)  
```
proc pthread_key_delete(a1: Pthread_key): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L374)  
```
proc pthread_mutex_destroy(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L376)  
```
proc pthread_mutex_getprioceiling(a1: ptr Pthread_mutex; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L377)  
```
proc pthread_mutex_init(a1: ptr Pthread_mutex; a2: ptr Pthread_mutexattr): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L379)  
```
proc pthread_mutex_lock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L381)  
```
proc pthread_mutex_setprioceiling(a1: ptr Pthread_mutex; a2: cint; a3: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L382)  
```
proc pthread_mutex_timedlock(a1: ptr Pthread_mutex; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L384)  
```
proc pthread_mutex_trylock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L386)  
```
proc pthread_mutex_unlock(a1: ptr Pthread_mutex): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L387)  
```
proc pthread_mutexattr_destroy(a1: ptr Pthread_mutexattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L388)  
```
proc pthread_mutexattr_getprioceiling(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L390)  
```
proc pthread_mutexattr_getprotocol(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L392)  
```
proc pthread_mutexattr_getpshared(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L394)  
```
proc pthread_mutexattr_gettype(a1: ptr Pthread_mutexattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L396)  
```
proc pthread_mutexattr_init(a1: ptr Pthread_mutexattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L399)  
```
proc pthread_mutexattr_setprioceiling(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L400)  
```
proc pthread_mutexattr_setprotocol(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L401)  
```
proc pthread_mutexattr_setpshared(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L402)  
```
proc pthread_mutexattr_settype(a1: ptr Pthread_mutexattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L403)  
```
proc pthread_once(a1: ptr Pthread_once; a2: proc () {...}{.noconv.}): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L405)  
```
proc pthread_rwlock_destroy(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L407)  
```
proc pthread_rwlock_init(a1: ptr Pthread_rwlock; a2: ptr Pthread_rwlockattr): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L408)  
```
proc pthread_rwlock_rdlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L410)  
```
proc pthread_rwlock_timedrdlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L411) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L411)  
```
proc pthread_rwlock_timedwrlock(a1: ptr Pthread_rwlock; a2: ptr Timespec): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L413)  
```
proc pthread_rwlock_tryrdlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L416)  
```
proc pthread_rwlock_trywrlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L417)  
```
proc pthread_rwlock_unlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L418)  
```
proc pthread_rwlock_wrlock(a1: ptr Pthread_rwlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L419)  
```
proc pthread_rwlockattr_destroy(a1: ptr Pthread_rwlockattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L420)  
```
proc pthread_rwlockattr_getpshared(a1: ptr Pthread_rwlockattr; a2: var cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L421)  
```
proc pthread_rwlockattr_init(a1: ptr Pthread_rwlockattr): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L423)  
```
proc pthread_rwlockattr_setpshared(a1: ptr Pthread_rwlockattr; a2: cint): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L424)  
```
proc pthread_self(): Pthread {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L426)  
```
proc pthread_setcancelstate(a1: cint; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L427)  
```
proc pthread_setcanceltype(a1: cint; a2: var cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L428)  
```
proc pthread_setconcurrency(a1: cint): cint {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L429)  
```
proc pthread_setschedparam(a1: Pthread; a2: cint; a3: ptr Sched_param): cint {...}{.
    importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L430) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L430)  
```
proc pthread_setschedprio(a1: Pthread; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L433)  
```
proc pthread_setspecific(a1: Pthread_key; a2: pointer): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L435)  
```
proc pthread_spin_destroy(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L437)  
```
proc pthread_spin_init(a1: ptr Pthread_spinlock; a2: cint): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L439)  
```
proc pthread_spin_lock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L441)  
```
proc pthread_spin_trylock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L443)  
```
proc pthread_spin_unlock(a1: ptr Pthread_spinlock): cint {...}{.importc,
    header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L445)  
```
proc pthread_testcancel() {...}{.importc, header: "<pthread.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L447)  
```
proc exitnow(code: int): void {...}{.importc: "_exit", header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L450)  
```
proc access(a1: cstring; a2: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L451)  
```
proc alarm(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L452)  
```
proc chdir(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L453)  
```
proc chown(a1: cstring; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L454)  
```
proc close(a1: cint | SocketHandle): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L455)  
```
proc confstr(a1: cint; a2: cstring; a3: int): int {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L456)  
```
proc crypt(a1, a2: cstring): cstring {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L457)  
```
proc ctermid(a1: cstring): cstring {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L458)  
```
proc dup(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L459)  
```
proc dup2(a1, a2: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L460)  
```
proc encrypt(a1: array[0 .. 63, char]; a2: cint) {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L461)  
```
proc execl(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L463)  
```
proc execle(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                     sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L464)  
```
proc execlp(a1, a2: cstring): cint {...}{.varargs, importc, header: "<unistd.h>",
                                     sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L465)  
```
proc execv(a1: cstring; a2: cstringArray): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L466)  
```
proc execve(a1: cstring; a2, a3: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L467)  
```
proc execvp(a1: cstring; a2: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L469)  
```
proc execvpe(a1: cstring; a2: cstringArray; a3: cstringArray): cint {...}{.importc,
    header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L470)  
```
proc fchown(a1: cint; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L471)  
```
proc fchdir(a1: cint): cint {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L472)  
```
proc fdatasync(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L473)  
```
proc fork(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L474)  
```
proc fpathconf(a1, a2: cint): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L475)  
```
proc fsync(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  synchronize a file's buffer cache to the storage device [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L476)  
```
proc ftruncate(a1: cint; a2: Off): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L479)  
```
proc getcwd(a1: cstring; a2: int): cstring {...}{.importc, header: "<unistd.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L480)  
```
proc getuid(): Uid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the real user ID of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L481)  
```
proc geteuid(): Uid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the effective user ID of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L484)  
```
proc getgid(): Gid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the real group ID of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L487)  
```
proc getegid(): Gid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the effective group ID of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L490)  
```
proc getgroups(a1: cint; a2: ptr array[0 .. 255, Gid]): cint {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L493)  
```
proc gethostid(): int {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L495)  
```
proc gethostname(a1: cstring; a2: int): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L496)  
```
proc getlogin(): cstring {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L497)  
```
proc getlogin_r(a1: cstring; a2: int): cint {...}{.importc, header: "<unistd.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L498)  
```
proc getopt(a1: cint; a2: cstringArray; a3: cstring): cint {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L500)  
```
proc getpgid(a1: Pid): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L502)  
```
proc getpgrp(): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L503)  
```
proc getpid(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the process ID (PID) of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L504)  
```
proc getppid(): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the process ID of the parent of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L507)  
```
proc getsid(a1: Pid): Pid {...}{.importc, header: "<unistd.h>", sideEffect.}
```
  returns the session ID of the calling process [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L510)  
```
proc getwd(a1: cstring): cstring {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L513)  
```
proc isatty(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L514)  
```
proc lchown(a1: cstring; a2: Uid; a3: Gid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L515)  
```
proc link(a1, a2: cstring): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L516)  
```
proc lockf(a1, a2: cint; a3: Off): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L518)  
```
proc lseek(a1: cint; a2: Off; a3: cint): Off {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L519)  
```
proc nice(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L520)  
```
proc pathconf(a1: cstring; a2: cint): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L521)  
```
proc pause(): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L523)  
```
proc pclose(a: File): cint {...}{.importc, header: "<stdio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L524)  
```
proc pipe(a: array[0 .. 1, cint]): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L525)  
```
proc popen(a1, a2: cstring): File {...}{.importc, header: "<stdio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L526)  
```
proc pread(a1: cint; a2: pointer; a3: int; a4: Off): int {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L527)  
```
proc pwrite(a1: cint; a2: pointer; a3: int; a4: Off): int {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L529)  
```
proc read(a1: cint; a2: pointer; a3: int): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L531)  
```
proc readlink(a1, a2: cstring; a3: int): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L532)  
```
proc ioctl(f: FileHandle; device: uint): int {...}{.importc: "ioctl",
    header: "<sys/ioctl.h>", varargs, tags: [WriteIOEffect].}
```
  A system call for device-specific input/output operations and other operations which cannot be expressed by regular system calls [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L533)  
```
proc rmdir(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L538)  
```
proc setegid(a1: Gid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L539)  
```
proc seteuid(a1: Uid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L540)  
```
proc setgid(a1: Gid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L541)  
```
proc setpgid(a1, a2: Pid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L543)  
```
proc setpgrp(): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L544)  
```
proc setregid(a1, a2: Gid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L545)  
```
proc setreuid(a1, a2: Uid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L546)  
```
proc setsid(): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L547)  
```
proc setuid(a1: Uid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L548)  
```
proc sleep(a1: cint): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L549)  
```
proc swab(a1, a2: pointer; a3: int) {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L550)  
```
proc symlink(a1, a2: cstring): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L551)  
```
proc sync() {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L552) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L552)  
```
proc sysconf(a1: cint): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L553)  
```
proc tcgetpgrp(a1: cint): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L554)  
```
proc tcsetpgrp(a1: cint; a2: Pid): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L555)  
```
proc truncate(a1: cstring; a2: Off): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L556)  
```
proc ttyname(a1: cint): cstring {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L557)  
```
proc ttyname_r(a1: cint; a2: cstring; a3: int): cint {...}{.importc,
    header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L558)  
```
proc ualarm(a1, a2: Useconds): Useconds {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L560)  
```
proc unlink(a1: cstring): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L561)  
```
proc usleep(a1: Useconds): cint {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L562)  
```
proc vfork(): Pid {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L563)  
```
proc write(a1: cint; a2: pointer; a3: int): int {...}{.importc, header: "<unistd.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L564)  
```
proc sem_close(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L566)  
```
proc sem_destroy(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L567)  
```
proc sem_getvalue(a1: ptr Sem; a2: var cint): cint {...}{.importc,
    header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L568)  
```
proc sem_init(a1: ptr Sem; a2: cint; a3: cint): cint {...}{.importc,
    header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L570)  
```
proc sem_open(a1: cstring; a2: cint): ptr Sem {...}{.varargs, importc,
    header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L572)  
```
proc sem_post(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L574)  
```
proc sem_timedwait(a1: ptr Sem; a2: ptr Timespec): cint {...}{.importc,
    header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L575)  
```
proc sem_trywait(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L577)  
```
proc sem_unlink(a1: cstring): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L578)  
```
proc sem_wait(a1: ptr Sem): cint {...}{.importc, header: "<semaphore.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L579)  
```
proc ftok(a1: cstring; a2: cint): Key {...}{.importc, header: "<sys/ipc.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L581)  
```
proc statvfs(a1: cstring; a2: var Statvfs): cint {...}{.importc,
    header: "<sys/statvfs.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L583) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L583)  
```
proc fstatvfs(a1: cint; a2: var Statvfs): cint {...}{.importc,
    header: "<sys/statvfs.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L585)  
```
proc chmod(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L588)  
```
proc fchmod(a1: cint; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
                                        sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L589)  
```
proc fstat(a1: cint; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L590)  
```
proc lstat(a1: cstring; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L591)  
```
proc mkdir(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>",
    sideEffect.}
```
  Use [os.createDir()](os#createDir,string) and similar. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L592)  
```
proc mkfifo(a1: cstring; a2: Mode): cint {...}{.importc, header: "<sys/stat.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L595)  
```
proc mknod(a1: cstring; a2: Mode; a3: Dev): cint {...}{.importc,
    header: "<sys/stat.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L596)  
```
proc stat(a1: cstring; a2: var Stat): cint {...}{.importc, header: "<sys/stat.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L598)  
```
proc umask(a1: Mode): Mode {...}{.importc, header: "<sys/stat.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L599) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L599)  
```
proc S_ISBLK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a block special file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L601)  
```
proc S_ISCHR(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a character special file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L603)  
```
proc S_ISDIR(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L605)  
```
proc S_ISFIFO(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a pipe or FIFO special file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L607) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L607)  
```
proc S_ISREG(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a regular file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L609)  
```
proc S_ISLNK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a symbolic link. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L611)  
```
proc S_ISSOCK(m: Mode): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a socket. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L613) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L613)  
```
proc S_TYPEISMQ(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a message queue. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L616)  
```
proc S_TYPEISSEM(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a semaphore. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L618)  
```
proc S_TYPEISSHM(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test for a shared memory object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L620)  
```
proc S_TYPEISTMO(buf: var Stat): bool {...}{.importc, header: "<sys/stat.h>".}
```
  Test macro for a typed memory object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L623)  
```
proc mlock(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L626)  
```
proc mlockall(a1: cint): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L627)  
```
proc mmap(a1: pointer; a2: int; a3, a4, a5: cint; a6: Off): pointer {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L628)  
```
proc mprotect(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L630)  
```
proc msync(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L632)  
```
proc munlock(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L634)  
```
proc munlockall(): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L635)  
```
proc munmap(a1: pointer; a2: int): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L636)  
```
proc posix_madvise(a1: pointer; a2: int; a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L637)  
```
proc posix_mem_offset(a1: pointer; a2: int; a3: var Off; a4: var int;
                      a5: var cint): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L639)  
```
proc posix_typed_mem_open(a1: cstring; a2, a3: cint): cint {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L645)  
```
proc shm_open(a1: cstring; a2: cint; a3: Mode): cint {...}{.importc,
    header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L647)  
```
proc shm_unlink(a1: cstring): cint {...}{.importc, header: "<sys/mman.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L649)  
```
proc asctime(a1: var Tm): cstring {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L651)  
```
proc asctime_r(a1: var Tm; a2: cstring): cstring {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L653)  
```
proc clock(): Clock {...}{.importc, header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L654)  
```
proc clock_getcpuclockid(a1: Pid; a2: var ClockId): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L655)  
```
proc clock_getres(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L657)  
```
proc clock_gettime(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L659)  
```
proc clock_nanosleep(a1: ClockId; a2: cint; a3: var Timespec; a4: var Timespec): cint {...}{.
    importc, header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L661)  
```
proc clock_settime(a1: ClockId; a2: var Timespec): cint {...}{.importc,
    header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L663)  
```
proc `==`(a, b: Time): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L666)  
```
proc `-`(a, b: Time): Time {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L667)  
```
proc ctime(a1: var Time): cstring {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L668)  
```
proc ctime_r(a1: var Time; a2: cstring): cstring {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L669)  
```
proc difftime(a1, a2: Time): cdouble {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L670)  
```
proc getdate(a1: cstring): ptr Tm {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L671)  
```
proc gmtime(a1: var Time): ptr Tm {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L672)  
```
proc gmtime_r(a1: var Time; a2: var Tm): ptr Tm {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L673)  
```
proc localtime(a1: var Time): ptr Tm {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L674)  
```
proc localtime_r(a1: var Time; a2: var Tm): ptr Tm {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L675)  
```
proc mktime(a1: var Tm): Time {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L676)  
```
proc timegm(a1: var Tm): Time {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L677)  
```
proc nanosleep(a1, a2: var Timespec): cint {...}{.importc, header: "<time.h>",
    sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L678)  
```
proc strftime(a1: cstring; a2: int; a3: cstring; a4: var Tm): int {...}{.importc,
    header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L679)  
```
proc strptime(a1, a2: cstring; a3: var Tm): cstring {...}{.importc,
    header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L681)  
```
proc time(a1: var Time): Time {...}{.importc, header: "<time.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L682)  
```
proc timer_create(a1: ClockId; a2: var SigEvent; a3: var Timer): cint {...}{.importc,
    header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L683)  
```
proc timer_delete(a1: Timer): cint {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L685)  
```
proc timer_gettime(a1: Timer; a2: var Itimerspec): cint {...}{.importc,
    header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L686)  
```
proc timer_getoverrun(a1: Timer): cint {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L688)  
```
proc timer_settime(a1: Timer; a2: cint; a3: var Itimerspec; a4: var Itimerspec): cint {...}{.
    importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L689)  
```
proc tzset() {...}{.importc, header: "<time.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L691)  
```
proc wait(a1: ptr cint): Pid {...}{.importc, discardable, header: "<sys/wait.h>",
                               sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L694)  
```
proc waitid(a1: cint; a2: Id; a3: var SigInfo; a4: cint): cint {...}{.importc,
    header: "<sys/wait.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L695)  
```
proc waitpid(a1: Pid; a2: var cint; a3: cint): Pid {...}{.importc,
    header: "<sys/wait.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L697)  
```
proc wait4(pid: Pid; status: ptr cint; options: cint; rusage: ptr Rusage): Pid {...}{.
    importc, header: "<sys/wait.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L708)  
```
proc getrusage(who: cint; rusage: ptr Rusage): cint {...}{.importc,
    header: "<sys/resource.h>", discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L717)  
```
proc bsd_signal(a1: cint; a2: proc (x: pointer) {...}{.noconv.}) {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L720)  
```
proc kill(a1: Pid; a2: cint): cint {...}{.importc, header: "<signal.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L722)  
```
proc killpg(a1: Pid; a2: cint): cint {...}{.importc, header: "<signal.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L723)  
```
proc pthread_kill(a1: Pthread; a2: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L724)  
```
proc pthread_sigmask(a1: cint; a2, a3: var Sigset): cint {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L725) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L725)  
```
proc `raise`(a1: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L727)  
```
proc sigaction(a1: cint; a2, a3: var Sigaction): cint {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L728)  
```
proc sigaction(a1: cint; a2: var Sigaction; a3: ptr Sigaction = nil): cint {...}{.
    importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L731)  
```
proc sigaddset(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L734) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L734)  
```
proc sigaltstack(a1, a2: var Stack): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L735)  
```
proc sigdelset(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L736)  
```
proc sigemptyset(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L737)  
```
proc sigfillset(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L738) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L738)  
```
proc sighold(a1: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L739)  
```
proc sigignore(a1: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L740) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L740)  
```
proc siginterrupt(a1, a2: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L741)  
```
proc sigismember(a1: var Sigset; a2: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L742)  
```
proc signal(a1: cint; a2: Sighandler) {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L743) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L743)  
```
proc sigpause(a1: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L745)  
```
proc sigpending(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L746)  
```
proc sigprocmask(a1: cint; a2, a3: var Sigset): cint {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L747)  
```
proc sigqueue(a1: Pid; a2: cint; a3: SigVal): cint {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L749)  
```
proc sigrelse(a1: cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L751)  
```
proc sigset(a1: int; a2: proc (x: cint) {...}{.noconv.}) {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L752) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L752)  
```
proc sigsuspend(a1: var Sigset): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L754)  
```
proc sigtimedwait(a1: var Sigset; a2: var SigInfo; a3: var Timespec): cint {...}{.
    importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L764) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L764)  
```
proc sigwait(a1: var Sigset; a2: var cint): cint {...}{.importc, header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L767) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L767)  
```
proc sigwaitinfo(a1: var Sigset; a2: var SigInfo): cint {...}{.importc,
    header: "<signal.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L769)  
```
proc catclose(a1: Nl_catd): cint {...}{.importc, header: "<nl_types.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L773) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L773)  
```
proc catgets(a1: Nl_catd; a2, a3: cint; a4: cstring): cstring {...}{.importc,
    header: "<nl_types.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L774) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L774)  
```
proc catopen(a1: cstring; a2: cint): Nl_catd {...}{.importc, header: "<nl_types.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L776) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L776)  
```
proc sched_get_priority_max(a1: cint): cint {...}{.importc, header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L779)  
```
proc sched_get_priority_min(a1: cint): cint {...}{.importc, header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L780) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L780)  
```
proc sched_getparam(a1: Pid; a2: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L781) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L781)  
```
proc sched_getscheduler(a1: Pid): cint {...}{.importc, header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L783) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L783)  
```
proc sched_rr_get_interval(a1: Pid; a2: var Timespec): cint {...}{.importc,
    header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L784) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L784)  
```
proc sched_setparam(a1: Pid; a2: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L786) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L786)  
```
proc sched_setscheduler(a1: Pid; a2: cint; a3: var Sched_param): cint {...}{.importc,
    header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L788) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L788)  
```
proc sched_yield(): cint {...}{.importc, header: "<sched.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L790) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L790)  
```
proc hstrerror(herrnum: cint): cstring {...}{.importc: "(char *)$1",
    header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L792)  
```
proc FD_CLR(a1: cint; a2: var TFdSet) {...}{.importc, header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L794)  
```
proc FD_ISSET(a1: cint | SocketHandle; a2: var TFdSet): cint {...}{.importc,
    header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L795) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L795)  
```
proc FD_SET(a1: cint | SocketHandle; a2: var TFdSet) {...}{.importc: "FD_SET",
    header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L797) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L797)  
```
proc FD_ZERO(a1: var TFdSet) {...}{.importc, header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L799)  
```
proc pselect(a1: cint; a2, a3, a4: ptr TFdSet; a5: ptr Timespec; a6: var Sigset): cint {...}{.
    importc, header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L801) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L801)  
```
proc select(a1: cint | SocketHandle; a2, a3, a4: ptr TFdSet; a5: ptr Timeval): cint {...}{.
    importc, header: "<sys/select.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L803) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L803)  
```
proc posix_spawn(a1: var Pid; a2: cstring; a3: var Tposix_spawn_file_actions;
                 a4: var Tposix_spawnattr; a5, a6: cstringArray): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L807) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L807)  
```
proc posix_spawn_file_actions_addclose(a1: var Tposix_spawn_file_actions;
                                       a2: cint): cint {...}{.importc,
    header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L811)  
```
proc posix_spawn_file_actions_adddup2(a1: var Tposix_spawn_file_actions;
                                      a2, a3: cint): cint {...}{.importc,
    header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L813) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L813)  
```
proc posix_spawn_file_actions_addopen(a1: var Tposix_spawn_file_actions;
                                      a2: cint; a3: cstring; a4: cint; a5: Mode): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L815) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L815)  
```
proc posix_spawn_file_actions_destroy(a1: var Tposix_spawn_file_actions): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L818) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L818)  
```
proc posix_spawn_file_actions_init(a1: var Tposix_spawn_file_actions): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L820) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L820)  
```
proc posix_spawnattr_destroy(a1: var Tposix_spawnattr): cint {...}{.importc,
    header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L822)  
```
proc posix_spawnattr_getsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L824)  
```
proc posix_spawnattr_getflags(a1: var Tposix_spawnattr; a2: var cshort): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L826) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L826)  
```
proc posix_spawnattr_getpgroup(a1: var Tposix_spawnattr; a2: var Pid): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L828) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L828)  
```
proc posix_spawnattr_getschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L830)  
```
proc posix_spawnattr_getschedpolicy(a1: var Tposix_spawnattr; a2: var cint): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L832)  
```
proc posix_spawnattr_getsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L834)  
```
proc posix_spawnattr_init(a1: var Tposix_spawnattr): cint {...}{.importc,
    header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L837) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L837)  
```
proc posix_spawnattr_setsigdefault(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L839)  
```
proc posix_spawnattr_setflags(a1: var Tposix_spawnattr; a2: cint): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L841)  
```
proc posix_spawnattr_setpgroup(a1: var Tposix_spawnattr; a2: Pid): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L843)  
```
proc posix_spawnattr_setschedparam(a1: var Tposix_spawnattr; a2: var Sched_param): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L846) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L846)  
```
proc posix_spawnattr_setschedpolicy(a1: var Tposix_spawnattr; a2: cint): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L848) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L848)  
```
proc posix_spawnattr_setsigmask(a1: var Tposix_spawnattr; a2: var Sigset): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L851) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L851)  
```
proc posix_spawnp(a1: var Pid; a2: cstring; a3: var Tposix_spawn_file_actions;
                  a4: var Tposix_spawnattr; a5, a6: cstringArray): cint {...}{.
    importc, header: "<spawn.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L853)  
```
proc getcontext(a1: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L859)  
```
proc makecontext(a1: var Ucontext; a4: proc () {...}{.noconv.}; a3: cint) {...}{.varargs,
    importc, header: "<ucontext.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L860) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L860)  
```
proc setcontext(a1: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L862) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L862)  
```
proc swapcontext(a1, a2: var Ucontext): cint {...}{.importc, header: "<ucontext.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L863)  
```
proc readv(a1: cint; a2: ptr IOVec; a3: cint): int {...}{.importc,
    header: "<sys/uio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L865) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L865)  
```
proc writev(a1: cint; a2: ptr IOVec; a3: cint): int {...}{.importc,
    header: "<sys/uio.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L867)  
```
proc CMSG_DATA(cmsg: ptr Tcmsghdr): cstring {...}{.importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L870) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L870)  
```
proc CMSG_NXTHDR(mhdr: ptr Tmsghdr; cmsg: ptr Tcmsghdr): ptr Tcmsghdr {...}{.importc,
    header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L873) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L873)  
```
proc CMSG_FIRSTHDR(mhdr: ptr Tmsghdr): ptr Tcmsghdr {...}{.importc,
    header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L876) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L876)  
```
proc CMSG_SPACE(len: csize): csize {...}{.importc, header: "<sys/socket.h>", deprecated: "argument `len` should be of type `csize_t`".}
```
   **Deprecated:** argument `len` should be of type `csize\_t`  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L879) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L879)  
```
proc CMSG_SPACE(len: csize_t): csize_t {...}{.importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L882) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L882)  
```
proc CMSG_LEN(len: csize): csize {...}{.importc, header: "<sys/socket.h>", deprecated: "argument `len` should be of type `csize_t`".}
```
   **Deprecated:** argument `len` should be of type `csize\_t`  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L885) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L885)  
```
proc CMSG_LEN(len: csize_t): csize_t {...}{.importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L888) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L888)  
```
proc `==`(x, y: SocketHandle): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L894) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L894)  
```
proc accept(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): SocketHandle {...}{.
    importc, header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L896) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L896)  
```
proc accept4(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen; flags: cint): SocketHandle {...}{.
    importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L900) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L900)  
```
proc bindSocket(a1: SocketHandle; a2: ptr SockAddr; a3: SockLen): cint {...}{.
    importc: "bind", header: "<sys/socket.h>".}
```
  is Posix's `bind`, because `bind` is a reserved word [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L903) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L903)  
```
proc connect(a1: SocketHandle; a2: ptr SockAddr; a3: SockLen): cint {...}{.importc,
    header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L907) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L907)  
```
proc getpeername(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L909) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L909)  
```
proc getsockname(a1: SocketHandle; a2: ptr SockAddr; a3: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L911)  
```
proc getsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: ptr SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L914) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L914)  
```
proc listen(a1: SocketHandle; a2: cint): cint {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L917) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L917)  
```
proc recv(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L919) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L919)  
```
proc recvfrom(a1: SocketHandle; a2: pointer; a3: int; a4: cint;
              a5: ptr SockAddr; a6: ptr SockLen): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L921) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L921)  
```
proc recvmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L924)  
```
proc send(a1: SocketHandle; a2: pointer; a3: int; a4: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L926) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L926)  
```
proc sendmsg(a1: SocketHandle; a2: ptr Tmsghdr; a3: cint): int {...}{.importc,
    header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L928) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L928)  
```
proc sendto(a1: SocketHandle; a2: pointer; a3: int; a4: cint; a5: ptr SockAddr;
            a6: SockLen): int {...}{.importc, header: "<sys/socket.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L930) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L930)  
```
proc setsockopt(a1: SocketHandle; a2, a3: cint; a4: pointer; a5: SockLen): cint {...}{.
    importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L933)  
```
proc shutdown(a1: SocketHandle; a2: cint): cint {...}{.importc,
    header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L935) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L935)  
```
proc socket(a1, a2, a3: cint): SocketHandle {...}{.importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L937) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L937)  
```
proc sockatmark(a1: cint): cint {...}{.importc, header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L939) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L939)  
```
proc socketpair(a1, a2, a3: cint; a4: var array[0 .. 1, cint]): cint {...}{.importc,
    header: "<sys/socket.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L941) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L941)  
```
proc if_nametoindex(a1: cstring): cint {...}{.importc, header: "<net/if.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L944) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L944)  
```
proc if_indextoname(a1: cint; a2: cstring): cstring {...}{.importc,
    header: "<net/if.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L945) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L945)  
```
proc if_nameindex(): ptr Tif_nameindex {...}{.importc, header: "<net/if.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L947) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L947)  
```
proc if_freenameindex(a1: ptr Tif_nameindex) {...}{.importc, header: "<net/if.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L948) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L948)  
```
proc IN6_IS_ADDR_UNSPECIFIED(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Unspecified address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L950)  
```
proc IN6_IS_ADDR_LOOPBACK(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Loopback address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L953) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L953)  
```
proc IN6_IS_ADDR_MULTICAST(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L956) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L956)  
```
proc IN6_IS_ADDR_LINKLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Unicast link-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L959) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L959)  
```
proc IN6_IS_ADDR_SITELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Unicast site-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L962) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L962)  
```
proc IN6_IS_ADDR_V4MAPPED(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  IPv4 mapped address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L970) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L970)  
```
proc IN6_IS_ADDR_V4COMPAT(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  IPv4-compatible address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L974) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L974)  
```
proc IN6_IS_ADDR_MC_NODELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast node-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L977) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L977)  
```
proc IN6_IS_ADDR_MC_LINKLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast link-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L980) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L980)  
```
proc IN6_IS_ADDR_MC_SITELOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast site-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L983) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L983)  
```
proc IN6_IS_ADDR_MC_ORGLOCAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast organization-local address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L986) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L986)  
```
proc IN6_IS_ADDR_MC_GLOBAL(a1: ptr In6Addr): cint {...}{.importc,
    header: "<netinet/in.h>".}
```
  Multicast global address. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L989) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L989)  
```
proc endhostent() {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L993) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L993)  
```
proc endnetent() {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L994) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L994)  
```
proc endprotoent() {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L995) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L995)  
```
proc endservent() {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L996) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L996)  
```
proc freeaddrinfo(a1: ptr AddrInfo) {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L997) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L997)  
```
proc gai_strerror(a1: cint): cstring {...}{.importc: "(char *)$1",
                                       header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L999) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L999)  
```
proc getaddrinfo(a1, a2: cstring; a3: ptr AddrInfo; a4: var ptr AddrInfo): cint {...}{.
    importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1001) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1001)  
```
proc gethostbyaddr(a1: pointer; a2: SockLen; a3: cint): ptr Hostent {...}{.importc,
    header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1005) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1005)  
```
proc gethostbyname(a1: cstring): ptr Hostent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1010) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1010)  
```
proc gethostent(): ptr Hostent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1011) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1011)  
```
proc getnameinfo(a1: ptr SockAddr; a2: SockLen; a3: cstring; a4: SockLen;
                 a5: cstring; a6: SockLen; a7: cint): cint {...}{.importc,
    header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1013)  
```
proc getnetbyaddr(a1: int32; a2: cint): ptr Tnetent {...}{.importc,
    header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1017)  
```
proc getnetbyname(a1: cstring): ptr Tnetent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1018) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1018)  
```
proc getnetent(): ptr Tnetent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1019) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1019)  
```
proc getprotobyname(a1: cstring): ptr Protoent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1021)  
```
proc getprotobynumber(a1: cint): ptr Protoent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1022) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1022)  
```
proc getprotoent(): ptr Protoent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1023) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1023)  
```
proc getservbyname(a1, a2: cstring): ptr Servent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1025) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1025)  
```
proc getservbyport(a1: cint; a2: cstring): ptr Servent {...}{.importc,
    header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1026) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1026)  
```
proc getservent(): ptr Servent {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1028) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1028)  
```
proc sethostent(a1: cint) {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1030) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1030)  
```
proc setnetent(a1: cint) {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1031) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1031)  
```
proc setprotoent(a1: cint) {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1032) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1032)  
```
proc setservent(a1: cint) {...}{.importc, header: "<netdb.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1033) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1033)  
```
proc poll(a1: ptr TPollfd; a2: Tnfds; a3: int): cint {...}{.importc,
    header: "<poll.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1036) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1036)  
```
proc realpath(name, resolved: cstring): cstring {...}{.importc: "realpath",
    header: "<stdlib.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1039)  
```
proc mkstemp(tmpl: cstring): cint {...}{.importc, header: "<stdlib.h>", sideEffect.}
```
  Creates a unique temporary file.

 **Warning**: The `tmpl` argument is written to by `mkstemp` and thus can't be a string literal. If in doubt make a copy of the cstring before passing it in.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1042) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1042)  
```
proc mkstemps(tmpl: cstring; suffixlen: int): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}
```
  Creates a unique temporary file.

 **Warning**: The `tmpl` argument is written to by `mkstemps` and thus can't be a string literal. If in doubt make a copy of the cstring before passing it in.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1049) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1049)  
```
proc mkdtemp(tmpl: cstring): pointer {...}{.importc, header: "<stdlib.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1056) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1056)  
```
proc mkostemp(tmpl: cstring; oflags: cint): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1059)  
```
proc mkostemps(tmpl: cstring; suffixlen: cint; oflags: cint): cint {...}{.importc,
    header: "<stdlib.h>", sideEffect.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1060) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1060)  
```
proc posix_memalign(memptr: pointer; alignment: csize_t; size: csize_t): cint {...}{.
    importc, header: "<stdlib.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1062) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1062)  
```
proc utimes(path: cstring; times: ptr array[2, Timeval]): int {...}{.
    importc: "utimes", header: "<sys/time.h>", sideEffect.}
```
  Sets file access and modification times.

 Pass the filename and an array of times to set the access and modification times respectively. If you pass nil as the array both attributes will be set to the current time.

 Returns zero on success.

 For more information read <http://www.unix.com/man-page/posix/3/utimes/>.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1064) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1064)  
```
proc setrlimit(resource: cint; rlp: var RLimit): cint {...}{.importc: "setrlimit",
    header: "<sys/resource.h>".}
```
  The setrlimit() system calls sets resource limits. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1105)  
```
proc getrlimit(resource: cint; rlp: var RLimit): cint {...}{.importc: "getrlimit",
    header: "<sys/resource.h>".}
```
  The getrlimit() system call gets resource limits. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1109)   Templates
---------

  
```
template onSignal(signals: varargs[cint]; body: untyped)
```
  Setup code to be executed when Unix signals are received. The currently handled signal is injected as `sig` into the calling scope.

 Example:

 
```
from posix import SIGINT, SIGTERM, onSignal
onSignal(SIGINT, SIGTERM):
  echo "bye from signal ", sig
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix.nim#L1078) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix.nim#L1078)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/posix.html>

posix\_utils
============

 A set of helpers for the POSIX module. Raw interfaces are in the other posix\*.nim files.

 Imports
-------

  <posix>  Types
-----

  
```
Uname = object
  sysname*, nodename*, release*, version*, machine*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L16)   Procs
-----

  
```
proc uname(): Uname {...}{.raises: [OSError], tags: [].}
```
  Provides system information in a `Uname` struct with sysname, nodename, release, version and machine attributes. **Example:**

 
```
echo uname().nodename, uname().release, uname().version
doAssert uname().sysname.len != 0
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L22)  
```
proc fsync(fd: int) {...}{.raises: [OSError], tags: [].}
```
  synchronize a file's buffer cache to the storage device [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L41)  
```
proc stat(path: string): Stat {...}{.raises: [OSError], tags: [].}
```
  Returns file status in a `Stat` structure [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L46)  
```
proc memoryLock(a1: pointer; a2: int) {...}{.raises: [OSError], tags: [].}
```
  Locks pages starting from a1 for a1 bytes and prevent them from being swapped. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L51)  
```
proc memoryLockAll(flags: int) {...}{.raises: [OSError], tags: [].}
```
  Locks all memory for the running process to prevent swapping.

 example:



```
memoryLockAll(MCL_CURRENT or MCL_FUTURE)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L56)  
```
proc memoryUnlock(a1: pointer; a2: int) {...}{.raises: [OSError], tags: [].}
```
  Unlock pages starting from a1 for a1 bytes and allow them to be swapped. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L65)  
```
proc memoryUnlockAll() {...}{.raises: [OSError], tags: [].}
```
  Unlocks all memory for the running process to allow swapping. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L70)  
```
proc sendSignal(pid: Pid; signal: int) {...}{.raises: [OSError], tags: [].}
```
  Sends a signal to a running process by calling `kill`. Raise exception in case of failure e.g. process not running. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L75)  
```
proc mkstemp(prefix: string; suffix = ""): (string, File) {...}{.raises: [OSError],
    tags: [].}
```
  Creates a unique temporary file from a prefix string. A six-character string will be added. If suffix is provided it will be added to the string The file is created with perms 0600. Returns the filename and a file opened in r/w mode. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L81)  
```
proc mkdtemp(prefix: string): string {...}{.raises: [OSError], tags: [].}
```
  Creates a unique temporary directory from a prefix string. Adds a six chars suffix. The directory is created with permissions 0700. Returns the directory name. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/posix_utils.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/posix_utils.nim#L103)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/posix_utils.html>

pcre
====

 Types
-----

  
```
Pcre = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L257)  
```
Pcre16 = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L258)  
```
Pcre32 = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L259)  
```
JitStack = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L260)  
```
JitStack16 = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L261)  
```
JitStack32 = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L262)  
```
ExtraData = object
  flags*: clong              ## Bits for which fields are set
  study_data*: pointer       ## Opaque data from pcre_study()
  match_limit*: clong        ## Maximum number of calls to match()
  callout_data*: pointer     ## Data passed back in callouts
  tables*: pointer           ## Pointer to character tables
  match_limit_recursion*: clong ## Max recursive calls to match()
  mark*: pointer             ## For passing back a mark pointer
  executable_jit*: pointer   ## Contains a pointer to a compiled jit code
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L271)  
```
CalloutBlock = object
  version*: cint             ## Identifies version of block
  callout_number*: cint      ## Number compiled into pattern
  offset_vector*: ptr cint   ## The offset vector
  subject*: cstring          ## The subject being matched
  subject_length*: cint      ## The length of the subject
  start_match*: cint         ## Offset to start of this match attempt
  current_position*: cint    ## Where we currently are in the subject
  capture_top*: cint         ## Max current capture
  capture_last*: cint        ## Most recently closed capture
  callout_data*: pointer     ## Data passed in with the call
  pattern_position*: cint    ## Offset to next item in the pattern
  next_item_length*: cint    ## Length of next item in the pattern
  mark*: pointer             ## Pointer to current mark or NULL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L286)  
```
JitCallback = proc (a: pointer): ptr JitStack {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L310)  
```
PPcre {...}{.deprecated.} = ptr Pcre
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L472)  
```
PJitStack {...}{.deprecated.} = ptr JitStack
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L473)   Consts
------

  
```
PCRE_MAJOR = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L13)  
```
PCRE_MINOR = 36
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L14)  
```
PCRE_PRERELEASE = true
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L15)  
```
PCRE_DATE = "2014-09-26"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L16)  
```
CASELESS = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L57)  
```
MULTILINE = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L58)  
```
DOTALL = 0x00000004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L59)  
```
EXTENDED = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L60)  
```
ANCHORED = 0x00000010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L61)  
```
DOLLAR_ENDONLY = 0x00000020
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L62)  
```
EXTRA = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L63)  
```
NOTBOL = 0x00000080
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L64)  
```
NOTEOL = 0x00000100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L65)  
```
UNGREEDY = 0x00000200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L66)  
```
NOTEMPTY = 0x00000400
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L67)  
```
UTF8 = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L68)  
```
UTF16 = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L69)  
```
UTF32 = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L70)  
```
NO_AUTO_CAPTURE = 0x00001000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L71)  
```
NO_UTF8_CHECK = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L72)  
```
NO_UTF16_CHECK = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L73)  
```
NO_UTF32_CHECK = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L74)  
```
AUTO_CALLOUT = 0x00004000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L75)  
```
PARTIAL_SOFT = 0x00008000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L76)  
```
PARTIAL = 0x00008000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L77)  
```
NEVER_UTF = 0x00010000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L81)  
```
DFA_SHORTEST = 0x00010000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L82)  
```
NO_AUTO_POSSESS = 0x00020000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L86)  
```
DFA_RESTART = 0x00020000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L87)  
```
FIRSTLINE = 0x00040000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L90)  
```
DUPNAMES = 0x00080000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L91)  
```
NEWLINE_CR = 0x00100000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L92)  
```
NEWLINE_LF = 0x00200000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L93)  
```
NEWLINE_CRLF = 0x00300000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L94)  
```
NEWLINE_ANY = 0x00400000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L95)  
```
NEWLINE_ANYCRLF = 0x00500000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L96)  
```
BSR_ANYCRLF = 0x00800000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L97)  
```
BSR_UNICODE = 0x01000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L98)  
```
JAVASCRIPT_COMPAT = 0x02000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L99)  
```
NO_START_OPTIMIZE = 0x04000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L100)  
```
NO_START_OPTIMISE = 0x04000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L101)  
```
PARTIAL_HARD = 0x08000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L102)  
```
NOTEMPTY_ATSTART = 0x10000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L103)  
```
UCP = 0x20000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L104)  
```
ERROR_NOMATCH = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L108)  
```
ERROR_NULL = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L109)  
```
ERROR_BADOPTION = -3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L110)  
```
ERROR_BADMAGIC = -4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L111)  
```
ERROR_UNKNOWN_OPCODE = -5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L112)  
```
ERROR_UNKNOWN_NODE = -5
```
  For backward compatibility [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L113)  
```
ERROR_NOMEMORY = -6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L114)  
```
ERROR_NOSUBSTRING = -7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L115)  
```
ERROR_MATCHLIMIT = -8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L116)  
```
ERROR_CALLOUT = -9
```
  Never used by PCRE itself [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L117)  
```
ERROR_BADUTF8 = -10
```
  Same for 8/16/32 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L118)  
```
ERROR_BADUTF16 = -10
```
  Same for 8/16/32 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L119)  
```
ERROR_BADUTF32 = -10
```
  Same for 8/16/32 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L120)  
```
ERROR_BADUTF8_OFFSET = -11
```
  Same for 8/16 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L121)  
```
ERROR_BADUTF16_OFFSET = -11
```
  Same for 8/16 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L122)  
```
ERROR_PARTIAL = -12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L123)  
```
ERROR_BADPARTIAL = -13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L124)  
```
ERROR_INTERNAL = -14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L125)  
```
ERROR_BADCOUNT = -15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L126)  
```
ERROR_DFA_UITEM = -16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L127)  
```
ERROR_DFA_UCOND = -17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L128)  
```
ERROR_DFA_UMLIMIT = -18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L129)  
```
ERROR_DFA_WSSIZE = -19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L130)  
```
ERROR_DFA_RECURSE = -20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L131)  
```
ERROR_RECURSIONLIMIT = -21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L132)  
```
ERROR_NULLWSLIMIT = -22
```
  No longer actually used [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L133)  
```
ERROR_BADNEWLINE = -23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L134)  
```
ERROR_BADOFFSET = -24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L135)  
```
ERROR_SHORTUTF8 = -25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L136)  
```
ERROR_SHORTUTF16 = -25
```
  Same for 8/16 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L137)  
```
ERROR_RECURSELOOP = -26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L138)  
```
ERROR_JIT_STACKLIMIT = -27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L139)  
```
ERROR_BADMODE = -28
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L140)  
```
ERROR_BADENDIANNESS = -29
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L141)  
```
ERROR_DFA_BADRESTART = -30
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L142)  
```
ERROR_JIT_BADOPTION = -31
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L143)  
```
ERROR_BADLENGTH = -32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L144)  
```
ERROR_UNSET = -33
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L145)  
```
UTF8_ERR0 = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L149)  
```
UTF8_ERR1 = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L150)  
```
UTF8_ERR2 = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L151)  
```
UTF8_ERR3 = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L152)  
```
UTF8_ERR4 = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L153)  
```
UTF8_ERR5 = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L154)  
```
UTF8_ERR6 = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L155)  
```
UTF8_ERR7 = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L156)  
```
UTF8_ERR8 = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L157)  
```
UTF8_ERR9 = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L158)  
```
UTF8_ERR10 = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L159)  
```
UTF8_ERR11 = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L160)  
```
UTF8_ERR12 = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L161)  
```
UTF8_ERR13 = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L162)  
```
UTF8_ERR14 = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L163)  
```
UTF8_ERR15 = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L164)  
```
UTF8_ERR16 = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L165)  
```
UTF8_ERR17 = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L166)  
```
UTF8_ERR18 = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L167)  
```
UTF8_ERR19 = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L168)  
```
UTF8_ERR20 = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L169)  
```
UTF8_ERR21 = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L170)  
```
UTF8_ERR22 = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L171)  
```
UTF16_ERR0 = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L175)  
```
UTF16_ERR1 = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L176)  
```
UTF16_ERR2 = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L177)  
```
UTF16_ERR3 = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L178)  
```
UTF16_ERR4 = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L179)  
```
UTF32_ERR0 = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L183)  
```
UTF32_ERR1 = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L184)  
```
UTF32_ERR2 = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L185)  
```
UTF32_ERR3 = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L186)  
```
INFO_OPTIONS = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L190)  
```
INFO_SIZE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L191)  
```
INFO_CAPTURECOUNT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L192)  
```
INFO_BACKREFMAX = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L193)  
```
INFO_FIRSTBYTE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L194)  
```
INFO_FIRSTCHAR = 4
```
  For backwards compatibility [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L195)  
```
INFO_FIRSTTABLE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L196)  
```
INFO_LASTLITERAL = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L197)  
```
INFO_NAMEENTRYSIZE = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L198)  
```
INFO_NAMECOUNT = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L199)  
```
INFO_NAMETABLE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L200)  
```
INFO_STUDYSIZE = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L201)  
```
INFO_DEFAULT_TABLES = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L202)  
```
INFO_OKPARTIAL = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L203)  
```
INFO_JCHANGED = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L204)  
```
INFO_HASCRORLF = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L205)  
```
INFO_MINLENGTH = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L206)  
```
INFO_JIT = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L207)  
```
INFO_JITSIZE = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L208)  
```
INFO_MAXLOOKBEHIND = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L209)  
```
INFO_FIRSTCHARACTER = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L210)  
```
INFO_FIRSTCHARACTERFLAGS = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L211)  
```
INFO_REQUIREDCHAR = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L212)  
```
INFO_REQUIREDCHARFLAGS = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L213)  
```
INFO_MATCHLIMIT = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L214)  
```
INFO_RECURSIONLIMIT = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L215)  
```
INFO_MATCH_EMPTY = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L216)  
```
CONFIG_UTF8 = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L221)  
```
CONFIG_NEWLINE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L222)  
```
CONFIG_LINK_SIZE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L223)  
```
CONFIG_POSIX_MALLOC_THRESHOLD = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L224)  
```
CONFIG_MATCH_LIMIT = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L225)  
```
CONFIG_STACKRECURSE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L226)  
```
CONFIG_UNICODE_PROPERTIES = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L227)  
```
CONFIG_MATCH_LIMIT_RECURSION = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L228)  
```
CONFIG_BSR = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L229)  
```
CONFIG_JIT = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L230)  
```
CONFIG_UTF16 = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L231)  
```
CONFIG_JITTARGET = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L232)  
```
CONFIG_UTF32 = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L233)  
```
CONFIG_PARENS_LIMIT = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L234)  
```
STUDY_JIT_COMPILE = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L239)  
```
STUDY_JIT_PARTIAL_SOFT_COMPILE = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L240)  
```
STUDY_JIT_PARTIAL_HARD_COMPILE = 0x00000004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L241)  
```
STUDY_EXTRA_NEEDED = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L242)  
```
EXTRA_STUDY_DATA = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L247)  
```
EXTRA_MATCH_LIMIT = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L248)  
```
EXTRA_CALLOUT_DATA = 0x00000004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L249)  
```
EXTRA_TABLES = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L250)  
```
EXTRA_MATCH_LIMIT_RECURSION = 0x00000010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L251)  
```
EXTRA_MARK = 0x00000020
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L252)  
```
EXTRA_EXECUTABLE_JIT = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L253)   Procs
-----

  
```
proc compile(pattern: cstring; options: cint; errptr: ptr cstring;
             erroffset: ptr cint; tableptr: pointer): ptr Pcre {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L333)  
```
proc compile2(pattern: cstring; options: cint; errorcodeptr: ptr cint;
              errptr: ptr cstring; erroffset: ptr cint; tableptr: pointer): ptr Pcre {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L339)  
```
proc config(what: cint; where: pointer): cint {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L346)  
```
proc copy_named_substring(code: ptr Pcre; subject: cstring; ovector: ptr cint;
                          stringcount: cint; stringname: cstring;
                          buffer: cstring; buffersize: cint): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L349)  
```
proc copy_substring(subject: cstring; ovector: ptr cint; stringcount: cint;
                    stringnumber: cint; buffer: cstring; buffersize: cint): cint {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L357)  
```
proc dfa_exec(code: ptr Pcre; extra: ptr ExtraData; subject: cstring;
              length: cint; startoffset: cint; options: cint; ovector: ptr cint;
              ovecsize: cint; workspace: ptr cint; wscount: cint): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L364)  
```
proc exec(code: ptr Pcre; extra: ptr ExtraData; subject: cstring; length: cint;
          startoffset: cint; options: cint; ovector: ptr cint; ovecsize: cint): cint {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L375)  
```
proc jit_exec(code: ptr Pcre; extra: ptr ExtraData; subject: cstring;
              length: cint; startoffset: cint; options: cint; ovector: ptr cint;
              ovecsize: cint; jstack: ptr JitStack): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L384)  
```
proc free_substring(stringptr: cstring) {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L394)  
```
proc free_substring_list(stringptr: cstringArray) {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L396)  
```
proc fullinfo(code: ptr Pcre; extra: ptr ExtraData; what: cint; where: pointer): cint {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L398)  
```
proc get_named_substring(code: ptr Pcre; subject: cstring; ovector: ptr cint;
                         stringcount: cint; stringname: cstring;
                         stringptr: cstringArray): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L403)  
```
proc get_stringnumber(code: ptr Pcre; name: cstring): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L410)  
```
proc get_stringtable_entries(code: ptr Pcre; name: cstring; first: cstringArray;
                             last: cstringArray): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L413)  
```
proc get_substring(subject: cstring; ovector: ptr cint; stringcount: cint;
                   stringnumber: cint; stringptr: cstringArray): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L418)  
```
proc get_substring_list(subject: cstring; ovector: ptr cint; stringcount: cint;
                        listptr: ptr cstringArray): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L424)  
```
proc maketables(): pointer {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L429)  
```
proc refcount(code: ptr Pcre; adjust: cint): cint {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L431)  
```
proc study(code: ptr Pcre; options: cint; errptr: ptr cstring): ptr ExtraData {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L434)  
```
proc free_study(extra: ptr ExtraData) {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L438)  
```
proc version(): cstring {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L440)  
```
proc pattern_to_host_byte_order(code: ptr Pcre; extra: ptr ExtraData;
                                tables: pointer): cint {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L444)  
```
proc jit_stack_alloc(startsize: cint; maxsize: cint): ptr JitStack {...}{.cdecl,
    importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L450)  
```
proc jit_stack_free(stack: ptr JitStack) {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L453)  
```
proc assign_jit_stack(extra: ptr ExtraData; callback: JitCallback; data: pointer) {...}{.
    cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L455)  
```
proc jit_free_unused_memory() {...}{.cdecl, importc: "pcre_$1".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L459)  
```
proc study(code: ptr Pcre; options: cint; errptr: var cstring): ptr ExtraData {...}{.
    deprecated, cdecl, importc: "pcre_$1".}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/pcre.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/pcre.nim#L463)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/pcre.html>

iup
===


Wrapper for the [IUP native GUI library](http://webserver2.tecgraf.puc-rio.br/iup).

 Requires `iup.dll` on Windows, `libiup.so` on Linux, `libiup.dylib` on OS X. Compile with `-d:nimDebugDlOpen` to debug the shared library opening.

 Examples
--------


![]
```
import os, iup
var argc = create(cint)
argc[] = paramCount().cint
var argv = allocCstringArray(commandLineParams())
assert open(argc, argv.addr) == 0         # UIP requires calling open()
message(r"Hello world 1", r"Hello world") # Message popup
close()                                   # UIP requires calling close()
```

![]
```
import os, iup
var argc = create(cint)
argc[] = paramCount().cint
var argv = allocCstringArray(commandLineParams())
assert open(argc, argv.addr) == 0            # UIP requires open()
let textarea = text(nil)                     # Text widget.
setAttribute(textarea, r"MULTILINE", r"YES") # Set text widget to multiline.
setAttribute(textarea, r"EXPAND", r"YES")    # Set text widget to auto expand.
let layout = vbox(textarea)                  # Vertical layout.
let window = dialog(layout)                  # Dialog window.
setAttribute(window, "TITLE", "Nim Notepad") # Set window title.
showXY(window, IUP_CENTER, IUP_CENTER)       # Show window.
mainLoop()                                   # Main loop.
close()                                      # UIP requires calling close()
```
 Types
-----

  
```
PIhandle = ptr Ihandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L94)  
```
Icallback = proc (arg: PIhandle): cint {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L96)  
```
Iparamcb = proc (dialog: PIhandle; paramIndex: cint; userData: pointer): cint {...}{.
    cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L124)   Consts
------

  
```
IUP_NAME = "IUP - Portable User Interface"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L85)  
```
IUP_COPYRIGHT = "Copyright (C) 1994-2009 Tecgraf, PUC-Rio."
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L86)  
```
IUP_DESCRIPTION = "Portable toolkit for building graphical user interfaces."
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L87)  
```
constIUP_VERSION = "3.0"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L88)  
```
constIUP_VERSION_NUMBER = 300000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L89)  
```
constIUP_VERSION_DATE = "2009/07/18"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L90)  
```
IUP_ERROR = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L415)  
```
IUP_NOERROR = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L416)  
```
IUP_OPENED = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L417)  
```
IUP_INVALID = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L418)  
```
IUP_IGNORE = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L421)  
```
IUP_DEFAULT = -2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L422)  
```
IUP_CLOSE = -3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L423)  
```
IUP_CONTINUE = -4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L424)  
```
IUP_CENTER = 65535'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L427)  
```
IUP_LEFT = 65534'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L428)  
```
IUP_RIGHT = 65533'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L429)  
```
IUP_MOUSEPOS = 65532'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L430) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L430)  
```
IUP_CURRENT = 65531'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L431)  
```
IUP_CENTERPARENT = 65530'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L432)  
```
IUP_TOP = 65534'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L433)  
```
IUP_BOTTOM = 65533'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L434)  
```
IUP_SHOW = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L437)  
```
IUP_RESTORE = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L438)  
```
IUP_MINIMIZE = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L439)  
```
IUP_MAXIMIZE = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L440)  
```
IUP_HIDE = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L441)  
```
IUP_SBUP = 0'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L444)  
```
IUP_SBDN = 1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L445)  
```
IUP_SBPGUP = 2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L446)  
```
IUP_SBPGDN = 3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L447)  
```
IUP_SBPOSV = 4'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L448)  
```
IUP_SBDRAGV = 5'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L449)  
```
IUP_SBLEFT = 6'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L450)  
```
IUP_SBRIGHT = 7'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L451)  
```
IUP_SBPGLEFT = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L452)  
```
IUP_SBPGRIGHT = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L453)  
```
IUP_SBPOSH = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L454)  
```
IUP_SBDRAGH = 11'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L455)  
```
IUP_BUTTON1 = 49'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L458)  
```
IUP_BUTTON2 = 50'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L459)  
```
IUP_BUTTON3 = 51'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L460)  
```
IUP_BUTTON4 = 52'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L461)  
```
IUP_BUTTON5 = 53'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L462)  
```
IUP_MASK_FLOAT = "[+/-]?(/d+/.?/d*|/./d+)"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L477)  
```
IUP_MASK_UFLOAT = "(/d+/.?/d*|/./d+)"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L478)  
```
IUP_MASK_EFLOAT = "[+/-]?(/d+/.?/d*|/./d+)([eE][+/-]?/d+)?"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L479)  
```
IUP_MASK_INT = "[+/-]?/d+"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L480)  
```
IUP_MASK_UINT = "/d+"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L481)  
```
K_SP = 32'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L486)  
```
K_exclam = 33'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L487)  
```
K_quotedbl = 34'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L488)  
```
K_numbersign = 35'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L489) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L489)  
```
K_dollar = 36'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L490)  
```
K_percent = 37'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L491)  
```
K_ampersand = 38'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L492)  
```
K_apostrophe = 39'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L493)  
```
K_parentleft = 40'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L494)  
```
K_parentright = 41'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L495)  
```
K_asterisk = 42'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L496)  
```
K_plus = 43'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L497)  
```
K_comma = 44'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L498)  
```
K_minus = 45'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L499) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L499)  
```
K_period = 46'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L500)  
```
K_slash = 47'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L501)  
```
K_0 = 48'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L502)  
```
K_1 = 49'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L503)  
```
K_2 = 50'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L504)  
```
K_3 = 51'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L505)  
```
K_4 = 52'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L506)  
```
K_5 = 53'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L507)  
```
K_6 = 54'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L508)  
```
K_7 = 55'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L509) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L509)  
```
K_8 = 56'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L510)  
```
K_9 = 57'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L511)  
```
K_colon = 58'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L512)  
```
K_semicolon = 59'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L513)  
```
K_less = 60'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L514)  
```
K_equal = 61'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L515)  
```
K_greater = 62'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L516)  
```
K_question = 63'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L517)  
```
K_at = 64'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L518)  
```
K_upperA = 65'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L519)  
```
K_upperB = 66'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L520)  
```
K_upperC = 67'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L521)  
```
K_upperD = 68'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L522)  
```
K_upperE = 69'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L523)  
```
K_upperF = 70'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L524)  
```
K_upperG = 71'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L525)  
```
K_upperH = 72'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L526)  
```
K_upperI = 73'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L527)  
```
K_upperJ = 74'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L528)  
```
K_upperK = 75'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L529)  
```
K_upperL = 76'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L530)  
```
K_upperM = 77'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L531)  
```
K_upperN = 78'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L532)  
```
K_upperO = 79'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L533)  
```
K_upperP = 80'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L534)  
```
K_upperQ = 81'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L535)  
```
K_upperR = 82'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L536) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L536)  
```
K_upperS = 83'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L537)  
```
K_upperT = 84'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L538)  
```
K_upperU = 85'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L539)  
```
K_upperV = 86'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L540)  
```
K_upperW = 87'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L541)  
```
K_upperX = 88'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L542)  
```
K_upperY = 89'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L543)  
```
K_upperZ = 90'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L544)  
```
K_bracketleft = 91'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L545)  
```
K_backslash = 92'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L546)  
```
K_bracketright = 93'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L547)  
```
K_circum = 94'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L548)  
```
K_underscore = 95'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L549)  
```
K_grave = 96'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L550)  
```
K_lowera = 97'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L551)  
```
K_lowerb = 98'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L552) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L552)  
```
K_lowerc = 99'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L553)  
```
K_lowerd = 100'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L554)  
```
K_lowere = 101'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L555)  
```
K_lowerf = 102'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L556)  
```
K_lowerg = 103'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L557)  
```
K_lowerh = 104'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L558)  
```
K_loweri = 105'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L559)  
```
K_lowerj = 106'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L560)  
```
K_lowerk = 107'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L561)  
```
K_lowerl = 108'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L562)  
```
K_lowerm = 109'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L563)  
```
K_lowern = 110'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L564)  
```
K_lowero = 111'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L565)  
```
K_lowerp = 112'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L566)  
```
K_lowerq = 113'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L567)  
```
K_lowerr = 114'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L568)  
```
K_lowers = 115'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L569)  
```
K_lowert = 116'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L570)  
```
K_loweru = 117'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L571)  
```
K_lowerv = 118'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L572)  
```
K_lowerw = 119'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L573)  
```
K_lowerx = 120'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L574)  
```
K_lowery = 121'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L575)  
```
K_lowerz = 122'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L576)  
```
K_braceleft = 123'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L577)  
```
K_bar = 124'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L578)  
```
K_braceright = 125'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L579)  
```
K_tilde = 126'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L580)  
```
K_BS = 8'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L586)  
```
K_TAB = 9'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L587) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L587)  
```
K_LF = 10'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L588)  
```
K_CR = 13'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L589)  
```
IUP_NUMMAXCODES = 1280
```
  5\*256=1280 Normal+Shift+Ctrl+Alt+Sys [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L612)  
```
K_HOME = 129
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L614) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L614)  
```
K_UP = 130
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L615)  
```
K_PGUP = 131
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L616)  
```
K_LEFT = 132
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L617)  
```
K_MIDDLE = 133
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L618)  
```
K_RIGHT = 134
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L619)  
```
K_END = 135
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L620)  
```
K_DOWN = 136
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L621) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L621)  
```
K_PGDN = 137
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L622)  
```
K_INS = 138
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L623)  
```
K_DEL = 139
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L624) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L624)  
```
K_PAUSE = 140
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L625) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L625)  
```
K_ESC = 141
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L626)  
```
K_ccedilla = 142
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L627)  
```
K_F1 = 143
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L628)  
```
K_F2 = 144
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L629) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L629)  
```
K_F3 = 145
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L630)  
```
K_F4 = 146
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L631)  
```
K_F5 = 147
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L632)  
```
K_F6 = 148
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L633)  
```
K_F7 = 149
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L634)  
```
K_F8 = 150
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L635)  
```
K_F9 = 151
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L636)  
```
K_F10 = 152
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L637)  
```
K_F11 = 153
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L638) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L638)  
```
K_F12 = 154
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L639)  
```
K_Print = 155
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L640)  
```
K_Menu = 156
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L641)  
```
K_acute = 157
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L643) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L643)  
```
K_sHOME = 385
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L645)  
```
K_sUP = 386
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L646)  
```
K_sPGUP = 387
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L647)  
```
K_sLEFT = 388
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L648)  
```
K_sMIDDLE = 389
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L649)  
```
K_sRIGHT = 390
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L650)  
```
K_sEND = 391
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L651)  
```
K_sDOWN = 392
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L652) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L652)  
```
K_sPGDN = 393
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L653)  
```
K_sINS = 394
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L654)  
```
K_sDEL = 395
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L655)  
```
K_sSP = 288
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L656)  
```
K_sTAB = 265
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L657)  
```
K_sCR = 269
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L658)  
```
K_sBS = 264
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L659)  
```
K_sPAUSE = 396
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L660)  
```
K_sESC = 397
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L661)  
```
K_sCcedilla = 398
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L662)  
```
K_sF1 = 399
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L663)  
```
K_sF2 = 400
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L664) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L664)  
```
K_sF3 = 401
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L665) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L665)  
```
K_sF4 = 402
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L666)  
```
K_sF5 = 403
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L667)  
```
K_sF6 = 404
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L668)  
```
K_sF7 = 405
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L669)  
```
K_sF8 = 406
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L670)  
```
K_sF9 = 407
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L671) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L671)  
```
K_sF10 = 408
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L672)  
```
K_sF11 = 409
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L673)  
```
K_sF12 = 410
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L674)  
```
K_sPrint = 411
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L675) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L675)  
```
K_sMenu = 412
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L676)  
```
K_cHOME = 641
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L678)  
```
K_cUP = 642
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L679)  
```
K_cPGUP = 643
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L680)  
```
K_cLEFT = 644
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L681) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L681)  
```
K_cMIDDLE = 645
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L682)  
```
K_cRIGHT = 646
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L683) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L683)  
```
K_cEND = 647
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L684)  
```
K_cDOWN = 648
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L685)  
```
K_cPGDN = 649
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L686)  
```
K_cINS = 650
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L687) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L687)  
```
K_cDEL = 651
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L688)  
```
K_cSP = 544
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L689)  
```
K_cTAB = 521
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L690)  
```
K_cCR = 525
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L691)  
```
K_cBS = 520
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L692) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L692)  
```
K_cPAUSE = 652
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L693)  
```
K_cESC = 653
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L694)  
```
K_cCcedilla = 654
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L695)  
```
K_cF1 = 655
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L696)  
```
K_cF2 = 656
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L697)  
```
K_cF3 = 657
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L698)  
```
K_cF4 = 658
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L699)  
```
K_cF5 = 659
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L700)  
```
K_cF6 = 660
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L701)  
```
K_cF7 = 661
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L702)  
```
K_cF8 = 662
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L703)  
```
K_cF9 = 663
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L704)  
```
K_cF10 = 664
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L705) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L705)  
```
K_cF11 = 665
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L706) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L706)  
```
K_cF12 = 666
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L707)  
```
K_cPrint = 667
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L708)  
```
K_cMenu = 668
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L709) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L709)  
```
K_mHOME = 897
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L711)  
```
K_mUP = 898
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L712)  
```
K_mPGUP = 899
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L713)  
```
K_mLEFT = 900
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L714)  
```
K_mMIDDLE = 901
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L715)  
```
K_mRIGHT = 902
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L716)  
```
K_mEND = 903
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L717)  
```
K_mDOWN = 904
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L718)  
```
K_mPGDN = 905
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L719) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L719)  
```
K_mINS = 906
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L720)  
```
K_mDEL = 907
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L721) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L721)  
```
K_mSP = 800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L722)  
```
K_mTAB = 777
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L723)  
```
K_mCR = 781
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L724)  
```
K_mBS = 776
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L725) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L725)  
```
K_mPAUSE = 908
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L726) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L726)  
```
K_mESC = 909
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L727)  
```
K_mCcedilla = 910
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L728)  
```
K_mF1 = 911
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L729) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L729)  
```
K_mF2 = 912
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L730) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L730)  
```
K_mF3 = 913
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L731)  
```
K_mF4 = 914
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L732) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L732)  
```
K_mF5 = 915
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L733) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L733)  
```
K_mF6 = 916
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L734) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L734)  
```
K_mF7 = 917
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L735)  
```
K_mF8 = 918
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L736)  
```
K_mF9 = 919
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L737)  
```
K_mF10 = 920
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L738) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L738)  
```
K_mF11 = 921
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L739)  
```
K_mF12 = 922
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L740) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L740)  
```
K_mPrint = 923
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L741)  
```
K_mMenu = 924
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L742)  
```
K_yHOME = 1153
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L744) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L744)  
```
K_yUP = 1154
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L745)  
```
K_yPGUP = 1155
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L746)  
```
K_yLEFT = 1156
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L747)  
```
K_yMIDDLE = 1157
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L748) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L748)  
```
K_yRIGHT = 1158
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L749)  
```
K_yEND = 1159
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L750)  
```
K_yDOWN = 1160
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L751)  
```
K_yPGDN = 1161
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L752) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L752)  
```
K_yINS = 1162
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L753) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L753)  
```
K_yDEL = 1163
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L754)  
```
K_ySP = 1056
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L755) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L755)  
```
K_yTAB = 1033
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L756) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L756)  
```
K_yCR = 1037
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L757) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L757)  
```
K_yBS = 1032
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L758) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L758)  
```
K_yPAUSE = 1164
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L759) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L759)  
```
K_yESC = 1165
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L760)  
```
K_yCcedilla = 1166
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L761) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L761)  
```
K_yF1 = 1167
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L762) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L762)  
```
K_yF2 = 1168
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L763) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L763)  
```
K_yF3 = 1169
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L764) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L764)  
```
K_yF4 = 1170
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L765) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L765)  
```
K_yF5 = 1171
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L766)  
```
K_yF6 = 1172
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L767) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L767)  
```
K_yF7 = 1173
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L768) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L768)  
```
K_yF8 = 1174
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L769)  
```
K_yF9 = 1175
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L770) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L770)  
```
K_yF10 = 1176
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L771) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L771)  
```
K_yF11 = 1177
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L772)  
```
K_yF12 = 1178
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L773) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L773)  
```
K_yPrint = 1179
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L774) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L774)  
```
K_yMenu = 1180
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L775) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L775)  
```
K_sPlus = 299
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L777) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L777)  
```
K_sComma = 300
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L778) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L778)  
```
K_sMinus = 301
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L779) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L779)  
```
K_sPeriod = 302
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L780) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L780)  
```
K_sSlash = 303
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L781) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L781)  
```
K_sAsterisk = 298
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L782) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L782)  
```
K_cupperA = 577
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L784) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L784)  
```
K_cupperB = 578
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L785) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L785)  
```
K_cupperC = 579
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L786) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L786)  
```
K_cupperD = 580
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L787) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L787)  
```
K_cupperE = 581
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L788) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L788)  
```
K_cupperF = 582
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L789) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L789)  
```
K_cupperG = 583
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L790) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L790)  
```
K_cupperH = 584
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L791) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L791)  
```
K_cupperI = 585
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L792)  
```
K_cupperJ = 586
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L793) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L793)  
```
K_cupperK = 587
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L794)  
```
K_cupperL = 588
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L795) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L795)  
```
K_cupperM = 589
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L796)  
```
K_cupperN = 590
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L797) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L797)  
```
K_cupperO = 591
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L798) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L798)  
```
K_cupperP = 592
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L799)  
```
K_cupperQ = 593
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L800) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L800)  
```
K_cupperR = 594
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L801) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L801)  
```
K_cupperS = 595
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L802) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L802)  
```
K_cupperT = 596
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L803) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L803)  
```
K_cupperU = 597
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L804) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L804)  
```
K_cupperV = 598
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L805) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L805)  
```
K_cupperW = 599
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L806) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L806)  
```
K_cupperX = 600
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L807) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L807)  
```
K_cupperY = 601
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L808) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L808)  
```
K_cupperZ = 602
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L809) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L809)  
```
K_c1 = 561
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L810) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L810)  
```
K_c2 = 562
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L811)  
```
K_c3 = 563
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L812) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L812)  
```
K_c4 = 564
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L813) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L813)  
```
K_c5 = 565
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L814) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L814)  
```
K_c6 = 566
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L815) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L815)  
```
K_c7 = 567
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L816)  
```
K_c8 = 568
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L817) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L817)  
```
K_c9 = 569
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L818) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L818)  
```
K_c0 = 560
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L819) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L819)  
```
K_cPlus = 555
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L820) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L820)  
```
K_cComma = 556
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L821) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L821)  
```
K_cMinus = 557
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L822)  
```
K_cPeriod = 558
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L823) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L823)  
```
K_cSlash = 559
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L824) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L824)  
```
K_cSemicolon = 571
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L825) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L825)  
```
K_cEqual = 573
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L826) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L826)  
```
K_cBracketleft = 603
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L827) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L827)  
```
K_cBracketright = 605
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L828) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L828)  
```
K_cBackslash = 604
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L829)  
```
K_cAsterisk = 554
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L830)  
```
K_mupperA = 833
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L832)  
```
K_mupperB = 834
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L833)  
```
K_mupperC = 835
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L834)  
```
K_mupperD = 836
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L835) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L835)  
```
K_mupperE = 837
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L836) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L836)  
```
K_mupperF = 838
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L837) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L837)  
```
K_mupperG = 839
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L838) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L838)  
```
K_mupperH = 840
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L839)  
```
K_mupperI = 841
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L840) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L840)  
```
K_mupperJ = 842
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L841)  
```
K_mupperK = 843
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L842) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L842)  
```
K_mupperL = 844
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L843)  
```
K_mupperM = 845
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L844) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L844)  
```
K_mupperN = 846
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L845)  
```
K_mupperO = 847
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L846) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L846)  
```
K_mupperP = 848
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L847) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L847)  
```
K_mupperQ = 849
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L848) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L848)  
```
K_mupperR = 850
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L849) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L849)  
```
K_mupperS = 851
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L850) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L850)  
```
K_mupperT = 852
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L851) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L851)  
```
K_mupperU = 853
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L852) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L852)  
```
K_mupperV = 854
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L853)  
```
K_mupperW = 855
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L854) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L854)  
```
K_mupperX = 856
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L855) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L855)  
```
K_mupperY = 857
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L856) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L856)  
```
K_mupperZ = 858
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L857) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L857)  
```
K_m1 = 817
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L858) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L858)  
```
K_m2 = 818
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L859) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L859)  
```
K_m3 = 819
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L860) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L860)  
```
K_m4 = 820
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L861) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L861)  
```
K_m5 = 821
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L862) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L862)  
```
K_m6 = 822
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L863)  
```
K_m7 = 823
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L864)  
```
K_m8 = 824
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L865) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L865)  
```
K_m9 = 825
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L866) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L866)  
```
K_m0 = 816
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L867)  
```
K_mPlus = 811
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L868)  
```
K_mComma = 812
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L869) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L869)  
```
K_mMinus = 813
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L870) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L870)  
```
K_mPeriod = 814
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L871) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L871)  
```
K_mSlash = 815
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L872) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L872)  
```
K_mSemicolon = 827
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L873) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L873)  
```
K_mEqual = 829
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L874) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L874)  
```
K_mBracketleft = 859
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L875) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L875)  
```
K_mBracketright = 861
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L876) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L876)  
```
K_mBackslash = 860
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L877) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L877)  
```
K_mAsterisk = 810
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L878) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L878)  
```
K_yA = 1089
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L880) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L880)  
```
K_yB = 1090
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L881) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L881)  
```
K_yC = 1091
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L882) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L882)  
```
K_yD = 1092
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L883) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L883)  
```
K_yE = 1093
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L884) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L884)  
```
K_yF = 1094
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L885) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L885)  
```
K_yG = 1095
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L886) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L886)  
```
K_yH = 1096
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L887) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L887)  
```
K_yI = 1097
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L888) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L888)  
```
K_yJ = 1098
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L889) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L889)  
```
K_yK = 1099
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L890)  
```
K_yL = 1100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L891) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L891)  
```
K_yM = 1101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L892) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L892)  
```
K_yN = 1102
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L893) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L893)  
```
K_yO = 1103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L894) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L894)  
```
K_yP = 1104
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L895) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L895)  
```
K_yQ = 1105
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L896) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L896)  
```
K_yR = 1106
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L897) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L897)  
```
K_yS = 1107
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L898) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L898)  
```
K_yT = 1108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L899) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L899)  
```
K_yU = 1109
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L900) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L900)  
```
K_yV = 1110
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L901) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L901)  
```
K_yW = 1111
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L902) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L902)  
```
K_yX = 1112
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L903) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L903)  
```
K_yY = 1113
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L904) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L904)  
```
K_yZ = 1114
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L905) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L905)  
```
K_y1 = 1073
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L906) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L906)  
```
K_y2 = 1074
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L907) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L907)  
```
K_y3 = 1075
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L908) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L908)  
```
K_y4 = 1076
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L909) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L909)  
```
K_y5 = 1077
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L910) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L910)  
```
K_y6 = 1078
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L911)  
```
K_y7 = 1079
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L912) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L912)  
```
K_y8 = 1080
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L913) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L913)  
```
K_y9 = 1081
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L914) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L914)  
```
K_y0 = 1072
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L915) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L915)  
```
K_yPlus = 1067
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L916) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L916)  
```
K_yComma = 1068
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L917) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L917)  
```
K_yMinus = 1069
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L918)  
```
K_yPeriod = 1070
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L919) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L919)  
```
K_ySlash = 1071
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L920) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L920)  
```
K_ySemicolon = 1083
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L921) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L921)  
```
K_yEqual = 1085
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L922) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L922)  
```
K_yBracketleft = 1115
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L923) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L923)  
```
K_yBracketright = 1117
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L924)  
```
K_yBackslash = 1116
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L925) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L925)  
```
K_yAsterisk = 1066
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L926) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L926)  
```
IUP_PRIMARY = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L961) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L961)  
```
IUP_SECONDARY = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L962) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L962)   Procs
-----

  
```
proc fileDlg(): PIhandle {...}{.importc: "IupFileDlg", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L99)  
```
proc messageDlg(): PIhandle {...}{.importc: "IupMessageDlg", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L100)  
```
proc colorDlg(): PIhandle {...}{.importc: "IupColorDlg", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L101)  
```
proc fontDlg(): PIhandle {...}{.importc: "IupFontDlg", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L102)  
```
proc getFile(arq: cstring): cint {...}{.importc: "IupGetFile", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L104)  
```
proc message(title, msg: cstring) {...}{.importc: "IupMessage", dynlib: dllname,
                                    cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L106)  
```
proc messagef(title, format: cstring) {...}{.importc: "IupMessagef", dynlib: dllname,
                                        cdecl, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L108)  
```
proc alarm(title, msg, b1, b2, b3: cstring): cint {...}{.importc: "IupAlarm",
    dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L110)  
```
proc scanf(format: cstring): cint {...}{.importc: "IupScanf", dynlib: dllname, cdecl,
                                    varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L112)  
```
proc listDialog(theType: cint; title: cstring; size: cint; list: cstringArray;
                op, maxCol, maxLin: cint; marks: ptr cint): cint {...}{.
    importc: "IupListDialog", dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L114)  
```
proc getText(title, text: cstring): cint {...}{.importc: "IupGetText",
    dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L118)  
```
proc getColor(x, y: cint; r, g, b: var byte): cint {...}{.importc: "IupGetColor",
    dynlib: dllname, cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L120)  
```
proc getParam(title: cstring; action: Iparamcb; userData: pointer;
              format: cstring): cint {...}{.importc: "IupGetParam", cdecl, varargs,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L127)  
```
proc getParamv(title: cstring; action: Iparamcb; userData: pointer;
               format: cstring; paramCount, paramExtra: cint; paramData: pointer): cint {...}{.
    importc: "IupGetParamv", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L130)  
```
proc open(argc: ptr cint; argv: ptr cstringArray): cint {...}{.importc: "IupOpen",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L138)  
```
proc close() {...}{.importc: "IupClose", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L140)  
```
proc imageLibOpen() {...}{.importc: "IupImageLibOpen", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L141)  
```
proc mainLoop(): cint {...}{.importc: "IupMainLoop", cdecl, dynlib: dllname,
                        discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L143)  
```
proc loopStep(): cint {...}{.importc: "IupLoopStep", cdecl, dynlib: dllname,
                        discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L145)  
```
proc mainLoopLevel(): cint {...}{.importc: "IupMainLoopLevel", cdecl,
                             dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L147)  
```
proc flush() {...}{.importc: "IupFlush", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L149)  
```
proc exitLoop() {...}{.importc: "IupExitLoop", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L150)  
```
proc update(ih: PIhandle) {...}{.importc: "IupUpdate", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L152)  
```
proc updateChildren(ih: PIhandle) {...}{.importc: "IupUpdateChildren", cdecl,
                                    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L153)  
```
proc redraw(ih: PIhandle; children: cint) {...}{.importc: "IupRedraw", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L154)  
```
proc refresh(ih: PIhandle) {...}{.importc: "IupRefresh", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L155)  
```
proc mapFont(iupfont: cstring): cstring {...}{.importc: "IupMapFont", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L157)  
```
proc unMapFont(driverfont: cstring): cstring {...}{.importc: "IupUnMapFont", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L158)  
```
proc help(url: cstring): cint {...}{.importc: "IupHelp", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L159)  
```
proc load(filename: cstring): cstring {...}{.importc: "IupLoad", cdecl,
                                        dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L160)  
```
proc iupVersion(): cstring {...}{.importc: "IupVersion", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L162)  
```
proc iupVersionDate(): cstring {...}{.importc: "IupVersionDate", cdecl,
                                 dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L163)  
```
proc iupVersionNumber(): cint {...}{.importc: "IupVersionNumber", cdecl,
                                dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L164)  
```
proc setLanguage(lng: cstring) {...}{.importc: "IupSetLanguage", cdecl,
                                 dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L165)  
```
proc getLanguage(): cstring {...}{.importc: "IupGetLanguage", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L166)  
```
proc destroy(ih: PIhandle) {...}{.importc: "IupDestroy", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L168)  
```
proc detach(child: PIhandle) {...}{.importc: "IupDetach", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L169)  
```
proc append(ih, child: PIhandle): PIhandle {...}{.importc: "IupAppend", cdecl,
    dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L170)  
```
proc insert(ih, refChild, child: PIhandle): PIhandle {...}{.importc: "IupInsert",
    cdecl, dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L172)  
```
proc getChild(ih: PIhandle; pos: cint): PIhandle {...}{.importc: "IupGetChild",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L174)  
```
proc getChildPos(ih, child: PIhandle): cint {...}{.importc: "IupGetChildPos", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L176)  
```
proc getChildCount(ih: PIhandle): cint {...}{.importc: "IupGetChildCount", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L178)  
```
proc getNextChild(ih, child: PIhandle): PIhandle {...}{.importc: "IupGetNextChild",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L180)  
```
proc getBrother(ih: PIhandle): PIhandle {...}{.importc: "IupGetBrother", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L182)  
```
proc getParent(ih: PIhandle): PIhandle {...}{.importc: "IupGetParent", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L184)  
```
proc getDialog(ih: PIhandle): PIhandle {...}{.importc: "IupGetDialog", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L186)  
```
proc getDialogChild(ih: PIhandle; name: cstring): PIhandle {...}{.
    importc: "IupGetDialogChild", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L188)  
```
proc reparent(ih, newParent: PIhandle): cint {...}{.importc: "IupReparent", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L190)  
```
proc popup(ih: PIhandle; x, y: cint): cint {...}{.importc: "IupPopup", cdecl,
    dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L193)  
```
proc show(ih: PIhandle): cint {...}{.importc: "IupShow", cdecl, dynlib: dllname,
                                discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L195)  
```
proc showXY(ih: PIhandle; x, y: cint): cint {...}{.importc: "IupShowXY", cdecl,
    dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L197)  
```
proc hide(ih: PIhandle): cint {...}{.importc: "IupHide", cdecl, dynlib: dllname,
                                discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L199)  
```
proc map(ih: PIhandle): cint {...}{.importc: "IupMap", cdecl, dynlib: dllname,
                               discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L201)  
```
proc unmap(ih: PIhandle) {...}{.importc: "IupUnmap", cdecl, dynlib: dllname,
                           discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L203)  
```
proc setAttribute(ih: PIhandle; name, value: cstring) {...}{.
    importc: "IupSetAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L206)  
```
proc storeAttribute(ih: PIhandle; name, value: cstring) {...}{.
    importc: "IupStoreAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L208)  
```
proc setAttributes(ih: PIhandle; str: cstring): PIhandle {...}{.
    importc: "IupSetAttributes", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L210)  
```
proc getAttribute(ih: PIhandle; name: cstring): cstring {...}{.
    importc: "IupGetAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L212)  
```
proc getAttributes(ih: PIhandle): cstring {...}{.importc: "IupGetAttributes", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L214)  
```
proc getInt(ih: PIhandle; name: cstring): cint {...}{.importc: "IupGetInt", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L216)  
```
proc getInt2(ih: PIhandle; name: cstring): cint {...}{.importc: "IupGetInt2", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L218)  
```
proc getIntInt(ih: PIhandle; name: cstring; i1, i2: var cint): cint {...}{.
    importc: "IupGetIntInt", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L220)  
```
proc getFloat(ih: PIhandle; name: cstring): cfloat {...}{.importc: "IupGetFloat",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L222)  
```
proc setfAttribute(ih: PIhandle; name, format: cstring) {...}{.
    importc: "IupSetfAttribute", cdecl, dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L224)  
```
proc getAllAttributes(ih: PIhandle; names: cstringArray; n: cint): cint {...}{.
    importc: "IupGetAllAttributes", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L226)  
```
proc setAtt(handleName: cstring; ih: PIhandle; name: cstring): PIhandle {...}{.
    importc: "IupSetAtt", cdecl, dynlib: dllname, varargs, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L228)  
```
proc setGlobal(name, value: cstring) {...}{.importc: "IupSetGlobal", cdecl,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L231)  
```
proc storeGlobal(name, value: cstring) {...}{.importc: "IupStoreGlobal", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L233)  
```
proc getGlobal(name: cstring): cstring {...}{.importc: "IupGetGlobal", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L235)  
```
proc setFocus(ih: PIhandle): PIhandle {...}{.importc: "IupSetFocus", cdecl,
                                        dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L238)  
```
proc getFocus(): PIhandle {...}{.importc: "IupGetFocus", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L240)  
```
proc previousField(ih: PIhandle): PIhandle {...}{.importc: "IupPreviousField", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L242)  
```
proc nextField(ih: PIhandle): PIhandle {...}{.importc: "IupNextField", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L244)  
```
proc getCallback(ih: PIhandle; name: cstring): Icallback {...}{.
    importc: "IupGetCallback", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L247)  
```
proc setCallback(ih: PIhandle; name: cstring; fn: Icallback): Icallback {...}{.
    importc: "IupSetCallback", cdecl, dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L249)  
```
proc setCallbacks(ih: PIhandle; name: cstring; fn: Icallback): PIhandle {...}{.
    importc: "IupSetCallbacks", cdecl, dynlib: dllname, varargs, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L252)  
```
proc getFunction(name: cstring): Icallback {...}{.importc: "IupGetFunction", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L255)  
```
proc setFunction(name: cstring; fn: Icallback): Icallback {...}{.
    importc: "IupSetFunction", cdecl, dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L257)  
```
proc getActionName(): cstring {...}{.importc: "IupGetActionName", cdecl,
                                dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L259)  
```
proc getHandle(name: cstring): PIhandle {...}{.importc: "IupGetHandle", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L262)  
```
proc setHandle(name: cstring; ih: PIhandle): PIhandle {...}{.importc: "IupSetHandle",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L264)  
```
proc getAllNames(names: cstringArray; n: cint): cint {...}{.
    importc: "IupGetAllNames", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L266)  
```
proc getAllDialogs(names: cstringArray; n: cint): cint {...}{.
    importc: "IupGetAllDialogs", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L268)  
```
proc getName(ih: PIhandle): cstring {...}{.importc: "IupGetName", cdecl,
                                      dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L270)  
```
proc setAttributeHandle(ih: PIhandle; name: cstring; ihNamed: PIhandle) {...}{.
    importc: "IupSetAttributeHandle", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L273)  
```
proc getAttributeHandle(ih: PIhandle; name: cstring): PIhandle {...}{.
    importc: "IupGetAttributeHandle", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L275)  
```
proc getClassName(ih: PIhandle): cstring {...}{.importc: "IupGetClassName", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L278)  
```
proc getClassType(ih: PIhandle): cstring {...}{.importc: "IupGetClassType", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L280)  
```
proc getClassAttributes(classname: cstring; names: cstringArray; n: cint): cint {...}{.
    importc: "IupGetClassAttributes", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L282)  
```
proc saveClassAttributes(ih: PIhandle) {...}{.importc: "IupSaveClassAttributes",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L285)  
```
proc setClassDefaultAttribute(classname, name, value: cstring) {...}{.
    importc: "IupSetClassDefaultAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L287)  
```
proc create(classname: cstring): PIhandle {...}{.importc: "IupCreate", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L290)  
```
proc createv(classname: cstring; params: pointer): PIhandle {...}{.
    importc: "IupCreatev", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L292)  
```
proc createp(classname: cstring; first: pointer): PIhandle {...}{.
    importc: "IupCreatep", cdecl, dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L294)  
```
proc fill(): PIhandle {...}{.importc: "IupFill", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L297)  
```
proc radio(child: PIhandle): PIhandle {...}{.importc: "IupRadio", cdecl,
                                        dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L298)  
```
proc vbox(child: PIhandle): PIhandle {...}{.importc: "IupVbox", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L300)  
```
proc vboxv(children: ptr PIhandle): PIhandle {...}{.importc: "IupVboxv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L302)  
```
proc zbox(child: PIhandle): PIhandle {...}{.importc: "IupZbox", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L304)  
```
proc zboxv(children: ptr PIhandle): PIhandle {...}{.importc: "IupZboxv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L306)  
```
proc hbox(child: PIhandle): PIhandle {...}{.importc: "IupHbox", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L308)  
```
proc hboxv(children: ptr PIhandle): PIhandle {...}{.importc: "IupHboxv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L310)  
```
proc normalizer(ihFirst: PIhandle): PIhandle {...}{.importc: "IupNormalizer", cdecl,
    dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L313)  
```
proc normalizerv(ihList: ptr PIhandle): PIhandle {...}{.importc: "IupNormalizerv",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L315)  
```
proc cbox(child: PIhandle): PIhandle {...}{.importc: "IupCbox", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L318)  
```
proc cboxv(children: ptr PIhandle): PIhandle {...}{.importc: "IupCboxv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L320)  
```
proc sbox(child: PIhandle): PIhandle {...}{.importc: "IupSbox", cdecl,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L322)  
```
proc frame(child: PIhandle): PIhandle {...}{.importc: "IupFrame", cdecl,
                                        dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L325)  
```
proc image(width, height: cint; pixmap: pointer): PIhandle {...}{.
    importc: "IupImage", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L328)  
```
proc imageRGB(width, height: cint; pixmap: pointer): PIhandle {...}{.
    importc: "IupImageRGB", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L330)  
```
proc imageRGBA(width, height: cint; pixmap: pointer): PIhandle {...}{.
    importc: "IupImageRGBA", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L332)  
```
proc item(title, action: cstring): PIhandle {...}{.importc: "IupItem", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L335)  
```
proc submenu(title: cstring; child: PIhandle): PIhandle {...}{.importc: "IupSubmenu",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L337)  
```
proc separator(): PIhandle {...}{.importc: "IupSeparator", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L339)  
```
proc menu(child: PIhandle): PIhandle {...}{.importc: "IupMenu", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L341)  
```
proc menuv(children: ptr PIhandle): PIhandle {...}{.importc: "IupMenuv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L343)  
```
proc button(title, action: cstring): PIhandle {...}{.importc: "IupButton", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L346)  
```
proc link(url, title: cstring): PIhandle {...}{.importc: "IupLink", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L348)  
```
proc canvas(action: cstring): PIhandle {...}{.importc: "IupCanvas", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L350)  
```
proc dialog(child: PIhandle): PIhandle {...}{.importc: "IupDialog", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L352)  
```
proc user(): PIhandle {...}{.importc: "IupUser", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L354)  
```
proc label(title: cstring): PIhandle {...}{.importc: "IupLabel", cdecl,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L356)  
```
proc list(action: cstring): PIhandle {...}{.importc: "IupList", cdecl,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L358)  
```
proc text(action: cstring): PIhandle {...}{.importc: "IupText", cdecl,
                                       dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L360)  
```
proc multiLine(action: cstring): PIhandle {...}{.importc: "IupMultiLine", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L362)  
```
proc toggle(title, action: cstring): PIhandle {...}{.importc: "IupToggle", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L364)  
```
proc timer(): PIhandle {...}{.importc: "IupTimer", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L366)  
```
proc progressBar(): PIhandle {...}{.importc: "IupProgressBar", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L368)  
```
proc val(theType: cstring): PIhandle {...}{.importc: "IupVal", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L370)  
```
proc tabs(child: PIhandle): PIhandle {...}{.importc: "IupTabs", cdecl,
                                       dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L372)  
```
proc tabsv(children: ptr PIhandle): PIhandle {...}{.importc: "IupTabsv", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L374)  
```
proc tree(): PIhandle {...}{.importc: "IupTree", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L376)  
```
proc spin(): PIhandle {...}{.importc: "IupSpin", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L378)  
```
proc spinbox(child: PIhandle): PIhandle {...}{.importc: "IupSpinbox", cdecl,
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L379)  
```
proc textConvertLinColToPos(ih: PIhandle; lin, col: cint; pos: var cint) {...}{.
    importc: "IupTextConvertLinColToPos", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L383)  
```
proc textConvertPosToLinCol(ih: PIhandle; pos: cint; lin, col: var cint) {...}{.
    importc: "IupTextConvertPosToLinCol", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L385)  
```
proc convertXYToPos(ih: PIhandle; x, y: cint): cint {...}{.
    importc: "IupConvertXYToPos", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L388)  
```
proc treeSetUserId(ih: PIhandle; id: cint; userid: pointer): cint {...}{.
    importc: "IupTreeSetUserId", cdecl, dynlib: dllname, discardable.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L392)  
```
proc treeGetUserId(ih: PIhandle; id: cint): pointer {...}{.
    importc: "IupTreeGetUserId", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L394)  
```
proc treeGetId(ih: PIhandle; userid: pointer): cint {...}{.importc: "IupTreeGetId",
    cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L396)  
```
proc treeSetAttribute(ih: PIhandle; name: cstring; id: cint; value: cstring) {...}{.
    importc: "IupTreeSetAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L399)  
```
proc treeStoreAttribute(ih: PIhandle; name: cstring; id: cint; value: cstring) {...}{.
    importc: "IupTreeStoreAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L401)  
```
proc treeGetAttribute(ih: PIhandle; name: cstring; id: cint): cstring {...}{.
    importc: "IupTreeGetAttribute", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L403)  
```
proc treeGetInt(ih: PIhandle; name: cstring; id: cint): cint {...}{.
    importc: "IupTreeGetInt", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L405)  
```
proc treeGetFloat(ih: PIhandle; name: cstring; id: cint): cfloat {...}{.
    importc: "IupTreeGetFloat", cdecl, dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L407)  
```
proc treeSetfAttribute(ih: PIhandle; name: cstring; id: cint; format: cstring) {...}{.
    importc: "IupTreeSetfAttribute", cdecl, dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L409)  
```
proc isShift(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L464)  
```
proc isControl(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L465)  
```
proc isButton1(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L466)  
```
proc isButton2(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L467)  
```
proc isbutton3(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L468)  
```
proc isDouble(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L469)  
```
proc isAlt(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L470)  
```
proc isSys(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L471)  
```
proc isButton4(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L472)  
```
proc isButton5(s: cstring): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L473)  
```
proc isPrint(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L582)  
```
proc isXkey(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L595)  
```
proc isShiftXkey(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L596)  
```
proc isCtrlXkey(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L597)  
```
proc isAltXkey(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L598)  
```
proc isSysXkey(c: cint): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L599) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L599)  
```
proc iUPxCODE(c: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L601)  
```
proc iUPsxCODE(c: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L602)  
```
proc iUPcxCODE(c: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L607) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L607)  
```
proc iUPmxCODE(c: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L608)  
```
proc iUPyxCODE(c: cint): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L609)  
```
proc controlsOpen(): cint {...}{.cdecl, importc: "IupControlsOpen", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L928) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L928)  
```
proc controlsClose() {...}{.cdecl, importc: "IupControlsClose", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L929) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L929)  
```
proc oldValOpen() {...}{.cdecl, importc: "IupOldValOpen", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L931) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L931)  
```
proc oldTabsOpen() {...}{.cdecl, importc: "IupOldTabsOpen", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L932) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L932)  
```
proc colorbar(): PIhandle {...}{.cdecl, importc: "IupColorbar", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L934) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L934)  
```
proc cells(): PIhandle {...}{.cdecl, importc: "IupCells", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L935) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L935)  
```
proc colorBrowser(): PIhandle {...}{.cdecl, importc: "IupColorBrowser",
                                dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L936) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L936)  
```
proc gauge(): PIhandle {...}{.cdecl, importc: "IupGauge", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L937) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L937)  
```
proc dial(theType: cstring): PIhandle {...}{.cdecl, importc: "IupDial",
                                        dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L938) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L938)  
```
proc matrix(action: cstring): PIhandle {...}{.cdecl, importc: "IupMatrix",
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L939) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L939)  
```
proc matSetAttribute(ih: PIhandle; name: cstring; lin, col: cint; value: cstring) {...}{.
    cdecl, importc: "IupMatSetAttribute", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L942) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L942)  
```
proc matStoreAttribute(ih: PIhandle; name: cstring; lin, col: cint;
                       value: cstring) {...}{.cdecl, importc: "IupMatStoreAttribute",
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L945) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L945)  
```
proc matGetAttribute(ih: PIhandle; name: cstring; lin, col: cint): cstring {...}{.
    cdecl, importc: "IupMatGetAttribute", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L948) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L948)  
```
proc matGetInt(ih: PIhandle; name: cstring; lin, col: cint): cint {...}{.cdecl,
    importc: "IupMatGetInt", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L950)  
```
proc matGetFloat(ih: PIhandle; name: cstring; lin, col: cint): cfloat {...}{.cdecl,
    importc: "IupMatGetFloat", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L952) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L952)  
```
proc matSetfAttribute(ih: PIhandle; name: cstring; lin, col: cint;
                      format: cstring) {...}{.cdecl, importc: "IupMatSetfAttribute",
    dynlib: dllname, varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L954) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L954)  
```
proc pPlotOpen() {...}{.cdecl, importc: "IupPPlotOpen", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L965) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L965)  
```
proc pPlot(): PIhandle {...}{.cdecl, importc: "IupPPlot", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L968) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L968)  
```
proc pPlotBegin(ih: PIhandle; strXdata: cint) {...}{.cdecl, importc: "IupPPlotBegin",
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L971) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L971)  
```
proc pPlotAdd(ih: PIhandle; x, y: cfloat) {...}{.cdecl, importc: "IupPPlotAdd",
    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L973) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L973)  
```
proc pPlotAddStr(ih: PIhandle; x: cstring; y: cfloat) {...}{.cdecl,
    importc: "IupPPlotAddStr", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L975) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L975)  
```
proc pPlotEnd(ih: PIhandle): cint {...}{.cdecl, importc: "IupPPlotEnd",
                                    dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L977) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L977)  
```
proc pPlotInsertStr(ih: PIhandle; index, sampleIndex: cint; x: cstring;
                    y: cfloat) {...}{.cdecl, importc: "IupPPlotInsertStr",
                                 dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L980) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L980)  
```
proc pPlotInsert(ih: PIhandle; index, sampleIndex: cint; x, y: cfloat) {...}{.cdecl,
    importc: "IupPPlotInsert", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L983) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L983)  
```
proc pPlotTransform(ih: PIhandle; x, y: cfloat; ix, iy: var cint) {...}{.cdecl,
    importc: "IupPPlotTransform", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L988) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L988)  
```
proc pPlotPaintTo(ih: PIhandle; cnv: pointer) {...}{.cdecl,
    importc: "IupPPlotPaintTo", dynlib: dllname.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/iup.nim#L992) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/iup.nim#L992)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/iup.html>

postgres
========

 Types
-----

  
```
POid = ptr Oid
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L31)  
```
Oid = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L32)  
```
SockAddr = array[1 .. 112, int8]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L39)  
```
PGresAttDesc {...}{.pure, final.} = object
  name*: cstring
  adtid*: Oid
  adtsize*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L40)  
```
PPGresAttDesc = ptr PGresAttDesc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L45)  
```
PPPGresAttDesc = ptr PPGresAttDesc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L46)  
```
PGresAttValue {...}{.pure, final.} = object
  length*: int32
  value*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L47)  
```
PPGresAttValue = ptr PGresAttValue
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L51)  
```
PPPGresAttValue = ptr PPGresAttValue
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L52)  
```
PExecStatusType = ptr ExecStatusType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L53)  
```
ExecStatusType = enum
  PGRES_EMPTY_QUERY = 0, PGRES_COMMAND_OK, PGRES_TUPLES_OK, PGRES_COPY_OUT,
  PGRES_COPY_IN, PGRES_BAD_RESPONSE, PGRES_NONFATAL_ERROR, PGRES_FATAL_ERROR
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L54)  
```
PGlobjfuncs {...}{.pure, final.} = object
  fn_lo_open*: Oid
  fn_lo_close*: Oid
  fn_lo_creat*: Oid
  fn_lo_unlink*: Oid
  fn_lo_lseek*: Oid
  fn_lo_tell*: Oid
  fn_lo_read*: Oid
  fn_lo_write*: Oid
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L57)  
```
PPGlobjfuncs = ptr PGlobjfuncs
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L67)  
```
PConnStatusType = ptr ConnStatusType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L68)  
```
ConnStatusType = enum
  CONNECTION_OK, CONNECTION_BAD, CONNECTION_STARTED, CONNECTION_MADE,
  CONNECTION_AWAITING_RESPONSE, CONNECTION_AUTH_OK, CONNECTION_SETENV,
  CONNECTION_SSL_STARTUP, CONNECTION_NEEDED
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L69)  
```
PGconn {...}{.pure, final.} = object
  pghost*: cstring
  pgtty*: cstring
  pgport*: cstring
  pgoptions*: cstring
  dbName*: cstring
  status*: ConnStatusType
  errorMessage*: array[0 .. 4096 - 1, char]
  Pfin*: File
  Pfout*: File
  Pfdebug*: File
  sock*: int32
  laddr*: SockAddr
  raddr*: SockAddr
  salt*: array[0 .. 2 - 1, char]
  asyncNotifyWaiting*: int32
  notifyList*: pointer
  pguser*: cstring
  pgpass*: cstring
  lobjfuncs*: PPGlobjfuncs
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L73)  
```
PPGconn = ptr PGconn
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L94)  
```
PGresult {...}{.pure, final.} = object
  ntups*: int32
  numAttributes*: int32
  attDescs*: PPGresAttDesc
  tuples*: PPPGresAttValue
  tupArrSize*: int32
  resultStatus*: ExecStatusType
  cmdStatus*: array[0 .. 40 - 1, char]
  binary*: int32
  conn*: PPGconn
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L95)  
```
PPGresult = ptr PGresult
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L106)  
```
PPostgresPollingStatusType = ptr PostgresPollingStatusType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L107)  
```
PostgresPollingStatusType = enum
  PGRES_POLLING_FAILED = 0, PGRES_POLLING_READING, PGRES_POLLING_WRITING,
  PGRES_POLLING_OK, PGRES_POLLING_ACTIVE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L108)  
```
PPGTransactionStatusType = ptr PGTransactionStatusType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L111)  
```
PGTransactionStatusType = enum
  PQTRANS_IDLE, PQTRANS_ACTIVE, PQTRANS_INTRANS, PQTRANS_INERROR,
  PQTRANS_UNKNOWN
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L112)  
```
PPGVerbosity = ptr PGVerbosity
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L115)  
```
PGVerbosity = enum
  PQERRORS_TERSE, PQERRORS_DEFAULT, PQERRORS_VERBOSE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L116)  
```
PPGNotify = ptr pgNotify
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L118)  
```
pgNotify {...}{.pure, final.} = object
  relname*: cstring
  be_pid*: int32
  extra*: cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L119)  
```
PQnoticeReceiver = proc (arg: pointer; res: PPGresult) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L124)  
```
PQnoticeProcessor = proc (arg: pointer; message: cstring) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L125)  
```
Ppqbool = ptr pqbool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L126)  
```
pqbool = char
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L127)  
```
PPQprintOpt = ptr PQprintOpt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L128)  
```
PQprintOpt {...}{.pure, final.} = object
  header*: pqbool
  align*: pqbool
  standard*: pqbool
  html3*: pqbool
  expanded*: pqbool
  pager*: pqbool
  fieldSep*: cstring
  tableOpt*: cstring
  caption*: cstring
  fieldName*: ptr cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L129)  
```
PPQconninfoOption = ptr PQconninfoOption
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L141)  
```
PQconninfoOption {...}{.pure, final.} = object
  keyword*: cstring
  envvar*: cstring
  compiled*: cstring
  val*: cstring
  label*: cstring
  dispchar*: cstring
  dispsize*: int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L142)  
```
PPQArgBlock = ptr PQArgBlock
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L151)  
```
PQArgBlock {...}{.pure, final.} = object
  length*: int32
  isint*: int32
  p*: pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L152)   Consts
------

  
```
ERROR_MSG_LENGTH = 4096
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L35)  
```
CMDSTATUS_LEN = 40
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L36)   Procs
-----

  
```
proc pqinitOpenSSL(do_ssl: int32; do_crypto: int32) {...}{.cdecl, dynlib: dllName,
    importc: "PQinitOpenSSL".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L157)  
```
proc pqconnectStart(conninfo: cstring): PPGconn {...}{.cdecl, dynlib: dllName,
    importc: "PQconnectStart".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L159)  
```
proc pqconnectPoll(conn: PPGconn): PostgresPollingStatusType {...}{.cdecl,
    dynlib: dllName, importc: "PQconnectPoll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L161)  
```
proc pqconnectdb(conninfo: cstring): PPGconn {...}{.cdecl, dynlib: dllName,
    importc: "PQconnectdb".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L163)  
```
proc pqsetdbLogin(pghost: cstring; pgport: cstring; pgoptions: cstring;
                  pgtty: cstring; dbName: cstring; login: cstring; pwd: cstring): PPGconn {...}{.
    cdecl, dynlib: dllName, importc: "PQsetdbLogin".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L165)  
```
proc pqfinish(conn: PPGconn) {...}{.cdecl, dynlib: dllName, importc: "PQfinish".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L169)  
```
proc pqconndefaults(): PPQconninfoOption {...}{.cdecl, dynlib: dllName,
    importc: "PQconndefaults".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L170)  
```
proc pqconninfoFree(connOptions: PPQconninfoOption) {...}{.cdecl, dynlib: dllName,
    importc: "PQconninfoFree".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L172)  
```
proc pqresetStart(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQresetStart".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L174)  
```
proc pqresetPoll(conn: PPGconn): PostgresPollingStatusType {...}{.cdecl,
    dynlib: dllName, importc: "PQresetPoll".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L176)  
```
proc pqreset(conn: PPGconn) {...}{.cdecl, dynlib: dllName, importc: "PQreset".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L178)  
```
proc pqrequestCancel(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQrequestCancel".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L179)  
```
proc pqdb(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQdb".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L181)  
```
proc pquser(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQuser".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L182)  
```
proc pqpass(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQpass".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L183)  
```
proc pqhost(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQhost".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L184)  
```
proc pqport(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQport".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L185)  
```
proc pqtty(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName, importc: "PQtty".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L186)  
```
proc pqoptions(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQoptions".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L187)  
```
proc pqstatus(conn: PPGconn): ConnStatusType {...}{.cdecl, dynlib: dllName,
    importc: "PQstatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L189)  
```
proc pqtransactionStatus(conn: PPGconn): PGTransactionStatusType {...}{.cdecl,
    dynlib: dllName, importc: "PQtransactionStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L191)  
```
proc pqparameterStatus(conn: PPGconn; paramName: cstring): cstring {...}{.cdecl,
    dynlib: dllName, importc: "PQparameterStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L193)  
```
proc pqserverVersion(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQserverVersion".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L195)  
```
proc pqprotocolVersion(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQprotocolVersion".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L197)  
```
proc pqerrorMessage(conn: PPGconn): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQerrorMessage".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L199)  
```
proc pqsocket(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
                                      importc: "PQsocket".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L201)  
```
proc pqbackendPID(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQbackendPID".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L203)  
```
proc pqconnectionNeedsPassword(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQconnectionNeedsPassword".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L205)  
```
proc pqconnectionUsedPassword(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQconnectionUsedPassword".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L207)  
```
proc pqclientEncoding(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQclientEncoding".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L209)  
```
proc pqsetClientEncoding(conn: PPGconn; encoding: cstring): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQsetClientEncoding".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L211)  
```
proc pqsetErrorVerbosity(conn: PPGconn; verbosity: PGVerbosity): PGVerbosity {...}{.
    cdecl, dynlib: dllName, importc: "PQsetErrorVerbosity".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L217)  
```
proc pqtrace(conn: PPGconn; debug_port: File) {...}{.cdecl, dynlib: dllName,
    importc: "PQtrace".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L219)  
```
proc pquntrace(conn: PPGconn) {...}{.cdecl, dynlib: dllName, importc: "PQuntrace".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L221)  
```
proc pqsetNoticeReceiver(conn: PPGconn; theProc: PQnoticeReceiver; arg: pointer): PQnoticeReceiver {...}{.
    cdecl, dynlib: dllName, importc: "PQsetNoticeReceiver".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L222)  
```
proc pqsetNoticeProcessor(conn: PPGconn; theProc: PQnoticeProcessor;
                          arg: pointer): PQnoticeProcessor {...}{.cdecl,
    dynlib: dllName, importc: "PQsetNoticeProcessor".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L224)  
```
proc pqexec(conn: PPGconn; query: cstring): PPGresult {...}{.cdecl, dynlib: dllName,
    importc: "PQexec".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L227)  
```
proc pqexecParams(conn: PPGconn; command: cstring; nParams: int32;
                  paramTypes: POid; paramValues: cstringArray;
                  paramLengths, paramFormats: ptr int32; resultFormat: int32): PPGresult {...}{.
    cdecl, dynlib: dllName, importc: "PQexecParams".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L229)  
```
proc pqprepare(conn: PPGconn; stmtName, query: cstring; nParams: int32;
               paramTypes: POid): PPGresult {...}{.cdecl, dynlib: dllName,
    importc: "PQprepare".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L233)  
```
proc pqexecPrepared(conn: PPGconn; stmtName: cstring; nParams: int32;
                    paramValues: cstringArray;
                    paramLengths, paramFormats: ptr int32; resultFormat: int32): PPGresult {...}{.
    cdecl, dynlib: dllName, importc: "PQexecPrepared".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L235)  
```
proc pqsendQuery(conn: PPGconn; query: cstring): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQsendQuery".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L239)  
```
proc pqsendQueryParams(conn: PPGconn; command: cstring; nParams: int32;
                       paramTypes: POid; paramValues: cstringArray;
                       paramLengths, paramFormats: ptr int32;
                       resultFormat: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQsendQueryParams".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L241)  
```
proc pqsendQueryPrepared(conn: PPGconn; stmtName: cstring; nParams: int32;
                         paramValues: cstringArray;
                         paramLengths, paramFormats: ptr int32;
                         resultFormat: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQsendQueryPrepared".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L246)  
```
proc pqgetResult(conn: PPGconn): PPGresult {...}{.cdecl, dynlib: dllName,
    importc: "PQgetResult".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L251)  
```
proc pqisBusy(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
                                      importc: "PQisBusy".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L253)  
```
proc pqconsumeInput(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQconsumeInput".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L255)  
```
proc pqnotifies(conn: PPGconn): PPGNotify {...}{.cdecl, dynlib: dllName,
    importc: "PQnotifies".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L257)  
```
proc pqputCopyData(conn: PPGconn; buffer: cstring; nbytes: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "PQputCopyData".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L259)  
```
proc pqputCopyEnd(conn: PPGconn; errormsg: cstring): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQputCopyEnd".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L261)  
```
proc pqgetCopyData(conn: PPGconn; buffer: cstringArray; async: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "PQgetCopyData".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L263)  
```
proc pqgetline(conn: PPGconn; str: cstring; len: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQgetline".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L265)  
```
proc pqputline(conn: PPGconn; str: cstring): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQputline".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L267)  
```
proc pqgetlineAsync(conn: PPGconn; buffer: cstring; bufsize: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "PQgetlineAsync".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L269)  
```
proc pqputnbytes(conn: PPGconn; buffer: cstring; nbytes: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQputnbytes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L271)  
```
proc pqendcopy(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
                                       importc: "PQendcopy".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L273)  
```
proc pqsetnonblocking(conn: PPGconn; arg: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQsetnonblocking".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L275)  
```
proc pqisnonblocking(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQisnonblocking".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L277)  
```
proc pqflush(conn: PPGconn): int32 {...}{.cdecl, dynlib: dllName, importc: "PQflush".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L279)  
```
proc pqfn(conn: PPGconn; fnid: int32; result_buf, result_len: ptr int32;
          result_is_int: int32; args: PPQArgBlock; nargs: int32): PPGresult {...}{.
    cdecl, dynlib: dllName, importc: "PQfn".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L280)  
```
proc pqresultStatus(res: PPGresult): ExecStatusType {...}{.cdecl, dynlib: dllName,
    importc: "PQresultStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L283)  
```
proc pqresStatus(status: ExecStatusType): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQresStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L285)  
```
proc pqresultErrorMessage(res: PPGresult): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQresultErrorMessage".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L287)  
```
proc pqresultErrorField(res: PPGresult; fieldcode: int32): cstring {...}{.cdecl,
    dynlib: dllName, importc: "PQresultErrorField".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L289)  
```
proc pqntuples(res: PPGresult): int32 {...}{.cdecl, dynlib: dllName,
                                        importc: "PQntuples".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L291)  
```
proc pqnfields(res: PPGresult): int32 {...}{.cdecl, dynlib: dllName,
                                        importc: "PQnfields".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L293)  
```
proc pqbinaryTuples(res: PPGresult): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQbinaryTuples".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L295)  
```
proc pqfname(res: PPGresult; field_num: int32): cstring {...}{.cdecl,
    dynlib: dllName, importc: "PQfname".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L297)  
```
proc pqfnumber(res: PPGresult; field_name: cstring): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQfnumber".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L299)  
```
proc pqftable(res: PPGresult; field_num: int32): Oid {...}{.cdecl, dynlib: dllName,
    importc: "PQftable".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L301)  
```
proc pqftablecol(res: PPGresult; field_num: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQftablecol".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L303)  
```
proc pqfformat(res: PPGresult; field_num: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "PQfformat".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L305)  
```
proc pqftype(res: PPGresult; field_num: int32): Oid {...}{.cdecl, dynlib: dllName,
    importc: "PQftype".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L307)  
```
proc pqfsize(res: PPGresult; field_num: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQfsize".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L309)  
```
proc pqfmod(res: PPGresult; field_num: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQfmod".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L311)  
```
proc pqcmdStatus(res: PPGresult): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQcmdStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L313)  
```
proc pqoidStatus(res: PPGresult): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQoidStatus".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L315)  
```
proc pqoidValue(res: PPGresult): Oid {...}{.cdecl, dynlib: dllName,
                                       importc: "PQoidValue".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L317)  
```
proc pqcmdTuples(res: PPGresult): cstring {...}{.cdecl, dynlib: dllName,
    importc: "PQcmdTuples".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L319)  
```
proc pqgetvalue(res: PPGresult; tup_num: int32; field_num: int32): cstring {...}{.
    cdecl, dynlib: dllName, importc: "PQgetvalue".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L321)  
```
proc pqgetlength(res: PPGresult; tup_num: int32; field_num: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "PQgetlength".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L323)  
```
proc pqgetisnull(res: PPGresult; tup_num: int32; field_num: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "PQgetisnull".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L325)  
```
proc pqclear(res: PPGresult) {...}{.cdecl, dynlib: dllName, importc: "PQclear".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L327)  
```
proc pqfreemem(p: pointer) {...}{.cdecl, dynlib: dllName, importc: "PQfreemem".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L328)  
```
proc pqmakeEmptyPGresult(conn: PPGconn; status: ExecStatusType): PPGresult {...}{.
    cdecl, dynlib: dllName, importc: "PQmakeEmptyPGresult".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L329)  
```
proc pqescapeString(till, from: cstring; len: int): int {...}{.cdecl,
    dynlib: dllName, importc: "PQescapeString".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L331)  
```
proc pqescapeBytea(bintext: cstring; binlen: int; bytealen: var int): cstring {...}{.
    cdecl, dynlib: dllName, importc: "PQescapeBytea".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L333)  
```
proc pqunescapeBytea(strtext: cstring; retbuflen: var int): cstring {...}{.cdecl,
    dynlib: dllName, importc: "PQunescapeBytea".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L335)  
```
proc pqprint(fout: File; res: PPGresult; ps: PPQprintOpt) {...}{.cdecl,
    dynlib: dllName, importc: "PQprint".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L337)  
```
proc pqdisplayTuples(res: PPGresult; fp: File; fillAlign: int32;
                     fieldSep: cstring; printHeader: int32; quiet: int32) {...}{.
    cdecl, dynlib: dllName, importc: "PQdisplayTuples".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L339)  
```
proc pqprintTuples(res: PPGresult; fout: File; printAttName: int32;
                   terseOutput: int32; width: int32) {...}{.cdecl, dynlib: dllName,
    importc: "PQprintTuples".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L342)  
```
proc lo_open(conn: PPGconn; lobjId: Oid; mode: int32): int32 {...}{.cdecl,
    dynlib: dllName, importc: "lo_open".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L345) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L345)  
```
proc lo_close(conn: PPGconn; fd: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "lo_close".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L347)  
```
proc lo_read(conn: PPGconn; fd: int32; buf: cstring; length: int): int32 {...}{.
    cdecl, dynlib: dllName, importc: "lo_read".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L349)  
```
proc lo_write(conn: PPGconn; fd: int32; buf: cstring; length: int): int32 {...}{.
    cdecl, dynlib: dllName, importc: "lo_write".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L351)  
```
proc lo_lseek(conn: PPGconn; fd: int32; offset: int32; whence: int32): int32 {...}{.
    cdecl, dynlib: dllName, importc: "lo_lseek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L353)  
```
proc lo_creat(conn: PPGconn; mode: int32): Oid {...}{.cdecl, dynlib: dllName,
    importc: "lo_creat".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L355)  
```
proc lo_tell(conn: PPGconn; fd: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "lo_tell".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L357)  
```
proc lo_unlink(conn: PPGconn; lobjId: Oid): int32 {...}{.cdecl, dynlib: dllName,
    importc: "lo_unlink".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L359)  
```
proc lo_import(conn: PPGconn; filename: cstring): Oid {...}{.cdecl, dynlib: dllName,
    importc: "lo_import".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L361) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L361)  
```
proc lo_export(conn: PPGconn; lobjId: Oid; filename: cstring): int32 {...}{.cdecl,
    dynlib: dllName, importc: "lo_export".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L363)  
```
proc pqmblen(s: cstring; encoding: int32): int32 {...}{.cdecl, dynlib: dllName,
    importc: "PQmblen".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L365)  
```
proc pqenv2encoding(): int32 {...}{.cdecl, dynlib: dllName, importc: "PQenv2encoding".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L367) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L367)  
```
proc pqsetdb(M_PGHOST, M_PGPORT, M_PGOPT, M_PGTTY, M_DBNAME: cstring): PPGconn {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/postgres.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/postgres.nim#L368)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/postgres.html>

mysql
=====

 Types
-----

  
```
my_bool = bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L25)  
```
Pmy_bool = ptr my_bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L26)  
```
PVIO = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L27)  
```
Pgptr = ptr gptr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L28)  
```
gptr = cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L29)  
```
Pmy_socket = ptr my_socket
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L30)  
```
my_socket = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L31)  
```
PPByte = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L32)  
```
cuint = cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L33)  
```
Enum_server_command = enum
  COM_SLEEP, COM_QUIT, COM_INIT_DB, COM_QUERY, COM_FIELD_LIST, COM_CREATE_DB,
  COM_DROP_DB, COM_REFRESH, COM_SHUTDOWN, COM_STATISTICS, COM_PROCESS_INFO,
  COM_CONNECT, COM_PROCESS_KILL, COM_DEBUG, COM_PING, COM_TIME,
  COM_DELAYED_INSERT, COM_CHANGE_USER, COM_BINLOG_DUMP, COM_TABLE_DUMP,
  COM_CONNECT_OUT, COM_REGISTER_SLAVE, COM_STMT_PREPARE, COM_STMT_EXECUTE,
  COM_STMT_SEND_LONG_DATA, COM_STMT_CLOSE, COM_STMT_RESET, COM_SET_OPTION,
  COM_STMT_FETCH, COM_END
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L55)  
```
Pst_net = ptr St_net
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L155)  
```
St_net {...}{.final.} = object
  vio*: PVIO
  buff*: cstring
  buff_end*: cstring
  write_pos*: cstring
  read_pos*: cstring
  fd*: my_socket
  max_packet*: int
  max_packet_size*: int
  pkt_nr*: cuint
  compress_pkt_nr*: cuint
  write_timeout*: cuint
  read_timeout*: cuint
  retry_count*: cuint
  fcntl*: cint
  compress*: my_bool
  remain_in_buf*: int
  len*: int
  buf_length*: int
  where_b*: int
  return_status*: ptr cint
  reading_or_writing*: char
  save_char*: cchar
  no_send_ok*: my_bool
  no_send_eof*: my_bool
  no_send_error*: my_bool
  last_error*: array[0 .. 200 - 1, char]
  sqlstate*: array[0 .. 6 - 1, char]
  last_errno*: cuint
  error*: char
  query_cache_query*: gptr
  report_error*: my_bool
  return_errno*: my_bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L156)  
```
NET = St_net
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L196)  
```
PNET = ptr NET
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L197)  
```
Enum_field_types = enum
  TYPE_DECIMAL, TYPE_TINY, TYPE_SHORT, TYPE_LONG, TYPE_FLOAT, TYPE_DOUBLE,
  TYPE_NULL, TYPE_TIMESTAMP, TYPE_LONGLONG, TYPE_INT24, TYPE_DATE, TYPE_TIME,
  TYPE_DATETIME, TYPE_YEAR, TYPE_NEWDATE, TYPE_VARCHAR, TYPE_BIT,
  TYPE_NEWDECIMAL = 246, TYPE_ENUM = 247, TYPE_SET = 248, TYPE_TINY_BLOB = 249,
  TYPE_MEDIUM_BLOB = 250, TYPE_LONG_BLOB = 251, TYPE_BLOB = 252,
  TYPE_VAR_STRING = 253, TYPE_STRING = 254, TYPE_GEOMETRY = 255
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L204)  
```
Enum_shutdown_level = enum
  SHUTDOWN_DEFAULT = 0, SHUTDOWN_WAIT_CONNECTIONS = 1,
  SHUTDOWN_WAIT_TRANSACTIONS = 2, SHUTDOWN_WAIT_UPDATES = 8,
  SHUTDOWN_WAIT_ALL_BUFFERS = 16, SHUTDOWN_WAIT_CRITICAL_BUFFERS = 17,
  KILL_QUERY = 254, KILL_CONNECTION = 255
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L251)  
```
Enum_cursor_type = enum
  CURSOR_TYPE_NO_CURSOR = 0, CURSOR_TYPE_READ_ONLY = 1,
  CURSOR_TYPE_FOR_UPDATE = 2, CURSOR_TYPE_SCROLLABLE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L256)  
```
Enum_mysql_set_option = enum
  OPTION_MULTI_STATEMENTS_ON, OPTION_MULTI_STATEMENTS_OFF
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L259)  
```
Psockaddr = ptr Sockaddr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L285)  
```
Sockaddr {...}{.final.} = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L286)  
```
Prand_struct = ptr Rand_struct
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L292)  
```
Rand_struct {...}{.final.} = object
  seed1*: int
  seed2*: int
  max_value*: int
  max_value_dbl*: cdouble
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L293)  
```
Item_result = enum
  STRING_RESULT, REAL_RESULT, INT_RESULT, ROW_RESULT, DECIMAL_RESULT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L299)  
```
PItem_result = ptr Item_result
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L301)  
```
Pst_udf_args = ptr St_udf_args
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L302)  
```
St_udf_args {...}{.final.} = object
  arg_count*: cuint
  arg_type*: PItem_result
  args*: cstringArray
  lengths*: ptr int
  maybe_null*: cstring
  attributes*: cstringArray
  attribute_lengths*: ptr int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L303)  
```
UDF_ARGS = St_udf_args
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L312)  
```
PUDF_ARGS = ptr UDF_ARGS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L313)  
```
Pst_udf_init = ptr St_udf_init
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L314)  
```
St_udf_init {...}{.final.} = object
  maybe_null*: my_bool
  decimals*: cuint
  max_length*: int
  theptr*: cstring
  const_item*: my_bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L315)  
```
UDF_INIT = St_udf_init
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L322)  
```
PUDF_INIT = ptr UDF_INIT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L323)  
```
Pst_mysql_field = ptr St_mysql_field
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L400)  
```
St_mysql_field {...}{.final.} = object
  name*: cstring
  org_name*: cstring
  table*: cstring
  org_table*: cstring
  db*: cstring
  catalog*: cstring
  def*: cstring
  len*: int
  max_length*: int
  name_length*: cuint
  org_name_length*: cuint
  table_length*: cuint
  org_table_length*: cuint
  db_length*: cuint
  catalog_length*: cuint
  def_length*: cuint
  flags*: cuint
  decimals*: cuint
  charsetnr*: cuint
  ftype*: Enum_field_types
  extension*: pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L401)  
```
FIELD = St_mysql_field
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L424)  
```
PFIELD = ptr FIELD
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L425)  
```
PROW = ptr ROW
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L426)  
```
ROW = cstringArray
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L427)  
```
PFIELD_OFFSET = ptr FIELD_OFFSET
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L428)  
```
FIELD_OFFSET = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L429)  
```
my_ulonglong = int64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L440)  
```
Pmy_ulonglong = ptr my_ulonglong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L441)  
```
Pst_mysql_rows = ptr St_mysql_rows
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L447)  
```
St_mysql_rows {...}{.final.} = object
  next*: Pst_mysql_rows
  data*: ROW
  len*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L448)  
```
ROWS = St_mysql_rows
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L453)  
```
PROWS = ptr ROWS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L454)  
```
PROW_OFFSET = ptr ROW_OFFSET
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L455)  
```
ROW_OFFSET = ROWS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L456)  
```
Pst_used_mem = ptr St_used_mem
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L465)  
```
St_used_mem {...}{.final.} = object
  next*: Pst_used_mem
  left*: cuint
  size*: cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L466)  
```
USED_MEM = St_used_mem
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L471)  
```
PUSED_MEM = ptr USED_MEM
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L472)  
```
Pst_mem_root = ptr St_mem_root
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L473)  
```
St_mem_root {...}{.final.} = object
  free*: PUSED_MEM
  used*: PUSED_MEM
  pre_alloc*: PUSED_MEM
  min_malloc*: cuint
  block_size*: cuint
  block_num*: cuint
  first_block_usage*: cuint
  error_handler*: proc () {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L474)  
```
MEM_ROOT = St_mem_root
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L486)  
```
PMEM_ROOT = ptr MEM_ROOT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L487)  
```
Pst_mysql_data = ptr St_mysql_data
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L492)  
```
St_mysql_data {...}{.final.} = object
  rows*: my_ulonglong
  fields*: cuint
  data*: PROWS
  alloc*: MEM_ROOT
  prev_ptr*: ptr PROWS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L493)  
```
DATA = St_mysql_data
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L500)  
```
PDATA = ptr DATA
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L501)  
```
Option = enum
  OPT_CONNECT_TIMEOUT, OPT_COMPRESS, OPT_NAMED_PIPE, INIT_COMMAND,
  READ_DEFAULT_FILE, READ_DEFAULT_GROUP, SET_CHARSET_DIR, SET_CHARSET_NAME,
  OPT_LOCAL_INFILE, OPT_PROTOCOL, SHARED_MEMORY_BASE_NAME, OPT_READ_TIMEOUT,
  OPT_WRITE_TIMEOUT, OPT_USE_RESULT, OPT_USE_REMOTE_CONNECTION,
  OPT_USE_EMBEDDED_CONNECTION, OPT_GUESS_CONNECTION, SET_CLIENT_IP, SECURE_AUTH,
  REPORT_DATA_TRUNCATION, OPT_RECONNECT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L502)  
```
St_dynamic_array {...}{.final.} = object
  buffer*: cstring
  elements*: cuint
  max_element*: cuint
  alloc_increment*: cuint
  size_of_element*: cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L521)  
```
DYNAMIC_ARRAY = St_dynamic_array
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L528)  
```
Pst_dynamic_array = ptr St_dynamic_array
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L529)  
```
Pst_mysql_options = ptr St_mysql_options
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L530)  
```
St_mysql_options {...}{.final.} = object
  connect_timeout*: cuint
  read_timeout*: cuint
  write_timeout*: cuint
  port*: cuint
  protocol*: cuint
  client_flag*: int
  host*: cstring
  user*: cstring
  password*: cstring
  unix_socket*: cstring
  db*: cstring
  init_commands*: Pst_dynamic_array
  my_cnf_file*: cstring
  my_cnf_group*: cstring
  charset_dir*: cstring
  charset_name*: cstring
  ssl_key*: cstring
  ssl_cert*: cstring
  ssl_ca*: cstring
  ssl_capath*: cstring
  ssl_cipher*: cstring
  shared_memory_base_name*: cstring
  max_allowed_packet*: int
  use_ssl*: my_bool
  compress*: my_bool
  named_pipe*: my_bool
  rpl_probe*: my_bool
  rpl_parse*: my_bool
  no_master_reads*: my_bool
  separate_thread*: my_bool
  methods_to_use*: Option
  client_ip*: cstring
  secure_auth*: my_bool
  report_data_truncation*: my_bool
  local_infile_init*: proc (para1: var pointer; para2: cstring; para3: pointer): cint {...}{.
      cdecl.}
  local_infile_read*: proc (para1: pointer; para2: cstring; para3: cuint): cint
  local_infile_end*: proc (para1: pointer)
  local_infile_error*: proc (para1: pointer; para2: cstring; para3: cuint): cint
  local_infile_userdata*: pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L531)  
```
Status = enum
  STATUS_READY, STATUS_GET_RESULT, STATUS_USE_RESULT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L577)  
```
Protocol_type = enum
  PROTOCOL_DEFAULT, PROTOCOL_TCP, PROTOCOL_SOCKET, PROTOCOL_PIPE,
  PROTOCOL_MEMORY
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L579)  
```
Rpl_type = enum
  RPL_MASTER, RPL_SLAVE, RPL_ADMIN
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L584)  
```
Charset_info_st {...}{.final.} = object
  number*: cuint
  primary_number*: cuint
  binary_number*: cuint
  state*: cuint
  csname*: cstring
  name*: cstring
  comment*: cstring
  tailoring*: cstring
  ftype*: cstring
  to_lower*: cstring
  to_upper*: cstring
  sort_order*: cstring
  contractions*: ptr int16
  sort_order_big*: ptr ptr int16
  tab_to_uni*: ptr int16
  tab_from_uni*: pointer
  state_map*: cstring
  ident_map*: cstring
  strxfrm_multiply*: cuint
  mbminlen*: cuint
  mbmaxlen*: cuint
  min_sort_char*: int16
  max_sort_char*: int16
  escape_with_backslash_is_dangerous*: my_bool
  cset*: pointer
  coll*: pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L586)  
```
CHARSET_INFO = Charset_info_st
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L614) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L614)  
```
Pcharset_info_st = ptr Charset_info_st
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L615)  
```
Pcharacter_set = ptr Character_set
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L616)  
```
Character_set {...}{.final.} = object
  number*: cuint
  state*: cuint
  csname*: cstring
  name*: cstring
  comment*: cstring
  dir*: cstring
  mbminlen*: cuint
  mbmaxlen*: cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L617)  
```
MY_CHARSET_INFO = Character_set
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L627)  
```
PMY_CHARSET_INFO = ptr MY_CHARSET_INFO
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L628)  
```
Pst_mysql_methods = ptr St_mysql_methods
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L629) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L629)  
```
Pst_mysql = ptr St_mysql
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L630)  
```
St_mysql {...}{.final.} = object
  net*: NET
  connector_fd*: gptr
  host*: cstring
  user*: cstring
  passwd*: cstring
  unix_socket*: cstring
  server_version*: cstring
  host_info*: cstring
  info*: cstring
  db*: cstring
  charset*: Pcharset_info_st
  fields*: PFIELD
  field_alloc*: MEM_ROOT
  affected_rows*: my_ulonglong
  insert_id*: my_ulonglong
  extra_info*: my_ulonglong
  thread_id*: int
  packet_length*: int
  port*: cuint
  client_flag*: int
  server_capabilities*: int
  protocol_version*: cuint
  field_count*: cuint
  server_status*: cuint
  server_language*: cuint
  warning_count*: cuint
  options*: St_mysql_options
  status*: Status
  free_me*: my_bool
  reconnect*: my_bool
  scramble*: array[0 .. 21 - 1, char]
  rpl_pivot*: my_bool
  master*: Pst_mysql
  next_slave*: Pst_mysql
  last_used_slave*: Pst_mysql
  last_used_con*: Pst_mysql
  stmts*: pointer
  methods*: Pst_mysql_methods
  thd*: pointer
  unbuffered_fetch_owner*: Pmy_bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L631)  
```
MySQL = St_mysql
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L677)  
```
PMySQL = ptr MySQL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L678)  
```
Pst_mysql_res = ptr St_mysql_res
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L679)  
```
St_mysql_res {...}{.final.} = object
  row_count*: my_ulonglong
  fields*: PFIELD
  data*: PDATA
  data_cursor*: PROWS
  lengths*: ptr int
  handle*: PMySQL
  field_alloc*: MEM_ROOT
  field_count*: cuint
  current_field*: cuint
  row*: ROW
  current_row*: ROW
  eof*: my_bool
  unbuffered_fetch_cancelled*: my_bool
  methods*: Pst_mysql_methods
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L680)  
```
RES = St_mysql_res
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L696)  
```
PRES = ptr RES
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L697)  
```
Pst_mysql_stmt = ptr St_mysql_stmt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L698)  
```
PSTMT = ptr STMT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L699)  
```
St_mysql_methods {...}{.final.} = object
  read_query_result*: proc (MySQL: PMySQL): my_bool {...}{.cdecl.}
  advanced_command*: proc (MySQL: PMySQL; command: Enum_server_command;
                           header: cstring; header_length: int; arg: cstring;
                           arg_length: int; skip_check: my_bool): my_bool
  read_rows*: proc (MySQL: PMySQL; fields: PFIELD; fields_count: cuint): PDATA
  use_result*: proc (MySQL: PMySQL): PRES
  fetch_lengths*: proc (fto: ptr int; column: ROW; field_count: cuint)
  flush_use_result*: proc (MySQL: PMySQL)
  list_fields*: proc (MySQL: PMySQL): PFIELD
  read_prepare_result*: proc (MySQL: PMySQL; stmt: PSTMT): my_bool
  stmt_execute*: proc (stmt: PSTMT): cint
  read_binary_rows*: proc (stmt: PSTMT): cint
  unbuffered_fetch*: proc (MySQL: PMySQL; row: cstringArray): cint
  free_embedded_thd*: proc (MySQL: PMySQL)
  read_statistics*: proc (MySQL: PMySQL): cstring
  next_result*: proc (MySQL: PMySQL): my_bool
  read_change_user_result*: proc (MySQL: PMySQL; buff: cstring; passwd: cstring): cint
  read_rowsfrom_cursor*: proc (stmt: PSTMT): cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L700)  
```
METHODS = St_mysql_methods
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L720)  
```
PMETHODS = ptr METHODS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L721) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L721)  
```
Pst_mysql_manager = ptr St_mysql_manager
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L722) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L722)  
```
St_mysql_manager {...}{.final.} = object
  net*: NET
  host*: cstring
  user*: cstring
  passwd*: cstring
  port*: cuint
  free_me*: my_bool
  eof*: my_bool
  cmd_status*: cint
  last_errno*: cint
  net_buf*: cstring
  net_buf_pos*: cstring
  net_data_end*: cstring
  net_buf_size*: cint
  last_error*: array[0 .. 256 - 1, char]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L723) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L723)  
```
MANAGER = St_mysql_manager
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L739)  
```
PMANAGER = ptr MANAGER
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L740) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L740)  
```
Pst_mysql_parameters = ptr St_mysql_parameters
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L741)  
```
St_mysql_parameters {...}{.final.} = object
  p_max_allowed_packet*: ptr int
  p_net_buffer_length*: ptr int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L742)  
```
PARAMETERS = St_mysql_parameters
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L746)  
```
PPARAMETERS = ptr PARAMETERS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L747)  
```
Enum_mysql_stmt_state = enum
  STMT_INIT_DONE = 1, STMT_PREPARE_DONE, STMT_EXECUTE_DONE, STMT_FETCH_DONE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L748) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L748)  
```
Pst_mysql_bind = ptr St_mysql_bind
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L750)  
```
St_mysql_bind {...}{.final.} = object
  len*: int
  is_null*: Pmy_bool
  buffer*: pointer
  error*: Pmy_bool
  buffer_type*: Enum_field_types
  buffer_length*: int
  row_ptr*: ptr byte
  offset*: int
  length_value*: int
  param_number*: cuint
  pack_length*: cuint
  error_value*: my_bool
  is_unsigned*: my_bool
  long_data_used*: my_bool
  is_null_value*: my_bool
  store_param_func*: proc (net: PNET; param: Pst_mysql_bind) {...}{.cdecl.}
  fetch_result*: proc (para1: Pst_mysql_bind; para2: PFIELD; row: PPByte)
  skip_result*: proc (para1: Pst_mysql_bind; para2: PFIELD; row: PPByte)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L751)  
```
BIND = St_mysql_bind
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L772)  
```
PBIND = ptr BIND
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L773) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L773)  
```
St_mysql_stmt {...}{.final.} = object
  mem_root*: MEM_ROOT
  mysql*: PMySQL
  params*: PBIND
  `bind`*: PBIND
  fields*: PFIELD
  result*: DATA
  data_cursor*: PROWS
  affected_rows*: my_ulonglong
  insert_id*: my_ulonglong
  read_row_func*: proc (stmt: Pst_mysql_stmt; row: PPByte): cint {...}{.cdecl.}
  stmt_id*: int
  flags*: int
  prefetch_rows*: int
  server_status*: cuint
  last_errno*: cuint
  param_count*: cuint
  field_count*: cuint
  state*: Enum_mysql_stmt_state
  last_error*: array[0 .. 200 - 1, char]
  sqlstate*: array[0 .. 6 - 1, char]
  send_types_to_server*: my_bool
  bind_param_done*: my_bool
  bind_result_done*: char
  unbuffered_fetch_cancelled*: my_bool
  update_max_length*: my_bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L774) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L774)  
```
STMT = St_mysql_stmt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L802) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L802)  
```
Enum_stmt_attr_type = enum
  STMT_ATTR_UPDATE_MAX_LENGTH, STMT_ATTR_CURSOR_TYPE, STMT_ATTR_PREFETCH_ROWS
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L804) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L804)   Consts
------

  
```
NAME_LEN = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L42)  
```
HOSTNAME_LENGTH = 60
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L43)  
```
USERNAME_LENGTH = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L44)  
```
SERVER_VERSION_LENGTH = 60
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L45)  
```
SQLSTATE_LENGTH = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L46)  
```
LOCAL_HOST = "localhost"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L47)  
```
LOCAL_HOST_NAMEDPIPE = '.'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L48)  
```
NAMEDPIPE = "MySQL"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L51)  
```
SERVICENAME = "MySQL"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L52)  
```
SCRAMBLE_LENGTH = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L66)  
```
SCRAMBLE_LENGTH_323 = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L69)  
```
SCRAMBLED_PASSWORD_CHAR_LENGTH = 41
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L71)  
```
SCRAMBLED_PASSWORD_CHAR_LENGTH_323 = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L72)  
```
NOT_NULL_FLAG = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L73)  
```
PRI_KEY_FLAG = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L74)  
```
UNIQUE_KEY_FLAG = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L75)  
```
MULTIPLE_KEY_FLAG = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L76)  
```
BLOB_FLAG = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L77)  
```
UNSIGNED_FLAG = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L78)  
```
ZEROFILL_FLAG = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L79)  
```
BINARY_FLAG = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L80)  
```
ENUM_FLAG = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L82)  
```
AUTO_INCREMENT_FLAG = 512
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L83)  
```
TIMESTAMP_FLAG = 1024
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L84)  
```
SET_FLAG = 2048
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L85)  
```
NO_DEFAULT_VALUE_FLAG = 4096
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L86)  
```
NUM_FLAG = 32768
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L87)  
```
PART_KEY_FLAG = 16384
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L88)  
```
GROUP_FLAG = 32768
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L89)  
```
UNIQUE_FLAG = 65536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L90)  
```
BINCMP_FLAG = 131072
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L91)  
```
REFRESH_GRANT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L92)  
```
REFRESH_LOG = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L93)  
```
REFRESH_TABLES = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L94)  
```
REFRESH_HOSTS = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L95)  
```
REFRESH_STATUS = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L96)  
```
REFRESH_THREADS = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L97)  
```
REFRESH_SLAVE = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L98)  
```
REFRESH_MASTER = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L99)  
```
REFRESH_READ_LOCK = 16384
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L101)  
```
REFRESH_FAST = 32768
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L102)  
```
REFRESH_QUERY_CACHE = 65536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L103)  
```
REFRESH_QUERY_CACHE_FREE = 0x00020000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L104)  
```
REFRESH_DES_KEY_FILE = 0x00040000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L105)  
```
REFRESH_USER_RESOURCES = 0x00080000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L106)  
```
CLIENT_LONG_PASSWORD = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L107)  
```
CLIENT_FOUND_ROWS = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L108)  
```
CLIENT_LONG_FLAG = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L109)  
```
CLIENT_CONNECT_WITH_DB = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L110)  
```
CLIENT_NO_SCHEMA = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L111)  
```
CLIENT_COMPRESS = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L112)  
```
CLIENT_ODBC = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L113)  
```
CLIENT_LOCAL_FILES = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L114)  
```
CLIENT_IGNORE_SPACE = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L115)  
```
CLIENT_PROTOCOL_41 = 512
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L116)  
```
CLIENT_INTERACTIVE = 1024
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L117)  
```
CLIENT_SSL = 2048
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L118)  
```
CLIENT_IGNORE_SIGPIPE = 4096
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L119)  
```
CLIENT_TRANSACTIONS = 8192
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L120)  
```
CLIENT_RESERVED = 16384
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L121)  
```
CLIENT_SECURE_CONNECTION = 32768
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L122)  
```
CLIENT_MULTI_STATEMENTS = 65536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L123)  
```
CLIENT_MULTI_RESULTS = 131072
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L124)  
```
CLIENT_REMEMBER_OPTIONS: int = 2147483648
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L125)  
```
SERVER_STATUS_IN_TRANS = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L126)  
```
SERVER_STATUS_AUTOCOMMIT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L127)  
```
SERVER_STATUS_MORE_RESULTS = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L128)  
```
SERVER_MORE_RESULTS_EXISTS = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L129)  
```
SERVER_QUERY_NO_GOOD_INDEX_USED = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L130)  
```
SERVER_QUERY_NO_INDEX_USED = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L131)  
```
SERVER_STATUS_CURSOR_EXISTS = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L134)  
```
SERVER_STATUS_LAST_ROW_SENT = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L136)  
```
SERVER_STATUS_DB_DROPPED = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L137)  
```
SERVER_STATUS_NO_BACKSLASH_ESCAPES = 512
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L138)  
```
ERRMSG_SIZE = 200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L139)  
```
NET_READ_TIMEOUT = 30
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L140)  
```
NET_WRITE_TIMEOUT = 60
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L141)  
```
NET_WAIT_TIMEOUT = 28800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L142)  
```
ONLY_KILL_QUERY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L143)  
```
MAX_TINYINT_WIDTH = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L146)  
```
MAX_SMALLINT_WIDTH = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L147)  
```
MAX_MEDIUMINT_WIDTH = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L148)  
```
MAX_INT_WIDTH = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L149)  
```
MAX_BIGINT_WIDTH = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L150)  
```
MAX_CHAR_WIDTH = 255
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L151)  
```
MAX_BLOB_WIDTH = 8192
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L152)  
```
packet_error = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L201)  
```
CLIENT_MULTI_QUERIES = 65536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L215)  
```
FIELD_TYPE_DECIMAL = TYPE_DECIMAL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L216)  
```
FIELD_TYPE_NEWDECIMAL = TYPE_NEWDECIMAL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L217)  
```
FIELD_TYPE_TINY = TYPE_TINY
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L218)  
```
FIELD_TYPE_SHORT = TYPE_SHORT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L219)  
```
FIELD_TYPE_LONG = TYPE_LONG
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L220)  
```
FIELD_TYPE_FLOAT = TYPE_FLOAT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L221)  
```
FIELD_TYPE_DOUBLE = TYPE_DOUBLE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L222)  
```
FIELD_TYPE_NULL = TYPE_NULL
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L223)  
```
FIELD_TYPE_TIMESTAMP = TYPE_TIMESTAMP
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L224)  
```
FIELD_TYPE_LONGLONG = TYPE_LONGLONG
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L225)  
```
FIELD_TYPE_INT24 = TYPE_INT24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L226)  
```
FIELD_TYPE_DATE = TYPE_DATE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L227)  
```
FIELD_TYPE_TIME = TYPE_TIME
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L228)  
```
FIELD_TYPE_DATETIME = TYPE_DATETIME
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L229)  
```
FIELD_TYPE_YEAR = TYPE_YEAR
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L230)  
```
FIELD_TYPE_NEWDATE = TYPE_NEWDATE
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L231)  
```
FIELD_TYPE_ENUM = TYPE_ENUM
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L232)  
```
FIELD_TYPE_SET = TYPE_SET
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L233)  
```
FIELD_TYPE_TINY_BLOB = TYPE_TINY_BLOB
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L234)  
```
FIELD_TYPE_MEDIUM_BLOB = TYPE_MEDIUM_BLOB
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L235)  
```
FIELD_TYPE_LONG_BLOB = TYPE_LONG_BLOB
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L236)  
```
FIELD_TYPE_BLOB = TYPE_BLOB
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L237)  
```
FIELD_TYPE_VAR_STRING = TYPE_VAR_STRING
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L238)  
```
FIELD_TYPE_STRING = TYPE_STRING
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L239)  
```
FIELD_TYPE_CHAR = TYPE_TINY
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L240)  
```
FIELD_TYPE_INTERVAL = TYPE_ENUM
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L241)  
```
FIELD_TYPE_GEOMETRY = TYPE_GEOMETRY
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L242)  
```
FIELD_TYPE_BIT = TYPE_BIT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L243)  
```
SHUTDOWN_KILLABLE_CONNECT = '\x01'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L245)  
```
SHUTDOWN_KILLABLE_TRANS = '\x02'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L246)  
```
SHUTDOWN_KILLABLE_LOCK_TABLE = '\x04'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L247)  
```
SHUTDOWN_KILLABLE_UPDATE = '\b'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L248)  
```
NET_HEADER_SIZE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L329)  
```
COMP_HEADER_SIZE = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L330)  
```
NULL_LENGTH: int = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L382)  
```
STMT_HEADER = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L385)  
```
LONG_DATA_HEADER = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L386)  
```
CLIENT_NET_READ_TIMEOUT = 31536000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L396)  
```
CLIENT_NET_WRITE_TIMEOUT = 31536000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L397)  
```
COUNT_ERROR = -1'i64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L444)  
```
ALLOC_MAX_BLOCK_TO_DROP = 4096
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L461)  
```
ALLOC_MAX_BLOCK_USAGE_BEFORE_DROP = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L462)  
```
MAX_MYSQL_MANAGER_ERR = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L512)  
```
MAX_MYSQL_MANAGER_MSG = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L513)  
```
MANAGER_OK = 200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L514)  
```
MANAGER_INFO = 250
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L515)  
```
MANAGER_ACCESS = 401
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L516)  
```
MANAGER_CLIENT_ERR = 450
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L517)  
```
MANAGER_INTERNAL_ERR = 500
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L518)  
```
LOCAL_INFILE_ERROR_LEN = 512
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L907) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L907)  
```
NO_DATA = 100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1076) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1076)  
```
DATA_TRUNCATED = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1077) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1077)   Procs
-----

  
```
proc my_net_init(net: PNET; vio: PVIO): my_bool {...}{.cdecl, dynlib: lib,
    importc: "my_net_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L265)  
```
proc my_net_local_init(net: PNET) {...}{.cdecl, dynlib: lib,
                                    importc: "my_net_local_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L267)  
```
proc net_end(net: PNET) {...}{.cdecl, dynlib: lib, importc: "net_end".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L269)  
```
proc net_clear(net: PNET) {...}{.cdecl, dynlib: lib, importc: "net_clear".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L270)  
```
proc net_realloc(net: PNET; len: int): my_bool {...}{.cdecl, dynlib: lib,
    importc: "net_realloc".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L271)  
```
proc net_flush(net: PNET): my_bool {...}{.cdecl, dynlib: lib, importc: "net_flush".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L273)  
```
proc my_net_write(net: PNET; packet: cstring; length: int): my_bool {...}{.cdecl,
    dynlib: lib, importc: "my_net_write".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L274)  
```
proc net_write_command(net: PNET; command: char; header: cstring; head_len: int;
                       packet: cstring; length: int): my_bool {...}{.cdecl,
    dynlib: lib, importc: "net_write_command".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L276)  
```
proc net_real_write(net: PNET; packet: cstring; length: int): cint {...}{.cdecl,
    dynlib: lib, importc: "net_real_write".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L279)  
```
proc my_net_read(net: PNET): int {...}{.cdecl, dynlib: lib, importc: "my_net_read".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L281)  
```
proc my_connect(s: my_socket; name: Psockaddr; namelen: cuint; timeout: cuint): cint {...}{.
    cdecl, dynlib: lib, importc: "my_connect".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L289)  
```
proc randominit(para1: Prand_struct; seed1: int; seed2: int) {...}{.cdecl,
    dynlib: lib, importc: "randominit".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L335)  
```
proc my_rnd(para1: Prand_struct): cdouble {...}{.cdecl, dynlib: lib,
    importc: "my_rnd".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L337)  
```
proc create_random_string(fto: cstring; len: cuint; rand_st: Prand_struct) {...}{.
    cdecl, dynlib: lib, importc: "create_random_string".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L339)  
```
proc hash_password(fto: int; password: cstring; password_len: cuint) {...}{.cdecl,
    dynlib: lib, importc: "hash_password".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L341)  
```
proc make_scrambled_password_323(fto: cstring; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "make_scrambled_password_323".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L343)  
```
proc scramble_323(fto: cstring; message: cstring; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "scramble_323".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L345) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L345)  
```
proc check_scramble_323(para1: cstring; message: cstring; salt: int): my_bool {...}{.
    cdecl, dynlib: lib, importc: "check_scramble_323".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L347)  
```
proc get_salt_from_password_323(res: ptr int; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "get_salt_from_password_323".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L349)  
```
proc make_password_from_salt_323(fto: cstring; salt: ptr int) {...}{.cdecl,
    dynlib: lib, importc: "make_password_from_salt_323".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L351)  
```
proc octet2hex(fto: cstring; str: cstring; length: cuint): cstring {...}{.cdecl,
    dynlib: lib, importc: "octet2hex".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L353)  
```
proc make_scrambled_password(fto: cstring; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "make_scrambled_password".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L355)  
```
proc scramble(fto: cstring; message: cstring; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "scramble".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L357)  
```
proc check_scramble(reply: cstring; message: cstring; hash_stage2: pointer): my_bool {...}{.
    cdecl, dynlib: lib, importc: "check_scramble".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L359)  
```
proc get_salt_from_password(res: pointer; password: cstring) {...}{.cdecl,
    dynlib: lib, importc: "get_salt_from_password".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L361) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L361)  
```
proc make_password_from_salt(fto: cstring; hash_stage2: pointer) {...}{.cdecl,
    dynlib: lib, importc: "make_password_from_salt".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L363)  
```
proc get_tty_password(opt_message: cstring): cstring {...}{.cdecl, dynlib: lib,
    importc: "get_tty_password".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L366)  
```
proc errno_to_sqlstate(errno: cuint): cstring {...}{.cdecl, dynlib: lib,
    importc: "mysql_errno_to_sqlstate".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L368)  
```
proc modify_defaults_file(file_location: cstring; option: cstring;
                          option_value: cstring; section_name: cstring;
                          remove_option: cint): cint {...}{.cdecl, dynlib: lib,
    importc: "load_defaults".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L371)  
```
proc load_defaults(conf_file: cstring; groups: cstringArray; argc: ptr cint;
                   argv: ptr cstringArray): cint {...}{.cdecl, dynlib: lib,
    importc: "load_defaults".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L375)  
```
proc my_init(): my_bool {...}{.cdecl, dynlib: lib, importc: "my_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L378)  
```
proc my_thread_init(): my_bool {...}{.cdecl, dynlib: lib, importc: "my_thread_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L379)  
```
proc my_thread_end() {...}{.cdecl, dynlib: lib, importc: "my_thread_end".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L380)  
```
proc server_init(argc: cint; argv: cstringArray; groups: cstringArray): cint {...}{.
    cdecl, dynlib: lib, importc: "mysql_server_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L820) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L820)  
```
proc server_end() {...}{.cdecl, dynlib: lib, importc: "mysql_server_end".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L822) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L822)  
```
proc library_init(argc: cint; argv: cstringArray; groups: cstringArray): cint {...}{.
    cdecl, dynlib: lib, importc: "mysql_server_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L830)  
```
proc library_end() {...}{.cdecl, dynlib: lib, importc: "mysql_server_end".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L832) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L832)  
```
proc get_parameters(): PPARAMETERS {...}{.stdcall, dynlib: lib,
                                     importc: "mysql_get_parameters".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L833)  
```
proc thread_init(): my_bool {...}{.stdcall, dynlib: lib, importc: "mysql_thread_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L839)  
```
proc thread_end() {...}{.stdcall, dynlib: lib, importc: "mysql_thread_end".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L840) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L840)  
```
proc num_rows(res: PRES): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_num_rows".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L843)  
```
proc num_fields(res: PRES): cuint {...}{.stdcall, dynlib: lib,
                                    importc: "mysql_num_fields".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L845)  
```
proc eof(res: PRES): my_bool {...}{.stdcall, dynlib: lib, importc: "mysql_eof".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L847) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L847)  
```
proc fetch_field_direct(res: PRES; fieldnr: cuint): PFIELD {...}{.stdcall,
    dynlib: lib, importc: "mysql_fetch_field_direct".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L848) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L848)  
```
proc fetch_fields(res: PRES): PFIELD {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_fetch_fields".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L850) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L850)  
```
proc row_tell(res: PRES): ROW_OFFSET {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_row_tell".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L852) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L852)  
```
proc field_tell(res: PRES): FIELD_OFFSET {...}{.stdcall, dynlib: lib,
    importc: "mysql_field_tell".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L854) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L854)  
```
proc field_count(MySQL: PMySQL): cuint {...}{.stdcall, dynlib: lib,
    importc: "mysql_field_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L856) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L856)  
```
proc affected_rows(MySQL: PMySQL): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_affected_rows".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L858) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L858)  
```
proc insert_id(MySQL: PMySQL): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_insert_id".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L860) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L860)  
```
proc errno(MySQL: PMySQL): cuint {...}{.stdcall, dynlib: lib, importc: "mysql_errno".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L862) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L862)  
```
proc error(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib,
                                     importc: "mysql_error".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L863) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L863)  
```
proc sqlstate(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_sqlstate".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L864)  
```
proc warning_count(MySQL: PMySQL): cuint {...}{.stdcall, dynlib: lib,
    importc: "mysql_warning_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L865) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L865)  
```
proc info(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib, importc: "mysql_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L867) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L867)  
```
proc thread_id(MySQL: PMySQL): int {...}{.stdcall, dynlib: lib,
                                     importc: "mysql_thread_id".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L868) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L868)  
```
proc character_set_name(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib,
    importc: "mysql_character_set_name".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L869) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L869)  
```
proc set_character_set(MySQL: PMySQL; csname: cstring): int32 {...}{.stdcall,
    dynlib: lib, importc: "mysql_set_character_set".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L871) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L871)  
```
proc init(MySQL: PMySQL): PMySQL {...}{.stdcall, dynlib: lib, importc: "mysql_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L873) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L873)  
```
proc ssl_set(MySQL: PMySQL; key: cstring; cert: cstring; ca: cstring;
             capath: cstring; cipher: cstring): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_ssl_set".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L874) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L874)  
```
proc change_user(MySQL: PMySQL; user: cstring; passwd: cstring; db: cstring): my_bool {...}{.
    stdcall, dynlib: lib, importc: "mysql_change_user".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L877) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L877)  
```
proc real_connect(MySQL: PMySQL; host: cstring; user: cstring; passwd: cstring;
                  db: cstring; port: cuint; unix_socket: cstring;
                  clientflag: int): PMySQL {...}{.stdcall, dynlib: lib,
    importc: "mysql_real_connect".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L879) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L879)  
```
proc select_db(MySQL: PMySQL; db: cstring): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_select_db".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L883) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L883)  
```
proc query(MySQL: PMySQL; q: cstring): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L885) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L885)  
```
proc send_query(MySQL: PMySQL; q: cstring; len: int): cint {...}{.stdcall,
    dynlib: lib, importc: "mysql_send_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L886) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L886)  
```
proc real_query(MySQL: PMySQL; q: cstring; len: int): cint {...}{.stdcall,
    dynlib: lib, importc: "mysql_real_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L888) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L888)  
```
proc store_result(MySQL: PMySQL): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_store_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L890)  
```
proc use_result(MySQL: PMySQL): PRES {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_use_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L892) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L892)  
```
proc master_query(MySQL: PMySQL; q: cstring; len: int): my_bool {...}{.stdcall,
    dynlib: lib, importc: "mysql_master_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L894) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L894)  
```
proc master_send_query(MySQL: PMySQL; q: cstring; len: int): my_bool {...}{.stdcall,
    dynlib: lib, importc: "mysql_master_send_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L896) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L896)  
```
proc slave_query(MySQL: PMySQL; q: cstring; len: int): my_bool {...}{.stdcall,
    dynlib: lib, importc: "mysql_slave_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L899) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L899)  
```
proc slave_send_query(MySQL: PMySQL; q: cstring; len: int): my_bool {...}{.stdcall,
    dynlib: lib, importc: "mysql_slave_send_query".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L901) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L901)  
```
proc get_character_set_info(MySQL: PMySQL; charset: PMY_CHARSET_INFO) {...}{.stdcall,
    dynlib: lib, importc: "mysql_get_character_set_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L903) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L903)  
```
proc set_local_infile_default(MySQL: PMySQL) {...}{.cdecl, dynlib: lib,
    importc: "mysql_set_local_infile_default".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L912) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L912)  
```
proc enable_rpl_parse(MySQL: PMySQL) {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_enable_rpl_parse".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L916) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L916)  
```
proc disable_rpl_parse(MySQL: PMySQL) {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_disable_rpl_parse".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L918)  
```
proc rpl_parse_enabled(MySQL: PMySQL): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_rpl_parse_enabled".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L921) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L921)  
```
proc enable_reads_from_master(MySQL: PMySQL) {...}{.stdcall, dynlib: lib,
    importc: "mysql_enable_reads_from_master".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L924) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L924)  
```
proc disable_reads_from_master(MySQL: PMySQL) {...}{.stdcall, dynlib: lib,
    importc: "mysql_disable_reads_from_master".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L926) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L926)  
```
proc reads_from_master_enabled(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_reads_from_master_enabled".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L928) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L928)  
```
proc rpl_query_type(q: cstring; length: cint): Rpl_type {...}{.stdcall, dynlib: lib,
    importc: "mysql_rpl_query_type".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L930) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L930)  
```
proc rpl_probe(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_rpl_probe".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L933)  
```
proc set_master(MySQL: PMySQL; host: cstring; port: cuint; user: cstring;
                passwd: cstring): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_set_master".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L935) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L935)  
```
proc add_slave(MySQL: PMySQL; host: cstring; port: cuint; user: cstring;
               passwd: cstring): cint {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_add_slave".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L937) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L937)  
```
proc shutdown(MySQL: PMySQL; shutdown_level: Enum_shutdown_level): cint {...}{.
    stdcall, dynlib: lib, importc: "mysql_shutdown".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L939) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L939)  
```
proc dump_debug_info(MySQL: PMySQL): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_dump_debug_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L941) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L941)  
```
proc refresh(sql: PMySQL; refresh_options: cuint): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_refresh".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L943) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L943)  
```
proc kill(MySQL: PMySQL; pid: int): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_kill".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L945) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L945)  
```
proc set_server_option(MySQL: PMySQL; option: Enum_mysql_set_option): cint {...}{.
    stdcall, dynlib: lib, importc: "mysql_set_server_option".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L946) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L946)  
```
proc ping(MySQL: PMySQL): cint {...}{.stdcall, dynlib: lib, importc: "mysql_ping".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L948) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L948)  
```
proc stat(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib, importc: "mysql_stat".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L949) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L949)  
```
proc get_server_info(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib,
    importc: "mysql_get_server_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L950)  
```
proc get_client_info(): cstring {...}{.stdcall, dynlib: lib,
                                  importc: "mysql_get_client_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L952) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L952)  
```
proc get_client_version(): int {...}{.stdcall, dynlib: lib,
                                 importc: "mysql_get_client_version".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L954) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L954)  
```
proc get_host_info(MySQL: PMySQL): cstring {...}{.stdcall, dynlib: lib,
    importc: "mysql_get_host_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L956) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L956)  
```
proc get_server_version(MySQL: PMySQL): int {...}{.stdcall, dynlib: lib,
    importc: "mysql_get_server_version".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L958) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L958)  
```
proc get_proto_info(MySQL: PMySQL): cuint {...}{.stdcall, dynlib: lib,
    importc: "mysql_get_proto_info".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L960) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L960)  
```
proc list_dbs(MySQL: PMySQL; wild: cstring): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_list_dbs".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L962) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L962)  
```
proc list_tables(MySQL: PMySQL; wild: cstring): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_list_tables".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L964) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L964)  
```
proc list_processes(MySQL: PMySQL): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_list_processes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L966) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L966)  
```
proc options(MySQL: PMySQL; option: Option; arg: cstring): cint {...}{.stdcall,
    dynlib: lib, importc: "mysql_options".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L968) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L968)  
```
proc free_result(result: PRES) {...}{.stdcall, dynlib: lib,
                                 importc: "mysql_free_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L970) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L970)  
```
proc data_seek(result: PRES; offset: my_ulonglong) {...}{.stdcall, dynlib: lib,
    importc: "mysql_data_seek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L972) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L972)  
```
proc row_seek(result: PRES; offset: ROW_OFFSET): ROW_OFFSET {...}{.stdcall,
    dynlib: lib, importc: "mysql_row_seek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L974) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L974)  
```
proc field_seek(result: PRES; offset: FIELD_OFFSET): FIELD_OFFSET {...}{.stdcall,
    dynlib: lib, importc: "mysql_field_seek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L976) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L976)  
```
proc fetch_row(result: PRES): ROW {...}{.stdcall, dynlib: lib,
                                    importc: "mysql_fetch_row".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L978) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L978)  
```
proc fetch_lengths(result: PRES): ptr int {...}{.stdcall, dynlib: lib,
    importc: "mysql_fetch_lengths".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L980) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L980)  
```
proc fetch_field(result: PRES): PFIELD {...}{.stdcall, dynlib: lib,
    importc: "mysql_fetch_field".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L982) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L982)  
```
proc list_fields(MySQL: PMySQL; table: cstring; wild: cstring): PRES {...}{.stdcall,
    dynlib: lib, importc: "mysql_list_fields".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L984) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L984)  
```
proc escape_string(fto: cstring; from: cstring; from_length: int): int {...}{.
    stdcall, dynlib: lib, importc: "mysql_escape_string".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L986) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L986)  
```
proc hex_string(fto: cstring; from: cstring; from_length: int): int {...}{.stdcall,
    dynlib: lib, importc: "mysql_hex_string".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L988) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L988)  
```
proc real_escape_string(MySQL: PMySQL; fto: cstring; from: cstring; len: int): int {...}{.
    stdcall, dynlib: lib, importc: "mysql_real_escape_string".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L990) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L990)  
```
proc debug(debug: cstring) {...}{.stdcall, dynlib: lib, importc: "mysql_debug".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L992) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L992)  
```
proc myodbc_remove_escape(MySQL: PMySQL; name: cstring) {...}{.stdcall, dynlib: lib,
    importc: "myodbc_remove_escape".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L995) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L995)  
```
proc thread_safe(): cuint {...}{.stdcall, dynlib: lib, importc: "mysql_thread_safe".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L997) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L997)  
```
proc embedded(): my_bool {...}{.stdcall, dynlib: lib, importc: "mysql_embedded".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L998) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L998)  
```
proc manager_init(con: PMANAGER): PMANAGER {...}{.stdcall, dynlib: lib,
    importc: "mysql_manager_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L999) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L999)  
```
proc manager_connect(con: PMANAGER; host: cstring; user: cstring;
                     passwd: cstring; port: cuint): PMANAGER {...}{.stdcall,
    dynlib: lib, importc: "mysql_manager_connect".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1001) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1001)  
```
proc manager_close(con: PMANAGER) {...}{.stdcall, dynlib: lib,
                                    importc: "mysql_manager_close".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1004) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1004)  
```
proc manager_command(con: PMANAGER; cmd: cstring; cmd_len: cint): cint {...}{.
    stdcall, dynlib: lib, importc: "mysql_manager_command".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1006) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1006)  
```
proc manager_fetch_line(con: PMANAGER; res_buf: cstring; res_buf_size: cint): cint {...}{.
    stdcall, dynlib: lib, importc: "mysql_manager_fetch_line".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1008)  
```
proc read_query_result(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_read_query_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1010) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1010)  
```
proc stmt_init(MySQL: PMySQL): PSTMT {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_stmt_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1012) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1012)  
```
proc stmt_prepare(stmt: PSTMT; query: cstring; len: int): cint {...}{.stdcall,
    dynlib: lib, importc: "mysql_stmt_prepare".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1013)  
```
proc stmt_execute(stmt: PSTMT): cint {...}{.stdcall, dynlib: lib,
                                       importc: "mysql_stmt_execute".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1015) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1015)  
```
proc stmt_fetch(stmt: PSTMT): cint {...}{.stdcall, dynlib: lib,
                                     importc: "mysql_stmt_fetch".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1017)  
```
proc stmt_fetch_column(stmt: PSTMT; bind: PBIND; column: cuint; offset: int): cint {...}{.
    stdcall, dynlib: lib, importc: "mysql_stmt_fetch_column".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1019) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1019)  
```
proc stmt_store_result(stmt: PSTMT): cint {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_store_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1021)  
```
proc stmt_param_count(stmt: PSTMT): int {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_param_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1023) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1023)  
```
proc stmt_attr_set(stmt: PSTMT; attr_type: Enum_stmt_attr_type; attr: pointer): my_bool {...}{.
    stdcall, dynlib: lib, importc: "mysql_stmt_attr_set".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1025) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1025)  
```
proc stmt_attr_get(stmt: PSTMT; attr_type: Enum_stmt_attr_type; attr: pointer): my_bool {...}{.
    stdcall, dynlib: lib, importc: "mysql_stmt_attr_get".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1027) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1027)  
```
proc stmt_bind_param(stmt: PSTMT; bnd: PBIND): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_bind_param".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1029) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1029)  
```
proc stmt_bind_result(stmt: PSTMT; bnd: PBIND): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_bind_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1031) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1031)  
```
proc stmt_close(stmt: PSTMT): my_bool {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_stmt_close".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1033) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1033)  
```
proc stmt_reset(stmt: PSTMT): my_bool {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_stmt_reset".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1035)  
```
proc stmt_free_result(stmt: PSTMT): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_free_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1037) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1037)  
```
proc stmt_send_long_data(stmt: PSTMT; param_number: cuint; data: cstring;
                         len: int): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_send_long_data".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1039) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1039)  
```
proc stmt_result_metadata(stmt: PSTMT): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_result_metadata".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1042) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1042)  
```
proc stmt_param_metadata(stmt: PSTMT): PRES {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_param_metadata".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1044) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1044)  
```
proc stmt_errno(stmt: PSTMT): cuint {...}{.stdcall, dynlib: lib,
                                      importc: "mysql_stmt_errno".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1046) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1046)  
```
proc stmt_error(stmt: PSTMT): cstring {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_stmt_error".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1048) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1048)  
```
proc stmt_sqlstate(stmt: PSTMT): cstring {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_sqlstate".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1050) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1050)  
```
proc stmt_row_seek(stmt: PSTMT; offset: ROW_OFFSET): ROW_OFFSET {...}{.stdcall,
    dynlib: lib, importc: "mysql_stmt_row_seek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1052) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1052)  
```
proc stmt_row_tell(stmt: PSTMT): ROW_OFFSET {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_row_tell".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1054) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1054)  
```
proc stmt_data_seek(stmt: PSTMT; offset: my_ulonglong) {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_data_seek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1056) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1056)  
```
proc stmt_num_rows(stmt: PSTMT): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_num_rows".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1058) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1058)  
```
proc stmt_affected_rows(stmt: PSTMT): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_affected_rows".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1060) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1060)  
```
proc stmt_insert_id(stmt: PSTMT): my_ulonglong {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_insert_id".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1062) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1062)  
```
proc stmt_field_count(stmt: PSTMT): cuint {...}{.stdcall, dynlib: lib,
    importc: "mysql_stmt_field_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1064) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1064)  
```
proc commit(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
                                      importc: "mysql_commit".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1066) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1066)  
```
proc rollback(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_rollback".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1067) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1067)  
```
proc autocommit(MySQL: PMySQL; auto_mode: my_bool): my_bool {...}{.stdcall,
    dynlib: lib, importc: "mysql_autocommit".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1068) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1068)  
```
proc more_results(MySQL: PMySQL): my_bool {...}{.stdcall, dynlib: lib,
    importc: "mysql_more_results".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1070) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1070)  
```
proc next_result(MySQL: PMySQL): cint {...}{.stdcall, dynlib: lib,
                                        importc: "mysql_next_result".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1072) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1072)  
```
proc close(sock: PMySQL) {...}{.stdcall, dynlib: lib, importc: "mysql_close".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1073) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1073)  
```
proc net_safe_read(MySQL: PMySQL): cuint {...}{.cdecl, dynlib: lib,
    importc: "net_safe_read".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1087) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1087)  
```
proc IS_PRI_KEY(n: int32): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1089) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1089)  
```
proc IS_NOT_NULL(n: int32): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1092) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1092)  
```
proc IS_BLOB(n: int32): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1095) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1095)  
```
proc IS_NUM_FIELD(f: Pst_mysql_field): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1098) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1098)  
```
proc IS_NUM(t: Enum_field_types): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1101)  
```
proc INTERNAL_NUM_FIELD(f: Pst_mysql_field): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1105)  
```
proc reload(x: PMySQL): cint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/mysql.nim#L1110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/mysql.nim#L1110)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/mysql.html>

sqlite3
=======

 Types
-----

  
```
PSqlite3 = ptr Sqlite3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L109)  
```
PPSqlite3 = ptr PSqlite3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L110)  
```
PSqlite3_Backup = ptr Sqlite3_Backup
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L112)  
```
PPSqlite3_Backup = ptr PSqlite3_Backup
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L113)  
```
Pcontext = ptr Context
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L115)  
```
PStmt = ptr TStmt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L117)  
```
PValue = ptr Value
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L119)  
```
PValueArg = array[0 .. 127, PValue]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L120)  
```
Callback = proc (para1: pointer; para2: int32; para3, para4: cstringArray): int32 {...}{.
    cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L122)  
```
Tbind_destructor_func = proc (para1: pointer) {...}{.cdecl, locks: 0, tags: [],
    gcsafe.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L124)  
```
Create_function_step_func = proc (para1: Pcontext; para2: int32;
                                  para3: PValueArg) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L125)  
```
Create_function_func_func = proc (para1: Pcontext; para2: int32;
                                  para3: PValueArg) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L127)  
```
Create_function_final_func = proc (para1: Pcontext) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L129)  
```
Result_func = proc (para1: pointer) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L130)  
```
Create_collation_func = proc (para1: pointer; para2: int32; para3: pointer;
                              para4: int32; para5: pointer): int32 {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L131)  
```
Collation_needed_func = proc (para1: pointer; para2: PSqlite3; eTextRep: int32;
                              para4: cstring) {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L133)   Consts
------

  
```
SQLITE_INTEGER = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L34)  
```
SQLITE_FLOAT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L35)  
```
SQLITE_BLOB = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L36)  
```
SQLITE_NULL = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L37)  
```
SQLITE_TEXT = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L38)  
```
SQLITE_UTF8 = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L39)  
```
SQLITE_UTF16LE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L40)  
```
SQLITE_UTF16BE = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L41)  
```
SQLITE_UTF16 = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L42)  
```
SQLITE_ANY = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L43)  
```
SQLITE_OK = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L44)  
```
SQLITE_ERROR = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L45)  
```
SQLITE_INTERNAL = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L46)  
```
SQLITE_PERM = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L47)  
```
SQLITE_ABORT = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L48)  
```
SQLITE_BUSY = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L49)  
```
SQLITE_LOCKED = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L50)  
```
SQLITE_NOMEM = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L51)  
```
SQLITE_READONLY = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L52)  
```
SQLITE_INTERRUPT = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L53)  
```
SQLITE_IOERR = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L54)  
```
SQLITE_CORRUPT = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L55)  
```
SQLITE_NOTFOUND = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L56)  
```
SQLITE_FULL = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L57)  
```
SQLITE_CANTOPEN = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L58)  
```
SQLITE_PROTOCOL = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L59)  
```
SQLITE_EMPTY = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L60)  
```
SQLITE_SCHEMA = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L61)  
```
SQLITE_TOOBIG = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L62)  
```
SQLITE_CONSTRAINT = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L63)  
```
SQLITE_MISMATCH = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L64)  
```
SQLITE_MISUSE = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L65)  
```
SQLITE_NOLFS = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L66)  
```
SQLITE_AUTH = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L67)  
```
SQLITE_FORMAT = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L68)  
```
SQLITE_RANGE = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L69)  
```
SQLITE_NOTADB = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L70)  
```
SQLITE_ROW = 100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L71)  
```
SQLITE_DONE = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L72)  
```
SQLITE_COPY = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L73)  
```
SQLITE_CREATE_INDEX = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L74)  
```
SQLITE_CREATE_TABLE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L75)  
```
SQLITE_CREATE_TEMP_INDEX = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L76)  
```
SQLITE_CREATE_TEMP_TABLE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L77)  
```
SQLITE_CREATE_TEMP_TRIGGER = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L78)  
```
SQLITE_CREATE_TEMP_VIEW = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L79)  
```
SQLITE_CREATE_TRIGGER = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L80)  
```
SQLITE_CREATE_VIEW = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L81)  
```
SQLITE_DELETE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L82)  
```
SQLITE_DROP_INDEX = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L83)  
```
SQLITE_DROP_TABLE = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L84)  
```
SQLITE_DROP_TEMP_INDEX = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L85)  
```
SQLITE_DROP_TEMP_TABLE = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L86)  
```
SQLITE_DROP_TEMP_TRIGGER = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L87)  
```
SQLITE_DROP_TEMP_VIEW = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L88)  
```
SQLITE_DROP_TRIGGER = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L89)  
```
SQLITE_DROP_VIEW = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L90)  
```
SQLITE_INSERT = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L91)  
```
SQLITE_PRAGMA = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L92)  
```
SQLITE_READ = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L93)  
```
SQLITE_SELECT = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L94)  
```
SQLITE_TRANSACTION = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L95)  
```
SQLITE_UPDATE = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L96)  
```
SQLITE_ATTACH = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L97)  
```
SQLITE_DETACH = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L98)  
```
SQLITE_ALTER_TABLE = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L99)  
```
SQLITE_REINDEX = 27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L100)  
```
SQLITE_DENY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L101)  
```
SQLITE_IGNORE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L102)  
```
SQLITE_DETERMINISTIC = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L105)  
```
SQLITE_STATIC = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L137)  
```
SQLITE_TRANSIENT = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L138)   Procs
-----

  
```
proc close(para1: PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
                                     importc: "sqlite3_close".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L140)  
```
proc exec(para1: PSqlite3; sql: cstring; para3: Callback; para4: pointer;
          errmsg: var cstring): int32 {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_exec".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L141)  
```
proc last_insert_rowid(para1: PSqlite3): int64 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_last_insert_rowid".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L144)  
```
proc changes(para1: PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_changes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L146)  
```
proc total_changes(para1: PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_total_changes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L147)  
```
proc interrupt(para1: PSqlite3) {...}{.cdecl, dynlib: Lib,
                                  importc: "sqlite3_interrupt".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L149)  
```
proc complete(sql: cstring): int32 {...}{.cdecl, dynlib: Lib,
                                     importc: "sqlite3_complete".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L150)  
```
proc complete16(sql: pointer): int32 {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_complete16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L152)  
```
proc busy_handler(para1: PSqlite3;
                  para2: proc (para1: pointer; para2: int32): int32 {...}{.cdecl.};
                  para3: pointer): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_busy_handler".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L154)  
```
proc busy_timeout(para1: PSqlite3; ms: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_busy_timeout".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L158)  
```
proc get_table(para1: PSqlite3; sql: cstring; resultp: var cstringArray;
               nrow, ncolumn: var cint; errmsg: ptr cstring): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_get_table".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L160)  
```
proc free_table(result: cstringArray) {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_free_table".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L163)  
```
proc mprintf(para1: cstring): cstring {...}{.cdecl, varargs, dynlib: Lib,
                                        importc: "sqlite3_mprintf".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L167)  
```
proc free(z: cstring) {...}{.cdecl, dynlib: Lib, importc: "sqlite3_free".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L170)  
```
proc snprintf(para1: int32; para2: cstring; para3: cstring): cstring {...}{.cdecl,
    dynlib: Lib, varargs, importc: "sqlite3_snprintf".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L172)  
```
proc set_authorizer(para1: PSqlite3; xAuth: proc (para1: pointer; para2: int32;
    para3: cstring; para4: cstring; para5: cstring; para6: cstring): int32 {...}{.
    cdecl.}; pUserData: pointer): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_set_authorizer".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L174)  
```
proc trace(para1: PSqlite3;
           xTrace: proc (para1: pointer; para2: cstring) {...}{.cdecl.};
           para3: pointer): pointer {...}{.cdecl, dynlib: Lib,
                                      importc: "sqlite3_trace".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L178)  
```
proc progress_handler(para1: PSqlite3; para2: int32;
                      para3: proc (para1: pointer): int32 {...}{.cdecl.};
                      para4: pointer) {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_progress_handler".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L181)  
```
proc commit_hook(para1: PSqlite3; para2: proc (para1: pointer): int32 {...}{.cdecl.};
                 para3: pointer): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_commit_hook".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L185)  
```
proc open(filename: cstring; ppDb: var PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_open".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L188)  
```
proc open16(filename: pointer; ppDb: var PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_open16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L190)  
```
proc errcode(db: PSqlite3): int32 {...}{.cdecl, dynlib: Lib,
                                    importc: "sqlite3_errcode".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L192)  
```
proc errmsg(para1: PSqlite3): cstring {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_errmsg".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L193)  
```
proc errmsg16(para1: PSqlite3): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_errmsg16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L194)  
```
proc prepare(db: PSqlite3; zSql: cstring; nBytes: int32; ppStmt: var PStmt;
             pzTail: ptr cstring): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_prepare".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L196)  
```
proc prepare_v2(db: PSqlite3; zSql: cstring; nByte: cint; ppStmt: var PStmt;
                pzTail: ptr cstring): cint {...}{.importc: "sqlite3_prepare_v2",
    cdecl, dynlib: Lib.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L200)  
```
proc prepare16(db: PSqlite3; zSql: pointer; nBytes: int32; ppStmt: var PStmt;
               pzTail: var pointer): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_prepare16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L204)  
```
proc bind_blob(para1: PStmt; para2: int32; para3: pointer; n: int32;
               para5: Tbind_destructor_func): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_bind_blob".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L207)  
```
proc bind_double(para1: PStmt; para2: int32; para3: float64): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_bind_double".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L210)  
```
proc bind_int(para1: PStmt; para2: int32; para3: int32): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_bind_int".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L212)  
```
proc bind_int64(para1: PStmt; para2: int32; para3: int64): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_bind_int64".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L214)  
```
proc bind_null(para1: PStmt; para2: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_bind_null".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L216)  
```
proc bind_text(para1: PStmt; para2: int32; para3: cstring; n: int32;
               para5: Tbind_destructor_func): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_bind_text".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L218)  
```
proc bind_text16(para1: PStmt; para2: int32; para3: pointer; para4: int32;
                 para5: Tbind_destructor_func): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_bind_text16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L221)  
```
proc bind_blob(para1: PStmt; para2: int32; para3: pointer; n: int32;
               para5: int32): int32 {...}{.cdecl, dynlib: Lib,
                                      importc: "sqlite3_bind_blob".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L227)  
```
proc bind_text(para1: PStmt; para2: int32; para3: cstring; n: int32;
               para5: int32): int32 {...}{.cdecl, dynlib: Lib,
                                      importc: "sqlite3_bind_text".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L230)  
```
proc bind_text16(para1: PStmt; para2: int32; para3: pointer; para4: int32;
                 para5: int32): int32 {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_bind_text16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L233)  
```
proc bind_parameter_count(para1: PStmt): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_bind_parameter_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L236)  
```
proc bind_parameter_name(para1: PStmt; para2: int32): cstring {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_bind_parameter_name".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L238)  
```
proc bind_parameter_index(para1: PStmt; zName: cstring): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_bind_parameter_index".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L240)  
```
proc clear_bindings(para1: PStmt): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_clear_bindings".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L242)  
```
proc column_count(PStmt: PStmt): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L244)  
```
proc column_name(para1: PStmt; para2: int32): cstring {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_name".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L246)  
```
proc column_table_name(para1: PStmt; para2: int32): cstring {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_column_table_name".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L248)  
```
proc column_name16(para1: PStmt; para2: int32): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_name16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L250)  
```
proc column_decltype(para1: PStmt; i: int32): cstring {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_decltype".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L252)  
```
proc column_decltype16(para1: PStmt; para2: int32): pointer {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_column_decltype16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L254)  
```
proc step(para1: PStmt): int32 {...}{.cdecl, dynlib: Lib, importc: "sqlite3_step".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L256)  
```
proc data_count(PStmt: PStmt): int32 {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_data_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L257)  
```
proc column_blob(para1: PStmt; iCol: int32): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_blob".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L259)  
```
proc column_bytes(para1: PStmt; iCol: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_bytes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L261)  
```
proc column_bytes16(para1: PStmt; iCol: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_bytes16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L263)  
```
proc column_double(para1: PStmt; iCol: int32): float64 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_double".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L265)  
```
proc column_int(para1: PStmt; iCol: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_int".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L267)  
```
proc column_int64(para1: PStmt; iCol: int32): int64 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_int64".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L269)  
```
proc column_text(para1: PStmt; iCol: int32): cstring {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_text".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L271)  
```
proc column_text16(para1: PStmt; iCol: int32): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_text16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L273)  
```
proc column_type(para1: PStmt; iCol: int32): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_column_type".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L275)  
```
proc finalize(PStmt: PStmt): int32 {...}{.cdecl, dynlib: Lib,
                                     importc: "sqlite3_finalize".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L277)  
```
proc reset(PStmt: PStmt): int32 {...}{.cdecl, dynlib: Lib, importc: "sqlite3_reset".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L279)  
```
proc create_function(para1: PSqlite3; zFunctionName: cstring; nArg: int32;
                     eTextRep: int32; para5: pointer;
                     xFunc: Create_function_func_func;
                     xStep: Create_function_step_func;
                     xFinal: Create_function_final_func): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_create_function".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L280)  
```
proc create_function16(para1: PSqlite3; zFunctionName: pointer; nArg: int32;
                       eTextRep: int32; para5: pointer;
                       xFunc: Create_function_func_func;
                       xStep: Create_function_step_func;
                       xFinal: Create_function_final_func): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_create_function16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L286)  
```
proc aggregate_count(para1: Pcontext): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_aggregate_count".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L292)  
```
proc value_blob(para1: PValue): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_blob".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L294)  
```
proc value_bytes(para1: PValue): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_bytes".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L296)  
```
proc value_bytes16(para1: PValue): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_bytes16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L298)  
```
proc value_double(para1: PValue): float64 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_double".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L300)  
```
proc value_int(para1: PValue): int32 {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_value_int".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L302)  
```
proc value_int64(para1: PValue): int64 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_int64".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L304)  
```
proc value_text(para1: PValue): cstring {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_text".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L306)  
```
proc value_text16(para1: PValue): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_text16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L308)  
```
proc value_text16le(para1: PValue): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_text16le".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L310)  
```
proc value_text16be(para1: PValue): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_value_text16be".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L312)  
```
proc value_type(para1: PValue): int32 {...}{.cdecl, dynlib: Lib,
                                        importc: "sqlite3_value_type".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L314)  
```
proc aggregate_context(para1: Pcontext; nBytes: int32): pointer {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_aggregate_context".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L316)  
```
proc user_data(para1: Pcontext): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_user_data".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L318)  
```
proc get_auxdata(para1: Pcontext; para2: int32): pointer {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_get_auxdata".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L320)  
```
proc set_auxdata(para1: Pcontext; para2: int32; para3: pointer;
                 para4: proc (para1: pointer) {...}{.cdecl.}) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_set_auxdata".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L322)  
```
proc result_blob(para1: Pcontext; para2: pointer; para3: int32;
                 para4: Result_func) {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_result_blob".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L325)  
```
proc result_double(para1: Pcontext; para2: float64) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_double".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L328)  
```
proc result_error(para1: Pcontext; para2: cstring; para3: int32) {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_result_error".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L330)  
```
proc result_error16(para1: Pcontext; para2: pointer; para3: int32) {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_result_error16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L332)  
```
proc result_int(para1: Pcontext; para2: int32) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_int".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L334)  
```
proc result_int64(para1: Pcontext; para2: int64) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_int64".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L336)  
```
proc result_null(para1: Pcontext) {...}{.cdecl, dynlib: Lib,
                                    importc: "sqlite3_result_null".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L338)  
```
proc result_text(para1: Pcontext; para2: cstring; para3: int32;
                 para4: Result_func) {...}{.cdecl, dynlib: Lib,
                                       importc: "sqlite3_result_text".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L340)  
```
proc result_text16(para1: Pcontext; para2: pointer; para3: int32;
                   para4: Result_func) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_text16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L343)  
```
proc result_text16le(para1: Pcontext; para2: pointer; para3: int32;
                     para4: Result_func) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_text16le".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L346)  
```
proc result_text16be(para1: Pcontext; para2: pointer; para3: int32;
                     para4: Result_func) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_text16be".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L349)  
```
proc result_value(para1: Pcontext; para2: PValue) {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_result_value".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L352)  
```
proc create_collation(para1: PSqlite3; zName: cstring; eTextRep: int32;
                      para4: pointer; xCompare: Create_collation_func): int32 {...}{.
    cdecl, dynlib: Lib, importc: "sqlite3_create_collation".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L354)  
```
proc create_collation16(para1: PSqlite3; zName: cstring; eTextRep: int32;
                        para4: pointer; xCompare: Create_collation_func): int32 {...}{.
    cdecl, dynlib: Lib, importc: "sqlite3_create_collation16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L357)  
```
proc collation_needed(para1: PSqlite3; para2: pointer;
                      para3: Collation_needed_func): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_collation_needed".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L360)  
```
proc collation_needed16(para1: PSqlite3; para2: pointer;
                        para3: Collation_needed_func): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_collation_needed16".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L362)  
```
proc libversion(): cstring {...}{.cdecl, dynlib: Lib, importc: "sqlite3_libversion".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L364)  
```
proc version(): cstring {...}{.cdecl, dynlib: Lib, importc: "sqlite3_libversion".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L366)  
```
proc libversion_number(): int32 {...}{.cdecl, dynlib: Lib,
                                  importc: "sqlite3_libversion_number".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L368)  
```
proc backup_init(pDest: PSqlite3; zDestName: cstring; pSource: PSqlite3;
                 zSourceName: cstring): PSqlite3_Backup {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_backup_init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L371)  
```
proc backup_step(pBackup: PSqlite3_Backup; nPage: int32): int32 {...}{.cdecl,
    dynlib: Lib, importc: "sqlite3_backup_step".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L374)  
```
proc backup_finish(pBackup: PSqlite3_Backup): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_backup_finish".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L376)  
```
proc backup_pagecount(pBackup: PSqlite3_Backup): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_backup_pagecount".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L378)  
```
proc backup_remaining(pBackup: PSqlite3_Backup): int32 {...}{.cdecl, dynlib: Lib,
    importc: "sqlite3_backup_remaining".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L380)  
```
proc sqlite3_sleep(t: int64): int64 {...}{.cdecl, dynlib: Lib,
                                      importc: "sqlite3_sleep".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/sqlite3.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/sqlite3.nim#L382)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/sqlite3.html>

odbcsql
=======

 Types
-----

  
```
TSqlChar = char
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L40)  
```
TSqlSmallInt = int16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L41)  
```
SqlUSmallInt = int16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L42)  
```
SqlHandle = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L43)  
```
SqlHEnv = SqlHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L44)  
```
SqlHDBC = SqlHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L45)  
```
SqlHStmt = SqlHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L46)  
```
SqlHDesc = SqlHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L47)  
```
TSqlInteger = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L48)  
```
SqlUInteger = int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L49)  
```
TSqlLen = int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L50)  
```
TSqlULen = uint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L51)  
```
SqlPointer = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L52)  
```
TSqlReal = cfloat
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L53)  
```
TSqlDouble = cdouble
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L54)  
```
TSqlFloat = cdouble
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L55)  
```
SqlHWND = pointer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L56)  
```
PSQLCHAR = cstring
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L57)  
```
PSQLINTEGER = ptr TSqlInteger
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L58)  
```
PSQLUINTEGER = ptr SqlUInteger
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L59)  
```
PSQLSMALLINT = ptr TSqlSmallInt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L60)  
```
PSQLUSMALLINT = ptr SqlUSmallInt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L61)  
```
PSQLREAL = ptr TSqlReal
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L62)  
```
PSQLDOUBLE = ptr TSqlDouble
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L63)  
```
PSQLFLOAT = ptr TSqlFloat
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L64)  
```
PSQLHANDLE = ptr SqlHandle
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L65)  
```
SQL_DATE_STRUCT {...}{.final, pure.} = object
  Year*: TSqlSmallInt
  Month*: SqlUSmallInt
  Day*: SqlUSmallInt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L211)  
```
PSQL_DATE_STRUCT = ptr SQL_DATE_STRUCT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L216)  
```
SQL_TIME_STRUCT {...}{.final, pure.} = object
  Hour*: SqlUSmallInt
  Minute*: SqlUSmallInt
  Second*: SqlUSmallInt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L217)  
```
PSQL_TIME_STRUCT = ptr SQL_TIME_STRUCT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L222)  
```
SQL_TIMESTAMP_STRUCT {...}{.final, pure.} = object
  Year*: SqlUSmallInt
  Month*: SqlUSmallInt
  Day*: SqlUSmallInt
  Hour*: SqlUSmallInt
  Minute*: SqlUSmallInt
  Second*: SqlUSmallInt
  Fraction*: SqlUInteger
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L223)  
```
PSQL_TIMESTAMP_STRUCT = ptr SQL_TIMESTAMP_STRUCT
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L232)   Consts
------

  
```
SQL_UNKNOWN_TYPE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L68)  
```
SQL_LONGVARCHAR = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L69)  
```
SQL_BINARY = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L70)  
```
SQL_VARBINARY = -3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L71)  
```
SQL_LONGVARBINARY = -4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L72)  
```
SQL_BIGINT = -5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L73)  
```
SQL_TINYINT = -6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L74)  
```
SQL_BIT = -7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L75)  
```
SQL_WCHAR = -8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L76)  
```
SQL_WVARCHAR = -9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L77)  
```
SQL_WLONGVARCHAR = -10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L78)  
```
SQL_CHAR = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L79)  
```
SQL_NUMERIC = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L80)  
```
SQL_DECIMAL = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L81)  
```
SQL_INTEGER = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L82)  
```
SQL_SMALLINT = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L83)  
```
SQL_FLOAT = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L84)  
```
SQL_REAL = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L85)  
```
SQL_DOUBLE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L86)  
```
SQL_DATETIME = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L87)  
```
SQL_VARCHAR = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L88)  
```
SQL_TYPE_DATE = 91
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L89)  
```
SQL_TYPE_TIME = 92
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L90)  
```
SQL_TYPE_TIMESTAMP = 93
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L91)  
```
SQL_DATE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L92)  
```
SQL_TIME = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L93)  
```
SQL_TIMESTAMP = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L94)  
```
SQL_INTERVAL = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L95)  
```
SQL_GUID = -11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L96)  
```
SQL_CODE_YEAR = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L100)  
```
SQL_CODE_MONTH = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L101)  
```
SQL_CODE_DAY = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L102)  
```
SQL_CODE_HOUR = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L103)  
```
SQL_CODE_MINUTE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L104)  
```
SQL_CODE_SECOND = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L105)  
```
SQL_CODE_YEAR_TO_MONTH = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L106)  
```
SQL_CODE_DAY_TO_HOUR = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L107)  
```
SQL_CODE_DAY_TO_MINUTE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L108)  
```
SQL_CODE_DAY_TO_SECOND = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L109)  
```
SQL_CODE_HOUR_TO_MINUTE = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L110)  
```
SQL_CODE_HOUR_TO_SECOND = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L111)  
```
SQL_CODE_MINUTE_TO_SECOND = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L112)  
```
SQL_INTERVAL_YEAR = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L113)  
```
SQL_INTERVAL_MONTH = 102
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L114)  
```
SQL_INTERVAL_DAY = 103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L115)  
```
SQL_INTERVAL_HOUR = 104
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L116)  
```
SQL_INTERVAL_MINUTE = 105
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L117)  
```
SQL_INTERVAL_SECOND = 106
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L118)  
```
SQL_INTERVAL_YEAR_TO_MONTH = 107
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L119)  
```
SQL_INTERVAL_DAY_TO_HOUR = 108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L120)  
```
SQL_INTERVAL_DAY_TO_MINUTE = 109
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L121)  
```
SQL_INTERVAL_DAY_TO_SECOND = 110
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L122)  
```
SQL_INTERVAL_HOUR_TO_MINUTE = 111
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L123)  
```
SQL_INTERVAL_HOUR_TO_SECOND = 112
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L124)  
```
SQL_INTERVAL_MINUTE_TO_SECOND = 113
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L125)  
```
SQL_UNICODE = -8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L152)  
```
SQL_UNICODE_VARCHAR = -9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L153)  
```
SQL_UNICODE_LONGVARCHAR = -10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L154)  
```
SQL_UNICODE_CHAR = -8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L155)  
```
SQL_C_CHAR = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L157)  
```
SQL_C_LONG = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L158)  
```
SQL_C_SHORT = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L159)  
```
SQL_C_FLOAT = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L160)  
```
SQL_C_DOUBLE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L161)  
```
SQL_C_NUMERIC = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L162)  
```
SQL_C_DEFAULT = 99
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L163)  
```
SQL_SIGNED_OFFSET = -20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L164)  
```
SQL_UNSIGNED_OFFSET = -22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L165)  
```
SQL_C_DATE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L166)  
```
SQL_C_TIME = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L167)  
```
SQL_C_TIMESTAMP = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L168)  
```
SQL_C_TYPE_DATE = 91
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L169)  
```
SQL_C_TYPE_TIME = 92
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L170)  
```
SQL_C_TYPE_TIMESTAMP = 93
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L171)  
```
SQL_C_INTERVAL_YEAR = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L172)  
```
SQL_C_INTERVAL_MONTH = 102
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L173)  
```
SQL_C_INTERVAL_DAY = 103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L174)  
```
SQL_C_INTERVAL_HOUR = 104
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L175)  
```
SQL_C_INTERVAL_MINUTE = 105
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L176)  
```
SQL_C_INTERVAL_SECOND = 106
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L177)  
```
SQL_C_INTERVAL_YEAR_TO_MONTH = 107
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L178)  
```
SQL_C_INTERVAL_DAY_TO_HOUR = 108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L179)  
```
SQL_C_INTERVAL_DAY_TO_MINUTE = 109
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L180)  
```
SQL_C_INTERVAL_DAY_TO_SECOND = 110
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L181)  
```
SQL_C_INTERVAL_HOUR_TO_MINUTE = 111
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L182)  
```
SQL_C_INTERVAL_HOUR_TO_SECOND = 112
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L183)  
```
SQL_C_INTERVAL_MINUTE_TO_SECOND = 113
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L184)  
```
SQL_C_BINARY = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L185)  
```
SQL_C_BIT = -7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L186)  
```
SQL_C_SBIGINT = -25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L187)  
```
SQL_C_UBIGINT = -27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L188)  
```
SQL_C_TINYINT = -6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L189)  
```
SQL_C_SLONG = -16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L190)  
```
SQL_C_SSHORT = -15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L191)  
```
SQL_C_STINYINT = -26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L192)  
```
SQL_C_ULONG = -18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L193)  
```
SQL_C_USHORT = -17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L194)  
```
SQL_C_UTINYINT = -28
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L195)  
```
SQL_C_BOOKMARK = -18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L196)  
```
SQL_C_GUID = -11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L197)  
```
SQL_TYPE_NULL = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L198)  
```
SQL_C_VARBOOKMARK = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L206)  
```
SQL_API_SQLDESCRIBEPARAM = 58
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L207)  
```
SQL_NO_TOTAL = -4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L208)  
```
SQL_NAME_LEN = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L235)  
```
SQL_OV_ODBC3 = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L236)  
```
SQL_OV_ODBC2 = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L237)  
```
SQL_ATTR_ODBC_VERSION = 200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L238)  
```
SQL_DRIVER_NOPROMPT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L239)  
```
SQL_DRIVER_COMPLETE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L240)  
```
SQL_DRIVER_PROMPT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L241)  
```
SQL_DRIVER_COMPLETE_REQUIRED = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L242)  
```
SQL_IS_POINTER = -4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L243)  
```
SQL_IS_UINTEGER = -5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L244)  
```
SQL_IS_INTEGER = -6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L245)  
```
SQL_IS_USMALLINT = -7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L246)  
```
SQL_IS_SMALLINT = -8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L247)  
```
SQL_FETCH_BOOKMARK = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L248)  
```
SQL_SCROLL_OPTIONS = 44
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L249)  
```
SQL_UB_OFF = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L250)  
```
SQL_UB_ON = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L251)  
```
SQL_UB_DEFAULT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L252)  
```
SQL_UB_FIXED = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L253)  
```
SQL_UB_VARIABLE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L254)  
```
SQL_SO_FORWARD_ONLY = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L255)  
```
SQL_SO_KEYSET_DRIVEN = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L256)  
```
SQL_SO_DYNAMIC = 0x00000004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L257)  
```
SQL_SO_MIXED = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L258)  
```
SQL_SO_STATIC = 0x00000010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L259)  
```
SQL_BOOKMARK_PERSISTENCE = 82
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L260)  
```
SQL_STATIC_SENSITIVITY = 83
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L261)  
```
SQL_BP_CLOSE = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L262) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L262)  
```
SQL_BP_DELETE = 0x00000002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L263)  
```
SQL_BP_DROP = 0x00000004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L264)  
```
SQL_BP_TRANSACTION = 0x00000008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L265)  
```
SQL_BP_UPDATE = 0x00000010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L266)  
```
SQL_BP_OTHER_HSTMT = 0x00000020
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L267)  
```
SQL_BP_SCROLL = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L268)  
```
SQL_DYNAMIC_CURSOR_ATTRIBUTES1 = 144
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L269)  
```
SQL_DYNAMIC_CURSOR_ATTRIBUTES2 = 145
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L270)  
```
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES1 = 146
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L271)  
```
SQL_FORWARD_ONLY_CURSOR_ATTRIBUTES2 = 147
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L272)  
```
SQL_INDEX_KEYWORDS = 148
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L273)  
```
SQL_INFO_SCHEMA_VIEWS = 149
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L274)  
```
SQL_KEYSET_CURSOR_ATTRIBUTES1 = 150
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L275)  
```
SQL_KEYSET_CURSOR_ATTRIBUTES2 = 151
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L276)  
```
SQL_STATIC_CURSOR_ATTRIBUTES1 = 167
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L277)  
```
SQL_STATIC_CURSOR_ATTRIBUTES2 = 168
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L278)  
```
SQL_CA1_NEXT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L279)  
```
SQL_CA1_ABSOLUTE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L280)  
```
SQL_CA1_RELATIVE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L281)  
```
SQL_CA1_BOOKMARK = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L282)  
```
SQL_CA1_LOCK_NO_CHANGE = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L283)  
```
SQL_CA1_LOCK_EXCLUSIVE = 0x00000080
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L284)  
```
SQL_CA1_LOCK_UNLOCK = 0x00000100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L285)  
```
SQL_CA1_POS_POSITION = 0x00000200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L286)  
```
SQL_CA1_POS_UPDATE = 0x00000400
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L287)  
```
SQL_CA1_POS_DELETE = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L288) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L288)  
```
SQL_CA1_POS_REFRESH = 0x00001000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L289)  
```
SQL_CA1_POSITIONED_UPDATE = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L290)  
```
SQL_CA1_POSITIONED_DELETE = 0x00004000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L291)  
```
SQL_CA1_SELECT_FOR_UPDATE = 0x00008000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L292)  
```
SQL_CA1_BULK_ADD = 0x00010000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L293)  
```
SQL_CA1_BULK_UPDATE_BY_BOOKMARK = 0x00020000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L294) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L294)  
```
SQL_CA1_BULK_DELETE_BY_BOOKMARK = 0x00040000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L295)  
```
SQL_CA1_BULK_FETCH_BY_BOOKMARK = 0x00080000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L296)  
```
SQL_CA2_READ_ONLY_CONCURRENCY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L297)  
```
SQL_CA2_LOCK_CONCURRENCY = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L298)  
```
SQL_CA2_OPT_ROWVER_CONCURRENCY = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L299)  
```
SQL_CA2_OPT_VALUES_CONCURRENCY = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L300)  
```
SQL_CA2_SENSITIVITY_ADDITIONS = 0x00000010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L301)  
```
SQL_CA2_SENSITIVITY_DELETIONS = 0x00000020
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L302)  
```
SQL_CA2_SENSITIVITY_UPDATES = 0x00000040
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L303)  
```
SQL_CA2_MAX_ROWS_SELECT = 0x00000080
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L304)  
```
SQL_CA2_MAX_ROWS_INSERT = 0x00000100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L305)  
```
SQL_CA2_MAX_ROWS_DELETE = 0x00000200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L306)  
```
SQL_CA2_MAX_ROWS_UPDATE = 0x00000400
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L307)  
```
SQL_CA2_MAX_ROWS_CATALOG = 0x00000800
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L308)  
```
SQL_CA2_MAX_ROWS_AFFECTS_ALL = 3968
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L309)  
```
SQL_CA2_CRC_EXACT = 0x00001000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L313)  
```
SQL_CA2_CRC_APPROXIMATE = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L314)  
```
SQL_CA2_SIMULATE_NON_UNIQUE = 0x00004000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L315)  
```
SQL_CA2_SIMULATE_TRY_UNIQUE = 0x00008000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L316)  
```
SQL_CA2_SIMULATE_UNIQUE = 0x00010000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L317)  
```
SQL_ADD = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L318)  
```
SQL_SETPOS_MAX_OPTION_VALUE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L319)  
```
SQL_UPDATE_BY_BOOKMARK = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L320)  
```
SQL_DELETE_BY_BOOKMARK = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L321)  
```
SQL_FETCH_BY_BOOKMARK = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L322)  
```
SQL_POSITION = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L323)  
```
SQL_REFRESH = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L324)  
```
SQL_UPDATE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L325)  
```
SQL_DELETE = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L326) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L326)  
```
SQL_LOCK_NO_CHANGE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L327)  
```
SQL_LOCK_EXCLUSIVE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L328)  
```
SQL_LOCK_UNLOCK = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L329)  
```
SQL_ROW_SUCCESS = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L330)  
```
SQL_ROW_DELETED = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L331)  
```
SQL_ROW_UPDATED = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L332)  
```
SQL_ROW_NOROW = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L333)  
```
SQL_ROW_ADDED = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L334)  
```
SQL_ROW_ERROR = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L335)  
```
SQL_ROW_SUCCESS_WITH_INFO = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L336)  
```
SQL_ROW_PROCEED = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L337)  
```
SQL_ROW_IGNORE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L338)  
```
SQL_MAX_DSN_LENGTH = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L339)  
```
SQL_MAX_OPTION_STRING_LENGTH = 256
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L340) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L340)  
```
SQL_ODBC_CURSORS = 110
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L341)  
```
SQL_ATTR_ODBC_CURSORS = 110
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L342)  
```
SQL_CUR_USE_IF_NEEDED = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L343)  
```
SQL_CUR_USE_ODBC = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L344)  
```
SQL_CUR_USE_DRIVER = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L345) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L345)  
```
SQL_CUR_DEFAULT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L346)  
```
SQL_PARAM_TYPE_UNKNOWN = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L347) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L347)  
```
SQL_PARAM_INPUT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L348)  
```
SQL_PARAM_INPUT_OUTPUT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L349) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L349)  
```
SQL_RESULT_COL = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L350) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L350)  
```
SQL_PARAM_OUTPUT = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L351)  
```
SQL_RETURN_VALUE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L352)  
```
SQL_NULL_DATA = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L353)  
```
SQL_DATA_AT_EXEC = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L354)  
```
SQL_SUCCESS = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L355)  
```
SQL_SUCCESS_WITH_INFO = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L356)  
```
SQL_NO_DATA = 100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L357)  
```
SQL_ERROR = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L358)  
```
SQL_INVALID_HANDLE = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L359)  
```
SQL_STILL_EXECUTING = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L360)  
```
SQL_NEED_DATA = 99
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L361) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L361)  
```
SQL_NTS = -3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L362)  
```
SQL_MAX_MESSAGE_LENGTH = 512
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L363)  
```
SQL_DATE_LEN = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L364)  
```
SQL_TIME_LEN = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L365) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L365)  
```
SQL_TIMESTAMP_LEN = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L366) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L366)  
```
SQL_HANDLE_ENV = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L368) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L368)  
```
SQL_HANDLE_DBC = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L369) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L369)  
```
SQL_HANDLE_STMT = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L370)  
```
SQL_HANDLE_DESC = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L371)  
```
SQL_ATTR_OUTPUT_NTS = 10001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L372)  
```
SQL_ATTR_AUTO_IPD = 10001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L373)  
```
SQL_ATTR_METADATA_ID = 10014
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L374)  
```
SQL_ATTR_APP_ROW_DESC = 10010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L375) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L375)  
```
SQL_ATTR_APP_PARAM_DESC = 10011
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L376) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L376)  
```
SQL_ATTR_IMP_ROW_DESC = 10012
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L377)  
```
SQL_ATTR_IMP_PARAM_DESC = 10013
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L378)  
```
SQL_ATTR_CURSOR_SCROLLABLE = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L379)  
```
SQL_ATTR_CURSOR_SENSITIVITY = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L380) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L380)  
```
SQL_QUERY_TIMEOUT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L381)  
```
SQL_MAX_ROWS = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L382) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L382)  
```
SQL_NOSCAN = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L383)  
```
SQL_MAX_LENGTH = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L384)  
```
SQL_ASYNC_ENABLE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L385)  
```
SQL_BIND_TYPE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L386)  
```
SQL_CURSOR_TYPE = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L387) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L387)  
```
SQL_CONCURRENCY = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L388)  
```
SQL_KEYSET_SIZE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L389)  
```
SQL_ROWSET_SIZE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L390) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L390)  
```
SQL_SIMULATE_CURSOR = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L391)  
```
SQL_RETRIEVE_DATA = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L392) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L392)  
```
SQL_USE_BOOKMARKS = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L393) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L393)  
```
SQL_GET_BOOKMARK = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L394)  
```
SQL_ROW_NUMBER = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L395)  
```
SQL_ATTR_CURSOR_TYPE = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L396)  
```
SQL_ATTR_CONCURRENCY = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L397)  
```
SQL_ATTR_FETCH_BOOKMARK_PTR = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L398) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L398)  
```
SQL_ATTR_ROW_STATUS_PTR = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L399)  
```
SQL_ATTR_ROWS_FETCHED_PTR = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L400)  
```
SQL_AUTOCOMMIT = 102
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L401) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L401)  
```
SQL_ATTR_AUTOCOMMIT = 102
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L402)  
```
SQL_ATTR_ROW_NUMBER = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L403)  
```
SQL_TXN_ISOLATION = 108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L404) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L404)  
```
SQL_ATTR_TXN_ISOLATION = 108
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L405)  
```
SQL_ATTR_MAX_ROWS = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L406)  
```
SQL_ATTR_USE_BOOKMARKS = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L407)  
```
SQL_ACCESS_MODE = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L408) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L408)  
```
SQL_LOGIN_TIMEOUT = 103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L409)  
```
SQL_OPT_TRACE = 104
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L410)  
```
SQL_OPT_TRACEFILE = 105
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L411) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L411)  
```
SQL_TRANSLATE_DLL = 106
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L412) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L412)  
```
SQL_TRANSLATE_OPTION = 107
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L413)  
```
SQL_CURRENT_QUALIFIER = 109
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L414)  
```
SQL_QUIET_MODE = 111
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L415) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L415)  
```
SQL_PACKET_SIZE = 112
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L416) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L416)  
```
SQL_ATTR_ACCESS_MODE = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L417) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L417)  
```
SQL_ATTR_CONNECTION_DEAD = 1209
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L418)  
```
SQL_ATTR_CONNECTION_TIMEOUT = 113
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L419) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L419)  
```
SQL_ATTR_CURRENT_CATALOG = 109
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L420)  
```
SQL_ATTR_DISCONNECT_BEHAVIOR = 114
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L421)  
```
SQL_ATTR_ENLIST_IN_DTC = 1207
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L422)  
```
SQL_ATTR_ENLIST_IN_XA = 1208
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L423)  
```
SQL_ATTR_LOGIN_TIMEOUT = 103
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L424)  
```
SQL_ATTR_PACKET_SIZE = 112
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L425)  
```
SQL_ATTR_QUIET_MODE = 111
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L426)  
```
SQL_ATTR_TRACE = 104
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L427)  
```
SQL_ATTR_TRACEFILE = 105
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L428)  
```
SQL_ATTR_TRANSLATE_LIB = 106
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L429)  
```
SQL_ATTR_TRANSLATE_OPTION = 107
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L430) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L430)  
```
SQL_MODE_READ_WRITE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L432)  
```
SQL_MODE_READ_ONLY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L433)  
```
SQL_MODE_DEFAULT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L434)  
```
SQL_AUTOCOMMIT_OFF = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L435)  
```
SQL_AUTOCOMMIT_ON = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L436)  
```
SQL_AUTOCOMMIT_DEFAULT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L437)  
```
SQL_NONSCROLLABLE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L438)  
```
SQL_SCROLLABLE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L439)  
```
SQL_CURSOR_FORWARD_ONLY = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L440) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L440)  
```
SQL_CURSOR_KEYSET_DRIVEN = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L441)  
```
SQL_CURSOR_DYNAMIC = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L442)  
```
SQL_CURSOR_STATIC = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L443)  
```
SQL_CURSOR_TYPE_DEFAULT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L444)  
```
SQL_CONCUR_READ_ONLY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L446)  
```
SQL_CONCUR_LOCK = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L447)  
```
SQL_CONCUR_ROWVER = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L448)  
```
SQL_CONCUR_VALUES = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L449)  
```
SQL_CONCUR_DEFAULT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L450)  
```
SQL_DESC_COUNT = 1001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L452)  
```
SQL_DESC_TYPE = 1002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L453)  
```
SQL_DESC_LENGTH = 1003
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L454)  
```
SQL_DESC_OCTET_LENGTH_PTR = 1004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L455)  
```
SQL_DESC_PRECISION = 1005
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L456)  
```
SQL_DESC_SCALE = 1006
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L457)  
```
SQL_DESC_DATETIME_INTERVAL_CODE = 1007
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L458)  
```
SQL_DESC_NULLABLE = 1008
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L459) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L459)  
```
SQL_DESC_INDICATOR_PTR = 1009
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L460)  
```
SQL_DESC_DATA_PTR = 1010
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L461)  
```
SQL_DESC_NAME = 1011
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L462)  
```
SQL_DESC_UNNAMED = 1012
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L463)  
```
SQL_DESC_OCTET_LENGTH = 1013
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L464) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L464)  
```
SQL_DESC_ALLOC_TYPE = 1099
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L465)  
```
SQL_DIAG_RETURNCODE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L466) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L466)  
```
SQL_DIAG_NUMBER = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L467)  
```
SQL_DIAG_ROW_COUNT = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L468)  
```
SQL_DIAG_SQLSTATE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L469)  
```
SQL_DIAG_NATIVE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L470)  
```
SQL_DIAG_MESSAGE_TEXT = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L471)  
```
SQL_DIAG_DYNAMIC_FUNCTION = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L472)  
```
SQL_DIAG_CLASS_ORIGIN = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L473) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L473)  
```
SQL_DIAG_SUBCLASS_ORIGIN = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L474)  
```
SQL_DIAG_CONNECTION_NAME = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L475)  
```
SQL_DIAG_SERVER_NAME = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L476)  
```
SQL_DIAG_DYNAMIC_FUNCTION_CODE = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L477)  
```
SQL_DIAG_ALTER_TABLE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L478)  
```
SQL_DIAG_CREATE_INDEX = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L479)  
```
SQL_DIAG_CREATE_TABLE = 77
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L480)  
```
SQL_DIAG_CREATE_VIEW = 84
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L481)  
```
SQL_DIAG_DELETE_WHERE = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L482) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L482)  
```
SQL_DIAG_DROP_INDEX = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L483)  
```
SQL_DIAG_DROP_TABLE = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L484)  
```
SQL_DIAG_DROP_VIEW = 36
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L485) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L485)  
```
SQL_DIAG_DYNAMIC_DELETE_CURSOR = 38
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L486)  
```
SQL_DIAG_DYNAMIC_UPDATE_CURSOR = 81
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L487) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L487)  
```
SQL_DIAG_GRANT = 48
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L488)  
```
SQL_DIAG_INSERT = 50
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L489) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L489)  
```
SQL_DIAG_REVOKE = 59
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L490)  
```
SQL_DIAG_SELECT_CURSOR = 85
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L491) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L491)  
```
SQL_DIAG_UNKNOWN_STATEMENT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L492)  
```
SQL_DIAG_UPDATE_WHERE = 82
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L493) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L493)  
```
SQL_UNSPECIFIED = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L494)  
```
SQL_INSENSITIVE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L495) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L495)  
```
SQL_SENSITIVE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L496)  
```
SQL_ALL_TYPES = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L497) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L497)  
```
SQL_DEFAULT = 99
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L498)  
```
SQL_ARD_TYPE = -99
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L500) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L500)  
```
SQL_CODE_DATE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L501) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L501)  
```
SQL_CODE_TIME = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L502)  
```
SQL_CODE_TIMESTAMP = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L503) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L503)  
```
SQL_FALSE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L504)  
```
SQL_TRUE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L505)  
```
SQL_NO_NULLS = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L506) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L506)  
```
SQL_NULLABLE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L507)  
```
SQL_NULLABLE_UNKNOWN = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L509) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L509)  
```
SQL_CLOSE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L510) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L510)  
```
SQL_DROP = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L511)  
```
SQL_UNBIND = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L512)  
```
SQL_RESET_PARAMS = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L513)  
```
SQL_FETCH_NEXT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L515)  
```
SQL_FETCH_FIRST = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L516)  
```
SQL_FETCH_FIRST_USER = 31
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L517)  
```
SQL_FETCH_FIRST_SYSTEM = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L518)  
```
SQL_FETCH_LAST = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L519) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L519)  
```
SQL_FETCH_PRIOR = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L520)  
```
SQL_FETCH_ABSOLUTE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L521) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L521)  
```
SQL_FETCH_RELATIVE = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L522) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L522)  
```
SQL_NULL_HENV = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L523)  
```
SQL_NULL_HDBC = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L524)  
```
SQL_NULL_HSTMT = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L525)  
```
SQL_NULL_HDESC = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L526)  
```
SQL_NULL_HANDLE = nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L527) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L527)  
```
SQL_SCOPE_CURROW = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L528) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L528)  
```
SQL_SCOPE_TRANSACTION = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L529)  
```
SQL_SCOPE_SESSION = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L530) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L530)  
```
SQL_BEST_ROWID = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L531) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L531)  
```
SQL_ROWVER = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L532) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L532)  
```
SQL_ROW_IDENTIFIER = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L533)  
```
SQL_INDEX_UNIQUE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L534)  
```
SQL_INDEX_ALL = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L535) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L535)  
```
SQL_QUICK = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L536) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L536)  
```
SQL_ENSURE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L537)  
```
SQL_TABLE_STAT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L538)  
```
SQL_INDEX_CLUSTERED = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L539)  
```
SQL_INDEX_HASHED = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L540)  
```
SQL_INDEX_OTHER = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L541)  
```
SQL_SCROLL_CONCURRENCY = 43
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L542) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L542)  
```
SQL_TXN_CAPABLE = 46
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L543) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L543)  
```
SQL_TRANSACTION_CAPABLE = 46
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L544)  
```
SQL_USER_NAME = 47
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L545)  
```
SQL_TXN_ISOLATION_OPTION = 72
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L546)  
```
SQL_TRANSACTION_ISOLATION_OPTION = 72
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L547)  
```
SQL_OJ_CAPABILITIES = 115
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L548)  
```
SQL_OUTER_JOIN_CAPABILITIES = 115
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L549)  
```
SQL_XOPEN_CLI_YEAR = 10000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L550)  
```
SQL_CURSOR_SENSITIVITY = 10001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L551)  
```
SQL_DESCRIBE_PARAMETER = 10002
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L552) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L552)  
```
SQL_CATALOG_NAME = 10003
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L553)  
```
SQL_COLLATION_SEQ = 10004
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L554)  
```
SQL_MAX_IDENTIFIER_LEN = 10005
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L555)  
```
SQL_MAXIMUM_IDENTIFIER_LENGTH = 10005
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L556)  
```
SQL_SCCO_READ_ONLY = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L557)  
```
SQL_SCCO_LOCK = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L558)  
```
SQL_SCCO_OPT_ROWVER = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L559)  
```
SQL_SCCO_OPT_VALUES = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L560)  
```
SQL_TC_NONE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L561) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L561)  
```
SQL_TC_DML = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L562) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L562)  
```
SQL_TC_ALL = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L563)  
```
SQL_TC_DDL_COMMIT = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L564)  
```
SQL_TC_DDL_IGNORE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L565)  
```
SQL_TXN_READ_UNCOMMITTED = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L566)  
```
SQL_TRANSACTION_READ_UNCOMMITTED = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L567) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L567)  
```
SQL_TXN_READ_COMMITTED = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L568)  
```
SQL_TRANSACTION_READ_COMMITTED = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L569)  
```
SQL_TXN_REPEATABLE_READ = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L570)  
```
SQL_TRANSACTION_REPEATABLE_READ = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L571)  
```
SQL_TXN_SERIALIZABLE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L572)  
```
SQL_TRANSACTION_SERIALIZABLE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L573)  
```
SQL_SS_ADDITIONS = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L574)  
```
SQL_SS_DELETIONS = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L575)  
```
SQL_SS_UPDATES = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L576)  
```
SQL_COLUMN_COUNT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L577)  
```
SQL_COLUMN_NAME = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L578)  
```
SQL_COLUMN_TYPE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L579) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L579)  
```
SQL_COLUMN_LENGTH = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L580)  
```
SQL_COLUMN_PRECISION = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L581)  
```
SQL_COLUMN_SCALE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L582)  
```
SQL_COLUMN_DISPLAY_SIZE = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L583) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L583)  
```
SQL_COLUMN_NULLABLE = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L584) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L584)  
```
SQL_COLUMN_UNSIGNED = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L585)  
```
SQL_COLUMN_MONEY = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L586) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L586)  
```
SQL_COLUMN_UPDATABLE = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L587) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L587)  
```
SQL_COLUMN_AUTO_INCREMENT = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L588)  
```
SQL_COLUMN_CASE_SENSITIVE = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L589) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L589)  
```
SQL_COLUMN_SEARCHABLE = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L590) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L590)  
```
SQL_COLUMN_TYPE_NAME = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L591)  
```
SQL_COLUMN_TABLE_NAME = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L592)  
```
SQL_COLUMN_OWNER_NAME = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L593) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L593)  
```
SQL_COLUMN_QUALIFIER_NAME = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L594) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L594)  
```
SQL_COLUMN_LABEL = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L595)  
```
SQL_COLATT_OPT_MAX = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L596) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L596)  
```
SQL_COLUMN_DRIVER_START = 1000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L597)  
```
SQL_DESC_ARRAY_SIZE = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L598)  
```
SQL_DESC_ARRAY_STATUS_PTR = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L599) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L599)  
```
SQL_DESC_AUTO_UNIQUE_VALUE = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L600) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L600)  
```
SQL_DESC_BASE_COLUMN_NAME = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L601)  
```
SQL_DESC_BASE_TABLE_NAME = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L602)  
```
SQL_DESC_BIND_OFFSET_PTR = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L603)  
```
SQL_DESC_BIND_TYPE = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L604)  
```
SQL_DESC_CASE_SENSITIVE = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L605)  
```
SQL_DESC_CATALOG_NAME = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L606)  
```
SQL_DESC_CONCISE_TYPE = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L607) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L607)  
```
SQL_DESC_DATETIME_INTERVAL_PRECISION = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L608)  
```
SQL_DESC_DISPLAY_SIZE = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L609)  
```
SQL_DESC_FIXED_PREC_SCALE = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L610)  
```
SQL_DESC_LABEL = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L611) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L611)  
```
SQL_DESC_LITERAL_PREFIX = 27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L612)  
```
SQL_DESC_LITERAL_SUFFIX = 28
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L613) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L613)  
```
SQL_DESC_LOCAL_TYPE_NAME = 29
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L614) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L614)  
```
SQL_DESC_MAXIMUM_SCALE = 30
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L615)  
```
SQL_DESC_MINIMUM_SCALE = 31
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L616)  
```
SQL_DESC_NUM_PREC_RADIX = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L617) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L617)  
```
SQL_DESC_PARAMETER_TYPE = 33
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L618)  
```
SQL_DESC_ROWS_PROCESSED_PTR = 34
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L619) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L619)  
```
SQL_DESC_SCHEMA_NAME = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L620) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L620)  
```
SQL_DESC_SEARCHABLE = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L621) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L621)  
```
SQL_DESC_TYPE_NAME = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L622) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L622)  
```
SQL_DESC_TABLE_NAME = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L623) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L623)  
```
SQL_DESC_UNSIGNED = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L624) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L624)  
```
SQL_DESC_UPDATABLE = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L625) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L625)  
```
SQL_COMMIT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L626) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L626)  
```
SQL_ROLLBACK = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L627) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L627)  
```
SQL_ATTR_ROW_ARRAY_SIZE = 27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L628) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L628)  
```
ODBC_ADD_DSN = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L629) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L629)  
```
ODBC_CONFIG_DSN = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L630)  
```
ODBC_REMOVE_DSN = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L631)  
```
ODBC_ADD_SYS_DSN = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L632)  
```
ODBC_CONFIG_SYS_DSN = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L633)  
```
ODBC_REMOVE_SYS_DSN = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L634)  
```
SQL_ACTIVE_CONNECTIONS = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L636)  
```
SQL_DATA_SOURCE_NAME = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L637)  
```
SQL_DATA_SOURCE_READ_ONLY = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L638) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L638)  
```
SQL_DATABASE_NAME = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L639)  
```
SQL_DBMS_NAME = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L640) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L640)  
```
SQL_DBMS_VERSION = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L641)  
```
SQL_DRIVER_HDBC = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L642) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L642)  
```
SQL_DRIVER_HENV = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L643) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L643)  
```
SQL_DRIVER_HSTMT = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L644)  
```
SQL_DRIVER_NAME = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L645) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L645)  
```
SQL_DRIVER_VER = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L646)  
```
SQL_FETCH_DIRECTION = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L647)  
```
SQL_ODBC_VER = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L648)  
```
SQL_DRIVER_ODBC_VER = 77
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L649) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L649)  
```
SQL_SERVER_NAME = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L650) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L650)  
```
SQL_ACTIVE_ENVIRONMENTS = 116
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L651)  
```
SQL_ACTIVE_STATEMENTS = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L652) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L652)  
```
SQL_SQL_CONFORMANCE = 118
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L653)  
```
SQL_DATETIME_LITERALS = 119
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L654)  
```
SQL_ASYNC_MODE = 10021
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L655)  
```
SQL_BATCH_ROW_COUNT = 120
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L656)  
```
SQL_BATCH_SUPPORT = 121
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L657)  
```
SQL_CATALOG_LOCATION = 114
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L658) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L658)  
```
SQL_CATALOG_NAME_SEPARATOR = 41
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L660)  
```
SQL_CATALOG_TERM = 42
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L661)  
```
SQL_CATALOG_USAGE = 92
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L662) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L662)  
```
SQL_COLUMN_ALIAS = 87
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L664) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L664)   Procs
-----

  
```
proc SQLAllocHandle(HandleType: TSqlSmallInt; InputHandle: SqlHandle;
                    OutputHandlePtr: var SqlHandle): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L667) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L667)  
```
proc SQLSetEnvAttr(EnvironmentHandle: SqlHEnv; Attribute: TSqlInteger;
                   Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L670)  
```
proc SQLGetEnvAttr(EnvironmentHandle: SqlHEnv; Attribute: TSqlInteger;
                   Value: SqlPointer; BufferLength: TSqlInteger;
                   StringLength: PSQLINTEGER): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L673) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L673)  
```
proc SQLFreeHandle(HandleType: TSqlSmallInt; Handle: SqlHandle): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L677) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L677)  
```
proc SQLGetDiagRec(HandleType: TSqlSmallInt; Handle: SqlHandle;
                   RecNumber: TSqlSmallInt; Sqlstate: PSQLCHAR;
                   NativeError: var TSqlInteger; MessageText: PSQLCHAR;
                   BufferLength: TSqlSmallInt; TextLength: var TSqlSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L679) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L679)  
```
proc SQLGetDiagField(HandleType: TSqlSmallInt; Handle: SqlHandle;
                     RecNumber: TSqlSmallInt; DiagIdentifier: TSqlSmallInt;
                     DiagInfoPtr: SqlPointer; BufferLength: TSqlSmallInt;
                     StringLengthPtr: var TSqlSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L684)  
```
proc SQLConnect(ConnectionHandle: SqlHDBC; ServerName: PSQLCHAR;
                NameLength1: TSqlSmallInt; UserName: PSQLCHAR;
                NameLength2: TSqlSmallInt; Authentication: PSQLCHAR;
                NameLength3: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L689)  
```
proc SQLDisconnect(ConnectionHandle: SqlHDBC): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L693)  
```
proc SQLDriverConnect(hdbc: SqlHDBC; hwnd: SqlHWND; szCsin: cstring;
                      szCLen: TSqlSmallInt; szCsout: cstring;
                      cbCSMax: TSqlSmallInt; cbCsOut: var TSqlSmallInt;
                      f: SqlUSmallInt): TSqlSmallInt {...}{.dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L695)  
```
proc SQLBrowseConnect(hdbc: SqlHDBC; szConnStrIn: PSQLCHAR;
                      cbConnStrIn: TSqlSmallInt; szConnStrOut: PSQLCHAR;
                      cbConnStrOutMax: TSqlSmallInt;
                      cbConnStrOut: var TSqlSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L699)  
```
proc SQLExecDirect(StatementHandle: SqlHStmt; StatementText: PSQLCHAR;
                   TextLength: TSqlInteger): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L704)  
```
proc SQLExecDirectW(StatementHandle: SqlHStmt; StatementText: WideCString;
                    TextLength: TSqlInteger): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L706) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L706)  
```
proc SQLPrepare(StatementHandle: SqlHStmt; StatementText: PSQLCHAR;
                TextLength: TSqlInteger): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L708) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L708)  
```
proc SQLPrepareW(StatementHandle: SqlHStmt; StatementText: WideCString;
                 TextLength: TSqlInteger): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L710)  
```
proc SQLCloseCursor(StatementHandle: SqlHStmt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L712)  
```
proc SQLExecute(StatementHandle: SqlHStmt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L714)  
```
proc SQLFetch(StatementHandle: SqlHStmt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L715)  
```
proc SQLNumResultCols(StatementHandle: SqlHStmt; ColumnCount: var TSqlSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L716)  
```
proc SQLDescribeCol(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                    ColumnName: PSQLCHAR; BufferLength: TSqlSmallInt;
                    NameLength: var TSqlSmallInt; DataType: var TSqlSmallInt;
                    ColumnSize: var TSqlULen; DecimalDigits: var TSqlSmallInt;
                    Nullable: var TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L718)  
```
proc SQLFetchScroll(StatementHandle: SqlHStmt; FetchOrientation: TSqlSmallInt;
                    FetchOffset: TSqlLen): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L724) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L724)  
```
proc SQLExtendedFetch(hstmt: SqlHStmt; fFetchType: SqlUSmallInt; irow: TSqlLen;
                      pcrow: var TSqlULen; rgfRowStatus: PSQLUSMALLINT): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L727)  
```
proc SQLGetData(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                TargetType: TSqlSmallInt; TargetValue: SqlPointer;
                BufferLength: TSqlLen; StrLen_or_Ind: ptr TSqlLen): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L731) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L731)  
```
proc SQLSetStmtAttr(StatementHandle: SqlHStmt; Attribute: TSqlInteger;
                    Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L735)  
```
proc SQLGetStmtAttr(StatementHandle: SqlHStmt; Attribute: TSqlInteger;
                    Value: SqlPointer; BufferLength: TSqlInteger;
                    StringLength: PSQLINTEGER): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L738) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L738)  
```
proc SQLGetInfo(ConnectionHandle: SqlHDBC; InfoType: SqlUSmallInt;
                InfoValue: SqlPointer; BufferLength: TSqlSmallInt;
                StringLength: PSQLSMALLINT): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L742)  
```
proc SQLBulkOperations(StatementHandle: SqlHStmt; Operation: SqlUSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L746)  
```
proc SQLPutData(StatementHandle: SqlHStmt; Data: SqlPointer;
                StrLen_or_Ind: TSqlLen): TSqlSmallInt {...}{.dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L748) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L748)  
```
proc SQLBindCol(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                TargetType: TSqlSmallInt; TargetValue: SqlPointer;
                BufferLength: TSqlLen; StrLen_or_Ind: PSQLINTEGER): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L750) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L750)  
```
proc SQLSetPos(hstmt: SqlHStmt; irow: SqlUSmallInt; fOption: SqlUSmallInt;
               fLock: SqlUSmallInt): TSqlSmallInt {...}{.dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L754) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L754)  
```
proc SQLDataSources(EnvironmentHandle: SqlHEnv; Direction: SqlUSmallInt;
                    ServerName: PSQLCHAR; BufferLength1: TSqlSmallInt;
                    NameLength1: PSQLSMALLINT; Description: PSQLCHAR;
                    BufferLength2: TSqlSmallInt; NameLength2: PSQLSMALLINT): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L756) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L756)  
```
proc SQLDrivers(EnvironmentHandle: SqlHEnv; Direction: SqlUSmallInt;
                DriverDescription: PSQLCHAR; BufferLength1: TSqlSmallInt;
                DescriptionLength1: PSQLSMALLINT; DriverAttributes: PSQLCHAR;
                BufferLength2: TSqlSmallInt; AttributesLength2: PSQLSMALLINT): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L761) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L761)  
```
proc SQLSetConnectAttr(ConnectionHandle: SqlHDBC; Attribute: TSqlInteger;
                       Value: SqlPointer; StringLength: TSqlInteger): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L766) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L766)  
```
proc SQLGetCursorName(StatementHandle: SqlHStmt; CursorName: PSQLCHAR;
                      BufferLength: TSqlSmallInt; NameLength: PSQLSMALLINT): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L769) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L769)  
```
proc SQLSetCursorName(StatementHandle: SqlHStmt; CursorName: PSQLCHAR;
                      NameLength: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L772)  
```
proc SQLRowCount(StatementHandle: SqlHStmt; RowCount: var TSqlLen): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L775) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L775)  
```
proc SQLBindParameter(hstmt: SqlHStmt; ipar: SqlUSmallInt;
                      fParamType: TSqlSmallInt; fCType: TSqlSmallInt;
                      fSqlType: TSqlSmallInt; cbColDef: TSqlULen;
                      ibScale: TSqlSmallInt; rgbValue: SqlPointer;
                      cbValueMax: TSqlLen; pcbValue: var TSqlLen): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L777) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L777)  
```
proc SQLFreeStmt(StatementHandle: SqlHStmt; Option: SqlUSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L783) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L783)  
```
proc SQLColAttribute(StatementHandle: SqlHStmt; ColumnNumber: SqlUSmallInt;
                     FieldIdentifier: SqlUSmallInt;
                     CharacterAttribute: PSQLCHAR; BufferLength: TSqlSmallInt;
                     StringLength: PSQLSMALLINT; NumericAttribute: TSqlLen): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L785) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L785)  
```
proc SQLEndTran(HandleType: TSqlSmallInt; Handle: SqlHandle;
                CompletionType: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L791) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L791)  
```
proc SQLTables(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
               cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
               cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
               cbTableName: TSqlSmallInt; szTableType: PSQLCHAR;
               cbTableType: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L794) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L794)  
```
proc SQLColumns(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
                cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
                cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
                cbTableName: TSqlSmallInt; szColumnName: PSQLCHAR;
                cbColumnName: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L799) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L799)  
```
proc SQLSpecialColumns(StatementHandle: SqlHStmt; IdentifierType: SqlUSmallInt;
                       CatalogName: PSQLCHAR; NameLength1: TSqlSmallInt;
                       SchemaName: PSQLCHAR; NameLength2: TSqlSmallInt;
                       TableName: PSQLCHAR; NameLength3: TSqlSmallInt;
                       Scope: SqlUSmallInt; Nullable: SqlUSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L804) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L804)  
```
proc SQLProcedures(hstmt: SqlHStmt; szTableQualifier: PSQLCHAR;
                   cbTableQualifier: TSqlSmallInt; szTableOwner: PSQLCHAR;
                   cbTableOwner: TSqlSmallInt; szTableName: PSQLCHAR;
                   cbTableName: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L811)  
```
proc SQLPrimaryKeys(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                    NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                    NameLength2: TSqlSmallInt; TableName: PSQLCHAR;
                    NameLength3: TSqlSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L816)  
```
proc SQLProcedureColumns(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                         NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                         NameLength2: TSqlSmallInt; ProcName: PSQLCHAR;
                         NameLength3: TSqlSmallInt; ColumnName: PSQLCHAR;
                         NameLength4: TSqlSmallInt): TSqlSmallInt {...}{.
    dynlib: odbclib, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L821) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L821)  
```
proc SQLStatistics(hstmt: SqlHStmt; CatalogName: PSQLCHAR;
                   NameLength1: TSqlSmallInt; SchemaName: PSQLCHAR;
                   NameLength2: TSqlSmallInt; TableName: PSQLCHAR;
                   NameLength3: TSqlSmallInt; Unique: SqlUSmallInt;
                   Reserved: SqlUSmallInt): TSqlSmallInt {...}{.dynlib: odbclib,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L827) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L827)  
```
proc SQLErr(henv: SqlHEnv; hdbc: SqlHDBC; hstmt: SqlHStmt;
            szSqlState, pfNativeError, szErrorMsg: PSQLCHAR;
            cbErrorMsgMax: TSqlSmallInt; pcbErrorMsg: PSQLSMALLINT): TSqlSmallInt {...}{.
    dynlib: odbclib, importc: "SQLError".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/odbcsql.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/odbcsql.nim#L833)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/odbcsql.html>

Nim Destructors and Move Semantics
==================================

 About this document
-------------------


This document describes the upcoming Nim runtime which does not use classical GC algorithms anymore but is based on destructors and move semantics. The new runtime's advantages are that Nim programs become oblivious to the involved heap sizes and programs are easier to write to make effective use of multi-core machines. As a nice bonus, files and sockets and the like will not require manual `close` calls anymore.

 This document aims to be a precise specification about how move semantics and destructors work in Nim.

 Motivating example
------------------


With the language mechanisms described here, a custom seq could be written as:

 
```
type
  myseq*[T] = object
    len, cap: int
    data: ptr UncheckedArray[T]

proc `=destroy`*[T](x: var myseq[T]) =
  if x.data != nil:
    for i in 0..<x.len: `=destroy`(x[i])
    dealloc(x.data)

proc `=copy`*[T](a: var myseq[T]; b: myseq[T]) =
  # do nothing for self-assignments:
  if a.data == b.data: return
  `=destroy`(a)
  wasMoved(a)
  a.len = b.len
  a.cap = b.cap
  if b.data != nil:
    a.data = cast[typeof(a.data)](alloc(a.cap * sizeof(T)))
    for i in 0..<a.len:
      a.data[i] = b.data[i]

proc `=sink`*[T](a: var myseq[T]; b: myseq[T]) =
  # move assignment, optional.
  # Compiler is using `=destroy` and `copyMem` when not provided
  `=destroy`(a)
  wasMoved(a)
  a.len = b.len
  a.cap = b.cap
  a.data = b.data

proc add*[T](x: var myseq[T]; y: sink T) =
  if x.len >= x.cap: resize(x)
  x.data[x.len] = y
  inc x.len

proc `[]`*[T](x: myseq[T]; i: Natural): lent T =
  assert i < x.len
  x.data[i]

proc `[]=`*[T](x: var myseq[T]; i: Natural; y: sink T) =
  assert i < x.len
  x.data[i] = y

proc createSeq*[T](elems: varargs[T]): myseq[T] =
  result.cap = elems.len
  result.len = elems.len
  result.data = cast[typeof(result.data)](alloc(result.cap * sizeof(T)))
  for i in 0..<result.len: result.data[i] = elems[i]

proc len*[T](x: myseq[T]): int {.inline.} = x.len
```
 Lifetime-tracking hooks
-----------------------


The memory management for Nim's standard `string` and `seq` types as well as other standard collections is performed via so-called "Lifetime-tracking hooks" or "type-bound operators". There are 3 different hooks for each (generic or concrete) object type `T` (`T` can also be a `distinct` type) that are called implicitly by the compiler.

 (Note: The word "hook" here does not imply any kind of dynamic binding or runtime indirections, the implicit calls are statically bound and potentially inlined.)

 ### 
`=destroy` hook


A `=destroy` hook frees the object's associated memory and releases other associated resources. Variables are destroyed via this hook when they go out of scope or when the routine they were declared in is about to return.

 The prototype of this hook for a type `T` needs to be:

 
```
proc `=destroy`(x: var T)
```

The general pattern in `=destroy` looks like:

 
```
proc `=destroy`(x: var T) =
  # first check if 'x' was moved to somewhere else:
  if x.field != nil:
    freeResource(x.field)
```
 ### 
`=sink` hook


A `=sink` hook moves an object around, the resources are stolen from the source and passed to the destination. It is ensured that the source's destructor does not free the resources afterward by setting the object to its default value (the value the object's state started in). Setting an object `x` back to its default value is written as `wasMoved(x)`. When not provided the compiler is using a combination of `=destroy` and `copyMem` instead. This is efficient hence users rarely need to implement their own `=sink` operator, it is enough to provide `=destroy` and `=copy`, compiler will take care of the rest.

 The prototype of this hook for a type `T` needs to be:

 
```
proc `=sink`(dest: var T; source: T)
```

The general pattern in `=sink` looks like:

 
```
proc `=sink`(dest: var T; source: T) =
  `=destroy`(dest)
  wasMoved(dest)
  dest.field = source.field
```

**Note**: `=sink` does not need to check for self-assignments. How self-assignments are handled is explained later in this document.

 ### 
`=copy` hook


The ordinary assignment in Nim conceptually copies the values. The `=copy` hook is called for assignments that couldn't be transformed into `=sink` operations.

 The prototype of this hook for a type `T` needs to be:

 
```
proc `=copy`(dest: var T; source: T)
```

The general pattern in `=copy` looks like:

 
```
proc `=copy`(dest: var T; source: T) =
  # protect against self-assignments:
  if dest.field != source.field:
    `=destroy`(dest)
    wasMoved(dest)
    dest.field = duplicateResource(source.field)
```

The `=copy` proc can be marked with the `{.error.}` pragma. Then any assignment that otherwise would lead to a copy is prevented at compile-time. This looks like:

 
```
proc `=copy`(dest: var T; source: T) {.error.}
```

but a custom error message (e.g., `{.error: "custom error".}`) will not be emitted by the compiler. Notice that there is no `=` before the `{.error.}` pragma.

 Move semantics
--------------


A "move" can be regarded as an optimized copy operation. If the source of the copy operation is not used afterward, the copy can be replaced by a move. This document uses the notation `lastReadOf(x)` to describe that `x` is not used afterwards. This property is computed by a static control flow analysis but can also be enforced by using `system.move` explicitly.

 Swap
----


The need to check for self-assignments and also the need to destroy previous objects inside `=copy` and `=sink` is a strong indicator to treat `system.swap` as a builtin primitive of its own that simply swaps every field in the involved objects via `copyMem` or a comparable mechanism. In other words, `swap(a, b)` is **not** implemented as `let tmp = move(b); b = move(a); a = move(tmp)`.

 This has further consequences:

 * Objects that contain pointers that point to the same object are not supported by Nim's model. Otherwise swapped objects would end up in an inconsistent state.
* Seqs can use `realloc` in the implementation.

 Sink parameters
---------------


To move a variable into a collection usually `sink` parameters are involved. A location that is passed to a `sink` parameter should not be used afterward. This is ensured by a static analysis over a control flow graph. If it cannot be proven to be the last usage of the location, a copy is done instead and this copy is then passed to the sink parameter.

 A sink parameter *may* be consumed once in the proc's body but doesn't have to be consumed at all. The reason for this is that signatures like `proc put(t: var Table; k: sink Key, v: sink Value)` should be possible without any further overloads and `put` might not take ownership of `k` if `k` already exists in the table. Sink parameters enable an affine type system, not a linear type system.

 The employed static analysis is limited and only concerned with local variables; however, object and tuple fields are treated as separate entities:

 
```
proc consume(x: sink Obj) = discard "no implementation"

proc main =
  let tup = (Obj(), Obj())
  consume tup[0]
  # ok, only tup[0] was consumed, tup[1] is still alive:
  echo tup[1]
```

Sometimes it is required to explicitly `move` a value into its final position:

 
```
proc main =
  var dest, src: array[10, string]
  # ...
  for i in 0..high(dest): dest[i] = move(src[i])
```

An implementation is allowed, but not required to implement even more move optimizations (and the current implementation does not).

 Sink parameter inference
------------------------


The current implementation can do a limited form of sink parameter inference. But it has to be enabled via `--sinkInference:on`, either on the command line or via a `push` pragma.

 To enable it for a section of code, one can use `{.push sinkInference: on.}`...`{.pop.}`.

 The .nosinks pragma can be used to disable this inference for a single routine:

 
```
proc addX(x: T; child: T) {.nosinks.} =
  x.s.add child
```

The details of the inference algorithm are currently undocumented.

 Rewrite rules
-------------


**Note**: There are two different allowed implementation strategies:

 1. The produced `finally` section can be a single section that is wrapped around the complete routine body.
2. The produced `finally` section is wrapped around the enclosing scope.

 The current implementation follows strategy (2). This means that resources are destroyed at the scope exit.

 
```
var x: T; stmts
---------------             (destroy-var)
var x: T; try stmts
finally: `=destroy`(x)


g(f(...))
------------------------    (nested-function-call)
g(let tmp;
bitwiseCopy tmp, f(...);
tmp)
finally: `=destroy`(tmp)


x = f(...)
------------------------    (function-sink)
`=sink`(x, f(...))


x = lastReadOf z
------------------          (move-optimization)
`=sink`(x, z)
wasMoved(z)


v = v
------------------   (self-assignment-removal)
discard "nop"


x = y
------------------          (copy)
`=copy`(x, y)


f_sink(g())
-----------------------     (call-to-sink)
f_sink(g())


f_sink(notLastReadOf y)
--------------------------     (copy-to-sink)
(let tmp; `=copy`(tmp, y);
f_sink(tmp))


f_sink(lastReadOf y)
-----------------------     (move-to-sink)
f_sink(y)
wasMoved(y)
```
 Object and array construction
-----------------------------


Object and array construction is treated as a function call where the function has `sink` parameters.

 Destructor removal
------------------


`wasMoved(x);` followed by a `=destroy(x)` operation cancel each other out. An implementation is encouraged to exploit this in order to improve efficiency and code sizes. The current implementation does perform this optimization.

 Self assignments
----------------


`=sink` in combination with `wasMoved` can handle self-assignments but it's subtle.

 The simple case of `x = x` cannot be turned into `=sink(x, x); wasMoved(x)` because that would lose `x`'s value. The solution is that simple self-assignments are simply transformed into an empty statement that does nothing.

 The complex case looks like a variant of `x = f(x)`, we consider `x = select(rand() < 0.5, x, y)` here:

 
```
proc select(cond: bool; a, b: sink string): string =
  if cond:
    result = a # moves a into result
  else:
    result = b # moves b into result

proc main =
  var x = "abc"
  var y = "xyz"
  # possible self-assignment:
  x = select(true, x, y)
```

Is transformed into:

 
```
proc select(cond: bool; a, b: sink string): string =
  try:
    if cond:
      `=sink`(result, a)
      wasMoved(a)
    else:
      `=sink`(result, b)
      wasMoved(b)
  finally:
    `=destroy`(b)
    `=destroy`(a)

proc main =
  var
    x: string
    y: string
  try:
    `=sink`(x, "abc")
    `=sink`(y, "xyz")
    `=sink`(x, select(true,
      let blitTmp = x
      wasMoved(x)
      blitTmp,
      let blitTmp = y
      wasMoved(y)
      blitTmp))
    echo [x]
  finally:
    `=destroy`(y)
    `=destroy`(x)
```

As can be manually verified, this transformation is correct for self-assignments.

 Lent type
---------


`proc p(x: sink T)` means that the proc `p` takes ownership of `x`. To eliminate even more creation/copy <-> destruction pairs, a proc's return type can be annotated as `lent T`. This is useful for "getter" accessors that seek to allow an immutable view into a container.

 The `sink` and `lent` annotations allow us to remove most (if not all) superfluous copies and destructions.

 `lent T` is like `var T` a hidden pointer. It is proven by the compiler that the pointer does not outlive its origin. No destructor call is injected for expressions of type `lent T` or of type `var T`.

 
```
type
  Tree = object
    kids: seq[Tree]

proc construct(kids: sink seq[Tree]): Tree =
  result = Tree(kids: kids)
  # converted into:
  `=sink`(result.kids, kids); wasMoved(kids)
  `=destroy`(kids)

proc `[]`*(x: Tree; i: int): lent Tree =
  result = x.kids[i]
  # borrows from 'x', this is transformed into:
  result = addr x.kids[i]
  # This means 'lent' is like 'var T' a hidden pointer.
  # Unlike 'var' this hidden pointer cannot be used to mutate the object.

iterator children*(t: Tree): lent Tree =
  for x in t.kids: yield x

proc main =
  # everything turned into moves:
  let t = construct(@[construct(@[]), construct(@[])])
  echo t[0] # accessor does not copy the element!
```
 The .cursor annotation
----------------------


Under the `--gc:arc|orc` modes Nim's `ref` type is implemented via the same runtime "hooks" and thus via reference counting. This means that cyclic structures cannot be freed immediately (`--gc:orc` ships with a cycle collector). With the `.cursor` annotation one can break up cycles declaratively:

 
```
type
  Node = ref object
    left: Node # owning ref
    right {.cursor.}: Node # non-owning ref
```

But please notice that this is not C++'s weak\_ptr, it means the right field is not involved in the reference counting, it is a raw pointer without runtime checks.

 Automatic reference counting also has the disadvantage that it introduces overhead when iterating over linked structures. The `.cursor` annotation can also be used to avoid this overhead:

 
```
var it {.cursor.} = listRoot
while it != nil:
  use(it)
  it = it.next
```

In fact, `.cursor` more generally prevents object construction/destruction pairs and so can also be useful in other contexts. The alternative solution would be to use raw pointers (`ptr`) instead which is more cumbersome and also more dangerous for Nim's evolution: Later on, the compiler can try to prove `.cursor` annotations to be safe, but for `ptr` the compiler has to remain silent about possible problems.

 Cursor inference / copy elision
-------------------------------


The current implementation also performs `.cursor` inference. Cursor inference is a form of copy elision.

 To see how and when we can do that, think about this question: In `dest = src` when do we really have to *materialize* the full copy? - Only if `dest` or `src` are mutated afterward. If `dest` is a local variable that is simple to analyze. And if `src` is a location derived from a formal parameter, we also know it is not mutated! In other words, we do a compile-time copy-on-write analysis.

 This means that "borrowed" views can be written naturally and without explicit pointer indirections:

 
```
proc main(tab: Table[string, string]) =
  let v = tab["key"] # inferred as .cursor because 'tab' is not mutated.
  # no copy into 'v', no destruction of 'v'.
  use(v)
  useItAgain(v)
```
 Hook lifting
------------


The hooks of a tuple type `(A, B, ...)` are generated by lifting the hooks of the involved types `A`, `B`, ... to the tuple type. In other words, a copy `x = y` is implemented as `x[0] = y[0]; x[1] = y[1]; ...`, likewise for `=sink` and `=destroy`.

 Other value-based compound types like `object` and `array` are handled correspondingly. For `object` however, the compiler-generated hooks can be overridden. This can also be important to use an alternative traversal of the involved data structure that is more efficient or in order to avoid deep recursions.

 Hook generation
---------------


The ability to override a hook leads to a phase ordering problem:

 
```
type
  Foo[T] = object

proc main =
  var f: Foo[int]
  # error: destructor for 'f' called here before
  # it was seen in this module.

proc `=destroy`[T](f: var Foo[T]) =
  discard
```

The solution is to define `proc `=destroy`[T](f: var Foo[T])` before it is used. The compiler generates implicit hooks for all types in *strategic places* so that an explicitly provided hook that comes too "late" can be detected reliably. These *strategic places* have been derived from the rewrite rules and are as follows:

 * In the construct `let/var x = ...` (var/let binding) hooks are generated for `typeof(x)`.
* In `x = ...` (assignment) hooks are generated for `typeof(x)`.
* In `f(...)` (function call) hooks are generated for `typeof(f(...))`.
* For every sink parameter `x: sink T` the hooks are generated for `typeof(x)`.

 nodestroy pragma
----------------


The experimental nodestroy pragma inhibits hook injections. This can be used to specialize the object traversal in order to avoid deep recursions:

 
```
type Node = ref object
  x, y: int32
  left, right: Node

type Tree = object
  root: Node

proc `=destroy`(t: var Tree) {.nodestroy.} =
  # use an explicit stack so that we do not get stack overflows:
  var s: seq[Node] = @[t.root]
  while s.len > 0:
    let x = s.pop
    if x.left != nil: s.add(x.left)
    if x.right != nil: s.add(x.right)
    # free the memory explicit:
    dispose(x)
  # notice how even the destructor for 's' is not called implicitly
  # anymore thanks to .nodestroy, so we have to call it on our own:
  `=destroy`(s)
```

As can be seen from the example, this solution is hardly sufficient and should eventually be replaced by a better solution. 



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/destructors.html>

db\_common
==========

 Common datatypes and definitions for all `db_*.nim` ( <db_mysql>, <db_postgres>, and <db_sqlite>) modules.

 Types
-----

  
```
DbError = object of IOError
```
  exception that is raised if a database error occurs [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L15)  
```
SqlQuery = distinct string
```
  an SQL query string [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L17)  
```
DbEffect = object of IOEffect
```
  effect that denotes a database operation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L20)  
```
ReadDbEffect = object of DbEffect
```
  effect that denotes a read operation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L21)  
```
WriteDbEffect = object of DbEffect
```
  effect that denotes a write operation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L22)  
```
DbTypeKind = enum
  dbUnknown,                ## unknown datatype
  dbSerial,                 ## datatype used for primary auto-increment keys
  dbNull,                   ## datatype used for the NULL value
  dbBit,                    ## bit datatype
  dbBool,                   ## boolean datatype
  dbBlob,                   ## blob datatype
  dbFixedChar,              ## string of fixed length
  dbVarchar,                ## string datatype
  dbJson,                   ## JSON datatype
  dbXml,                    ## XML datatype
  dbInt,                    ## some integer type
  dbUInt,                   ## some unsigned integer type
  dbDecimal,                ## decimal numbers (fixed-point number)
  dbFloat,                  ## some floating point type
  dbDate,                   ## a year-month-day description
  dbTime,                   ## HH:MM:SS information
  dbDatetime,               ## year-month-day and HH:MM:SS information,
                             ## plus optional time or timezone information
  dbTimestamp, ## Timestamp values are stored as the number of seconds
                ## since the epoch ('1970-01-01 00:00:00' UTC).
  dbTimeInterval,           ## an interval [a,b] of times
  dbEnum,                   ## some enum
  dbSet,                    ## set of enum values
  dbArray,                  ## an array of values
  dbComposite,              ## composite type (record, struct, etc)
  dbUrl,                    ## a URL
  dbUuid,                   ## a UUID
  dbInet,                   ## an IP address
  dbMacAddress,             ## a MAC address
  dbGeometry,               ## some geometric type
  dbPoint,                  ## Point on a plane   (x,y)
  dbLine,                   ## Infinite line ((x1,y1),(x2,y2))
  dbLseg,                   ## Finite line segment   ((x1,y1),(x2,y2))
  dbBox,                    ## Rectangular box   ((x1,y1),(x2,y2))
  dbPath,                   ## Closed or open path (similar to polygon) ((x1,y1),...)
  dbPolygon,                ## Polygon (similar to closed path)   ((x1,y1),...)
  dbCircle,                 ## Circle   <(x,y),r> (center point and radius)
  dbUser1,                  ## user definable datatype 1 (for unknown extensions)
  dbUser2,                  ## user definable datatype 2 (for unknown extensions)
  dbUser3,                  ## user definable datatype 3 (for unknown extensions)
  dbUser4,                  ## user definable datatype 4 (for unknown extensions)
  dbUser5                    ## user definable datatype 5 (for unknown extensions)
```
  a superset of datatypes that might be supported. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L24)  
```
DbType = object
  kind*: DbTypeKind          ## the kind of the described type
  notNull*: bool             ## does the type contain NULL?
  name*: string              ## the name of the type
  size*: Natural             ## the size of the datatype; 0 if of variable size
  maxReprLen*: Natural       ## maximal length required for the representation
  precision*, scale*: Natural ## precision and scale of the number
  min*, max*: BiggestInt     ## the minimum and maximum of allowed values
  validValues*: seq[string]  ## valid values of an enum or a set
```
  describes a database type [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L68)  
```
DbColumn = object
  name*: string              ## name of the column
  tableName*: string         ## name of the table the column belongs to (optional)
  typ*: DbType               ## type of the column
  primaryKey*: bool          ## is this a primary key?
  foreignKey*: bool          ## is this a foreign key?
```
  information about a database column [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L78)  
```
DbColumns = seq[DbColumn]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L84)   Procs
-----

  
```
proc dbError(msg: string) {...}{.noreturn, noinline, raises: [DbError], tags: [].}
```
  raises an DbError exception with message `msg`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L95)   Templates
---------

  
```
template sql(query: string): SqlQuery
```
  constructs a SqlQuery from the string `query`. This is supposed to be used as a raw-string-literal modifier: `sql"update user set counter = counter + 1"`

 If assertions are turned off, it does nothing. If assertions are turned on, later versions will check the string for valid syntax.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/db_common.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/db_common.nim#L86)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/db_common.html>

Nim Enhancement Proposal #1 - Standard Library Style Guide
==========================================================

 Introduction
------------


Although Nim supports a variety of code and formatting styles, it is nevertheless beneficial that certain community efforts, such as the standard library, should follow a consistent set of style guidelines when suitable. This enhancement proposal aims to list a series of guidelines that the standard library should follow.

 Note that there can be exceptions to these rules. Nim being as flexible as it is, there will be parts of this style guide that don't make sense in certain contexts. Furthermore, just as [Python's style guide](http://legacy.python.org/dev/peps/pep-0008/) changes over time, this style guide will too.

 These rules will only be enforced for contributions to the Nim codebase and official projects, such as the Nim compiler, the standard library, and the various official tools such as C2Nim.

 ### Spacing and Whitespace Conventions


* Lines should be no longer than 80 characters. Limiting the amount of information present on each line makes for more readable code - the reader has smaller chunks to process.
* Two spaces should be used for indentation of blocks; tabstops are not allowed (the compiler enforces this). Using spaces means that the appearance of code is more consistent across editors. Unlike spaces, tabstop width varies across editors, and not all editors provide means of changing this width.
* Although use of whitespace for stylistic reasons other than the ones endorsed by this guide are allowed, careful thought should be put into such practices. Not all editors support automatic alignment of code sections, and re-aligning long sections of code by hand can quickly become tedious.
```
# This is bad, as the next time someone comes
# to edit this code block, they
# must re-align all the assignments again:
type
  WordBool*    = int16
  CalType*     = int
  ... # 5 lines later
  CalId*       = int
  LongLong*    = int64
  LongLongPtr* = ptr LongLong
```

 ### Naming Conventions


Note: While the rules outlined below are the *current* naming conventions, these conventions have not always been in place. Previously, the naming conventions for identifiers followed the Pascal tradition of prefixes which indicated the base type of the identifier - PFoo for pointer and reference types, TFoo for value types, EFoo for exceptions, etc. Though this has since changed, there are many places in the standard library which still use this convention. Such style remains in place purely for legacy reasons, and will be changed in the future.

 * Type identifiers should be in PascalCase. All other identifiers should be in camelCase with the exception of constants which **may** use PascalCase but are not required to.
```
# Constants can start with either a lower case or upper case letter.
const aConstant = 42
const FooBar = 4.2

var aVariable = "Meep" # Variables must start with a lowercase letter.

# Types must start with an uppercase letter.
type
  FooBar = object
```

For constants coming from a C/C++ wrapper, ALL\_UPPERCASE are allowed, but ugly. (Why shout CONSTANT? Constants do no harm, variables do!)
* When naming types that come in value, pointer, and reference varieties, use a regular name for the variety that is to be used the most, and add a "Obj", "Ref", or "Ptr" suffix for the other varieties. If there is no single variety that will be used the most, add the suffixes to the pointer variants only. The same applies to C/C++ wrappers.
```
type
  Handle = object # Will be used most often
    fd: int64
  HandleRef = ref Handle # Will be used less often
```

 * Exception and Error types should have the "Error" or "Defect" suffix.
```
type
  ValueError = object of CatchableError
  AssertionDefect = object of Defect
  Foo = object of Exception # bad style, try to inherit CatchableError or Defect
```

 * Unless marked with the `{.pure.}` pragma, members of enums should have an identifying prefix, such as an abbreviation of the enum's name.
```
type
  PathComponent = enum
    pcDir
    pcLinkToDir
    pcFile
    pcLinkToFile
```

 * Non-pure enum values should use camelCase whereas pure enum values should use PascalCase.
```
type
  PathComponent {.pure.} = enum
    Dir
    LinkToDir
    File
    LinkToFile
```

 * In the age of HTTP, HTML, FTP, TCP, IP, UTF, WWW it is foolish to pretend these are somewhat special words requiring all uppercase. Instead treat them as what they are: Real words. So it's `parseUrl` rather than `parseURL`, `checkHttpHeader` instead of `checkHTTPHeader` etc.
* Operations like `mitems` or `mpairs` (or the now deprecated `mget`) that allow a *mutating view* into some data structure should start with an `m`.
* When both in-place mutation and 'returns transformed copy' are available the latter is a past participle of the former:
	+ reverse and reversed in algorithm
	+ sort and sorted
	+ rotate and rotated
* When the 'returns transformed copy' version already exists like `strutils.replace` an in-place version should get an `-In` suffix (`replaceIn` for this example).

 * Use `subjectVerb`, not `verbSubject`, e.g.: `fileExists`, not `existsFile`.

 The stdlib API is designed to be **easy to use** and consistent. Ease of use is measured by the number of calls to achieve a concrete high level action. The ultimate goal is that the programmer can *guess* a name.

 The library uses a simple naming scheme that makes use of common abbreviations to keep the names short but meaningful.

 

| English word | To use | Notes |
| --- | --- | --- |
| initialize | initT  | `init` is used to create a value type `T` |
| new | newP  | `new` is used to create a reference type `P` |
| find | find | should return the position where something was found; for a bool result use `contains` |
| contains | contains | often short for `find() >= 0` |
| append | add | use `add` instead of `append` |
| compare | cmp | should return an int with the `< 0` `== 0` or `> 0` semantics; for a bool result use `sameXYZ` |
| put | put, `[]=` | consider overloading `[]=` for put |
| get | get, `[]` | consider overloading `[]` for get; consider to not use `get` as a prefix: `len` instead of `getLen` |
| length | len | also used for *number of elements* |
| size | size, len | size should refer to a byte size |
| capacity | cap |  |
| memory | mem | implies a low-level operation |
| items | items | default iterator over a collection |
| pairs | pairs | iterator over (key, value) pairs |
| delete | delete, del | del is supposed to be faster than delete, because it does not keep the order; delete keeps the order |
| remove | delete, del | inconsistent right now |
| include | incl |  |
| exclude | excl |  |
| command | cmd |  |
| execute | exec |  |
| environment | env |  |
| variable | var |  |
| value | value, val  | val is preferred, inconsistent right now |
| executable | exe |  |
| directory | dir |  |
| path | path | path is the string "/usr/bin" (for example), dir is the content of "/usr/bin"; inconsistent right now |
| extension | ext |  |
| separator | sep |  |
| column | col, column  | col is preferred, inconsistent right now |
| application | app |  |
| configuration | cfg |  |
| message | msg |  |
| argument | arg |  |
| object | obj |  |
| parameter | param |  |
| operator | opr |  |
| procedure | proc |  |
| function | func |  |
| coordinate | coord |  |
| rectangle | rect |  |
| point | point |  |
| symbol | sym |  |
| literal | lit |  |
| string | str |  |
| identifier | ident |  |
| indentation | indent |  |

 ### Coding Conventions


* The 'return' statement should ideally be used when its control-flow properties are required. Use a procedure's implicit 'result' variable whenever possible. This improves readability.
```
proc repeat(text: string, x: int): string =
  result = ""
  
  for i in 0 .. x:
    result.add($i)
```

 * Use a proc when possible, only using the more powerful facilities of macros, templates, iterators, and converters when necessary.
* Use the `let` statement (not the `var` statement) when declaring variables that do not change within their scope. Using the `let` statement ensures that variables remain immutable, and gives those who read the code a better idea of the code's purpose.

 ### Conventions for multi-line statements and expressions


* Tuples which are longer than one line should indent their parameters to align with the parameters above it.
```
type
  LongTupleA = tuple[wordyTupleMemberOne: int, wordyTupleMemberTwo: string,
                     wordyTupleMemberThree: float]
```

 * Similarly, any procedure and procedure type declarations that are longer than one line should do the same thing.
```
type
  EventCallback = proc (timeReceived: Time, errorCode: int, event: Event,
                        output: var string)

proc lotsOfArguments(argOne: string, argTwo: int, argThree: float,
                     argFour: proc(), argFive: bool): int
                    {.heyLookALongPragma.} =
```

 * Multi-line procedure calls should continue on the same column as the opening parenthesis (like multi-line procedure declarations).
```
startProcess(nimExecutable, currentDirectory, compilerArguments
             environment, processOptions)
```



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nep1.html>

Nim Backend Integration
=======================



> "Heresy grows from idleness." -- Unknown.
> 
> 

 Introduction
------------


The [Nim Compiler User Guide](nimc) documents the typical compiler invocation, using the `compile` or `c` command to transform a `.nim` file into one or more `.c` files which are then compiled with the platform's C compiler into a static binary. However, there are other commands to compile to C++, Objective-C, or JavaScript. This document tries to concentrate in a single place all the backend and interfacing options.

 The Nim compiler supports mainly two backend families: the C, C++ and Objective-C targets and the JavaScript target. [The C like targets](#backends-the-c-like-targets) creates source files that can be compiled into a library or a final executable. [The JavaScript target](#backends-the-javascript-target) can generate a `.js` file which you reference from an HTML file or create a [standalone Node.js program](http://nodejs.org).

 On top of generating libraries or standalone applications, Nim offers bidirectional interfacing with the backend targets through generic and specific pragmas.

 Backends
--------

 ### The C like targets


The commands to compile to either C, C++ or Objective-C are:

 

|  |  |
| --- | --- |
| compileToC, cc | compile project with C code generator |
| compileToCpp, cpp | compile project to C++ code |
| compileToOC, objc | compile project to Objective C code |

 The most significant difference between these commands is that if you look into the `nimcache` directory you will find `.c`, `.cpp` or `.m` files, other than that all of them will produce a native binary for your project. This allows you to take the generated code and place it directly into a project using any of these languages. Here are some typical command- line invocations:



```
$ nim c hallo.nim
$ nim cpp hallo.nim
$ nim objc hallo.nim
```
 The compiler commands select the target backend, but if needed you can [specify additional switches for cross-compilation](nimc#crossminuscompilation) to select the target CPU, operative system or compiler/linker commands.

 ### The JavaScript target


Nim can also generate JavaScript code through the `js` command.

 Nim targets JavaScript 1.5 which is supported by any widely used browser. Since JavaScript does not have a portable means to include another module, Nim just generates a long `.js` file.

 Features or modules that the JavaScript platform does not support are not available. This includes:

 * manual memory management (`alloc`, etc.)
* casting and other unsafe operations (`cast` operator, `zeroMem`, etc.)
* file management
* OS-specific operations
* threading, coroutines
* some modules of the standard library
* proper 64-bit integer arithmetic

 To compensate, the standard library has modules [catered to the JS backend](lib#pure-libraries-modules-for-js-backend) and more support will come in the future (for instance, Node.js bindings to get OS info).

 To compile a Nim module into a `.js` file use the `js` command; the default is a `.js` file that is supposed to be referenced in an `.html` file. However, you can also run the code with nodejs (<http://nodejs.org>):



```
nim js -d:nodejs -r examples/hallo.nim
```
 Interfacing
-----------


Nim offers bidirectional interfacing with the target backend. This means that you can call backend code from Nim and Nim code can be called by the backend code. Usually the direction of which calls which depends on your software architecture (is Nim your main program or is Nim providing a component?).

 ### Nim code calling the backend


Nim code can interface with the backend through the [Foreign function interface](manual#foreign-function-interface) mainly through the [importc pragma](manual#foreign-function-interface-importc-pragma). The `importc` pragma is the *generic* way of making backend symbols available in Nim and is available in all the target backends (JavaScript too). The C++ or Objective-C backends have their respective [ImportCpp](manual#implementation-specific-pragmas-importcpp-pragma) and [ImportObjC](manual#implementation-specific-pragmas-importobjc-pragma) pragmas to call methods from classes.

 Whenever you use any of these pragmas you need to integrate native code into your final binary. In the case of JavaScript this is no problem at all, the same HTML file which hosts the generated JavaScript will likely provide other JavaScript functions which you are importing with `importc`.

 However, for the C like targets you need to link external code either statically or dynamically. The preferred way of integrating native code is to use dynamic linking because it allows you to compile Nim programs without the need for having the related development libraries installed. This is done through the [dynlib pragma for import](manual#foreign-function-interface-dynlib-pragma-for-import), though more specific control can be gained using the [dynlib module](dynlib).

 The [dynlibOverride](nimc#dynliboverride) command line switch allows to avoid dynamic linking if you need to statically link something instead. Nim wrappers designed to statically link source files can use the [compile pragma](manual#implementation-specific-pragmas-compile-pragma) if there are few sources or providing them along the Nim code is easier than using a system library. Libraries installed on the host system can be linked in with the [PassL pragma](manual#implementation-specific-pragmas-passl-pragma).

 To wrap native code, take a look at the [c2nim tool](https://github.com/nim-lang/c2nim/blob/master/doc/c2nim.rst) which helps with the process of scanning and transforming header files into a Nim interface.

 #### C invocation example


Create a `logic.c` file with the following content:

 
```
int addTwoIntegers(int a, int b)
{
  return a + b;
}
```

Create a `calculator.nim` file with the following content:

 
```
{.compile: "logic.c".}
proc addTwoIntegers(a, b: cint): cint {.importc.}

when isMainModule:
  echo addTwoIntegers(3, 7)
```

With these two files in place, you can run `nim c -r calculator.nim` and the Nim compiler will compile the `logic.c` file in addition to `calculator.nim` and link both into an executable, which outputs `10` when run. Another way to link the C file statically and get the same effect would be to remove the line with the `compile` pragma and run the following typical Unix commands:



```
$ gcc -c logic.c
$ ar rvs mylib.a logic.o
$ nim c --passL:mylib.a -r calculator.nim
```
 Just like in this example we pass the path to the `mylib.a` library (and we could as well pass `logic.o`) we could be passing switches to link any other static C library.

 #### JavaScript invocation example


Create a `host.html` file with the following content:

 
```
<html><body>
<script type="text/javascript">
function addTwoIntegers(a, b)
{
  return a + b;
}
</script>
<script type="text/javascript" src="calculator.js"></script>
</body></html>
```

Create a `calculator.nim` file with the following content (or reuse the one from the previous section):

 
```
proc addTwoIntegers(a, b: int): int {.importc.}

when isMainModule:
  echo addTwoIntegers(3, 7)
```

Compile the Nim code to JavaScript with `nim js -o:calculator.js calculator.nim` and open `host.html` in a browser. If the browser supports javascript, you should see the value `10` in the browser's console. Use the [dom module](dom) for specific DOM querying and modification procs or take a look at [karax](https://github.com/pragmagic/karax) for how to develop browser-based applications.

 ### Backend code calling Nim


Backend code can interface with Nim code exposed through the [exportc pragma](manual#foreign-function-interface-exportc-pragma). The `exportc` pragma is the *generic* way of making Nim symbols available to the backends. By default, the Nim compiler will mangle all the Nim symbols to avoid any name collision, so the most significant thing the `exportc` pragma does is maintain the Nim symbol name, or if specified, use an alternative symbol for the backend in case the symbol rules don't match.

 The JavaScript target doesn't have any further interfacing considerations since it also has garbage collection, but the C targets require you to initialize Nim's internals, which is done calling a `NimMain` function. Also, C code requires you to specify a forward declaration for functions or the compiler will assume certain types for the return value and parameters which will likely make your program crash at runtime.

 The Nim compiler can generate a C interface header through the `--header` command-line switch. The generated header will contain all the exported symbols and the `NimMain` proc which you need to call before any other Nim code.

 #### Nim invocation example from C


Create a `fib.nim` file with the following content:

 
```
proc fib(a: cint): cint {.exportc.} =
  if a <= 2:
    result = 1
  else:
    result = fib(a - 1) + fib(a - 2)
```

Create a `maths.c` file with the following content:

 
```
#include "fib.h"
#include <stdio.h>

int main(void)
{
  NimMain();
  for (int f = 0; f < 10; f++)
    printf("Fib of %d is %d\n", f, fib(f));
  return 0;
}
```

Now you can run the following Unix like commands to first generate C sources from the Nim code, then link them into a static binary along your main C program:



```
$ nim c --noMain --noLinking --header:fib.h fib.nim
$ gcc -o m -I$HOME/.cache/nim/fib_d -Ipath/to/nim/lib $HOME/.cache/nim/fib_d/*.c maths.c
```
 The first command runs the Nim compiler with three special options to avoid generating a `main()` function in the generated files, avoid linking the object files into a final binary, and explicitly generate a header file for C integration. All the generated files are placed into the `nimcache` directory. That's why the next command compiles the `maths.c` source plus all the `.c` files from `nimcache`. In addition to this path, you also have to tell the C compiler where to find Nim's `nimbase.h` header file.

 Instead of depending on the generation of the individual `.c` files you can also ask the Nim compiler to generate a statically linked library:



```
$ nim c --app:staticLib --noMain --header fib.nim
$ gcc -o m -Inimcache -Ipath/to/nim/lib libfib.nim.a maths.c
```
 The Nim compiler will handle linking the source files generated in the `nimcache` directory into the `libfib.nim.a` static library, which you can then link into your C program. Note that these commands are generic and will vary for each system. For instance, on Linux systems you will likely need to use `-ldl` too to link in required dlopen functionality.

 #### Nim invocation example from JavaScript


Create a `mhost.html` file with the following content:

 
```
<html><body>
<script type="text/javascript" src="fib.js"></script>
<script type="text/javascript">
alert("Fib for 9 is " + fib(9));
</script>
</body></html>
```

Create a `fib.nim` file with the following content (or reuse the one from the previous section):

 
```
proc fib(a: cint): cint {.exportc.} =
  if a <= 2:
    result = 1
  else:
    result = fib(a - 1) + fib(a - 2)
```

Compile the Nim code to JavaScript with `nim js -o:fib.js fib.nim` and open `mhost.html` in a browser. If the browser supports javascript, you should see an alert box displaying the text `Fib for 9 is 34`. As mentioned earlier, JavaScript doesn't require an initialization call to `NimMain` or a similar function and you can call the exported Nim proc directly.

 ### Nimcache naming logic


The nimcache directory is generated during compilation and will hold either temporary or final files depending on your backend target. The default name for the directory depends on the used backend and on your OS but you can use the `--nimcache` [compiler switch](nimc#compiler-usage-commandminusline-switches) to change it.

 Memory management
-----------------


In the previous sections, the `NimMain()` function reared its head. Since JavaScript already provides automatic memory management, you can freely pass objects between the two languages without problems. In C and derivate languages you need to be careful about what you do and how you share memory. The previous examples only dealt with simple scalar values, but passing a Nim string to C, or reading back a C string in Nim already requires you to be aware of who controls what to avoid crashing.

 ### Strings and C strings


The manual mentions that [Nim strings are implicitly convertible to cstrings](manual#types-cstring-type) which makes interaction usually painless. Most C functions accepting a Nim string converted to a `cstring` will likely not need to keep this string around and by the time they return the string won't be needed anymore. However, for the rare cases where a Nim string has to be preserved and made available to the C backend as a `cstring`, you will need to manually prevent the string data from being freed with [GC\_ref](system#GC_ref,string) and [GC\_unref](system#GC_unref,string).

 A similar thing happens with C code invoking Nim code which returns a `cstring`. Consider the following proc:

 
```
proc gimme(): cstring {.exportc.} =
  result = "Hey there C code! " & $rand(100)
```

Since Nim's garbage collector is not aware of the C code, once the `gimme` proc has finished it can reclaim the memory of the `cstring`. However, from a practical standpoint, the C code invoking the `gimme` function directly will be able to use it since Nim's garbage collector has not had a chance to run *yet*. This gives you enough time to make a copy for the C side of the program, as calling any further Nim procs *might* trigger garbage collection making the previously returned string garbage. Or maybe you are [yourself triggering the collection](gc).

 ### Custom data types


Just like strings, custom data types that are to be shared between Nim and the backend will need careful consideration of who controls who. If you want to hand a Nim reference to C code, you will need to use [GC\_ref](system#GC_ref,ref.T) to mark the reference as used, so it does not get freed. And for the C backend you will need to expose the [GC\_unref](system#GC_unref,ref.T) proc to clean up this memory when it is not required anymore.

 Again, if you are wrapping a library which *mallocs* and *frees* data structures, you need to expose the appropriate *free* function to Nim so you can clean it up. And of course, once cleaned you should avoid accessing it from Nim (or C for that matter). Typically C data structures have their own `malloc_structure` and `free_structure` specific functions, so wrapping these for the Nim side should be enough.

 ### Thread coordination


When the `NimMain()` function is called Nim initializes the garbage collector to the current thread, which is usually the main thread of your application. If your C code later spawns a different thread and calls Nim code, the garbage collector will fail to work properly and you will crash.

 As long as you don't use the threadvar emulation Nim uses native thread variables, of which you get a fresh version whenever you create a thread. You can then attach a GC to this thread via

 
```
system.setupForeignThreadGc()
```

It is **not** safe to disable the garbage collector and enable it after the call from your background thread even if the code you are calling is short lived.

 Before the thread exits, you should tear down the thread's GC to prevent memory leaks by calling

 
```
system.tearDownForeignThreadGc()
```


 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/backends.html>

Nim IDE Integration Guide
=========================



>  "yes, I'm the creator" -- Araq, 2013-07-26 19:28:32. 
> 
> 


Note: this is mostly outdated, see instead <nimsuggest>

 Nim differs from many other compilers in that it is really fast, and being so fast makes it suited to provide external queries for text editors about the source code being written. Through the `idetools` command of [the compiler](nimc), any IDE can query a `.nim` source file and obtain useful information like definition of symbols or suggestions for completion.

 This document will guide you through the available options. If you want to look at practical examples of idetools support you can look at the test files found in the [Test suite](#test-suite) or [various editor integrations](https://github.com/Araq/Nim/wiki/Editor-Support) already available.

 Idetools invocation
-------------------

 ### Specifying the location of the query


All of the available idetools commands require you to specify a query location through the `--track` or `--trackDirty` switches. The general idetools invocations are:



```
nim idetools --track:FILE,LINE,COL <switches> proj.nim
```
 Or:



```
nim idetools --trackDirty:DIRTY_FILE,FILE,LINE,COL <switches> proj.nim
```
 
`proj.nim` This is the main *project* filename. Most of the time you will pass in the same as **FILE**, but for bigger projects this is the file which is used as main entry point for the program, the one which users compile to generate a final binary. `<switches>` This would be any of the other idetools available options, like `--def` or `--suggest` explained in the following sections. `COL` An integer with the column you are going to query. For the compiler columns start at zero, so the first column will be **0** and the last in an 80 column terminal will be **79**. `LINE` An integer with the line you are going to query. For the compiler lines start at **1**. `FILE` The file you want to perform the query on. Usually you will pass in the same value as **proj.nim**. `DIRTY_FILE` 
The **FILE** parameter is enough for static analysis, but IDEs tend to have *unsaved buffers* where the user may still be in the middle of typing a line. In such situations the IDE can save the current contents to a temporary file and then use the `--trackDirty` switch.

 Dirty files are likely to contain errors and they are usually compiled partially only to the point needed to service the idetool request. The compiler discriminates them to ensure that **a)** they won't be cached and **b)** they won't invalidate the cached contents of the original module.

 The other reason is that the dirty file can appear anywhere on disk (e.g. in tmpfs), but it must be treated as having a path matching the original module when it comes to usage of relative paths, etc. Queries, however, will refer to the dirty module name in their answers instead of the normal filename.

   ### Definitions


The `--def` idetools switch performs a query about the definition of a specific symbol. If available, idetools will answer with the type, source file, line/column information and other accessory data if available like a docstring. With this information an IDE can provide the typical *Jump to definition* where a user puts the cursor on a symbol or uses the mouse to select it and is redirected to the place where the symbol is located.

 Since Nim is implemented in Nim, one of the nice things of this feature is that any user with an IDE supporting it can quickly jump around the standard library implementation and see exactly what a proc does, learning about the language and seeing real life examples of how to write/implement specific features.

 Idetools will always answer with a single definition or none if it can't find any valid symbol matching the position of the query.

 ### Suggestions


The `--suggest` idetools switch performs a query about possible completion symbols at some point in the file. IDEs can easily provide an autocompletion feature where the IDE scans the current file (and related ones, if it knows about the language being edited and follows includes/imports) and when the user starts typing something a completion box with different options appears.

 However such features are not context sensitive and work simply on string matching, which can be problematic in Nim especially due to the case insensitiveness of the language (plus underscores as separators!).

 The typical usage scenario for this option is to call it after the user has typed the dot character for [the object oriented call syntax](https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax). Idetools will try to return the suggestions sorted first by scope (from innermost to outermost) and then by item name.

 ### Invocation context


The `--context` idetools switch is very similar to the suggestions switch, but instead of being used after the user has typed a dot character, this one is meant to be used after the user has typed an opening brace to start typing parameters.

 ### Symbol usages


The `--usages` idetools switch lists all usages of the symbol at a position. IDEs can use this to find all the places in the file where the symbol is used and offer the user to rename it in all places at the same time. Again, a pure string based search and replace may catch symbols out of the scope of a function/loop.

 For this kind of query the IDE will most likely ignore all the type/signature info provided by idetools and concentrate on the filename, line and column position of the multiple returned answers.

 ### Expression evaluation


This feature is still under development. In the future it will allow an IDE to evaluate an expression in the context of the currently running/debugged user project.

 Compiler as a service (CAAS)
----------------------------


The occasional use of idetools is acceptable for things like definitions, where the user puts the cursor on a symbol or double clicks it and after a second or two the IDE displays where that symbol is defined. Such latencies would be terrible for features like symbol suggestion, plus why wait at all if we can avoid it?

 The idetools command can be run as a compiler service (CAAS), where you first launch the compiler and it will stay online as a server, accepting queries in a telnet like fashion. The advantage of staying on is that for many queries the compiler can cache the results of the compilation, and subsequent queries should be fast in the millisecond range, thus being responsive enough for IDEs.

 If you want to start the server using stdin/stdout as communication you need to type:



```
nim serve --server.type:stdin proj.nim
```
 If you want to start the server using tcp and a port, you need to type:



```
nim serve --server.type:tcp --server.port:6000 \
  --server.address:hostname proj.nim
```
 In both cases the server will start up and await further commands. The syntax of the commands you can now send to the server is practically the same as running the nim compiler on the commandline, you only need to remove the name of the compiler since you are already talking to it. The server will answer with as many lines of text it thinks necessary plus an empty line to indicate the end of the answer.

 You can find examples of client/server communication in the idetools tests found in the [Test suite](#test-suite).

 Parsing idetools output
-----------------------


Idetools outputs is always returned on single lines separated by tab characters (`\t`). The values of each column are:

 1. Three characters indicating the type of returned answer (e.g. def for definition, `sug` for suggestion, etc).
2. Type of the symbol. This can be `skProc`, `skLet`, and just about any of the enums defined in the module `compiler/ast.nim`.
3. Full qualified path of the symbol. If you are querying a symbol defined in the `proj.nim` file, this would have the form `proj.symbolName`.
4. Type/signature. For variables and enums this will contain the type of the symbol, for procs, methods and templates this will contain the full unique signature (e.g. `proc (File)`).
5. Full path to the file containing the symbol.
6. Line where the symbol is located in the file. Lines start to count at **1**.
7. Column where the symbol is located in the file. Columns start to count at **0**.
8. Docstring for the symbol if available or the empty string. To differentiate the docstring from end of answer in server mode, the docstring is always provided enclosed in double quotes, and if the docstring spans multiple lines, all following lines of the docstring will start with a blank space to align visually with the starting quote.

 Also, you won't find raw `\n` characters breaking the one answer per line format. Instead you will need to parse sequences in the form `\xHH`, where *HH* is a hexadecimal value (e.g. newlines generate the sequence `\x0A`).

 The following sections define the expected output for each kind of symbol for which idetools returns valid output.

 ### skConst


**Third column**: module + [n scope nesting] + const name.  
**Fourth column**: the type of the const value.  
**Docstring**: always the empty string.  




```
const SOME_SEQUENCE = @[1, 2]
--> col 2: $MODULE.SOME_SEQUENCE
    col 3: seq[int]
    col 7: ""
```
 ### skEnumField


**Third column**: module + [n scope nesting] + enum type + enum field name.  
**Fourth column**: enum type grouping other enum fields.  
**Docstring**: always the empty string.  




```
Open(filename, fmWrite)
--> col 2: system.FileMode.fmWrite
    col 3: FileMode
    col 7: ""
```
 ### skForVar


**Third column**: module + [n scope nesting] + var name.  
**Fourth column**: type of the var.  
**Docstring**: always the empty string.  




```
proc looper(filename = "tests.nim") =
  for letter in filename:
    echo letter
--> col 2: $MODULE.looper.letter
    col 3: char
    col 7: ""
```
 ### skIterator, skClosureIterator


The fourth column will be the empty string if the iterator is being defined, since at that point in the file the parser hasn't processed the full line yet. The signature will be returned complete in posterior instances of the iterator.

 **Third column**: module + [n scope nesting] + iterator name.  
**Fourth column**: signature of the iterator including return type.  
**Docstring**: docstring if available.  




```
let
  text = "some text"
  letters = toSeq(runes(text))
--> col 2: unicode.runes
    col 3: iterator (string): Rune
    col 7: "iterates over any unicode character of the string `s`."
```
 ### skLabel


**Third column**: module + [n scope nesting] + name.  
**Fourth column**: always the empty string.  
**Docstring**: always the empty string.  




```
proc test(text: string) =
  var found = -1
  block loops:
--> col 2: $MODULE.test.loops
    col 3: ""
    col 7: ""
```
 ### skLet


**Third column**: module + [n scope nesting] + let name.  
**Fourth column**: the type of the let variable.  
**Docstring**: always the empty string.  




```
let
  text = "some text"
--> col 2: $MODULE.text
    col 3: TaintedString
    col 7: ""
```
 ### skMacro


The fourth column will be the empty string if the macro is being defined, since at that point in the file the parser hasn't processed the full line yet. The signature will be returned complete in posterior instances of the macro.

 **Third column**: module + [n scope nesting] + macro name.  
**Fourth column**: signature of the macro including return type.  
**Docstring**: docstring if available.  




```
proc testMacro() =
  expect(EArithmetic):
--> col 2: idetools_api.expect
    col 3: proc (varargs[expr], stmt): stmt
    col 7: ""
```
 ### skMethod


The fourth column will be the empty string if the method is being defined, since at that point in the file the parser hasn't processed the full line yet. The signature will be returned complete in posterior instances of the method.

 Methods imply [dynamic dispatch](https://nim-lang.org/docs/tut2.html#object-oriented-programming-dynamic-dispatch) and idetools performs a static analysis on the code. For this reason idetools may not return the definition of the correct method you are querying because it may be impossible to know until the code is executed. It will try to return the method which covers the most possible cases (i.e. for variations of different classes in a hierarchy it will prefer methods using the base class).

 While at the language level a method is differentiated from others by the parameters and return value, the signature of the method returned by idetools returns also the pragmas for the method.

 Note that at the moment the word `proc` is returned for the signature of the found method instead of the expected `method`. This may change in the future.

 **Third column**: module + [n scope nesting] + method name.  
**Fourth column**: signature of the method including return type.  
**Docstring**: docstring if available.  




```
method eval(e: PExpr): int = quit "to override!"
method eval(e: PLiteral): int = e.x
method eval(e: PPlusExpr): int = eval(e.a) + eval(e.b)
echo eval(newPlus(newPlus(newLit(1), newLit(2)), newLit(4)))
--> col 2: $MODULE.eval
    col 3: proc (PPlusExpr): int
    col 7: ""
```
 ### skParam


**Third column**: module + [n scope nesting] + param name.  
**Fourth column**: the type of the parameter.  
**Docstring**: always the empty string.  




```
proc reader(filename = "tests.nim") =
  let text = readFile(filename)
--> col 2: $MODULE.reader.filename
    col 3: string
    col 7: ""
```
 ### skProc


The fourth column will be the empty string if the proc is being defined, since at that point in the file the parser hasn't processed the full line yet. The signature will be returned complete in posterior instances of the proc.

 While at the language level a proc is differentiated from others by the parameters and return value, the signature of the proc returned by idetools returns also the pragmas for the proc.

 **Third column**: module + [n scope nesting] + proc name.  
**Fourth column**: signature of the proc including return type.  
**Docstring**: docstring if available.  




```
open(filename, fmWrite)
--> col 2: system.Open
    col 3: proc (var File, string, FileMode, int): bool
    col 7:
"Opens a file named `filename` with given `mode`.
 
 Default mode is readonly. Returns true iff the file could be opened.
 This throws no exception if the file could not be opened."
```
 ### skResult


**Third column**: module + [n scope nesting] + result.  
**Fourth column**: the type of the result.  
**Docstring**: always the empty string.  




```
proc getRandomValue() : int =
  return 4
--> col 2: $MODULE.getRandomValue.result
    col 3: int
    col 7: ""
```
 ### skTemplate


The fourth column will be the empty string if the template is being defined, since at that point in the file the parser hasn't processed the full line yet. The signature will be returned complete in posterior instances of the template.

 **Third column**: module + [n scope nesting] + template name.  
**Fourth column**: signature of the template including return type.  
**Docstring**: docstring if available.  




```
let
  text = "some text"
  letters = toSeq(runes(text))
--> col 2: sequtils.toSeq
    col 3: proc (expr): expr
    col 7:
"Transforms any iterator into a sequence.
 
 Example:
 
 .. code-block:: nim
   let
     numeric = @[1, 2, 3, 4, 5, 6, 7, 8, 9]
     odd_numbers = toSeq(filter(numeric) do (x: int) -> bool:
       if x mod 2 == 1:
         result = true)
   assert odd_numbers == @[1, 3, 5, 7, 9]"
```
 ### skType


**Third column**: module + [n scope nesting] + type name.  
**Fourth column**: the type.  
**Docstring**: always the empty string.  




```
proc writeTempFile() =
  var output: File
--> col 2: system.File
    col 3: File
    col 7: ""
```
 ### skVar


**Third column**: module + [n scope nesting] + var name.  
**Fourth column**: the type of the var.  
**Docstring**: always the empty string.  




```
proc writeTempFile() =
  var output: File
  output.open("/tmp/somefile", fmWrite)
  output.write("test")
--> col 2: $MODULE.writeTempFile.output
    col 3: File
    col 7: ""
```
 Test suite
----------


To verify that idetools is working properly there are files in the `tests/caas/` directory which provide unit testing. If you find odd idetools behaviour and are able to reproduce it, you are welcome to report it as a bug and add a test to the suite to avoid future regressions.

 ### Running the test suite


At the moment idetools support is still in development so the test suite is not integrated with the main test suite and you have to run it manually. First you have to compile the tester:



```
$ cd my/nim/checkout/tests
$ nim c testament/caasdriver.nim
```
 Running the `caasdriver` without parameters will attempt to process all the test cases in all three operation modes. If a test succeeds nothing will be printed and the process will exit with zero. If any test fails, the specific line of the test preceding the failure and the failure itself will be dumped to stdout, along with a final indicator of the success state and operation mode. You can pass the parameter `verbose` to force all output even on successful tests.

 The normal operation mode is called `ProcRun` and it involves starting a process for each command or query, similar to running manually the Nim compiler from the commandline. The `CaasRun` mode starts a server process to answer all queries. The `SymbolProcRun` mode is used by compiler developers. This means that running all tests involves processing all `*.txt` files three times, which can be quite time consuming.

 If you don't want to run all the test case files you can pass any substring as a parameter to `caasdriver`. Only files matching the passed substring will be run. The filtering doesn't use any globbing metacharacters, it's a plain match. For example, to run only `*-compile*.txt` tests in verbose mode:



```
./caasdriver verbose -compile
```
 ### Test case file format


All the `tests/caas/*.txt` files encode a session with the compiler:

 * The first line indicates the main project file.
* Lines starting with `>` indicate a command to be sent to the compiler and the lines following a command include checks for expected or forbidden output (`!` for forbidden).
* If a line starts with `#` it will be ignored completely, so you can use that for comments.
* Since some cases are specific to either `ProcRun` or `CaasRun` modes, you can prefix a line with the mode and the line will be processed only in that mode.
* The rest of the line is treated as a [regular expression](re), so be careful escaping metacharacters like parenthesis.

 Before the line is processed as a regular expression, some basic variables are searched for and replaced in the tests. The variables which will be replaced are:

 * **$TESTNIM**: filename specified in the first line of the script.
* **$MODULE**: like $TESTNIM but without extension, useful for expected output.

 When adding a test case to the suite it is a good idea to write a few comments about what the test is meant to verify. 



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/idetools.html>

NimScript
=========

 Strictly speaking, `NimScript` is the subset of Nim that can be evaluated by Nim's builtin virtual machine (VM). This VM is used for Nim's compiletime function evaluation features.

 The `nim` executable processes the `.nims` configuration files in the following directories (in this order; later files overwrite previous settings):

 1. If environment variable `XDG_CONFIG_HOME` is defined, `$XDG_CONFIG_HOME/nim/config.nims` or `~/.config/nim/config.nims` (POSIX) or `%APPDATA%/nim/config.nims` (Windows). This file can be skipped with the `--skipUserCfg` command line option.
2. `$parentDir/config.nims` where `$parentDir` stands for any parent directory of the project file's path. These files can be skipped with the `--skipParentCfg` command line option.
3. `$projectDir/config.nims` where `$projectDir` stands for the project's path. This file can be skipped with the `--skipProjCfg` command line option.
4. A project can also have a project specific configuration file named `$project.nims` that resides in the same directory as `$project.nim`. This file can be skipped with the same `--skipProjCfg` command line option.

 For available procs and implementation details see <nimscript>.

 Limitations
-----------


NimScript is subject to some limitations caused by the implementation of the VM (virtual machine):

 * Nim's FFI (foreign function interface) is not available in NimScript. This means that any stdlib module which relies on `importc` can not be used in the VM.
* `ptr` operations are are hard to emulate with the symbolic representation the VM uses. They are available and tested extensively but there are bugs left.
* `var T` function arguments rely on `ptr` operations internally and might also be problematic in some cases.
* More than one level of `ref` is generally not supported (for example, the type `ref ref int`).
* Multimethods are not available.
* `random.randomize()` requires an `int64` explicitly passed as argument, you *must* pass a Seed integer.

 Standard library modules
------------------------


At least the following standard library modules are available:

 * <macros>
* <os>
* <strutils>
* <math>
* <distros>
* <sugar>
* <algorithm>
* <base64>
* <bitops>
* <chains>
* <colors>
* <complex>
* <htmlgen>
* <httpcore>
* <lenientops>
* <mersenne>
* <options>
* <parseutils>
* <punycode>
* [random](punycode)
* <stats>
* <strformat>
* <strmisc>
* <strscans>
* <unicode>
* <uri>
* [std/editdistance](editdistance)
* [std/wordwrap](wordwrap)
* [std/sums](sums)
* <parsecsv>
* <parsecfg>
* <parsesql>
* <xmlparser>
* <htmlparser>
* <ropes>
* <json>
* <parsejson>
* <strtabs>
* <unidecode>

 In addition to the standard Nim syntax (<system> module), NimScripts support the procs and templates defined in the <nimscript> module too.

 See also:

 * [Check the tests for more information about modules compatible with NimScript.](https://github.com/nim-lang/Nim/blob/devel/tests/test_nimscript.nims)

 NimScript as a configuration file
---------------------------------


A command-line switch `--FOO` is written as `switch("FOO")` in NimScript. Similarly, command-line `--FOO:VAL` translates to `switch("FOO", "VAL")`.

 Here are few examples of using the `switch` proc:

 
```
# command-line: --opt:size
switch("opt", "size")
# command-line: --define:foo or -d:foo
switch("define", "foo")
# command-line: --forceBuild
switch("forceBuild")
```

NimScripts also support `--` templates for convenience, which look like command-line switches written as-is in the NimScript file. So the above example can be rewritten as:

 
```
--opt:size
--define:foo
--forceBuild
```

**Note**: In general, the *define* switches can also be set in NimScripts using `switch` or `--`, as shown in above examples. Only the `release` define (`-d:release`) cannot be set in NimScripts.

 NimScript as a build tool
-------------------------


The `task` template that the `system` module defines allows a NimScript file to be used as a build tool. The following example defines a task `build` that is an alias for the `c` command:

 
```
task build, "builds an example":
  setCommand "c"
```

In fact, as a convention the following tasks should be available:

 

| Task | Description |
| --- | --- |
| `help` | List all the available NimScript tasks along with their docstrings. |
| `build` | Build the project with the required backend (`c`, `cpp` or `js`). |
| `tests` | Runs the tests belonging to the project. |
| `bench` | Runs benchmarks belonging to the project. |


Look at the module <distros> for some support of the OS's native package managers.

 Nimble integration
------------------


See the [Nimble readme](https://github.com/nim-lang/nimble#readme) for more information.

 Standalone NimScript
--------------------


NimScript can also be used directly as a portable replacement for Bash and Batch files. Use `nim myscript.nims` to run `myscript.nims`. For example, installation of Nimble could be accomplished with this simple script:

 
```
mode = ScriptMode.Verbose

var id = 0
while dirExists("nimble" & $id):
  inc id

exec "git clone https://github.com/nim-lang/nimble.git nimble" & $id

withDir "nimble" & $id & "/src":
  exec "nim c nimble"

mvFile "nimble" & $id & "/src/nimble".toExe, "bin/nimble".toExe
```

On Unix, you can also use the shebang `#!/usr/bin/env nim`, as long as your filename ends with `.nims`:

 
```
#!/usr/bin/env nim
mode = ScriptMode.Silent

echo "hello world"
```

Use `#!/usr/bin/env -S nim --hints:off` to disable hints.

 Benefits
--------

 ### Cross-Platform


It is a cross-platform scripting language that can run where Nim can run, e.g. you can not run Batch or PowerShell on Linux or Mac, the Bash for Linux might not run on Mac, there are no unit tests tools for Batch, etc.

 NimScript can detect on which platform, operating system, architecture, and even which Linux distribution is running on, allowing the same script to support a lot of systems.

 See the following (incomplete) example:

 
```
import distros

# Architectures.
if defined(amd64):
  echo "Architecture is x86 64Bits"
elif defined(i386):
  echo "Architecture is x86 32Bits"
elif defined(arm):
  echo "Architecture is ARM"

# Operating Systems.
if defined(linux):
  echo "Operating System is GNU Linux"
elif defined(windows):
  echo "Operating System is Microsoft Windows"
elif defined(macosx):
  echo "Operating System is Apple OS X"

# Distros.
if detectOs(Ubuntu):
  echo "Distro is Ubuntu"
elif detectOs(ArchLinux):
  echo "Distro is ArchLinux"
elif detectOs(Debian):
  echo "Distro is Debian"
```
 ### Uniform Syntax


The syntax, style, and rest of the ecosystem is the same as for compiled Nim, that means there is nothing new to learn, no context switch for developers.

 ### Powerful Metaprogramming


NimScript can use Nim's templates, macros, types, concepts, effect tracking system, and more, you can create modules that work on compiled Nim and also on interpreted NimScript.

 `func` will still check for side effects, `debugEcho` also works as expected, making it ideal for functional scripting metaprogramming.

 This is an example of a third party module that uses macros and templates to translate text strings on unmodified NimScript:

 
```
import nimterlingua
nimterlingua("translations.cfg")
echo "cat"  # Run with -d:RU becomes "kot", -d:ES becomes "gato", ...
```

translations.cfg

 
```
[cat]
ES = gato
PT = minino
RU = kot
FR = chat
```

* [Nimterlingua](https://nimble.directory/pkg/nimterlingua)

 ### Graceful Fallback


Some features of compiled Nim may not work on NimScript, but often a graceful and seamless fallback degradation is used.

 See the following NimScript:

 
```
if likely(true):
  discard
elif unlikely(false):
  discard

proc foo() {.compiletime.} = echo NimVersion

static:
  echo CompileDate
```

`likely()`, `unlikely()`, `static:` and `{.compiletime.}` will produce no code at all when run on NimScript, but still no error nor warning is produced and the code just works.

 ### Evolving Scripting language


NimScript evolves together with Nim, [occasionally new features might become available on NimScript](https://github.com/nim-lang/Nim/pulls?utf8=%E2%9C%93&q=nimscript) , adapted from compiled Nim or added as new features on both.

 ### Scripting Language with a Package Manager


You can create your own modules to be compatible with NimScript, and check [Nimble](https://nimble.directory) to search for third party modules that may work on NimScript.

 ### DevOps Scripting


You can use NimScript to deploy to production, run tests, build projects, do benchmarks, generate documentation, and all kinds of DevOps/SysAdmin specific tasks.

 * [An example of a third party NimScript that can be used as a project-agnostic tool.](https://github.com/kaushalmodi/nim_config#list-available-tasks)

 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nims.html>

Nim maintenance script
======================



>  "A great chef is an artist that I truly respect" -- Robert Stack. 
> 
> 

 Introduction
------------


The koch program is Nim's maintenance script. It is a replacement for make and shell scripting with the advantage that it is much more portable. The word *koch* means *cook* in German. `koch` is used mainly to build the Nim compiler, but it can also be used for other tasks. This document describes the supported commands and their options.

 Commands
--------

 ### boot command


The boot command bootstraps the compiler, and it accepts different options:

 
-d:release By default a debug version is created, passing this option will force a release build, which is much faster and should be preferred unless you are debugging the compiler. -d:nimUseLinenoise Use the linenoise library for interactive mode (not needed on Windows).  After compilation is finished you will hopefully end up with the nim compiler in the `bin` directory. You can add Nim's `bin` directory to your `$PATH` or use the install command to place it where it will be found.

 ### csource command


The csource command builds the C sources for installation. It accepts the same options as you would pass to the [boot command](#commands-boot-command).

 ### temp command


The temp command builds the Nim compiler but with a different final name (`nim_temp`), so it doesn't overwrite your normal compiler. You can use this command to test different options, the same you would issue for the [boot command](#commands-boot-command).

 ### test command


The test command can also be invoked with the alias `tests`. This command will compile and run `testament/tester.nim`, which is the main driver of Nim's test suite. You can pass options to the `test` command, they will be forwarded to the tester. See its source code for available options.

 ### web command


The web command converts the documentation in the `doc` directory from rst to HTML. It also repeats the same operation but places the result in the `web/upload` which can be used to update the website at <https://nim-lang.org>.

 By default, the documentation will be built in parallel using the number of available CPU cores. If any documentation build sub-commands fail, they will be rerun in serial fashion so that meaningful error output can be gathered for inspection. The `--parallelBuild:n` switch or configuration option can be used to force a specific number of parallel jobs or run everything serially from the start (`n == 1`). 



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/koch.html>

aliases
=======

 Simple alias analysis for the HLO and the code generators.

 Imports
-------

  <ast>, <astalgo>, <types>, <trees>  Types
-----

  
```
TAnalysisResult = enum
  arNo, arMaybe, arYes
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/aliases.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/aliases.nim#L16)   Procs
-----

  
```
proc isPartOf(a, b: PNode): TAnalysisResult {...}{.
    raises: [Exception, ERecoverableError], tags: [RootEffect].}
```
  checks if location `a` can be part of location `b`. We treat seqs and strings as pointers because the code gen often just passes them as such.

 Note: `a` can only be part of `b`, if `a`'s type can be part of `b`'s type. Since however type analysis is more expensive, we perform it only if necessary.

 cases:

 
YES-cases: x <| x # for general trees x[] <| x x[i] <| x x.f <| x  NO-cases: x !<| y # depending on type and symbol kind x[constA] !<| x[constB] x.f !<| x.g x.f !<| y.f iff x !<= y

 MAYBE-cases:

 
> 
> x[] ?<| y[] iff compatible type
> 
>  x[] ?<| y depending on type
> 
>  

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/aliases.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/aliases.nim#L66)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/aliases.html>

asciitables
===========

 Types
-----

  
```
Cell = object
  text*: string
  width*, row*, col*, ncols*, nrows*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/asciitables.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/asciitables.nim#L6)   Procs
-----

  
```
proc alignTable(s: string; delim = '\t'; fill = ' '; sep = " "): string {...}{.
    raises: [], tags: [].}
```
  formats a `delim`-delimited `s` representing a table; each cell is aligned to a width that's computed for each column; consecutive columns are delimited by `sep`, and alignment space is filled using `fill`. More customized formatting can be done by calling `parseTableCells` directly. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/asciitables.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/asciitables.nim#L71)   Iterators
---------

  
```
iterator parseTableCells(s: string; delim = '\t'): Cell {...}{.raises: [], tags: [].}
```
  iterates over all cells in a `delim`-delimited `s`, after a 1st pass that computes number of rows, columns, and width of each column. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/asciitables.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/asciitables.nim#L10)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/asciitables.html>

openssl
=======


OpenSSL support

 When OpenSSL is dynamically linked, the wrapper provides partial forward and backward compatibility for OpenSSL versions above and below 1.1.0

 OpenSSL can also be statically linked using `--dynlibOverride:ssl` for OpenSSL >= 1.1.0. If you want to statically link against OpenSSL 1.0.x, you now have to define the `openssl10` symbol via `-d:openssl10`.

 Build and test examples:

 
```
./bin/nim c -d:ssl -p:. -r tests/untestable/tssl.nim
./bin/nim c -d:ssl -p:. --dynlibOverride:ssl --passl:-lcrypto --passl:-lssl -r tests/untestable/tssl.nim
```
 Imports
-------

  <winlean>, <dynlib>, <strutils>  Types
-----

  
```
SslPtr = ptr SslStruct
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L98)  
```
PSslPtr = ptr SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L99)  
```
SslCtx = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L100)  
```
PSSL_METHOD = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L101)  
```
PSTACK = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L102)  
```
PX509 = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L103)  
```
PX509_NAME = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L104)  
```
PEVP_MD = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L105)  
```
PBIO_METHOD = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L106)  
```
BIO = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L107)  
```
EVP_PKEY = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L108)  
```
PRSA = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L109)  
```
PASN1_UTCTIME = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L110)  
```
PASN1_cInt = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L111)  
```
PPasswdCb = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L112)  
```
EVP_MD = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L113)  
```
EVP_MD_CTX = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L114)  
```
EVP_PKEY_CTX = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L115)  
```
ENGINE = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L116)  
```
PFunction = proc () {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L117)  
```
DES_cblock = array[0 .. 7, int8]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L118)  
```
PDES_cblock = ptr DES_cblock
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L119)  
```
des_ks_struct {...}{.final.} = object
  ks*: DES_cblock
  weak_key*: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L120)  
```
des_key_schedule = array[1 .. 16, des_ks_struct]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L124)  
```
pem_password_cb = proc (buf: cstring; size, rwflag: cint; userdata: pointer): cint {...}{.
    cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L126)  
```
PaddingType = enum
  RSA_PKCS1_PADDING = 1, RSA_SSLV23_PADDING = 2, RSA_NO_PADDING = 3,
  RSA_PKCS1_OAEP_PADDING = 4, RSA_X931_PADDING = 5, RSA_PKCS1_PSS_PADDING = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L128)  
```
PskClientCallback = proc (ssl: SslPtr; hint: cstring; identity: cstring;
                          max_identity_len: cuint; psk: ptr cuchar;
                          max_psk_len: cuint): cuint {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L602) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L602)  
```
PskServerCallback = proc (ssl: SslPtr; identity: cstring; psk: ptr cuchar;
                          max_psk_len: cint): cuint {...}{.cdecl.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L606) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L606)  
```
MD5_LONG = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L733) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L733)  
```
MD5_CTX = object
  A, B, C, D, Nl, Nh: MD5_LONG
  data: array[MD5_LBLOCK, MD5_LONG]
  num: cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L739) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L739)  
```
PX509_STORE = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L825) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L825)  
```
PX509_OBJECT = SslPtr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L826) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L826)   Consts
------

  
```
DLLSSLName = "(libssl-1_1-x64|ssleay64|libssl64).dll"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L66)  
```
DLLUtilName = "(libcrypto-1_1-x64|libeay64).dll"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L67)  
```
SSL_SENT_SHUTDOWN = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L138)  
```
SSL_RECEIVED_SHUTDOWN = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L139)  
```
EVP_MAX_MD_SIZE = 36
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L140)  
```
SSL_ERROR_NONE = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L141)  
```
SSL_ERROR_SSL = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L142)  
```
SSL_ERROR_WANT_READ = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L143)  
```
SSL_ERROR_WANT_WRITE = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L144)  
```
SSL_ERROR_WANT_X509_LOOKUP = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L145)  
```
SSL_ERROR_SYSCALL = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L146)  
```
SSL_ERROR_ZERO_RETURN = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L147)  
```
SSL_ERROR_WANT_CONNECT = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L148)  
```
SSL_ERROR_WANT_ACCEPT = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L149)  
```
SSL_CTRL_NEED_TMP_RSA = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L150)  
```
SSL_CTRL_SET_TMP_RSA = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L151)  
```
SSL_CTRL_SET_TMP_DH = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L152)  
```
SSL_CTRL_SET_TMP_ECDH = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L153)  
```
SSL_CTRL_SET_TMP_RSA_CB = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L154)  
```
SSL_CTRL_SET_TMP_DH_CB = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L155)  
```
SSL_CTRL_SET_TMP_ECDH_CB = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L156)  
```
SSL_CTRL_GET_SESSION_REUSED = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L157)  
```
SSL_CTRL_GET_CLIENT_CERT_REQUEST = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L158)  
```
SSL_CTRL_GET_NUM_RENEGOTIATIONS = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L159)  
```
SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L160)  
```
SSL_CTRL_GET_TOTAL_RENEGOTIATIONS = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L161)  
```
SSL_CTRL_GET_FLAGS = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L162)  
```
SSL_CTRL_EXTRA_CHAIN_CERT = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L163)  
```
SSL_CTRL_SET_MSG_CALLBACK = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L164)  
```
SSL_CTRL_SET_MSG_CALLBACK_ARG = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L165)  
```
SSL_CTRL_SET_MTU = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L166)  
```
SSL_CTRL_SESS_NUMBER = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L167)  
```
SSL_CTRL_SESS_CONNECT = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L168)  
```
SSL_CTRL_SESS_CONNECT_GOOD = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L169)  
```
SSL_CTRL_SESS_CONNECT_RENEGOTIATE = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L170)  
```
SSL_CTRL_SESS_ACCEPT = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L171)  
```
SSL_CTRL_SESS_ACCEPT_GOOD = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L172)  
```
SSL_CTRL_SESS_ACCEPT_RENEGOTIATE = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L173)  
```
SSL_CTRL_SESS_HIT = 27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L174)  
```
SSL_CTRL_SESS_CB_HIT = 28
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L175)  
```
SSL_CTRL_SESS_MISSES = 29
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L176)  
```
SSL_CTRL_SESS_TIMEOUTS = 30
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L177)  
```
SSL_CTRL_SESS_CACHE_FULL = 31
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L178)  
```
SSL_CTRL_OPTIONS = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L179)  
```
SSL_CTRL_MODE = 33
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L180)  
```
SSL_CTRL_GET_READ_AHEAD = 40
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L181)  
```
SSL_CTRL_SET_READ_AHEAD = 41
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L182)  
```
SSL_CTRL_SET_SESS_CACHE_SIZE = 42
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L183)  
```
SSL_CTRL_GET_SESS_CACHE_SIZE = 43
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L184)  
```
SSL_CTRL_SET_SESS_CACHE_MODE = 44
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L185)  
```
SSL_CTRL_GET_SESS_CACHE_MODE = 45
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L186)  
```
SSL_CTRL_GET_MAX_CERT_LIST = 50
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L187)  
```
SSL_CTRL_SET_MAX_CERT_LIST = 51
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L188)  
```
SSL_CTRL_SET_ECDH_AUTO = 94
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L193)  
```
TLSEXT_NAMETYPE_host_name = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L194)  
```
SSL_TLSEXT_ERR_OK = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L195)  
```
SSL_TLSEXT_ERR_ALERT_WARNING = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L196)  
```
SSL_TLSEXT_ERR_ALERT_FATAL = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L197)  
```
SSL_TLSEXT_ERR_NOACK = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L198)  
```
SSL_MODE_ENABLE_PARTIAL_WRITE = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L199)  
```
SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L203)  
```
SSL_MODE_AUTO_RETRY = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L205)  
```
SSL_MODE_NO_AUTO_CHAIN = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L206)  
```
SSL_OP_NO_SSLv2 = 0x01000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L207)  
```
SSL_OP_NO_SSLv3 = 0x02000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L208)  
```
SSL_OP_NO_TLSv1 = 0x04000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L209) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L209)  
```
SSL_OP_NO_TLSv1_1 = 0x08000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L210)  
```
SSL_OP_ALL = 0x000FFFFF
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L211)  
```
SSL_VERIFY_NONE = 0x00000000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L212)  
```
SSL_VERIFY_PEER = 0x00000001
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L213)  
```
SSL_ST_CONNECT = 0x00001000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L214)  
```
SSL_ST_ACCEPT = 0x00002000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L215)  
```
SSL_ST_INIT = 12288
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L216)  
```
OPENSSL_DES_DECRYPT = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L217)  
```
OPENSSL_DES_ENCRYPT = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L218)  
```
X509_V_OK = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L219)  
```
X509_V_ILLEGAL = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L220)  
```
X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L221)  
```
X509_V_ERR_UNABLE_TO_GET_CRL = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L222)  
```
X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L223)  
```
X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L224)  
```
X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L225)  
```
X509_V_ERR_CERT_SIGNATURE_FAILURE = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L226)  
```
X509_V_ERR_CRL_SIGNATURE_FAILURE = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L227)  
```
X509_V_ERR_CERT_NOT_YET_VALID = 9
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L228)  
```
X509_V_ERR_CERT_HAS_EXPIRED = 10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L229)  
```
X509_V_ERR_CRL_NOT_YET_VALID = 11
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L230)  
```
X509_V_ERR_CRL_HAS_EXPIRED = 12
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L231)  
```
X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L232)  
```
X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L233)  
```
X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L234)  
```
X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L235)  
```
X509_V_ERR_OUT_OF_MEM = 17
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L236)  
```
X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L237)  
```
X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L238)  
```
X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L239)  
```
X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L240)  
```
X509_V_ERR_CERT_CHAIN_TOO_LONG = 22
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L241)  
```
X509_V_ERR_CERT_REVOKED = 23
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L242)  
```
X509_V_ERR_INVALID_CA = 24
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L243)  
```
X509_V_ERR_PATH_LENGTH_EXCEEDED = 25
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L244)  
```
X509_V_ERR_INVALID_PURPOSE = 26
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L245)  
```
X509_V_ERR_CERT_UNTRUSTED = 27
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L246)  
```
X509_V_ERR_CERT_REJECTED = 28
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L247)  
```
X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L248)  
```
X509_V_ERR_AKID_SKID_MISMATCH = 30
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L249)  
```
X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH = 31
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L250)  
```
X509_V_ERR_KEYUSAGE_NO_CERTSIGN = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L251)  
```
X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER = 33
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L252)  
```
X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION = 34
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L253)  
```
X509_V_ERR_APPLICATION_VERIFICATION = 50
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L254)  
```
SSL_FILETYPE_ASN1 = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L255)  
```
SSL_FILETYPE_PEM = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L256)  
```
EVP_PKEY_RSA = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L257)  
```
MD5_CBLOCK = 64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L735) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L735)  
```
MD5_LBLOCK = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L736) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L736)  
```
MD5_DIGEST_LENGTH = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L737) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L737)   Procs
-----

  
```
proc TLSv1_method(): PSSL_METHOD {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L263)  
```
proc SSL_library_init(): cint {...}{.discardable, raises: [Exception, LibraryError],
                                tags: [RootEffect].}
```
  Initialize SSL using OPENSSL\_init\_ssl for OpenSSL >= 1.1.0 otherwise SSL\_library\_init [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L372) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L372)  
```
proc SSL_load_error_strings() {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L383)  
```
proc SSLv23_client_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L388)  
```
proc SSLv23_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L391)  
```
proc SSLv2_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                   tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L394)  
```
proc SSLv3_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                   tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L397)  
```
proc TLS_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                 tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L400)  
```
proc TLS_client_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                        tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L403)  
```
proc TLS_server_method(): PSSL_METHOD {...}{.raises: [Exception, LibraryError],
                                        tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L406)  
```
proc OpenSSL_add_all_algorithms() {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L409)  
```
proc getOpenSSLVersion(): culong {...}{.raises: [Exception], tags: [RootEffect].}
```
  Return OpenSSL version as unsigned long or 0 if not available [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L414)  
```
proc SSL_in_init(ssl: SslPtr): cint {...}{.raises: [Exception, LibraryError],
                                      tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L421)  
```
proc SSL_CTX_set_ciphersuites(ctx: SslCtx; str: cstring): cint {...}{.
    raises: [Exception, LibraryError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L436)  
```
proc ERR_load_BIO_strings() {...}{.cdecl, dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L442)  
```
proc SSL_new(context: SslCtx): SslPtr {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L444)  
```
proc SSL_free(ssl: SslPtr) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L445)  
```
proc SSL_get_SSL_CTX(ssl: SslPtr): SslCtx {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L446) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L446)  
```
proc SSL_set_SSL_CTX(ssl: SslPtr; ctx: SslCtx): SslCtx {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L447)  
```
proc SSL_CTX_set_session_id_context(context: SslCtx; sid_ctx: string;
                                    sid_ctx_len: int) {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L448)  
```
proc SSL_get0_verified_chain(ssl: SslPtr): PSTACK {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L449)  
```
proc SSL_CTX_new(meth: PSSL_METHOD): SslCtx {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L451) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L451)  
```
proc SSL_CTX_load_verify_locations(ctx: SslCtx; CAfile: cstring; CApath: cstring): cint {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L453)  
```
proc SSL_CTX_free(arg0: SslCtx) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L455)  
```
proc SSL_CTX_set_verify(s: SslCtx; mode: int;
                        cb: proc (a: int; b: pointer): int {...}{.cdecl.}) {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L456)  
```
proc SSL_get_verify_result(ssl: SslPtr): int {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L457)  
```
proc SSL_CTX_set_cipher_list(s: SslCtx; ciphers: cstring): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L460)  
```
proc SSL_CTX_use_certificate_file(ctx: SslCtx; filename: cstring; typ: cint): cint {...}{.
    stdcall, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L461) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L461)  
```
proc SSL_CTX_use_certificate_chain_file(ctx: SslCtx; filename: cstring): cint {...}{.
    stdcall, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L463) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L463)  
```
proc SSL_CTX_use_PrivateKey_file(ctx: SslCtx; filename: cstring; typ: cint): cint {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L465)  
```
proc SSL_CTX_check_private_key(ctx: SslCtx): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L467)  
```
proc SSL_CTX_get_ex_new_index(argl: clong; argp: pointer; new_func: pointer;
                              dup_func: pointer; free_func: pointer): cint {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L470) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L470)  
```
proc SSL_CTX_set_ex_data(ssl: SslCtx; idx: cint; arg: pointer): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L471)  
```
proc SSL_CTX_get_ex_data(ssl: SslCtx; idx: cint): pointer {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L472) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L472)  
```
proc SSL_set_fd(ssl: SslPtr; fd: SocketHandle): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L474) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L474)  
```
proc SSL_shutdown(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L476)  
```
proc SSL_set_shutdown(ssl: SslPtr; mode: cint) {...}{.cdecl, dynlib: DLLSSLName,
    importc: "SSL_set_shutdown".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L477) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L477)  
```
proc SSL_get_shutdown(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc: "SSL_get_shutdown".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L478)  
```
proc SSL_connect(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L479)  
```
proc SSL_read(ssl: SslPtr; buf: pointer; num: int): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L480)  
```
proc SSL_write(ssl: SslPtr; buf: cstring; num: int): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L481)  
```
proc SSL_get_error(s: SslPtr; ret_code: cint): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L482) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L482)  
```
proc SSL_accept(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L483)  
```
proc SSL_pending(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L484) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L484)  
```
proc BIO_new_mem_buf(data: pointer; len: cint): BIO {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L486)  
```
proc BIO_new_ssl_connect(ctx: SslCtx): BIO {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L488)  
```
proc BIO_ctrl(bio: BIO; cmd: cint; larg: int; arg: cstring): int {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L490) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L490)  
```
proc BIO_get_ssl(bio: BIO; ssl: ptr SslPtr): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L492)  
```
proc BIO_set_conn_hostname(bio: BIO; name: cstring): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L494)  
```
proc BIO_do_handshake(bio: BIO): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L496) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L496)  
```
proc BIO_do_connect(bio: BIO): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L498)  
```
proc BIO_read(b: BIO; data: cstring; length: cint): cint {...}{.cdecl,
    dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L502)  
```
proc BIO_write(b: BIO; data: cstring; length: cint): cint {...}{.cdecl,
    dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L504) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L504)  
```
proc BIO_free(b: BIO): cint {...}{.cdecl, dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L507)  
```
proc ERR_print_errors_fp(fp: File) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L509) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L509)  
```
proc ERR_error_string(e: culong; buf: cstring): cstring {...}{.cdecl,
    dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L511)  
```
proc ERR_get_error(): culong {...}{.cdecl, dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L513) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L513)  
```
proc ERR_peek_last_error(): culong {...}{.cdecl, dynlib: DLLUtilName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L514)  
```
proc OPENSSL_config(configName: cstring) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L516) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L516)  
```
proc OPENSSL_sk_num(stack: PSTACK): int {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L518) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L518)  
```
proc OPENSSL_sk_value(stack: PSTACK; index: int): pointer {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L520)  
```
proc d2i_X509(px: ptr PX509; i: ptr ptr cuchar; len: cint): PX509 {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L523)  
```
proc i2d_X509(cert: PX509; o: ptr ptr cuchar): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L526)  
```
proc d2i_X509(b: string): PX509 {...}{.raises: [Exception], tags: [].}
```
  decode DER/BER bytestring into X.509 certificate struct [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L529)  
```
proc i2d_X509(cert: PX509): string {...}{.raises: [Exception], tags: [].}
```
  encode `cert` to DER string [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L537) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L537)  
```
proc CRYPTO_malloc_init() {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L560)  
```
proc SSL_CTX_ctrl(ctx: SslCtx; cmd: cint; larg: clong; parg: pointer): clong {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L564) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L564)  
```
proc SSLCTXSetMode(ctx: SslCtx; mode: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L570) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L570)  
```
proc SSL_ctrl(ssl: SslPtr; cmd: cint; larg: int; parg: pointer): int {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L573) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L573)  
```
proc SSL_set_tlsext_host_name(ssl: SslPtr; name: cstring): int {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L576)  
```
proc SSL_get_servername(ssl: SslPtr; typ: cint = TLSEXT_NAMETYPE_host_name): cstring {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  Retrieve the server name requested in the client hello. This can be used in the callback set in `SSL_CTX_set_tlsext_servername_callback` to implement virtual hosting. May return `nil`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L582) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L582)  
```
proc SSL_CTX_set_tlsext_servername_callback(ctx: SslCtx;
    cb: proc (ssl: SslPtr; cb_id: int; arg: pointer): int {...}{.cdecl.}): int {...}{.
    raises: [], tags: [].}
```
  Set the callback to be used on listening SSL connections when the client hello is received.

 The callback should return one of:

 * SSL\_TLSEXT\_ERR\_OK
* SSL\_TLSEXT\_ERR\_ALERT\_WARNING
* SSL\_TLSEXT\_ERR\_ALERT\_FATAL
* SSL\_TLSEXT\_ERR\_NOACK

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L587) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L587)  
```
proc SSL_CTX_set_tlsext_servername_arg(ctx: SslCtx; arg: pointer): int {...}{.
    raises: [], tags: [].}
```
  Set the pointer to be used in the callback registered to `SSL_CTX_set_tlsext_servername_callback`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L597)  
```
proc SSL_CTX_set_psk_client_callback(ctx: SslCtx; callback: PskClientCallback) {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  Set callback called when OpenSSL needs PSK (for client). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L609) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L609)  
```
proc SSL_CTX_set_psk_server_callback(ctx: SslCtx; callback: PskServerCallback) {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  Set callback called when OpenSSL needs PSK (for server). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L612) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L612)  
```
proc SSL_CTX_use_psk_identity_hint(ctx: SslCtx; hint: cstring): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  Set PSK identity hint to use. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L615)  
```
proc SSL_get_psk_identity(ssl: SslPtr): cstring {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  Get PSK identity. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L618) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L618)  
```
proc SSL_CTX_set_ecdh_auto(ctx: SslCtx; onoff: cint): cint {...}{.inline,
    raises: [Exception], tags: [RootEffect].}
```
  Set automatic curve selection.

 On OpenSSL >= 1.1.0 this is on by default and cannot be disabled.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L621) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L621)  
```
proc bioNew(b: PBIO_METHOD): BIO {...}{.cdecl, dynlib: DLLUtilName,
                                   importc: "BIO_new".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L630) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L630)  
```
proc bioFreeAll(b: BIO) {...}{.cdecl, dynlib: DLLUtilName, importc: "BIO_free_all".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L631) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L631)  
```
proc bioSMem(): PBIO_METHOD {...}{.cdecl, dynlib: DLLUtilName, importc: "BIO_s_mem".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L632)  
```
proc bioCtrlPending(b: BIO): cint {...}{.cdecl, dynlib: DLLUtilName,
                                    importc: "BIO_ctrl_pending".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L633) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L633)  
```
proc bioRead(b: BIO; Buf: cstring; length: cint): cint {...}{.cdecl,
    dynlib: DLLUtilName, importc: "BIO_read".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L634)  
```
proc bioWrite(b: BIO; Buf: cstring; length: cint): cint {...}{.cdecl,
    dynlib: DLLUtilName, importc: "BIO_write".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L636) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L636)  
```
proc sslSetConnectState(s: SslPtr) {...}{.cdecl, dynlib: DLLSSLName,
                                     importc: "SSL_set_connect_state".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L639)  
```
proc sslSetAcceptState(s: SslPtr) {...}{.cdecl, dynlib: DLLSSLName,
                                    importc: "SSL_set_accept_state".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L641)  
```
proc sslRead(ssl: SslPtr; buf: cstring; num: cint): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc: "SSL_read".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L644) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L644)  
```
proc sslPeek(ssl: SslPtr; buf: cstring; num: cint): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc: "SSL_peek".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L646)  
```
proc sslWrite(ssl: SslPtr; buf: cstring; num: cint): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc: "SSL_write".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L648) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L648)  
```
proc sslSetBio(ssl: SslPtr; rbio, wbio: BIO) {...}{.cdecl, dynlib: DLLSSLName,
    importc: "SSL_set_bio".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L651) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L651)  
```
proc sslDoHandshake(ssl: SslPtr): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc: "SSL_do_handshake".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L654) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L654)  
```
proc ErrClearError() {...}{.cdecl, dynlib: DLLUtilName, importc: "ERR_clear_error".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L659) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L659)  
```
proc ErrFreeStrings() {...}{.cdecl, dynlib: DLLUtilName, importc: "ERR_free_strings".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L660) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L660)  
```
proc ErrRemoveState(pid: cint) {...}{.cdecl, dynlib: DLLUtilName,
                                 importc: "ERR_remove_state".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L661) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L661)  
```
proc PEM_read_bio_RSA_PUBKEY(bp: BIO; x: ptr PRSA; pw: pem_password_cb;
                             u: pointer): PRSA {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L663)  
```
proc RSA_verify(kind: cint; origMsg: pointer; origMsgLen: cuint;
                signature: pointer; signatureLen: cuint; rsa: PRSA): cint {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L666)  
```
proc PEM_read_RSAPrivateKey(fp: pointer; x: ptr PRSA; cb: pem_password_cb;
                            u: pointer): PRSA {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L668)  
```
proc PEM_read_RSAPublicKey(fp: pointer; x: ptr PRSA; cb: pem_password_cb;
                           u: pointer): PRSA {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L670) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L670)  
```
proc PEM_read_bio_RSAPublicKey(bp: BIO; x: ptr PRSA; cb: pem_password_cb;
                               u: pointer): PRSA {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L672) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L672)  
```
proc PEM_read_bio_RSAPrivateKey(bp: BIO; x: ptr PRSA; cb: pem_password_cb;
                                u: pointer): PRSA {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L674) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L674)  
```
proc RSA_private_encrypt(flen: cint; fr: ptr cuchar; to: ptr cuchar; rsa: PRSA;
                         padding: PaddingType): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L676) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L676)  
```
proc RSA_public_encrypt(flen: cint; fr: ptr cuchar; to: ptr cuchar; rsa: PRSA;
                        padding: PaddingType): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L678) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L678)  
```
proc RSA_private_decrypt(flen: cint; fr: ptr cuchar; to: ptr cuchar; rsa: PRSA;
                         padding: PaddingType): cint {...}{.cdecl,
    dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L680) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L680)  
```
proc RSA_public_decrypt(flen: cint; fr: ptr cuchar; to: ptr cuchar; rsa: PRSA;
                        padding: PaddingType): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L682) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L682)  
```
proc RSA_free(rsa: PRSA) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L684) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L684)  
```
proc RSA_size(rsa: PRSA): cint {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L685) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L685)  
```
proc EVP_md_null(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L688)  
```
proc EVP_md2(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L689)  
```
proc EVP_md4(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L690) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L690)  
```
proc EVP_md5(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L691)  
```
proc EVP_sha(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L692) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L692)  
```
proc EVP_sha1(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L693)  
```
proc EVP_dss(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L694)  
```
proc EVP_dss1(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L695) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L695)  
```
proc EVP_ecdsa(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L696) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L696)  
```
proc EVP_sha224(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L697) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L697)  
```
proc EVP_sha256(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L698)  
```
proc EVP_sha384(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L699) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L699)  
```
proc EVP_sha512(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L700) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L700)  
```
proc EVP_mdc2(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L701)  
```
proc EVP_ripemd160(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L702)  
```
proc EVP_whirlpool(): EVP_MD {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L703) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L703)  
```
proc EVP_MD_size(md: EVP_MD): cint {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L704) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L704)  
```
proc HMAC(evp_md: EVP_MD; key: pointer; key_len: cint; d: cstring; n: csize_t;
          md: cstring; md_len: ptr cuint): cstring {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L707) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L707)  
```
proc PEM_read_bio_PrivateKey(bp: BIO; x: ptr EVP_PKEY; cb: pointer; u: pointer): EVP_PKEY {...}{.
    cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L710) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L710)  
```
proc EVP_PKEY_free(p: EVP_PKEY) {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L711) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L711)  
```
proc EVP_DigestSignInit(ctx: EVP_MD_CTX; pctx: ptr EVP_PKEY_CTX; typ: EVP_MD;
                        e: ENGINE; pkey: EVP_PKEY): cint {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L712)  
```
proc EVP_DigestInit_ex(ctx: EVP_MD_CTX; typ: PEVP_MD; engine: SslPtr = nil): cint {...}{.
    cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L713) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L713)  
```
proc EVP_DigestUpdate(ctx: EVP_MD_CTX; data: pointer; len: cuint): cint {...}{.cdecl,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L714) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L714)  
```
proc EVP_DigestFinal_ex(ctx: EVP_MD_CTX; buffer: pointer; size: ptr cuint): cint {...}{.
    cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L715) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L715)  
```
proc EVP_DigestSignFinal(ctx: EVP_MD_CTX; data: pointer; len: ptr csize_t): cint {...}{.
    cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L716)  
```
proc EVP_PKEY_CTX_new(pkey: EVP_PKEY; e: ENGINE): EVP_PKEY_CTX {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L717)  
```
proc EVP_PKEY_CTX_free(pkeyCtx: EVP_PKEY_CTX) {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L718)  
```
proc EVP_PKEY_sign_init(c: EVP_PKEY_CTX): cint {...}{.cdecl, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L719) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L719)  
```
proc EVP_MD_CTX_create(): EVP_MD_CTX {...}{.cdecl, importc: "EVP_MD_CTX_new".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L727)  
```
proc EVP_MD_CTX_destroy(ctx: EVP_MD_CTX) {...}{.cdecl, importc: "EVP_MD_CTX_free".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L728) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L728)  
```
proc EVP_MD_CTX_cleanup(ctx: EVP_MD_CTX): cint {...}{.cdecl,
    importc: "EVP_MD_CTX_cleanup".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L729) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L729)  
```
proc md5_Init(c: var MD5_CTX): cint {...}{.importc: "MD5_Init".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L745)  
```
proc md5_Update(c: var MD5_CTX; data: pointer; len: csize_t): cint {...}{.
    importc: "MD5_Update".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L746)  
```
proc md5_Final(md: cstring; c: var MD5_CTX): cint {...}{.importc: "MD5_Final".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L747) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L747)  
```
proc md5(d: ptr cuchar; n: csize_t; md: ptr cuchar): ptr cuchar {...}{.importc: "MD5".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L748) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L748)  
```
proc md5_Transform(c: var MD5_CTX; b: ptr cuchar) {...}{.importc: "MD5_Transform".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L749)  
```
proc md5_File(file: string): string {...}{.raises: [IOError, Exception],
                                      tags: [ReadIOEffect].}
```
  Generate MD5 hash for a file. Result is a 32 character [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L760)  
```
proc md5_Str(str: string): string {...}{.raises: [], tags: [].}
```
  Generate MD5 hash for a string. Result is a 32 character hex string with lowercase characters [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L780) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L780)  
```
proc SSL_get_peer_certificate(ssl: SslCtx): PX509 {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L806) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L806)  
```
proc X509_get_subject_name(a: PX509): PX509_NAME {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L809) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L809)  
```
proc X509_get_issuer_name(a: PX509): PX509_NAME {...}{.cdecl, dynlib: DLLUtilName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L811)  
```
proc X509_NAME_oneline(a: PX509_NAME; buf: cstring; size: cint): cstring {...}{.
    cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L813) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L813)  
```
proc X509_NAME_get_text_by_NID(subject: cstring; NID: cint; buf: cstring;
                               size: cint): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L816) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L816)  
```
proc X509_check_host(cert: PX509; name: cstring; namelen: cint; flags: cuint;
                     peername: cstring): cint {...}{.cdecl, dynlib: DLLSSLName,
    importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L819) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L819)  
```
proc X509_free(cert: PX509) {...}{.cdecl, dynlib: DLLSSLName, importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L821) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L821)  
```
proc X509_OBJECT_new(): PX509_OBJECT {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L830) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L830)  
```
proc X509_OBJECT_free(a: PX509_OBJECT) {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L831) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L831)  
```
proc X509_STORE_new(): PX509_STORE {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L833)  
```
proc X509_STORE_free(v: PX509_STORE) {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L834) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L834)  
```
proc X509_STORE_lock(ctx: PX509_STORE): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L835) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L835)  
```
proc X509_STORE_unlock(ctx: PX509_STORE): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L836) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L836)  
```
proc X509_STORE_up_ref(v: PX509_STORE): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L837) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L837)  
```
proc X509_STORE_set_flags(ctx: PX509_STORE; flags: culong): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L838) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L838)  
```
proc X509_STORE_set_purpose(ctx: PX509_STORE; purpose: cint): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L839)  
```
proc X509_STORE_set_trust(ctx: PX509_STORE; trust: cint): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L840) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L840)  
```
proc X509_STORE_add_cert(ctx: PX509_STORE; x: PX509): cint {...}{.importc.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/wrappers/openssl.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/wrappers/openssl.nim#L841)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/openssl.html>

ast
===

 Imports
-------

  <lineinfos>, <options>, <ropes>, <idents>, <idgen>, <int128>  Types
-----

  
```
TCallingConvention = enum
  ccNimCall = "nimcall", ccStdCall = "stdcall", ccCDecl = "cdecl",
  ccSafeCall = "safecall", ccSysCall = "syscall", ccInline = "inline",
  ccNoInline = "noinline", ccFastCall = "fastcall", ccThisCall = "thiscall",
  ccClosure = "closure", ccNoConvention = "noconv"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L19)  
```
TNodeKind = enum
  nkNone, nkEmpty, nkIdent, nkSym, nkType, nkCharLit, nkIntLit, nkInt8Lit,
  nkInt16Lit, nkInt32Lit, nkInt64Lit, nkUIntLit, nkUInt8Lit, nkUInt16Lit,
  nkUInt32Lit, nkUInt64Lit, nkFloatLit, nkFloat32Lit, nkFloat64Lit,
  nkFloat128Lit, nkStrLit, nkRStrLit, nkTripleStrLit, nkNilLit, nkComesFrom,
  nkDotCall, nkCommand, nkCall, nkCallStrLit, nkInfix, nkPrefix, nkPostfix,
  nkHiddenCallConv, nkExprEqExpr, nkExprColonExpr, nkIdentDefs, nkVarTuple,
  nkPar, nkObjConstr, nkCurly, nkCurlyExpr, nkBracket, nkBracketExpr,
  nkPragmaExpr, nkRange, nkDotExpr, nkCheckedFieldExpr, nkDerefExpr, nkIfExpr,
  nkElifExpr, nkElseExpr, nkLambda, nkDo, nkAccQuoted, nkTableConstr, nkBind,
  nkClosedSymChoice, nkOpenSymChoice, nkHiddenStdConv, nkHiddenSubConv, nkConv,
  nkCast, nkStaticExpr, nkAddr, nkHiddenAddr, nkHiddenDeref, nkObjDownConv,
  nkObjUpConv, nkChckRangeF, nkChckRange64, nkChckRange, nkStringToCString,
  nkCStringToString, nkAsgn, nkFastAsgn, nkGenericParams, nkFormalParams,
  nkOfInherit, nkImportAs, nkProcDef, nkMethodDef, nkConverterDef, nkMacroDef,
  nkTemplateDef, nkIteratorDef, nkOfBranch, nkElifBranch, nkExceptBranch,
  nkElse, nkAsmStmt, nkPragma, nkPragmaBlock, nkIfStmt, nkWhenStmt, nkForStmt,
  nkParForStmt, nkWhileStmt, nkCaseStmt, nkTypeSection, nkVarSection,
  nkLetSection, nkConstSection, nkConstDef, nkTypeDef, nkYieldStmt, nkDefer,
  nkTryStmt, nkFinally, nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt,
  nkBlockStmt, nkStaticStmt, nkDiscardStmt, nkStmtList, nkImportStmt,
  nkImportExceptStmt, nkExportStmt, nkExportExceptStmt, nkFromStmt,
  nkIncludeStmt, nkBindStmt, nkMixinStmt, nkUsingStmt, nkCommentStmt,
  nkStmtListExpr, nkBlockExpr, nkStmtListType, nkBlockType, nkWith, nkWithout,
  nkTypeOfExpr, nkObjectTy, nkTupleTy, nkTupleClassTy, nkTypeClassTy,
  nkStaticTy, nkRecList, nkRecCase, nkRecWhen, nkRefTy, nkPtrTy, nkVarTy,
  nkConstTy, nkMutableTy, nkDistinctTy, nkProcTy, nkIteratorTy, nkSharedTy,
  nkEnumTy, nkEnumFieldDef, nkArgList, nkPattern, nkHiddenTryStmt, nkClosure,
  nkGotoState, nkState, nkBreakState, nkFuncDef, nkTupleConstr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L33)  
```
TNodeKinds = set[TNodeKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L225)  
```
TSymFlag = enum
  sfUsed, sfExported, sfFromGeneric, sfGlobal, sfForward, sfWasForwarded,
  sfImportc, sfExportc, sfMangleCpp, sfVolatile, sfRegister, sfPure,
  sfNoSideEffect, sfSideEffect, sfMainModule, sfSystemModule, sfNoReturn,
  sfAddrTaken, sfCompilerProc, sfProcvar, sfDiscriminant, sfRequiresInit,
  sfDeprecated, sfExplain, sfError, sfShadowed, sfThread, sfCompileTime,
  sfConstructor, sfDispatcher, sfBorrow, sfInfixCall, sfNamedParamCall,
  sfDiscardable, sfOverriden, sfCallsite, sfGenSym, sfNonReloadable,
  sfGeneratedOp, sfTemplateParam, sfCursor, sfInjectDestructors, sfNeverRaises,
  sfUsedInFinallyOrExcept, sfSingleUsedTemp, sfNoalias
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L228)  
```
TSymFlags = set[TSymFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L295)  
```
TTypeKind = enum
  tyNone, tyBool, tyChar, tyEmpty, tyAlias, tyNil, tyUntyped, tyTyped,
  tyTypeDesc, tyGenericInvocation, tyGenericBody, tyGenericInst, tyGenericParam,
  tyDistinct, tyEnum, tyOrdinal, tyArray, tyObject, tyTuple, tySet, tyRange,
  tyPtr, tyRef, tyVar, tySequence, tyProc, tyPointer, tyOpenArray, tyString,
  tyCString, tyForward, tyInt, tyInt8, tyInt16, tyInt32, tyInt64, tyFloat,
  tyFloat32, tyFloat64, tyFloat128, tyUInt, tyUInt8, tyUInt16, tyUInt32,
  tyUInt64, tyOwned, tySink, tyLent, tyVarargs, tyUncheckedArray, tyProxy,
  tyBuiltInTypeClass, tyUserTypeClass, tyUserTypeClassInst,
  tyCompositeTypeClass, tyInferred, tyAnd, tyOr, tyNot, tyAnything, tyStatic,
  tyFromExpr, tyOptDeprecated, tyVoid
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L343)  
```
TTypeKinds = set[TTypeKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L460)  
```
TNodeFlag = enum
  nfNone, nfBase2, nfBase8, nfBase16, nfAllConst, nfTransf, nfNoRewrite, nfSem,
  nfLL, nfDotField, nfDotSetter, nfExplicitCall, nfExprCall, nfIsRef, nfIsPtr,
  nfPreventCg, nfBlockArg, nfFromTemplate, nfDefaultParam, nfDefaultRefsParam,
  nfExecuteOnReload
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L462)  
```
TNodeFlags = set[TNodeFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L488)  
```
TTypeFlag = enum
  tfVarargs, tfNoSideEffect, tfFinal, tfInheritable, tfHasOwned, tfEnumHasHoles,
  tfShallow, tfThread, tfFromGeneric, tfUnresolved, tfResolved, tfRetType,
  tfCapturesEnv, tfByCopy, tfByRef, tfIterator, tfPartial, tfNotNil,
  tfRequiresInit, tfNeedsFullInit, tfVarIsPtr, tfHasMeta, tfHasGCedMem,
  tfPacked, tfHasStatic, tfGenericTypeParam, tfImplicitTypeParam,
  tfInferrableStatic, tfConceptMatchedTypeSym, tfExplicit, tfWildcard,
  tfHasAsgn, tfBorrowDot, tfTriggersCompileTime, tfRefsAnonObj, tfCovariant,
  tfWeakCovariant, tfContravariant, tfCheckedForDestructor, tfAcyclic,
  tfIncompleteStruct, tfCompleteStruct, tfExplicitCallConv
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L489) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L489)  
```
TTypeFlags = set[TTypeFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L557)  
```
TSymKind = enum
  skUnknown, skConditional, skDynLib, skParam, skGenericParam, skTemp, skModule,
  skType, skVar, skLet, skConst, skResult, skProc, skFunc, skMethod, skIterator,
  skConverter, skMacro, skTemplate, skField, skEnumField, skForVar, skLabel,
  skStub, skPackage, skAlias
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L559)  
```
TSymKinds = set[TSymKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L592)  
```
TMagic = enum
  mNone, mDefined, mDeclared, mDeclaredInScope, mCompiles, mArrGet, mArrPut,
  mAsgn, mLow, mHigh, mSizeOf, mAlignOf, mOffsetOf, mTypeTrait, mIs, mOf, mAddr,
  mType, mTypeOf, mPlugin, mEcho, mShallowCopy, mSlurp, mStaticExec, mStatic,
  mParseExprToAst, mParseStmtToAst, mExpandToAst, mQuoteAst, mInc, mDec, mOrd,
  mNew, mNewFinalize, mNewSeq, mNewSeqOfCap, mLengthOpenArray, mLengthStr,
  mLengthArray, mLengthSeq, mIncl, mExcl, mCard, mChr, mGCref, mGCunref, mAddI,
  mSubI, mMulI, mDivI, mModI, mSucc, mPred, mAddF64, mSubF64, mMulF64, mDivF64,
  mShrI, mShlI, mAshrI, mBitandI, mBitorI, mBitxorI, mMinI, mMaxI, mAddU, mSubU,
  mMulU, mDivU, mModU, mEqI, mLeI, mLtI, mEqF64, mLeF64, mLtF64, mLeU, mLtU,
  mEqEnum, mLeEnum, mLtEnum, mEqCh, mLeCh, mLtCh, mEqB, mLeB, mLtB, mEqRef,
  mLePtr, mLtPtr, mXor, mEqCString, mEqProc, mUnaryMinusI, mUnaryMinusI64,
  mAbsI, mNot, mUnaryPlusI, mBitnotI, mUnaryPlusF64, mUnaryMinusF64, mCharToStr,
  mBoolToStr, mIntToStr, mInt64ToStr, mFloatToStr, mCStrToStr, mStrToStr,
  mEnumToStr, mAnd, mOr, mImplies, mIff, mExists, mForall, mOld, mEqStr, mLeStr,
  mLtStr, mEqSet, mLeSet, mLtSet, mMulSet, mPlusSet, mMinusSet, mConStrStr,
  mSlice, mDotDot, mFields, mFieldPairs, mOmpParFor, mAppendStrCh,
  mAppendStrStr, mAppendSeqElem, mInSet, mRepr, mExit, mSetLengthStr,
  mSetLengthSeq, mIsPartOf, mAstToStr, mParallel, mSwap, mIsNil, mArrToSeq,
  mNewString, mNewStringOfCap, mParseBiggestFloat, mMove, mWasMoved, mDestroy,
  mDefault, mUnown, mIsolate, mAccessEnv, mReset, mArray, mOpenArray, mRange,
  mSet, mSeq, mVarargs, mRef, mPtr, mVar, mDistinct, mVoid, mTuple, mOrdinal,
  mInt, mInt8, mInt16, mInt32, mInt64, mUInt, mUInt8, mUInt16, mUInt32, mUInt64,
  mFloat, mFloat32, mFloat64, mFloat128, mBool, mChar, mString, mCstring,
  mPointer, mNil, mExpr, mStmt, mTypeDesc, mVoidType, mPNimrodNode, mSpawn,
  mDeepCopy, mIsMainModule, mCompileDate, mCompileTime, mProcCall, mCpuEndian,
  mHostOS, mHostCPU, mBuildOS, mBuildCPU, mAppType, mCompileOption,
  mCompileOptionArg, mNLen, mNChild, mNSetChild, mNAdd, mNAddMultiple, mNDel,
  mNKind, mNSymKind, mNccValue, mNccInc, mNcsAdd, mNcsIncl, mNcsLen, mNcsAt,
  mNctPut, mNctLen, mNctGet, mNctHasNext, mNctNext, mNIntVal, mNFloatVal,
  mNSymbol, mNIdent, mNGetType, mNStrVal, mNSetIntVal, mNSetFloatVal,
  mNSetSymbol, mNSetIdent, mNSetType, mNSetStrVal, mNLineInfo, mNNewNimNode,
  mNCopyNimNode, mNCopyNimTree, mStrToIdent, mNSigHash, mNSizeOf, mNBindSym,
  mNCallSite, mEqIdent, mEqNimrodNode, mSameNodeType, mGetImpl, mNGenSym,
  mNHint, mNWarning, mNError, mInstantiationInfo, mGetTypeInfo, mGetTypeInfoV2,
  mNimvm, mIntDefine, mStrDefine, mBoolDefine, mRunnableExamples, mException,
  mBuiltinType, mSymOwner, mUncheckedArray, mGetImplTransf,
  mSymIsInstantiationOf, mNodeId
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L610) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L610)  
```
PNode = ref TNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L716)  
```
TNodeSeq = seq[PNode]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L717) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L717)  
```
PType = ref TType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L718)  
```
PSym = ref TSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L719) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L719)  
```
TNode {...}{.final, acyclic.} = object
  when defined(useNodeIds):
      id*: int

  typ*: PType
  info*: TLineInfo
  flags*: TNodeFlags
  case kind*: TNodeKind
  of nkCharLit .. nkUInt64Lit:
      intVal*: BiggestInt

  of nkFloatLit .. nkFloat128Lit:
      floatVal*: BiggestFloat

  of nkStrLit .. nkTripleStrLit:
      strVal*: string

  of nkSym:
      sym*: PSym

  of nkIdent:
      ident*: PIdent

  else:
      sons*: TNodeSeq

  comment*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L720) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L720)  
```
TStrTable = object
  counter*: int
  data*: seq[PSym]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L741)  
```
TLocKind = enum
  locNone, locTemp, locLocalVar, locGlobalVar, locParam, locField, locExpr,
  locProc, locData, locCall, locOther
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L746) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L746)  
```
TLocFlag = enum
  lfIndirect, lfFullExternalName, lfNoDeepCopy, lfNoDecl, lfDynamicLib,
  lfExportLib, lfHeader, lfImportCompilerProc, lfSingleUse, lfEnforceDeref,
  lfPrepareForMutation
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L758) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L758)  
```
TStorageLoc = enum
  OnUnknown, OnStatic, OnStack, OnHeap
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L774) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L774)  
```
TLocFlags = set[TLocFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L780) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L780)  
```
TLoc = object
  k*: TLocKind
  storage*: TStorageLoc
  flags*: TLocFlags
  lode*: PNode
  r*: Rope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L781) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L781)  
```
TLibKind = enum
  libHeader, libDynamic
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L790) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L790)  
```
TLib = object
  kind*: TLibKind
  generated*: bool
  isOverriden*: bool
  name*: Rope
  path*: PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L793) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L793)  
```
CompilesId = int
```
  id that is used for the caching logic within `system.compiles`. See the seminst module. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L801) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L801)  
```
TInstantiation = object
  sym*: PSym
  concreteTypes*: seq[PType]
  compilesId*: CompilesId
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L803) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L803)  
```
PInstantiation = ref TInstantiation
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L808) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L808)  
```
TScope {...}{.acyclic.} = object
  depthLevel*: int
  symbols*: TStrTable
  parent*: PScope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L810) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L810)  
```
PScope = ref TScope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L815) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L815)  
```
PLib = ref TLib
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L817) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L817)  
```
TSym {...}{.acyclic.} = object of TIdObj
  case kind*: TSymKind
  of skType, skGenericParam:
      typeInstCache*: seq[PType]

  of routineKinds:
      procInstCache*: seq[PInstantiation]
      gcUnsafetyReason*: PSym
      transformedBody*: PNode

  of skModule, skPackage:
      usedGenerics*: seq[PInstantiation]
      tab*: TStrTable

  of skLet, skVar, skField, skForVar:
      guard*: PSym
      bitsize*: int
      alignment*: int

  else:
    nil
  magic*: TMagic
  typ*: PType
  name*: PIdent
  info*: TLineInfo
  owner*: PSym
  flags*: TSymFlags
  ast*: PNode
  options*: TOptions
  position*: int
  offset*: int
  loc*: TLoc
  annex*: PLib
  when hasFFI:
      cname*: string

  constraint*: PNode
  when defined(nimsuggest):
      allUsages*: seq[TLineInfo]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L818) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L818)  
```
TTypeSeq = seq[PType]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L884) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L884)  
```
TLockLevel = distinct int16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L885) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L885)  
```
TTypeAttachedOp = enum
  attachedDestructor, attachedAsgn, attachedSink, attachedTrace,
  attachedDispose, attachedDeepCopy
```
  as usual, order is important here [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L887) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L887)  
```
TType {...}{.acyclic.} = object of TIdObj
  kind*: TTypeKind
  callConv*: TCallingConvention
  flags*: TTypeFlags
  sons*: TTypeSeq
  n*: PNode
  owner*: PSym
  sym*: PSym
  attachedOps*: array[TTypeAttachedOp, PSym]
  methods*: seq[(int, PSym)]
  size*: BiggestInt
  align*: int16
  paddingAtEnd*: int16
  lockLevel*: TLockLevel
  loc*: TLoc
  typeInst*: PType
  uniqueId*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L895) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L895)  
```
TPair = object
  key*, val*: RootRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L928) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L928)  
```
TPairSeq = seq[TPair]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L931) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L931)  
```
TIdPair = object
  key*: PIdObj
  val*: RootRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L933)  
```
TIdPairSeq = seq[TIdPair]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L937) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L937)  
```
TIdTable = object
  counter*: int
  data*: TIdPairSeq
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L938) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L938)  
```
TIdNodePair = object
  key*: PIdObj
  val*: PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L942) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L942)  
```
TIdNodePairSeq = seq[TIdNodePair]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L946) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L946)  
```
TIdNodeTable = object
  counter*: int
  data*: TIdNodePairSeq
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L947) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L947)  
```
TNodePair = object
  h*: Hash
  key*: PNode
  val*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L951) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L951)  
```
TNodePairSeq = seq[TNodePair]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L956) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L956)  
```
TNodeTable = object
  counter*: int
  data*: TNodePairSeq
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L957) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L957)  
```
TObjectSeq = seq[RootRef]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L962) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L962)  
```
TObjectSet = object
  counter*: int
  data*: TObjectSeq
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L963) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L963)  
```
TImplication = enum
  impUnknown, impNo, impYes
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L967) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L967)   Vars
----

  
```
eqTypeFlags = {tfIterator, tfNotNil, tfVarIsPtr, tfGcSafe, tfNoSideEffect}
```
  type flags that are essential for type equality. This is now a variable because for emulation of version:1.0 we might exclude {tfGcSafe, tfNoSideEffect}. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L604) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L604)  
```
ggDebug: bool
```
  convenience switch for trying out things [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1063) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1063)   Consts
------

  
```
sfNoInit = sfMainModule
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L298)  
```
sfAllUntyped = sfVolatile
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L300)  
```
sfDirty = sfPure
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L303)  
```
sfAnon = sfDiscardable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L307)  
```
sfNoForward = sfRegister
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L312)  
```
sfReorder = sfForward
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L314)  
```
sfCompileToCpp = sfInfixCall
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L317)  
```
sfCompileToObjc = sfNamedParamCall
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L318)  
```
sfExperimental = sfOverriden
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L319)  
```
sfGoto = sfOverriden
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L320)  
```
sfWrittenTo = sfBorrow
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L321) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L321)  
```
sfEscapes = sfProcvar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L322)  
```
sfBase = sfDiscriminant
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L323)  
```
sfIsSelf = sfOverriden
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L324)  
```
sfCustomPragma = sfRegister
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L325)  
```
nkWhen = nkWhenStmt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L329)  
```
nkWhenExpr = nkWhenStmt
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L330)  
```
nkEffectList = nkArgList
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L331)  
```
exceptionEffects = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L333)  
```
requiresEffects = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L334)  
```
ensuresEffects = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L335)  
```
tagEffects = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L336)  
```
pragmasEffects = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L337)  
```
effectListLen = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L338)  
```
nkLastBlockStmts = {nkRaiseStmt, nkReturnStmt, nkBreakStmt, nkContinueStmt}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L339)  
```
tyPureObject = tyTuple
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L442) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L442)  
```
GcTypeKinds = {tyRef, tySequence, tyString}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L443)  
```
tyError = tyProxy
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L444)  
```
tyUnknown = tyFromExpr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L445) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L445)  
```
tyUnknownTypes = {tyProxy, tyFromExpr}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L447)  
```
tyTypeClasses = {tyBuiltInTypeClass, tyCompositeTypeClass, tyUserTypeClass,
                 tyUserTypeClassInst, tyAnd, tyOr, tyNot, tyAnything}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L449) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L449)  
```
tyMetaTypes = {tyUntyped, tyTypeDesc, tyGenericParam,
               tyBuiltInTypeClass..tyCompositeTypeClass, tyAnd..tyAnything}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L453)  
```
tyUserTypeClasses = {tyUserTypeClass, tyUserTypeClassInst}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L454) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L454)  
```
abstractVarRange = {tyGenericInst, tyRange, tyVar, tyDistinct, tyOrdinal,
                    tyTypeDesc, tyAlias, tyInferred, tySink, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L456) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L456)  
```
routineKinds = {skProc, skFunc, skMethod, skIterator, skConverter, skMacro,
                skTemplate}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L595)  
```
tfUnion = tfNoSideEffect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L597)  
```
tfGcSafe = tfThread
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L598)  
```
tfObjHasKids = tfEnumHasHoles
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L599) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L599)  
```
tfReturnsNew = tfInheritable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L600) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L600)  
```
skError = skUnknown
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L601) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L601)  
```
ctfeWhitelist = {mNone, mSucc, mPred, mInc, mDec, mOrd, mLengthOpenArray,
                 mLengthStr, mLengthArray, mLengthSeq, mArrGet, mArrPut, mAsgn,
                 mDestroy, mIncl, mExcl, mCard, mChr, mAddI, mSubI, mMulI,
                 mDivI, mModI, mAddF64, mSubF64, mMulF64, mDivF64, mShrI, mShlI,
                 mBitandI, mBitorI, mBitxorI, mMinI, mMaxI, mAddU, mSubU, mMulU,
                 mDivU, mModU, mEqI, mLeI, mLtI, mEqF64, mLeF64, mLtF64, mLeU,
                 mLtU, mEqEnum, mLeEnum, mLtEnum, mEqCh, mLeCh, mLtCh, mEqB,
                 mLeB, mLtB, mEqRef, mEqProc, mLePtr, mLtPtr, mEqCString, mXor,
                 mUnaryMinusI, mUnaryMinusI64, mAbsI, mNot, mUnaryPlusI,
                 mBitnotI, mUnaryPlusF64, mUnaryMinusF64, mCharToStr,
                 mBoolToStr, mIntToStr, mInt64ToStr, mFloatToStr, mCStrToStr,
                 mStrToStr, mEnumToStr, mAnd, mOr, mEqStr, mLeStr, mLtStr,
                 mEqSet, mLeSet, mLtSet, mMulSet, mPlusSet, mMinusSet,
                 mConStrStr, mAppendStrCh, mAppendStrStr, mAppendSeqElem,
                 mInSet, mRepr}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L688)  
```
OverloadableSyms = {skProc, skFunc, skMethod, skIterator, skConverter, skModule,
                    skTemplate, skMacro}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L975) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L975)  
```
GenericTypes: TTypeKinds = {tyGenericInvocation, tyGenericBody, tyGenericParam}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L978) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L978)  
```
StructuralEquivTypes: TTypeKinds = {tyNil, tyTuple, tyArray, tySet, tyRange,
                                    tyPtr, tyRef, tyVar, tyLent, tySequence,
                                    tyProc, tyOpenArray, tyVarargs}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L981) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L981)  
```
ConcreteTypes: TTypeKinds = {tyBool, tyChar, tyEnum, tyArray, tyObject, tySet,
                             tyTuple, tyRange, tyPtr, tyRef, tyVar, tyLent,
                             tySequence, tyProc, tyPointer, tyOpenArray,
                             tyString, tyCString, tyInt..tyInt64,
                             tyFloat..tyFloat128, tyUInt..tyUInt64}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L985) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L985)  
```
IntegralTypes = {tyBool, tyChar, tyEnum, tyInt..tyInt64, tyFloat..tyFloat128,
                 tyUInt..tyUInt64}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L992) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L992)  
```
ConstantDataTypes: TTypeKinds = {tyArray, tySet, tyTuple, tySequence}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L994) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L994)  
```
NilableTypes: TTypeKinds = {tyPointer, tyCString, tyRef, tyPtr, tyProc, tyProxy}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L996) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L996)  
```
PtrLikeKinds: TTypeKinds = {tyPointer, tyPtr}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L998) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L998)  
```
ExportableSymKinds = {skVar, skConst, skProc, skFunc, skMethod, skType,
                      skIterator, skMacro, skTemplate, skConverter, skEnumField,
                      skLet, skStub, skAlias}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L999) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L999)  
```
PersistentNodeFlags: TNodeFlags = {nfBase2, nfBase8, nfBase16, nfDotSetter,
                                   nfDotField, nfIsRef, nfIsPtr, nfPreventCg,
                                   nfLL, nfFromTemplate, nfDefaultRefsParam,
                                   nfExecuteOnReload}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1002) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1002)  
```
namePos = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1007) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1007)  
```
patternPos = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1008)  
```
genericParamsPos = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1009) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1009)  
```
paramsPos = 3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1010) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1010)  
```
pragmasPos = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1011) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1011)  
```
miscPos = 5
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1012) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1012)  
```
bodyPos = 6
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1013) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1013)  
```
resultPos = 7
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1014) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1014)  
```
dispatcherPos = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1015) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1015)  
```
nfAllFieldsSet = nfBase2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1017)  
```
nkCallKinds = {nkCall, nkInfix, nkPrefix, nkPostfix, nkCommand, nkCallStrLit,
               nkHiddenCallConv}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1019) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1019)  
```
nkIdentKinds = {nkIdent, nkSym, nkAccQuoted, nkOpenSymChoice, nkClosedSymChoice}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1021)  
```
nkPragmaCallKinds = {nkExprColonExpr, nkCall, nkCallStrLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1024) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1024)  
```
nkLiterals = {nkCharLit..nkTripleStrLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1025) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1025)  
```
nkFloatLiterals = {nkFloatLit..nkFloat128Lit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1026) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1026)  
```
nkLambdaKinds = {nkLambda, nkDo}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1027) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1027)  
```
declarativeDefs = {nkProcDef, nkFuncDef, nkMethodDef, nkIteratorDef,
                   nkConverterDef}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1028) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1028)  
```
routineDefs = {nkProcDef..nkIteratorDef, nkFuncDef}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1029) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1029)  
```
procDefs = {nkLambda..nkDo, nkProcDef..nkConverterDef, nkIteratorDef, nkFuncDef}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1030) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1030)  
```
nkSymChoices = {nkClosedSymChoice, nkOpenSymChoice}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1032) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1032)  
```
nkStrKinds = {nkStrLit..nkTripleStrLit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1033) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1033)  
```
skLocalVars = {skVar, skLet, skForVar, skParam, skResult}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1035)  
```
skProcKinds = {skProc, skFunc, skTemplate, skMacro, skIterator, skMethod,
               skConverter}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1036) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1036)  
```
GrowthFactor = 2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1215) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1215)  
```
StartSize = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1216) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1216)  
```
UnspecifiedLockLevel = -1'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1326) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1326)  
```
MaxLockLevel = 1000'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1327) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1327)  
```
UnknownLockLevel = 1001'i16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1328) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1328)  
```
AttachedOpToStr: array[TTypeAttachedOp, string] = ["=destroy", "=copy", "=sink",
    "=trace", "=dispose", "=deepcopy"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1329) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1329)   Procs
-----

  
```
proc getnimblePkg(a: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1044) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1044)  
```
proc getnimblePkgId(a: PSym): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1059) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1059)  
```
proc isCallExpr(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1067) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1067)  
```
proc len(n: Indexable): int {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1074) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1074)  
```
proc safeLen(n: PNode): int {...}{.inline, raises: [], tags: [].}
```
  works even for leaves. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1081) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1081)  
```
proc safeArrLen(n: PNode): int {...}{.inline, raises: [], tags: [].}
```
  works for array-like objects (strings passed as openArray in VM). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1086) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1086)  
```
proc add(father, son: Indexable)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1092) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1092)  
```
proc newNode(kind: TNodeKind): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1108) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1108)  
```
proc newNodeI(kind: TNodeKind; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1117)  
```
proc newNodeI(kind: TNodeKind; info: TLineInfo; children: int): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1126) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1126)  
```
proc newNodeIT(kind: TNodeKind; info: TLineInfo; typ: PType): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1137) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1137)  
```
proc newTree(kind: TNodeKind; children: varargs[PNode]): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1142) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1142)  
```
proc newTreeI(kind: TNodeKind; info: TLineInfo; children: varargs[PNode]): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1148) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1148)  
```
proc newTreeIT(kind: TNodeKind; info: TLineInfo; typ: PType;
               children: varargs[PNode]): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1154) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1154)  
```
proc newSym(symKind: TSymKind; name: PIdent; owner: PSym; info: TLineInfo;
            options: TOptions = {}): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1163)  
```
proc astdef(s: PSym): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1171) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1171)  
```
proc isMetaType(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1178) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1178)  
```
proc isUnresolvedStatic(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1183) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1183)  
```
proc linkTo(t: PType; s: PSym): PType {...}{.discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1186)  
```
proc linkTo(s: PSym; t: PType): PSym {...}{.discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1191)  
```
proc appendToModule(m: PSym; n: PNode) {...}{.raises: [], tags: [].}
```
  The compiler will use this internally to add nodes that will be appended to the module after the sem pass [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1204) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1204)  
```
proc copyStrTable(dest: var TStrTable; src: TStrTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1218) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1218)  
```
proc copyIdTable(dest: var TIdTable; src: TIdTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1223) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1223)  
```
proc copyObjectSet(dest: var TObjectSet; src: TObjectSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1228) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1228)  
```
proc discardSons(father: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1233) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1233)  
```
proc withInfo(n: PNode; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1239) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1239)  
```
proc newIdentNode(ident: PIdent; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1243) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1243)  
```
proc newSymNode(sym: PSym): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1248) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1248)  
```
proc newSymNode(sym: PSym; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1254) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1254)  
```
proc newIntNode(kind: TNodeKind; intVal: BiggestInt): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1260) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1260)  
```
proc newIntNode(kind: TNodeKind; intVal: Int128): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1264) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1264)  
```
proc lastSon(n: Indexable): Indexable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1268)  
```
proc skipTypes(t: PType; kinds: TTypeKinds): PType {...}{.raises: [], tags: [].}
```
  Used throughout the compiler code to test whether a type tree contains or doesn't contain a specific type/types - it is often the case that only the last child nodes of a type tree need to be searched. This is a really hot path within the compiler! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1270) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1270)  
```
proc newIntTypeNode(intVal: BiggestInt; typ: PType): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1278) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1278)  
```
proc newIntTypeNode(intVal: Int128; typ: PType): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1301) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1301)  
```
proc newFloatNode(kind: TNodeKind; floatVal: BiggestFloat): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1305) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1305)  
```
proc newStrNode(kind: TNodeKind; strVal: string): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1309) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1309)  
```
proc newStrNode(strVal: string; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1313) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1313)  
```
proc newProcNode(kind: TNodeKind; info: TLineInfo; body: PNode; params, name,
    pattern, genericParams, pragmas, exceptions: PNode): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1317) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1317)  
```
proc `$`(x: TLockLevel): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1332) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1332)  
```
proc `$`(s: PSym): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1337) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1337)  
```
proc newType(kind: TTypeKind; owner: PSym): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1343) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1343)  
```
proc newSons(father: Indexable; length: int)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1362) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1362)  
```
proc assignType(dest, src: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1371) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1371)  
```
proc copyType(t: PType; owner: PSym; keepId: bool): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1391) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1391)  
```
proc exactReplica(t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1400) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1400)  
```
proc copySym(s: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1402) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1402)  
```
proc createModuleAlias(s: PSym; newIdent: PIdent; info: TLineInfo;
                       options: TOptions): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1421) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1421)  
```
proc initStrTable(x: var TStrTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1436) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1436)  
```
proc newStrTable(): TStrTable {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1440) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1440)  
```
proc initIdTable(x: var TIdTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1443) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1443)  
```
proc newIdTable(): TIdTable {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1447) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1447)  
```
proc resetIdTable(x: var TIdTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1450) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1450)  
```
proc initObjectSet(x: var TObjectSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1456) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1456)  
```
proc initIdNodeTable(x: var TIdNodeTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1460) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1460)  
```
proc initNodeTable(x: var TNodeTable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1464) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1464)  
```
proc skipTypes(t: PType; kinds: TTypeKinds; maxIters: int): PType {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1468) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1468)  
```
proc skipTypesOrNil(t: PType; kinds: TTypeKinds): PType {...}{.raises: [], tags: [].}
```
  same as skipTypes but handles 'nil' [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1476) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1476)  
```
proc isGCedMem(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1483) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1483)  
```
proc propagateToOwner(owner, elem: PType; propagateHasAsgn = true) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1487) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1487)  
```
proc rawAddSon(father, son: PType; propagateHasAsgn = true) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1512) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1512)  
```
proc rawAddSonNoPropagationOfTypeFlags(father, son: PType) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1518) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1518)  
```
proc addSonNilAllowed(father, son: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1523) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1523)  
```
proc delSon(father: PNode; idx: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1528) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1528)  
```
proc copyNode(src: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1536) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1536)  
```
proc transitionSonsKind(n: PNode; kind: range[nkComesFrom .. nkTupleConstr]) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1563) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1563)  
```
proc transitionIntKind(n: PNode; kind: range[nkCharLit .. nkUInt64Lit]) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1567) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1567)  
```
proc transitionNoneToSym(n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1571) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1571)  
```
proc transitionGenericParamToType(s: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1585) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1585)  
```
proc transitionRoutineSymKind(s: PSym; kind: range[skProc .. skTemplate]) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1589) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1589)  
```
proc transitionToLet(s: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1595) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1595)  
```
proc shallowCopy(src: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1619) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1619)  
```
proc copyTree(src: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1624) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1624)  
```
proc copyTreeWithoutNode(src, skippedNode: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1631) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1631)  
```
proc hasSonWith(n: PNode; kind: TNodeKind): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1638) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1638)  
```
proc hasNilSon(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1644) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1644)  
```
proc containsNode(n: PNode; kinds: TNodeKinds): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1652) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1652)  
```
proc hasSubnodeWith(n: PNode; kind: TNodeKind): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1660) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1660)  
```
proc getInt(a: PNode): Int128 {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1669) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1669)  
```
proc getInt64(a: PNode): int64 {...}{.deprecated: "use getInt",
                                 raises: [ERecoverableError], tags: [].}
```
   **Deprecated:** use getInt  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1682) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1682)  
```
proc getFloat(a: PNode): BiggestFloat {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1689) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1689)  
```
proc getStr(a: PNode): string {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1700) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1700)  
```
proc getStrOrChar(a: PNode): string {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1715) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1715)  
```
proc isGenericRoutine(s: PSym): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1725) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1725)  
```
proc skipGenericOwner(s: PSym): PSym {...}{.raises: [], tags: [].}
```
  Generic instantiations are owned by their originating generic symbol. This proc skips such owners and goes straight to the owner of the generic itself (the module or the enclosing proc). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1732) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1732)  
```
proc originatingModule(s: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1741) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1741)  
```
proc isRoutine(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1745) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1745)  
```
proc isCompileTimeProc(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1748) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1748)  
```
proc isRunnableExamples(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1752) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1752)  
```
proc requiredParams(s: PSym): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1757) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1757)  
```
proc hasPattern(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1766) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1766)  
```
proc isAtom(n: PNode): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1775) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1775)  
```
proc isEmptyType(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  'void' and 'typed' types are often equivalent to 'nil' these days: [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1778) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1778)  
```
proc makeStmtList(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1782) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1782)  
```
proc skipStmtList(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1789) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1789)  
```
proc toVar(typ: PType; kind: TTypeKind): PType {...}{.raises: [], tags: [].}
```
  If `typ` is not a tyVar then it is converted into a `var <typ>` and returned. Otherwise `typ` is simply returned as-is. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1797) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1797)  
```
proc toRef(typ: PType): PType {...}{.raises: [], tags: [].}
```
  If `typ` is a tyObject then it is converted into a `ref <typ>` and returned. Otherwise `typ` is simply returned as-is. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1805) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1805)  
```
proc toObject(typ: PType): PType {...}{.raises: [], tags: [].}
```
  If `typ` is a tyRef then its immediate son is returned (which in many cases should be a `tyObject`). Otherwise `typ` is simply returned as-is. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1813) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1813)  
```
proc isImportedException(t: PType; conf: ConfigRef): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1821) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1821)  
```
proc isInfixAs(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1832) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1832)  
```
proc skipColon(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1835) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1835)  
```
proc findUnresolvedStatic(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1840) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1840)  
```
proc hasDisabledAsgn(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1860) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1860)  
```
proc isInlineIterator(typ: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1874) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1874)  
```
proc isClosureIterator(typ: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1877) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1877)  
```
proc isClosure(typ: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1880) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1880)  
```
proc isSinkParam(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1883) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1883)  
```
proc isSinkType(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1886) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1886)  
```
proc newProcType(info: TLineInfo; owner: PSym): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1889) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1889)  
```
proc addParam(procType: PType; param: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1898) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1898)  
```
proc canRaiseConservative(fn: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1910) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1910)  
```
proc canRaise(fn: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1916) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1916)  
```
proc toHumanStr(kind: TSymKind): string {...}{.raises: [], tags: [].}
```
  strips leading `sk` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1933) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1933)  
```
proc toHumanStr(kind: TTypeKind): string {...}{.raises: [], tags: [].}
```
  strips leading `tk` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1937) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1937)  
```
proc skipAddr(n: PNode): PNode {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1941) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1941)   Iterators
---------

  
```
iterator items(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1769) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1769)  
```
iterator pairs(n: PNode): tuple[i: int, n: PNode] {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1772) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1772)   Templates
---------

  
```
template `[]`(n: Indexable; i: int): Indexable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1098) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1098)  
```
template `[]=`(n: Indexable; i: int; x: Indexable)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1099) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1099)  
```
template `[]`(n: Indexable; i: BackwardsIndex): Indexable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1101) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1101)  
```
template `[]=`(n: Indexable; i: BackwardsIndex; x: Indexable)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1102) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1102)  
```
template previouslyInferred(t: PType): PType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1160) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1160)  
```
template fileIdx(c: PSym): FileIndex
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1196) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1196)  
```
template filename(c: PSym): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1200) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1200)  
```
template transitionSymKindCommon(k: TSymKind)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1574) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1574)  
```
template hasDestructor(t: PType): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1858) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1858)  
```
template incompleteType(t: PType): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1863) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1863)  
```
template typeCompleted(s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1866) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1866)  
```
template getBody(s: PSym): PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1869) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1869)  
```
template detailedInfo(sym: PSym): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1871) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1871)  
```
template destructor(t: PType): PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1903) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1903)  
```
template assignment(t: PType): PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1904) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1904)  
```
template asink(t: PType): PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ast.nim#L1905) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ast.nim#L1905)   Exports
-------

  [bitxor](int128#bitxor,Int128,Int128), [maskUInt16](int128#maskUInt16,Int128), [<](#), [<=](#), [high](int128#high.t,typedesc%5BInt128%5D), [castToUInt64](int128#castToUInt64,Int128), [shr](int128#shr,Int128,int), [toHex](int128#toHex,Int128), [==](int128#==,Int128,Int128), [+](int128#+,BiggestInt,Int128), [addInt128](int128#addInt128,string,Int128), [abs](int128#abs,Int128), [One](int128#One), [<=](#), [maskUInt64](int128#maskUInt64,Int128), [$](int128#%24,Int128), [toUInt8](int128#toUInt8,Int128), [inc](int128#inc,Int128,uint32), [<](#), [+=](int128#+=,Int128,Int128), [maskBytes](int128#maskBytes,Int128,int), [Ten](int128#Ten), [-](int128#-,Int128), [-](int128#-,Int128,BiggestInt), [\*=](int128#*=,Int128,int32), [Zero](int128#Zero), [toInt32](int128#toInt32,Int128), [==](int128#==,BiggestInt,Int128), [-=](int128#-=,Int128,Int128), [toInt64Checked](int128#toInt64Checked,Int128,int64), [+](int128#+,Int128,Int128), [parseDecimalInt128](int128#parseDecimalInt128,string,int), [toInt8](int128#toInt8,Int128), [toUInt16](int128#toUInt16,Int128), [mod](int128#mod,Int128,Int128), [toInt128](int128#toInt128,T), [shl](int128#shl,Int128,int), [maskUInt32](int128#maskUInt32,Int128), [toUInt32](int128#toUInt32,Int128), [fastLog2](int128#fastLog2,Int128), [toInt128](int128#toInt128,float64), [toUInt](int128#toUInt,Int128), [<](#), [bitor](int128#bitor,Int128,Int128), [<=](#), [toFloat64](int128#toFloat64,Int128), [-](int128#-,BiggestInt,Int128), [==](int128#==,Int128,BiggestInt), [\*=](int128#*=,Int128,Int128), [bitnot](int128#bitnot,Int128), [toInt64](int128#toInt64,Int128), [NegOne](int128#NegOne), [div](int128#div,Int128,Int128), [+](int128#+,Int128,BiggestInt), [\*](int128#*,Int128,int32), [toUInt64](int128#toUInt64,Int128), [low](int128#low.t,typedesc%5BInt128%5D), [addToHex](int128#addToHex,string,Int128), [-](int128#-,Int128,Int128), [maskUInt8](int128#maskUInt8,Int128), [divMod](int128#divMod,Int128,Int128), [bitand](int128#bitand,Int128,Int128), [Int128](int128#Int128), [cmp](int128#cmp,Int128,Int128), [\*](int128#*,Int128,Int128), [toInt16](int128#toInt16,Int128), [toInt](int128#toInt,Int128), [castToInt64](int128#castToInt64,Int128) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/ast.html>

astalgo
=======

 Imports
-------

  <ast>, <options>, <lineinfos>, <ropes>, <idents>, <rodutils>, <msgs>  Types
-----

  
```
TIIPair {...}{.final.} = object
  key*, val*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L98)  
```
TIIPairSeq = seq[TIIPair]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L101)  
```
TIITable {...}{.final.} = object
  counter*: int
  data*: TIIPairSeq
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L102)  
```
TIdentIter = object
  h*: Hash
  name*: PIdent
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L806) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L806)  
```
TTabIter = object
  h: Hash
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L853)   Consts
------

  
```
InvalidKey = -9223372036854775808
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L95)   Procs
-----

  
```
proc typekinds(t: PType) {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L34)  
```
proc skipConvCastAndClosure(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L113)  
```
proc sameValue(a, b: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L124)  
```
proc leValue(a, b: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L138)  
```
proc weakLeValue(a, b: PNode): TImplication {...}{.raises: [ERecoverableError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L153)  
```
proc lookupInRecord(n: PNode; field: PIdent): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L159)  
```
proc getModule(s: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L180)  
```
proc fromSystem(op: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L185)  
```
proc getSymFromList(list: PNode; ident: PIdent; start: int = 0): PSym {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L186)  
```
proc getNamedParamFromList(list: PNode; ident: PIdent): PSym {...}{.raises: [],
    tags: [].}
```
  Named parameters are special because a named parameter can be gensym'ed and then they have '`<number>' suffix that we need to ignore, see compiler / evaltempl.nim, snippet:
result.add newIdentNode(getIdent(c.ic, x.name.s & "`gensym" & $x.id), if c.instLines: actual.info else: templ.info)  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L220)  
```
proc hashNode(p: RootRef): Hash {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L234)  
```
proc mustRehash(length, counter: int): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L237)  
```
proc makeYamlString(s: string): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L251)  
```
proc lineInfoToStr(conf: ConfigRef; info: TLineInfo): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L278)  
```
proc treeToYaml(conf: ConfigRef; n: PNode; indent: int = 0;
                maxRecDepth: int = -1): Rope {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L391) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L391)  
```
proc typeToYaml(conf: ConfigRef; n: PType; indent: int = 0;
                maxRecDepth: int = -1): Rope {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L395) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L395)  
```
proc symToYaml(conf: ConfigRef; n: PSym; indent: int = 0; maxRecDepth: int = -1): Rope {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L399)  
```
proc debug(n: PSym; conf: ConfigRef = nil) {...}{.exportc: "debugSym", deprecated,
    raises: [Exception], tags: [RootEffect].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L639) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L639)  
```
proc debug(n: PType; conf: ConfigRef = nil) {...}{.exportc: "debugType", deprecated,
    raises: [Exception], tags: [RootEffect].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L647)  
```
proc debug(n: PNode; conf: ConfigRef = nil) {...}{.exportc: "debugNode", deprecated,
    raises: [Exception], tags: [RootEffect].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L655) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L655)  
```
proc nextTry(h, maxHash: Hash): Hash {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L663) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L663)  
```
proc objectSetContains(t: TObjectSet; obj: RootRef): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L669) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L669)  
```
proc objectSetIncl(t: var TObjectSet; obj: RootRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L693) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L693)  
```
proc objectSetContainsOrIncl(t: var TObjectSet; obj: RootRef): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L698) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L698)  
```
proc strTableContains(t: TStrTable; n: PSym): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L716) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L716)  
```
proc symTabReplace(t: var TStrTable; prevSym: PSym; newSym: PSym) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L745)  
```
proc strTableAdd(t: var TStrTable; n: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L755) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L755)  
```
proc strTableInclReportConflict(t: var TStrTable; n: PSym;
                                onConflictKeepOld = false): PSym {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L760) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L760)  
```
proc strTableIncl(t: var TStrTable; n: PSym; onConflictKeepOld = false): bool {...}{.
    discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L792) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L792)  
```
proc strTableGet(t: TStrTable; name: PIdent): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L796) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L796)  
```
proc nextIdentIter(ti: var TIdentIter; tab: TStrTable): PSym {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L810) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L810)  
```
proc initIdentIter(ti: var TIdentIter; tab: TStrTable; s: PIdent): PSym {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L823) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L823)  
```
proc nextIdentExcluding(ti: var TIdentIter; tab: TStrTable; excluding: IntSet): PSym {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L829) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L829)  
```
proc firstIdentExcluding(ti: var TIdentIter; tab: TStrTable; s: PIdent;
                         excluding: IntSet): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L845)  
```
proc nextIter(ti: var TTabIter; tab: TStrTable): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L856) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L856)  
```
proc initTabIter(ti: var TTabIter; tab: TStrTable): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L872) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L872)  
```
proc idTableHasObjectAsKey(t: TIdTable; key: PIdObj): bool {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L901) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L901)  
```
proc idTableGet(t: TIdTable; key: PIdObj): RootRef {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L906) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L906)  
```
proc idTableGet(t: TIdTable; key: int): RootRef {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L911)  
```
proc idTablePut(t: var TIdTable; key: PIdObj; val: RootRef) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L931) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L931)  
```
proc idNodeTableGet(t: TIdNodeTable; key: PIdObj): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L963) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L963)  
```
proc idNodeTablePut(t: var TIdNodeTable; key: PIdObj; val: PNode) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L979) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L979)  
```
proc initIiTable(x: var TIITable) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L999) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L999)  
```
proc iiTableGet(t: TIITable; key: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L1012) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L1012)  
```
proc iiTablePut(t: var TIITable; key, val: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L1027) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L1027)  
```
proc isAddrNode(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L1044) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L1044)  
```
proc listSymbolNames(symbols: openArray[PSym]): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L1052) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L1052)  
```
proc isDiscriminantField(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L1058) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L1058)   Iterators
---------

  
```
iterator items(tab: TStrTable): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L879) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L879)  
```
iterator pairs(t: TIdTable): tuple[key: int, value: RootRef] {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L916) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L916)  
```
iterator idTablePairs(t: TIdTable): tuple[key: PIdObj, val: RootRef] {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L950)  
```
iterator pairs(t: TIdNodeTable): tuple[key: PIdObj, val: PNode] {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L995) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L995)   Templates
---------

  
```
template debug(x: PSym | PType | PNode) {...}{.deprecated.}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L43)  
```
template debug(x: auto) {...}{.deprecated.}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L51)  
```
template mdbg(): bool {...}{.deprecated.}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/astalgo.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/astalgo.nim#L54)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/astalgo.html>

bitsets
=======

 Types
-----

  
```
TBitSet = seq[ElemType]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L15)   Consts
------

  
```
ElemSize = 8
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L19)   Procs
-----

  
```
proc bitSetIn(x: TBitSet; e: BiggestInt): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L39)  
```
proc bitSetIncl(x: var TBitSet; elem: BiggestInt) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L42)  
```
proc bitSetExcl(x: var TBitSet; elem: BiggestInt) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L47)  
```
proc bitSetInit(b: var TBitSet; length: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L51)  
```
proc bitSetUnion(x: var TBitSet; y: TBitSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L54)  
```
proc bitSetDiff(x: var TBitSet; y: TBitSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L57)  
```
proc bitSetSymDiff(x: var TBitSet; y: TBitSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L60)  
```
proc bitSetIntersect(x: var TBitSet; y: TBitSet) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L63)  
```
proc bitSetEquals(x, y: TBitSet): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L66)  
```
proc bitSetContains(x, y: TBitSet): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L72)  
```
proc bitSetCard(x: TBitSet): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/bitsets.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/bitsets.nim#L99)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/bitsets.html>

btrees
======

 BTree implementation with few features, but good enough for the Nim compiler's needs.

 Types
-----

  
```
BTree[Key; Val] = object
  root: Node[Key, Val]
  entries: int               ## number of key-value pairs
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L27)   Procs
-----

  
```
proc initBTree[Key, Val](): BTree[Key, Val]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L31)  
```
proc getOrDefault[Key, Val](b: BTree[Key, Val]; key: Key): Val
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L37)  
```
proc contains[Key, Val](b: BTree[Key, Val]; key: Key): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L48)  
```
proc add[Key, Val](b: var BTree[Key, Val]; key: Key; val: Val)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L111)  
```
proc hasNext[Key, Val](b: BTree[Key, Val]; index: int): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L138)  
```
proc next[Key, Val](b: BTree[Key, Val]; index: int): (Key, Val, int)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L148)  
```
proc len[Key, Val](b: BTree[Key, Val]): int {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L170)   Iterators
---------

  
```
iterator pairs[Key, Val](b: BTree[Key, Val]): (Key, Val)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/btrees.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/btrees.nim#L163)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/btrees.html>

ccgmerge
========

 This module implements the merge operation of 2 different C files. This is needed for incremental compilation.

 Imports
-------

  <ast>, <ropes>, <options>, <nimlexbase>, <cgendata>, <rodutils>, <llstream>, <modulegraphs>, <pathutils>  Procs
-----

  
```
proc genSectionStart(fs: TCFileSection; conf: ConfigRef): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L50)  
```
proc genSectionEnd(fs: TCFileSection; conf: ConfigRef): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L61)  
```
proc genSectionStart(ps: TCProcSection; conf: ConfigRef): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L65)  
```
proc genSectionEnd(ps: TCProcSection; conf: ConfigRef): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L72)  
```
proc genMergeInfo(m: BModule): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L102)  
```
proc readMergeInfo(cfilename: AbsoluteFile; m: BModule) {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
```
  reads the merge meta information into `m`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L243)  
```
proc mergeRequired(m: BModule): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L280)  
```
proc mergeFiles(cfilename: AbsoluteFile; m: BModule) {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
```
  merges the C file with the old version on hard disc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgmerge.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgmerge.nim#L290)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/ccgmerge.html>

ccgutils
========

 Imports
-------

  <ast>, <msgs>, <wordrecg>, <platform>, <trees>, <options>  Procs
-----

  
```
proc getPragmaStmt(n: PNode; w: TSpecialWord): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L16)  
```
proc stmtsContainPragma(n: PNode; w: TSpecialWord): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L27)  
```
proc hashString(conf: ConfigRef; s: string): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L30)  
```
proc makeSingleLineCString(s: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L57)  
```
proc mangle(name: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L63)   Templates
---------

  
```
template getUniqueType(key: PType): PType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgutils.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgutils.nim#L55)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/ccgutils.html>

cgen
====

 This module implements the C code generator.This include file contains the logic to produce constant string and seq literals. The code here is responsible that `const x = ["a", "b"]` works without hidden runtime creation code. The price is that seqs and strings are not purely a library implementation.Generates traversal procs for the C backend.Code specialization instead of the old, incredibly slow 'genericReset' implementation.Thread var support for crappy architectures that lack native support for thread local storage. (**Thank you Mac OS X!**)

 Imports
-------

  <ast>, <astalgo>, <trees>, <platform>, <magicsys>, <extccomp>, <options>, <nversion>, <nimsets>, <msgs>, <bitsets>, <idents>, <types>, <ccgutils>, <ropes>, <passes>, <wordrecg>, <treetab>, <cgmeth>, <rodutils>, <renderer>, <cgendata>, <ccgmerge>, <aliases>, <lowerings>, <ndi>, <lineinfos>, <pathutils>, <transf>, <enumtostr>, <injectdestructors>, <spawn>, <semparallel>, <modulegraphs>, <lineinfos>, <sighashes>, <modulegraphs>, <lowerings>, <dfa>, <parampatterns>  Consts
------

  
```
cgenPass = (myOpen, myProcess, myClose, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgen.nim#L2128) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2128)   Procs
-----

  
```
proc fillObjectFields(m: BModule; typ: PType) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgtypes.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgtypes.nim#L588)  
```
proc cgenWriteModules(backend: RootRef; config: ConfigRef) {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect,
    WriteDirEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgen.nim#L2114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgen.nim#L2114)   Templates
---------

  
```
template cgDeclFrmt(s: PSym): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ccgtypes.nim#L972) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ccgtypes.nim#L972)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/cgen.html>

cgendata
========

 This module contains the data structures for the C code generation phase.

 Imports
-------

  <ast>, <ropes>, <options>, <ndi>, <lineinfos>, <pathutils>, <modulegraphs>  Types
-----

  
```
TLabel = Rope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L17)  
```
TCFileSection = enum
  cfsMergeInfo, cfsHeaders, cfsFrameDefines, cfsForwardTypes, cfsTypes,
  cfsSeqTypes, cfsFieldInfo, cfsTypeInfo, cfsProcHeaders, cfsData, cfsVars,
  cfsProcs, cfsInitProc, cfsDatInitProc, cfsTypeInit1, cfsTypeInit2,
  cfsTypeInit3, cfsDebugInit, cfsDynLibInit, cfsDynLibDeinit
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L18)  
```
TCTypeKind = enum
  ctVoid, ctChar, ctBool, ctInt, ctInt8, ctInt16, ctInt32, ctInt64, ctFloat,
  ctFloat32, ctFloat64, ctFloat128, ctUInt, ctUInt8, ctUInt16, ctUInt32,
  ctUInt64, ctArray, ctPtrToArray, ctStruct, ctPtr, ctNimStr, ctNimSeq, ctProc,
  ctCString
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L42)  
```
TCFileSections = array[TCFileSection, Rope]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L49)  
```
TCProcSection = enum
  cpsLocals, cpsInit, cpsStmts
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L50)  
```
TCProcSections = array[TCProcSection, Rope]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L54)  
```
BModule = ref TCGen
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L55)  
```
BProc = ref TCProc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L56)  
```
TBlock = object
  id*: int
  label*: Rope
  sections*: TCProcSections
  isLoop*: bool
  nestedTryStmts*: int16
  nestedExceptStmts*: int16
  frameLen*: int16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L57)  
```
TCProcFlag = enum
  beforeRetNeeded, threadVarAccessed, hasCurFramePointer, noSafePoints,
  nimErrorFlagAccessed, nimErrorFlagDeclared, nimErrorFlagDisabled
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L67)  
```
TTypeSeq = seq[PType]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L103)  
```
TypeCache = Table[SigHash, Rope]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L104)  
```
TypeCacheWithOwner = Table[SigHash, tuple[str: Rope, owner: PSym]]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L105)  
```
CodegenFlag = enum
  preventStackTrace, usesThreadVars, frameDeclared, isHeaderFile,
  includesStringh, objHasKidsValid
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L107)  
```
BModuleList = ref object of RootObj
  mainModProcs*, mainModInit*, otherModsInit*, mainDatInit*: Rope
  mapping*: Rope
  modules*: seq[BModule]
  modulesClosed*: seq[BModule]
  forwardedProcs*: seq[PSym]
  generatedHeader*: BModule
  typeInfoMarker*: TypeCacheWithOwner
  typeInfoMarkerV2*: TypeCacheWithOwner
  config*: ConfigRef
  graph*: ModuleGraph
  strVersion*, seqVersion*: int
  nimtv*: Rope
  nimtvDeps*: seq[PType]
  nimtvDeclared*: IntSet
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L117)   Procs
-----

  
```
proc includeHeader(this: BModule; header: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L179)  
```
proc s(p: BProc; s: TCProcSection): var Rope {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L183)  
```
proc procSec(p: BProc; s: TCProcSection): var Rope {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L187)  
```
proc newProc(prc: PSym; module: BModule): BProc {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L191)  
```
proc newModuleList(g: ModuleGraph): BModuleList {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L202)   Iterators
---------

  
```
iterator cgenModules(g: BModuleList): BModule {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L206)   Templates
---------

  
```
template config(m: BModule): ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L176)  
```
template config(p: BProc): ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgendata.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgendata.nim#L177)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/cgendata.html>

cgmeth
======

 This module implements code generation for methods.

 Imports
-------

  <options>, <ast>, <msgs>, <idents>, <renderer>, <types>, <magicsys>, <sempass2>, <modulegraphs>, <lineinfos>  Procs
-----

  
```
proc getDispatcher(s: PSym): PSym {...}{.raises: [], tags: [].}
```
  can return nil if is has no dispatcher. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgmeth.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgmeth.nim#L38)  
```
proc methodCall(n: PNode; conf: ConfigRef): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgmeth.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgmeth.nim#L44)  
```
proc methodDef(g: ModuleGraph; s: PSym; fromCache: bool) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgmeth.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgmeth.nim#L160)  
```
proc generateMethodDispatchers(g: ModuleGraph): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cgmeth.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cgmeth.nim#L286)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/cgmeth.html>

closureiters
============

 Imports
-------

  <ast>, <msgs>, <idents>, <renderer>, <magicsys>, <lowerings>, <lambdalifting>, <modulegraphs>, <lineinfos>, <options>  Procs
-----

  
```
proc transformClosureIterator(g: ModuleGraph; fn: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/closureiters.nim#L1382) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/closureiters.nim#L1382)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/closureiters.html>

cmdlinehelper
=============

 Helpers for binaries that use compiler passes, e.g.: nim, nimsuggest, nimfix

 Imports
-------

  <options>, <idents>, <nimconf>, <extccomp>, <commands>, <msgs>, <lineinfos>, <modulegraphs>, <condsyms>, <pathutils>  Types
-----

  
```
NimProg = ref object
  suggestMode*: bool
  supportsStdinFile*: bool
  processCmdLine*: proc (pass: TCmdLinePass; cmd: string; config: ConfigRef)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L33)   Procs
-----

  
```
proc prependCurDir(f: AbsoluteFile): AbsoluteFile {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L18)  
```
proc addCmdPrefix(result: var string; kind: CmdLineKind) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L25)  
```
proc initDefinesProg(self: NimProg; conf: ConfigRef; name: string) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L38)  
```
proc processCmdLineAndProjectPath(self: NimProg; conf: ConfigRef) {...}{.
    raises: [Exception, OSError],
    tags: [RootEffect, ReadEnvEffect, ReadIOEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L42)  
```
proc loadConfigsAndRunMainCommand(self: NimProg; cache: IdentCache;
                                  conf: ConfigRef; graph: ModuleGraph): bool {...}{.raises: [
    OSError, IOError, Exception, KeyError, ValueError, ERecoverableError,
    EOFError], tags: [ReadIOEffect, ReadDirEffect, ReadEnvEffect, RootEffect,
                      WriteIOEffect, WriteEnvEffect, WriteDirEffect,
                      ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/cmdlinehelper.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/cmdlinehelper.nim#L58)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/cmdlinehelper.html>

commands
========

 Imports
-------

  <msgs>, <options>, <nversion>, <condsyms>, <extccomp>, <platform>, <wordrecg>, <nimblecmd>, <lineinfos>, <pathutils>, <incremental>, <ast>  Types
-----

  
```
TCmdLinePass = enum
  passCmd1, passCmd2, passPP
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L45)   Procs
-----

  
```
proc writeCommandLineUsage(conf: ConfigRef) {...}{.
    raises: [Exception, IOError, ValueError], tags: [RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L110)  
```
proc processSpecificNote(arg: string; state: TSpecialWord; pass: TCmdLinePass;
                         info: TLineInfo; orig: string; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L176)  
```
proc testCompileOptionArg(conf: ConfigRef; switch, arg: string; info: TLineInfo): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L237) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L237)  
```
proc testCompileOption(conf: ConfigRef; switch: string; info: TLineInfo): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L280)  
```
proc handleStdinInput(conf: ConfigRef) {...}{.raises: [OSError],
    tags: [ReadEnvEffect, ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L386) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L386)  
```
proc processSwitch(switch, arg: string; pass: TCmdLinePass; info: TLineInfo;
                   conf: ConfigRef) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, OSError, KeyError, EOFError, Exception, ValueError,
    IOError, ERecoverableError, Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect, ReadDirEffect, WriteDirEffect,
                               WriteEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L407) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L407)  
```
proc processCommand(switch: string; pass: TCmdLinePass; config: ConfigRef) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, OSError, KeyError,
    EOFError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
                      ReadDirEffect, WriteDirEffect, WriteEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L933)  
```
proc processSwitch(pass: TCmdLinePass; p: OptParser; config: ConfigRef) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, OSError, KeyError,
    EOFError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
                      ReadDirEffect, WriteDirEffect, WriteEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L939) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L939)  
```
proc processArgument(pass: TCmdLinePass; p: OptParser; argsCount: var int;
                     config: ConfigRef): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/commands.nim#L950) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/commands.nim#L950)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/commands.html>

condsyms
========

 Imports
-------

  <options>, <lineinfos>  Procs
-----

  
```
proc defineSymbol(symbols: StringTableRef; symbol: string;
                  value: string = "true") {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/condsyms.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/condsyms.nim#L18)  
```
proc undefSymbol(symbols: StringTableRef; symbol: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/condsyms.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/condsyms.nim#L21)  
```
proc countDefinedSymbols(symbols: StringTableRef): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/condsyms.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/condsyms.nim#L31)  
```
proc initDefines(symbols: StringTableRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/condsyms.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/condsyms.nim#L34)   Iterators
---------

  
```
iterator definedSymbolNames(symbols: StringTableRef): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/condsyms.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/condsyms.nim#L27)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/condsyms.html>

depends
=======

 Imports
-------

  <options>, <ast>, <ropes>, <idents>, <passes>, <modulepaths>, <pathutils>, <modulegraphs>  Consts
------

  
```
gendependPass = (myOpen, addDotDependency, nil, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/depends.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/depends.nim#L67)   Procs
-----

  
```
proc generateDot(graph: ModuleGraph; project: AbsoluteFile) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/depends.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/depends.nim#L48)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/depends.html>

dfa
===


Data flow analysis for Nim. We transform the AST into a linear list of instructions first to make this easier to handle: There are only 2 different branching instructions: 'goto X' is an unconditional goto, 'fork X' is a conditional goto (either the next instruction or 'X' can be taken). Exhaustive case statements are translated so that the last branch is transformed into an 'else' branch. `return` and `break` are all covered by 'goto'.

 Control flow through exception handling: Contrary to popular belief, exception handling doesn't cause many problems for this DFA representation, `raise` is a statement that `goes to` the outer `finally` or `except` if there is one, otherwise it is the same as `return`. Every call is treated as a call that can potentially `raise`. However, without a surrounding `try` we don't emit these `fork ReturnLabel` instructions in order to speed up the dataflow analysis passes.

 The data structures and algorithms used here are inspired by "A Graph–Free Approach to Data–Flow Analysis" by Markus Mohnen. <https://link.springer.com/content/pdf/10.1007/3-540-45937-5_6.pdf>

 Imports
-------

  <ast>, <types>, <lineinfos>, <renderer>, <asciitables>, <patterns>  Types
-----

  
```
InstrKind = enum
  goto, fork, def, use
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L37)  
```
Instr = object
  n*: PNode
  case kind*: InstrKind
  of goto, fork:
    dest*: int
  else:
    nil
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L39)  
```
ControlFlowGraph = seq[Instr]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L45)  
```
InstrTargetKind = enum
  None, Full, Partial
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L595) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L595)   Procs
-----

  
```
proc echoCfg(c: ControlFlowGraph; start = 0; last = -1) {...}{.deprecated,
    raises: [Exception], tags: [RootEffect].}
```
   **Deprecated**  echos the ControlFlowGraph for debugging purposes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L90)  
```
proc skipConvDfa(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L566) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L566)  
```
proc aliases(obj, field: PNode): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L576) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L576)  
```
proc instrTargets(insloc, loc: PNode): InstrTargetKind {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L598)  
```
proc isAnalysableFieldAccess(orig: PNode; owner: PSym): bool {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L605)  
```
proc constructCfg(s: PSym; body: PNode): ControlFlowGraph {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  constructs a control flow graph for `body`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/dfa.nim#L761) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/dfa.nim#L761)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/dfa.html>

docgen
======

 Imports
-------

  <ast>, <options>, <msgs>, <ropes>, <idents>, <wordrecg>, <syntaxes>, <renderer>, <lexer>, <trees>, <types>, <typesrenderer>, <astalgo>, <lineinfos>, <pathutils>, <trees>, <nimpaths>, <renderverbatim>  Types
-----

  
```
PDoc = ref TDocumentor
```
  Alias to type less. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L57)   Procs
-----

  
```
proc presentationPath(conf: ConfigRef; file: AbsoluteFile; isTitle = false): RelativeFile {...}{.raises: [
    Exception, KeyError, ValueError, IOError, ERecoverableError, OSError], tags: [
    RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  returns a relative file that will be appended to outDir [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L59)  
```
proc newDocumentor(filename: AbsoluteFile; cache: IdentCache; conf: ConfigRef;
                   outExt: string = HtmlExt; module: PSym = nil): PDoc {...}{.raises: [
    ValueError, OSError, KeyError, Exception, IOError, ERecoverableError], tags: [
    ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L165)  
```
proc documentRaises(cache: IdentCache; n: PNode) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1020) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1020)  
```
proc generateDoc(d: PDoc; n, orig: PNode; docFlags: DocFlags = kDefault) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, OSError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1038) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1038)  
```
proc generateJson(d: PDoc; n: PNode; includeComments: bool = true) {...}{.raises: [
    KeyError, Exception, ValueError, OSError, IOError, ERecoverableError], tags: [
    RootEffect, ReadEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1095) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1095)  
```
proc generateTags(d: PDoc; n: PNode; r: var Rope) {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1139) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1139)  
```
proc generateIndex(d: PDoc) {...}{.raises: [OSError, Exception, KeyError, ValueError,
                                       IOError, ERecoverableError], tags: [
    RootEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1254) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1254)  
```
proc writeOutput(d: PDoc; useWarning = false; groupedToc = false) {...}{.raises: [
    OSError, ValueError, Exception, IOError, ERecoverableError, KeyError], tags: [
    ReadEnvEffect, ReadIOEffect, ExecIOEffect, RootEffect, WriteIOEffect,
    ReadDirEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1268)  
```
proc writeOutputJson(d: PDoc; useWarning = false) {...}{.raises: [OSError,
    ValueError, Exception, IOError, ERecoverableError, KeyError], tags: [
    ReadEnvEffect, ReadIOEffect, ExecIOEffect, RootEffect, WriteIOEffect,
    ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1290) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1290)  
```
proc handleDocOutputOptions(conf: ConfigRef) {...}{.raises: [OSError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1312) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1312)  
```
proc commandDoc(cache: IdentCache; conf: ConfigRef) {...}{.raises: [OSError,
    Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect,
    ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1319) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1319)  
```
proc commandRst2Html(cache: IdentCache; conf: ConfigRef) {...}{.raises: [ValueError,
    OSError, KeyError, Exception, IOError, ERecoverableError], tags: [
    ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
    ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1343) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1343)  
```
proc commandRst2TeX(cache: IdentCache; conf: ConfigRef) {...}{.raises: [ValueError,
    OSError, KeyError, Exception, IOError, ERecoverableError], tags: [
    ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
    ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1346) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1346)  
```
proc commandJson(cache: IdentCache; conf: ConfigRef) {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1349) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1349)  
```
proc commandTags(cache: IdentCache; conf: ConfigRef) {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1370) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1370)  
```
proc commandBuildIndex(conf: ConfigRef; dir: string; outFile = RelativeFile"") {...}{.
    raises: [OSError, IOError, ValueError, Exception, ERecoverableError], tags: [
    ReadDirEffect, ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect,
    TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen.nim#L1391) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen.nim#L1391)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/docgen.html>

docgen2
=======

 Imports
-------

  <options>, <ast>, <msgs>, <passes>, <docgen>, <lineinfos>, <pathutils>, <modulegraphs>  Consts
------

  
```
docgen2Pass = (myOpen, processNode, close, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen2.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen2.nim#L77)  
```
docgen2JsonPass = (myOpenJson, processNodeJson, closeJson, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen2.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen2.nim#L78)   Procs
-----

  
```
proc finishDoc2Pass(project: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/docgen2.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/docgen2.nim#L81)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/docgen2.html>

enumtostr
=========

 Imports
-------

  <ast>, <idents>, <lineinfos>, <modulegraphs>, <magicsys>  Procs
-----

  
```
proc genEnumToStrProc(t: PType; info: TLineInfo; g: ModuleGraph): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/enumtostr.nim#L4) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/enumtostr.nim#L4)  
```
proc genCaseObjDiscMapping(t: PType; field: PSym; info: TLineInfo;
                           g: ModuleGraph): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/enumtostr.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/enumtostr.nim#L65)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/enumtostr.html>

evaltempl
=========

 Template evaluation engine. Now hygienic.

 Imports
-------

  <options>, <ast>, <astalgo>, <msgs>, <renderer>, <lineinfos>, <idents>  Consts
------

  
```
evalTemplateLimit = 1000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/evaltempl.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/evaltempl.nim#L144)   Procs
-----

  
```
proc wrapInComesFrom(info: TLineInfo; sym: PSym; res: PNode): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/evaltempl.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/evaltempl.nim#L146)  
```
proc evalTemplate(n: PNode; tmpl, genSymOwner: PSym; conf: ConfigRef;
                  ic: IdentCache; instID: ref int; fromHlo = false): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/evaltempl.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/evaltempl.nim#L168)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/evaltempl.html>

extccomp
========

 Imports
-------

  <ropes>, <platform>, <condsyms>, <options>, <msgs>, <lineinfos>, <pathutils>  Types
-----

  
```
TInfoCCProp = enum
  hasSwitchRange, hasComputedGoto, hasCpp, hasAssume, hasGcGuard, hasGnuAsm,
  hasDeclspec, hasAttribute
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L20)  
```
TInfoCCProps = set[TInfoCCProp]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L29)  
```
TInfoCC = tuple[name: string, objExt: string, optSpeed: string, optSize: string,
                compilerExe: string, cppCompiler: string, compileTmpl: string,
                buildGui: string, buildDll: string, buildLib: string,
                linkerExe: string, linkTmpl: string, includeCmd: string,
                linkDirCmd: string, linkLibCmd: string, debug: string,
                pic: string, asmStmtFrmt: string, structStmtFmt: string,
                produceAsm: string, cppXsupport: string, props: TInfoCCProps]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L30)   Consts
------

  
```
CC: array[succ(low(TSystemCC)) .. high(TSystemCC), TInfoCC] = [("gcc", "o",
    " -O3 -fno-ident", " -Os -fno-ident", "gcc", "g++",
    "-c $options $include -o $objfile $file", " -mwindows", " -shared",
    "ar rcs $libfile $objfiles", "",
    "$buildgui $builddll -o $exefile $objfiles $options", " -I", " -L", " -l$1",
    "", "-fPIC", "asm($1);$n", "$1 $3 $2 ",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel",
    "-std=gnu++14 -funsigned-char", {hasSwitchRange, hasComputedGoto, hasCpp,
                                     hasGcGuard, hasGnuAsm, hasAttribute}), (
    "switch_gcc", "o", " -O3 ", " -Os ", "aarch64-none-elf-gcc",
    "aarch64-none-elf-g++",
    "-w -MMD -MP -MF $dfile -c $options $include -o $objfile $file",
    " -mwindows", " -shared", "aarch64-none-elf-gcc-ar rcs $libfile $objfiles",
    "aarch64-none-elf-gcc",
    "$buildgui $builddll -Wl,-Map,$mapfile -o $exefile $objfiles $options",
    " -I", " -L", " -l$1", "", "-fPIE", "asm($1);$n", "$1 $3 $2 ",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel",
    "-std=gnu++14 -funsigned-char", {hasSwitchRange, hasComputedGoto, hasCpp,
                                     hasGcGuard, hasGnuAsm, hasAttribute}), (
    "llvm_gcc", "o", " -O3 -fno-ident", " -Os -fno-ident", "llvm-gcc",
    "llvm-g++", "-c $options $include -o $objfile $file", " -mwindows",
    " -shared", "llvm-ar rcs $libfile $objfiles", "",
    "$buildgui $builddll -o $exefile $objfiles $options", " -I", " -L", " -l$1",
    "", "-fPIC", "asm($1);$n", "$1 $3 $2 ",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel",
    "-std=gnu++14 -funsigned-char", {hasSwitchRange, hasComputedGoto, hasCpp,
                                     hasGcGuard, hasGnuAsm, hasAttribute}), (
    "clang", "o", " -O3 -fno-ident", " -Os -fno-ident", "clang", "clang++",
    "-c $options $include -o $objfile $file", " -mwindows", " -shared",
    "llvm-ar rcs $libfile $objfiles", "",
    "$buildgui $builddll -o $exefile $objfiles $options", " -I", " -L", " -l$1",
    "", "-fPIC", "asm($1);$n", "$1 $3 $2 ",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel",
    "-std=gnu++14 -funsigned-char", {hasSwitchRange, hasComputedGoto, hasCpp,
                                     hasGcGuard, hasGnuAsm, hasAttribute}), (
    "bcc", "obj", " -O3 -6 ", " -O1 -6 ", "bcc32c", "cpp32c",
    "-c $options $include -o$objfile $file", " -tW", " -tWD", "", "bcc32",
    "$options $buildgui $builddll -e$exefile $objfiles", " -I", "", "", "", "",
    "__asm{$n$1$n}$n", "$1 $2", "", "",
    {hasSwitchRange, hasComputedGoto, hasCpp, hasGcGuard, hasAttribute}), (
    "vcc", "obj", " /Ogityb2 ", " /O1 ", "cl", "cl",
    "/c$vccplatform $options $include /nologo /Fo$objfile $file",
    " /SUBSYSTEM:WINDOWS user32.lib ", " /LD", "lib /OUT:$libfile $objfiles",
    "cl",
    "$builddll$vccplatform /Fe$exefile $objfiles $buildgui /nologo $options",
    " /I", " /LIBPATH:", " $1.lib", " /RTC1 /Z7 ", "", "__asm{$n$1$n}$n",
    "$3$n$1 $2", "/Fa$asmfile", "", {hasCpp, hasAssume, hasDeclspec}), ("tcc",
    "o", "", "", "tcc", "", "-c $options $include -o $objfile $file",
    "-Wl,-subsystem=gui", " -shared", "", "tcc",
    "-o $exefile $options $buildgui $builddll $objfiles", " -I", "", "", " -g ",
    "", "asm($1);$n", "$1 $2",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel", "",
    {hasSwitchRange, hasComputedGoto, hasGnuAsm}), ("env", "o", " -O3 ",
    " -O1 ", "", "", "-c $ccenvflags $options $include -o $objfile $file", "",
    " -shared ", "", "cc", "-o $exefile $buildgui $builddll $objfiles $options",
    " -I", "", "", "", "", "__asm{$n$1$n}$n", "$1 $2", "", "", {hasGnuAsm}), (
    "icl", "obj", " /Ogityb2 ", " /O1 ", "icl", "cl",
    "/c$vccplatform $options $include /nologo /Fo$objfile $file",
    " /SUBSYSTEM:WINDOWS user32.lib ", " /LD", "lib /OUT:$libfile $objfiles",
    "icl",
    "$builddll$vccplatform /Fe$exefile $objfiles $buildgui /nologo $options",
    " /I", " /LIBPATH:", " $1.lib", " /RTC1 /Z7 ", "", "__asm{$n$1$n}$n",
    "$3$n$1 $2", "/Fa$asmfile", "", {hasCpp, hasAssume, hasDeclspec}), ("icc",
    "o", " -O3 -fno-ident", " -Os -fno-ident", "icc", "g++",
    "-c $options $include -o $objfile $file", " -mwindows", " -shared",
    "ar rcs $libfile $objfiles", "icc",
    "$buildgui $builddll -o $exefile $objfiles $options", " -I", " -L", " -l$1",
    "", "-fPIC", "asm($1);$n", "$1 $3 $2 ",
    "-Wa,-acdl=$asmfile -g -fverbose-asm -masm=intel",
    "-std=gnu++14 -funsigned-char", {hasSwitchRange, hasComputedGoto, hasCpp,
                                     hasGcGuard, hasGnuAsm, hasAttribute}), (
    "clang_cl", "obj", " /Ogityb2 ", " /O1 ", "clang-cl", "clang-cl",
    "/c$vccplatform $options $include /nologo /Fo$objfile $file",
    " /SUBSYSTEM:WINDOWS user32.lib ", " /LD", "lib /OUT:$libfile $objfiles",
    "clang-cl", "-fuse-ld=lld $builddll$vccplatform /Fe$exefile $objfiles $buildgui /nologo $options",
    " /I", " /LIBPATH:", " $1.lib", " /RTC1 /Z7 ", "", "__asm{$n$1$n}$n",
    "$3$n$1 $2", "/Fa$asmfile", "", {hasCpp, hasAssume, hasDeclspec})]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L269)  
```
hExt = ".h"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L282) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L282)   Procs
-----

  
```
proc nameToCC(name: string): TSystemCC {...}{.raises: [], tags: [].}
```
  Returns the kind of compiler referred to by `name`, or ccNone if the name doesn't refer to any known compiler. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L284) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L284)  
```
proc isVSCompatible(conf: ConfigRef): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L298)  
```
proc setCC(conf: ConfigRef; ccname: string; info: TLineInfo) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L327) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L327)  
```
proc addLinkOption(conf: ConfigRef; option: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L341)  
```
proc addCompileOption(conf: ConfigRef; option: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L344) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L344)  
```
proc addLinkOptionCmd(conf: ConfigRef; option: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L348)  
```
proc addCompileOptionCmd(conf: ConfigRef; option: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L351)  
```
proc initVars(conf: ConfigRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L354) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L354)  
```
proc completeCfilePath(conf: ConfigRef; cfile: AbsoluteFile;
                       createSubDir: bool = true): AbsoluteFile {...}{.
    raises: [OSError, IOError], tags: [ReadEnvEffect, ReadIOEffect,
                                       WriteDirEffect, ReadDirEffect,
                                       WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L363) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L363)  
```
proc toObjFile(conf: ConfigRef; filename: AbsoluteFile): AbsoluteFile {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L367) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L367)  
```
proc addFileToCompile(conf: ConfigRef; cf: Cfile) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L371)  
```
proc addLocalCompileOption(conf: ConfigRef; option: string;
                           nimfile: AbsoluteFile) {...}{.
    raises: [OSError, IOError, KeyError, Exception], tags: [ReadEnvEffect,
    ReadIOEffect, WriteDirEffect, ReadDirEffect, WriteIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L374) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L374)  
```
proc resetCompilationLists(conf: ConfigRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L381)  
```
proc addExternalFileToLink(conf: ConfigRef; filename: AbsoluteFile) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L389) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L389)  
```
proc execExternalProgram(conf: ConfigRef; cmd: string; msg = hintExecuting) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L396)  
```
proc ccHasSaneOverflow(conf: ConfigRef): bool {...}{.raises: [],
    tags: [ExecIOEffect, ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L505)  
```
proc getCompileCFileCmd(conf: ConfigRef; cfile: Cfile; isMainFile = false;
                        produceOutput = false): string {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, OSError], tags: [
    ReadEnvEffect, RootEffect, WriteIOEffect, ReadIOEffect, WriteDirEffect,
    ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L538) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L538)  
```
proc addExternalFileToCompile(conf: ConfigRef; c: var Cfile) {...}{.raises: [OSError,
    KeyError, Exception, IOError, ValueError, ERecoverableError, EOFError], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, RootEffect, WriteIOEffect,
    WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L646)  
```
proc addExternalFileToCompile(conf: ConfigRef; filename: AbsoluteFile) {...}{.raises: [
    OSError, IOError, KeyError, Exception, ValueError, ERecoverableError,
    EOFError], tags: [ReadEnvEffect, ReadIOEffect, WriteDirEffect,
                      ReadDirEffect, WriteIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L656) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L656)  
```
proc callCCompiler(conf: ConfigRef) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, OSError], tags: [ReadEnvEffect, RootEffect,
                                        WriteIOEffect, ReadIOEffect,
                                        WriteDirEffect, ReadDirEffect,
                                        ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L839)  
```
proc writeJsonBuildInstructions(conf: ConfigRef) {...}{.
    raises: [OSError, IOError, Exception, ValueError, ERecoverableError], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, WriteIOEffect, RootEffect,
    WriteDirEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L937) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L937)  
```
proc changeDetectedViaJsonBuildInstructions(conf: ConfigRef;
    projectfile: AbsoluteFile): bool {...}{.raises: [OSError, Exception], tags: [
    ReadEnvEffect, ReadIOEffect, ReadDirEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L1035)  
```
proc runJsonBuildInstructions(conf: ConfigRef; projectfile: AbsoluteFile) {...}{.
    raises: [OSError], tags: [ReadEnvEffect, ReadIOEffect, WriteIOEffect,
                              WriteDirEffect, ReadDirEffect, RootEffect,
                              ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L1071) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L1071)  
```
proc writeMapping(conf: ConfigRef; symbolMapping: Rope) {...}{.
    raises: [ValueError, OSError, IOError, Exception, ERecoverableError],
    tags: [WriteIOEffect, RootEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/extccomp.nim#L1122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/extccomp.nim#L1122)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/extccomp.html>

filter\_tmpl
============

 Imports
-------

  <llstream>, <ast>, <msgs>, <options>, <filters>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc filterTmpl(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile;
                call: PNode): PLLStream {...}{.
    raises: [KeyError, Exception, ValueError, IOError, ERecoverableError], tags: [
    ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filter_tmpl.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filter_tmpl.nim#L202)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/filter_tmpl.html>

filters
=======

 Imports
-------

  <llstream>, <idents>, <ast>, <msgs>, <options>, <renderer>, <pathutils>  Procs
-----

  
```
proc charArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: char): char {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filters.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filters.nim#L31)  
```
proc strArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: string): string {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filters.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filters.nim#L37)  
```
proc boolArg(conf: ConfigRef; n: PNode; name: string; pos: int; default: bool): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filters.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filters.nim#L43)  
```
proc filterStrip(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile;
                 call: PNode): PLLStream {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filters.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filters.nim#L50)  
```
proc filterReplace(conf: ConfigRef; stdin: PLLStream; filename: AbsoluteFile;
                   call: PNode): PLLStream {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/filters.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/filters.nim#L64)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/filters.html>

gorgeimpl
=========

 Module that implements `gorge` for the compiler.

 Imports
-------

  <msgs>, <options>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc opGorge(cmd, input, cache: string; info: TLineInfo; conf: ConfigRef): (
    string, int) {...}{.raises: [OSError, IOError, ValueError, Exception, ValueError,
                            Exception], tags: [ReadEnvEffect, ReadIOEffect,
    ExecIOEffect, RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/gorgeimpl.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/gorgeimpl.nim#L25)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/gorgeimpl.html>

guards
======

 This module implements the 'implies' relation for guards.

 Imports
-------

  <ast>, <astalgo>, <msgs>, <magicsys>, <nimsets>, <trees>, <types>, <renderer>, <idents>, <saturate>, <modulegraphs>, <options>, <lineinfos>, <int128>  Types
-----

  
```
Operators = object
  opNot*, opContains*, opLe*, opLt*, opAnd*, opOr*, opIsNil*, opEq*: PSym
  opAdd*, opSub*, opMul*, opDiv*, opLen*: PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L86)  
```
TModel = object
  s*: seq[PNode]
  o*: Operators
  beSmart*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L405)   Procs
-----

  
```
proc interestingCaseExpr(m: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L83)  
```
proc initOperators(g: ModuleGraph): Operators {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L90)  
```
proc buildCall(op: PSym; a: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L159)  
```
proc buildCall(op: PSym; a, b: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L164)  
```
proc lowBound(conf: ConfigRef; x: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L210)  
```
proc highBound(conf: ConfigRef; x: PNode; o: Operators): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L214)  
```
proc buildLe(o: Operators; a, b: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L252)  
```
proc canon(n: PNode; o: Operators): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L255)  
```
proc buildAdd(a: PNode; b: BiggestInt; o: Operators): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L332)  
```
proc addFact(m: var TModel; nn: PNode) {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L410) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L410)  
```
proc addFactNeg(m: var TModel; n: PNode) {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L423)  
```
proc sameTree(a, b: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L439) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L439)  
```
proc invalidateFacts(s: var seq[PNode]; n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L467)  
```
proc invalidateFacts(m: var TModel; n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L488) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L488)  
```
proc doesImply(facts: TModel; prop: PNode): TImplication {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L734) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L734)  
```
proc impliesNotNil(m: TModel; arg: PNode): TImplication {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L742) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L742)  
```
proc simpleSlice(a, b: PNode): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L745) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L745)  
```
proc proveLe(m: TModel; a, b: PNode): TImplication {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L979) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L979)  
```
proc addFactLe(m: var TModel; a, b: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L988) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L988)  
```
proc addFactLt(m: var TModel; a, b: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L991) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L991)  
```
proc addDiscriminantFact(m: var TModel; n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L1021) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L1021)  
```
proc addAsgnFact(m: var TModel; key, value: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L1028) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L1028)  
```
proc sameSubexprs(m: TModel; a, b: PNode): bool {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L1035) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L1035)  
```
proc addCaseBranchFacts(m: var TModel; n: PNode; i: int) {...}{.
    raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L1051) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L1051)  
```
proc checkFieldAccess(m: TModel; n: PNode; conf: ConfigRef) {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/guards.nim#L1072) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/guards.nim#L1072)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/guards.html>

idents
======

 Imports
-------

  <wordrecg>  Types
-----

  
```
TIdObj = object of RootObj
  id*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L18)  
```
PIdObj = ref TIdObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L21)  
```
PIdent = ref TIdent
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L22)  
```
TIdent {...}{.acyclic.} = object of TIdObj
  s*: string
  next*: PIdent
  h*: Hash
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L23)  
```
IdentCache = ref object
  buckets: array[0 .. 8192 - 1, PIdent]
  wordCounter: int
  idAnon*, idDelegator*, emptyIdent*: PIdent
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L28)   Procs
-----

  
```
proc resetIdentCache() {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L33)  
```
proc cmpIgnoreStyle(a, b: cstring; blen: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L35)  
```
proc getIdent(ic: IdentCache; identifier: cstring; length: int; h: Hash): PIdent {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L69)  
```
proc getIdent(ic: IdentCache; identifier: string): PIdent {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L99)  
```
proc getIdent(ic: IdentCache; identifier: string; h: Hash): PIdent {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L103)  
```
proc newIdentCache(): IdentCache {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L106)  
```
proc whichKeyword(id: PIdent): TSpecialWord {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idents.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idents.nim#L116)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/idents.html>

idgen
=====

 This module contains a simple persistent id generator.

 Imports
-------

  <idents>, <options>, <pathutils>  Vars
----

  
```
gFrontEndId: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L14)   Consts
------

  
```
debugIds = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L17)   Procs
-----

  
```
proc registerID(id: PIdObj) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L24)  
```
proc getID(): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L29)  
```
proc setId(id: int) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L33)  
```
proc idSynchronizationPoint(idRange: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L36)  
```
proc saveMaxIds(conf: ConfigRef; project: AbsoluteFile) {...}{.
    raises: [IOError, OSError], tags: [ReadEnvEffect, ReadIOEffect,
                                       WriteDirEffect, ReadDirEffect,
                                       WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L45)  
```
proc loadMaxIds(conf: ConfigRef; project: AbsoluteFile) {...}{.
    raises: [OSError, IOError, ValueError], tags: [ReadEnvEffect, ReadIOEffect,
    WriteDirEffect, ReadDirEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/idgen.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/idgen.nim#L50)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/idgen.html>

importer
========

 This module implements the symbol importing mechanism.

 Imports
-------

  <ast>, <astalgo>, <msgs>, <options>, <idents>, <lookups>, <semdata>, <modulepaths>, <sigmatch>, <lineinfos>  Procs
-----

  
```
proc readExceptSet(c: PContext; n: PNode): IntSet {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L16)  
```
proc importPureEnumField(c: PContext; s: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L23)  
```
proc importAllSymbols(c: PContext; fromMod: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L110)  
```
proc evalImport(c: PContext; n: PNode): PNode {...}{.raises: [Exception, ValueError,
    IOError, ERecoverableError, OSError, KeyError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L195)  
```
proc evalFrom(c: PContext; n: PNode): PNode {...}{.raises: [Exception, ValueError,
    IOError, ERecoverableError, OSError, KeyError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L219)  
```
proc evalImportExcept(c: PContext; n: PNode): PNode {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, OSError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/importer.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/importer.nim#L231)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/importer.html>

incremental
===========

 Basic type definitions the module graph needs in order to support incremental compilations.

 Imports
-------

  <options>, <lineinfos>  Types
-----

  
```
IncrementalCtx = object
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/incremental.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/incremental.nim#L191)   Consts
------

  
```
nimIncremental = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/incremental.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/incremental.nim#L13)   Templates
---------

  
```
template init(incr: IncrementalCtx)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/incremental.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/incremental.nim#L193)  
```
template addModuleDep(incr: var IncrementalCtx; conf: ConfigRef;
                      module, fileIdx: FileIndex; isIncludeFile: bool)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/incremental.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/incremental.nim#L195)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/incremental.html>

index
=====

 This module only exists to generate docs for the compiler. 


### links


* [main docs](../lib)
* [compiler user guide](../nimc)
* [Internals of the Nim Compiler](../intern)

 Imports
-------

  <nim> 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/index.html>

injectdestructors
=================

 Injects destructor calls into Nim code as well as an optimizer that optimizes copies to moves. This is implemented as an AST to AST transformation so that every backend benefits from it.See doc/destructors.rst for a spec of the implemented rewrite rules

 Imports
-------

  <ast>, <astalgo>, <msgs>, <renderer>, <magicsys>, <types>, <idents>, <options>, <dfa>, <lowerings>, <modulegraphs>, <msgs>, <lineinfos>, <parampatterns>, <sighashes>, <liftdestructors>, <optimizer>, <varpartitions>, <trees>  Procs
-----

  
```
proc injectDestructorCalls(g: ModuleGraph; owner: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/injectdestructors.nim#L1015) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/injectdestructors.nim#L1015)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/injectdestructors.html>

int128
======

 This module is for compiler internal use only. For reliable error messages and range checks, the compiler needs a data type that can hold all from `low(BiggestInt)` to `high(BiggestUInt)`, This type is for that purpose.

 Types
-----

  
```
Int128 = object
  udata: array[4, uint32]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L9) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L9)   Consts
------

  
```
Zero = (udata: [0'u, 0'u, 0'u, 0'u])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L20)  
```
One = (udata: [1'u, 0'u, 0'u, 0'u])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L21)  
```
Ten = (udata: [10'u, 0'u, 0'u, 0'u])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L22)  
```
NegOne = (udata: [4294967295'u, 4294967295'u, 4294967295'u, 4294967295'u])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L25)   Procs
-----

  
```
proc toInt128[T: SomeInteger | bool](arg: T): Int128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L32)  
```
proc toInt64(arg: Int128): int64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L66)  
```
proc toInt64Checked(arg: Int128; onError: int64): int64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L76)  
```
proc toInt32(arg: Int128): int32 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L85)  
```
proc toInt16(arg: Int128): int16 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L97)  
```
proc toInt8(arg: Int128): int8 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L109)  
```
proc toInt(arg: Int128): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L121)  
```
proc toUInt64(arg: Int128): uint64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L127)  
```
proc toUInt32(arg: Int128): uint32 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L132)  
```
proc toUInt16(arg: Int128): uint16 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L138)  
```
proc toUInt8(arg: Int128): uint8 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L144)  
```
proc toUInt(arg: Int128): uint {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L150)  
```
proc castToInt64(arg: Int128): int64 {...}{.raises: [], tags: [].}
```
  Conversion to int64 without range check. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L156)  
```
proc castToUInt64(arg: Int128): uint64 {...}{.raises: [], tags: [].}
```
  Conversion to uint64 without range check. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L160)  
```
proc addToHex(result: var string; arg: Int128) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L169)  
```
proc toHex(arg: Int128): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L175)  
```
proc inc(a: var Int128; y: uint32 = 1) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L178)  
```
proc cmp(a, b: Int128): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L189)  
```
proc `<`(a, b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L199)  
```
proc `<=`(a, b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L202)  
```
proc `==`(a, b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L205)  
```
proc bitnot(a: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L218) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L218)  
```
proc bitand(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L224)  
```
proc bitor(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L230)  
```
proc bitxor(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L236)  
```
proc `shr`(a: Int128; b: int): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L242)  
```
proc `shl`(a: Int128; b: int): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L268)  
```
proc `+`(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L291)  
```
proc `+=`(a: var Int128; b: Int128) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L301)  
```
proc `-`(a: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L304)  
```
proc `-`(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L308)  
```
proc `-=`(a: var Int128; b: Int128) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L311)  
```
proc abs(a: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L314)  
```
proc `*`(a: Int128; b: int32): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L337)  
```
proc `*=`(a: var Int128; b: int32): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L342)  
```
proc `*`(lhs, rhs: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L357) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L357)  
```
proc `*=`(a: var Int128; b: Int128) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L379)  
```
proc fastLog2(a: Int128): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L384)  
```
proc divMod(dividend, divisor: Int128): tuple[quotient, remainder: Int128] {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L394) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L394)  
```
proc `div`(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L444)  
```
proc `mod`(a, b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L448)  
```
proc addInt128(result: var string; value: Int128) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L452)  
```
proc `$`(a: Int128): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L475) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L475)  
```
proc parseDecimalInt128(arg: string; pos: int = 0): Int128 {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L478) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L478)  
```
proc `<`(a: Int128; b: BiggestInt): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L499) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L499)  
```
proc `<`(a: BiggestInt; b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L502)  
```
proc `<=`(a: Int128; b: BiggestInt): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L505) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L505)  
```
proc `<=`(a: BiggestInt; b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L508) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L508)  
```
proc `==`(a: Int128; b: BiggestInt): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L511) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L511)  
```
proc `==`(a: BiggestInt; b: Int128): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L514) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L514)  
```
proc `-`(a: BiggestInt; b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L517) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L517)  
```
proc `-`(a: Int128; b: BiggestInt): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L520)  
```
proc `+`(a: BiggestInt; b: Int128): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L523)  
```
proc `+`(a: Int128; b: BiggestInt): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L526) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L526)  
```
proc toFloat64(arg: Int128): float64 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L529) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L529)  
```
proc toInt128(arg: float64): Int128 {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L544)  
```
proc maskUInt64(arg: Int128): Int128 {...}{.noinit, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L559) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L559)  
```
proc maskUInt32(arg: Int128): Int128 {...}{.noinit, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L565)  
```
proc maskUInt16(arg: Int128): Int128 {...}{.noinit, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L571)  
```
proc maskUInt8(arg: Int128): Int128 {...}{.noinit, inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L577)  
```
proc maskBytes(arg: Int128; numbytes: int): Int128 {...}{.noinit, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L583) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L583)   Templates
---------

  
```
template low(t: typedesc[Int128]): Int128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L27)  
```
template high(t: typedesc[Int128]): Int128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/int128.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/int128.nim#L28)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/int128.html>

isolation\_check
================

 Implementation of the check that `recover` needs, see <https://github.com/nim-lang/RFCs/issues/244> for more details.

 Imports
-------

  <ast>, <types>, <renderer>, <idents>  Procs
-----

  
```
proc canAlias(arg, ret: PType): bool {...}{.raises: [Exception, ERecoverableError],
                                       tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/isolation_check.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/isolation_check.nim#L72)  
```
proc checkIsolate(n: PNode): bool {...}{.raises: [Exception, ERecoverableError],
                                    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/isolation_check.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/isolation_check.nim#L80)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/isolation_check.html>

jsgen
=====

 Type info generation for the JS backend.

 Imports
-------

  <ast>, <trees>, <magicsys>, <options>, <nversion>, <msgs>, <idents>, <types>, <ropes>, <passes>, <ccgutils>, <wordrecg>, <renderer>, <cgmeth>, <lowerings>, <sighashes>, <modulegraphs>, <lineinfos>, <rodutils>, <transf>, <injectdestructors>, <sourcemap>, <modulegraphs>  Consts
------

  
```
JSgenPass = (myOpen, myProcess, myClose, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/jsgen.nim#L2737) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/jsgen.nim#L2737)   Templates
---------

  
```
template config(p: PProc): ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/jsgen.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/jsgen.nim#L108)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/jsgen.html>

lambdalifting
=============

 Imports
-------

  <options>, <ast>, <astalgo>, <msgs>, <idents>, <renderer>, <types>, <magicsys>, <lowerings>, <modulegraphs>, <lineinfos>, <transf>, <liftdestructors>  Consts
------

  
```
upName = ":up"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L120)  
```
paramName = ":envP"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L121)  
```
envName = ":env"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L122)   Procs
-----

  
```
proc createClosureIterStateType(g: ModuleGraph; iter: PSym): PType {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L129)  
```
proc getClosureIterResult(g: ModuleGraph; iter: PSym): PSym {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L149)  
```
proc getEnvParam(routine: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L181)  
```
proc makeClosure(g: ModuleGraph; prc: PSym; env: PNode; info: TLineInfo): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L212)  
```
proc liftIterSym(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L247)  
```
proc freshVarForClosureIter(g: ModuleGraph; s, owner: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L274)  
```
proc getStateField(g: ModuleGraph; owner: PSym): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L688) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L688)  
```
proc semCaptureSym(s, owner: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L802) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L802)  
```
proc liftIterToProc(g: ModuleGraph; fn: PSym; body: PNode; ptrType: PType): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L839) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L839)  
```
proc liftLambdas(g: ModuleGraph; fn: PSym; body: PNode; tooEarly: var bool): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L853)  
```
proc liftLambdasForTopLevel(module: PSym; body: PNode): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L886) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L886)  
```
proc liftForLoop(g: ModuleGraph; body: PNode; owner: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L892) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L892)   Templates
---------

  
```
template isIterator(owner: PSym): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lambdalifting.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lambdalifting.nim#L232)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/lambdalifting.html>

lexer
=====

 Imports
-------

  <options>, <msgs>, <platform>, <idents>, <nimlexbase>, <llstream>, <wordrecg>, <lineinfos>, <pathutils>  Types
-----

  
```
TokType = enum
  tkInvalid = "tkInvalid", tkEof = "[EOF]", tkSymbol = "tkSymbol",
  tkAddr = "addr", tkAnd = "and", tkAs = "as", tkAsm = "asm", tkBind = "bind",
  tkBlock = "block", tkBreak = "break", tkCase = "case", tkCast = "cast",
  tkConcept = "concept", tkConst = "const", tkContinue = "continue",
  tkConverter = "converter", tkDefer = "defer", tkDiscard = "discard",
  tkDistinct = "distinct", tkDiv = "div", tkDo = "do", tkElif = "elif",
  tkElse = "else", tkEnd = "end", tkEnum = "enum", tkExcept = "except",
  tkExport = "export", tkFinally = "finally", tkFor = "for", tkFrom = "from",
  tkFunc = "func", tkIf = "if", tkImport = "import", tkIn = "in",
  tkInclude = "include", tkInterface = "interface", tkIs = "is",
  tkIsnot = "isnot", tkIterator = "iterator", tkLet = "let", tkMacro = "macro",
  tkMethod = "method", tkMixin = "mixin", tkMod = "mod", tkNil = "nil",
  tkNot = "not", tkNotin = "notin", tkObject = "object", tkOf = "of",
  tkOr = "or", tkOut = "out", tkProc = "proc", tkPtr = "ptr", tkRaise = "raise",
  tkRef = "ref", tkReturn = "return", tkShl = "shl", tkShr = "shr",
  tkStatic = "static", tkTemplate = "template", tkTry = "try",
  tkTuple = "tuple", tkType = "type", tkUsing = "using", tkVar = "var",
  tkWhen = "when", tkWhile = "while", tkXor = "xor", tkYield = "yield",
  tkIntLit = "tkIntLit", tkInt8Lit = "tkInt8Lit", tkInt16Lit = "tkInt16Lit",
  tkInt32Lit = "tkInt32Lit", tkInt64Lit = "tkInt64Lit", tkUIntLit = "tkUIntLit",
  tkUInt8Lit = "tkUInt8Lit", tkUInt16Lit = "tkUInt16Lit",
  tkUInt32Lit = "tkUInt32Lit", tkUInt64Lit = "tkUInt64Lit",
  tkFloatLit = "tkFloatLit", tkFloat32Lit = "tkFloat32Lit",
  tkFloat64Lit = "tkFloat64Lit", tkFloat128Lit = "tkFloat128Lit",
  tkStrLit = "tkStrLit", tkRStrLit = "tkRStrLit",
  tkTripleStrLit = "tkTripleStrLit", tkGStrLit = "tkGStrLit",
  tkGTripleStrLit = "tkGTripleStrLit", tkCharLit = "tkCharLit", tkParLe = "(",
  tkParRi = ")", tkBracketLe = "[", tkBracketRi = "]", tkCurlyLe = "{",
  tkCurlyRi = "}", tkBracketDotLe = "[.", tkBracketDotRi = ".]",
  tkCurlyDotLe = "{.", tkCurlyDotRi = ".}", tkParDotLe = "(.",
  tkParDotRi = ".)", tkComma = ",", tkSemiColon = ";", tkColon = ":",
  tkColonColon = "::", tkEquals = "=", tkDot = ".", tkDotDot = "..",
  tkBracketLeColon = "[:", tkOpr, tkComment, tkAccent = "`", tkSpaces,
  tkInfixOpr, tkPrefixOpr, tkPostfixOpr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L33)  
```
TokTypes = set[TokType]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L75)  
```
NumericalBase = enum
  base10, base2, base8, base16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L86)  
```
Token = object
  tokType*: TokType
  indent*: int
  ident*: PIdent
  iNumber*: BiggestInt
  fNumber*: BiggestFloat
  base*: NumericalBase
  strongSpaceA*: int8
  strongSpaceB*: int8
  literal*: string
  line*, col*: int
  when defined(nimpretty):
      offsetA*, offsetB*: int
      commentOffsetA*, commentOffsetB*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L91)  
```
ErrorHandler = proc (conf: ConfigRef; info: TLineInfo; msg: TMsgKind;
                     arg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L110)  
```
Lexer = object of TBaseLexer
  fileIdx*: FileIndex
  indentAhead*: int
  currLineIndent*: int
  strongSpaces*, allowTabs*: bool
  errorHandler*: ErrorHandler
  cache*: IdentCache
  when defined(nimsuggest):
      previousToken: TLineInfo

  config*: ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L111)   Consts
------

  
```
MaxLineLength = 80
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L23)  
```
numChars: set[char] = {'0'..'9', 'a'..'z', 'A'..'Z'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L24)  
```
SymChars: set[char] = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L25)  
```
SymStartChars: set[char] = {'a'..'z', 'A'..'Z', '\x80'..'\xFF'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L26)  
```
OpChars: set[char] = {'+', '-', '*', '/', '\\', '<', '>', '!', '?', '^', '.',
                      '|', '=', '%', '&', '$', '@', '~', ':'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L27)  
```
tokKeywordLow = tkAddr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L82)  
```
tokKeywordHigh = tkYield
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L83)   Procs
-----

  
```
proc getLineInfo(L: Lexer; tok: Token): TLineInfo {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L124)  
```
proc isKeyword(kind: TokType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L132)  
```
proc isNimIdentifier(s: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L137)  
```
proc `$`(tok: Token): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L147)  
```
proc prettyTok(tok: Token): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L159)  
```
proc printTok(conf: ConfigRef; tok: Token) {...}{.raises: [Exception, IOError],
    tags: [RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L163)  
```
proc initToken(L: var Token) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L166)  
```
proc openLexer(lex: var Lexer; fileIdx: FileIndex; inputstream: PLLStream;
               cache: IdentCache; config: ConfigRef) {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L192)  
```
proc openLexer(lex: var Lexer; filename: AbsoluteFile; inputstream: PLLStream;
               cache: IdentCache; config: ConfigRef) {...}{.
    raises: [IOError, Exception, KeyError],
    tags: [ReadIOEffect, RootEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L204)  
```
proc closeLexer(lex: var Lexer) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L208) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L208)  
```
proc lexMessage(L: Lexer; msg: TMsgKind; arg = "") {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L222) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L222)  
```
proc lexMessageTok(L: Lexer; msg: TMsgKind; tok: Token; arg = "") {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L225)  
```
proc getPrecedence(tok: Token): int {...}{.raises: [], tags: [].}
```
  Calculates the precedence of the given token. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L904) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L904)  
```
proc newlineFollows(L: Lexer): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L934) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L934)  
```
proc rawGetTok(L: var Lexer; tok: var Token) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L1137) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1137)  
```
proc getIndentWidth(fileIdx: FileIndex; inputstream: PLLStream;
                    cache: IdentCache; config: ConfigRef): int {...}{.
    raises: [IOError, Exception, ValueError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L1285) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1285)  
```
proc getPrecedence(ident: PIdent): int {...}{.raises: [], tags: [].}
```
  assumes ident is binary operator already [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lexer.nim#L1300) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lexer.nim#L1300)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/lexer.html>

liftdestructors
===============

 This module implements lifting for type-bound operations (`=sink`, `=`, `=destroy`, `=deepCopy`).

 Imports
-------

  <modulegraphs>, <lineinfos>, <idents>, <ast>, <renderer>, <semdata>, <sighashes>, <lowerings>, <options>, <types>, <msgs>, <magicsys>, <trees>  Procs
-----

  
```
proc produceDestructorForDiscriminator(g: ModuleGraph; typ: PType; field: PSym;
                                       info: TLineInfo): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/liftdestructors.nim#L947) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/liftdestructors.nim#L947)  
```
proc createTypeBoundOps(g: ModuleGraph; c: PContext; orig: PType;
                        info: TLineInfo) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  In the semantic pass this is called in strategic places to ensure we lift assignment, destructors and moves properly. The later 'injectdestructors' pass depends on it. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/liftdestructors.nim#L1005) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/liftdestructors.nim#L1005)   Templates
---------

  
```
template liftTypeBoundOps(c: PContext; typ: PType; info: TLineInfo)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/liftdestructors.nim#L969) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/liftdestructors.nim#L969)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/liftdestructors.html>

liftlocals
==========

 This module implements the '.liftLocals' pragma.

 Imports
-------

  <options>, <ast>, <msgs>, <idents>, <renderer>, <types>, <lowerings>, <lineinfos>, <pragmas>, <wordrecg>  Procs
-----

  
```
proc liftLocalsIfRequested(prc: PSym; n: PNode; cache: IdentCache;
                           conf: ConfigRef): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/liftlocals.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/liftlocals.nim#L56)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/liftlocals.html>

lineinfos
=========

 This module contains the `TMsgKind` enum as well as the `TLineInfo` object.

 Imports
-------

  <ropes>, <pathutils>  Types
-----

  
```
TMsgKind = enum
  errUnknown, errInternal, errIllFormedAstX, errCannotOpenFile, errXExpected,
  errGridTableNotImplemented, errGeneralParseError, errNewSectionExpected,
  errInvalidDirectiveX, errProveInit, errGenerated, errUser,
  warnCannotOpenFile = "CannotOpenFile", warnOctalEscape = "OctalEscape",
  warnXIsNeverRead = "XIsNeverRead",
  warnXmightNotBeenInit = "XmightNotBeenInit", warnDeprecated = "Deprecated",
  warnConfigDeprecated = "ConfigDeprecated",
  warnSmallLshouldNotBeUsed = "SmallLshouldNotBeUsed",
  warnUnknownMagic = "UnknownMagic",
  warnRedefinitionOfLabel = "RedefinitionOfLabel",
  warnUnknownSubstitutionX = "UnknownSubstitutionX",
  warnLanguageXNotSupported = "LanguageXNotSupported",
  warnFieldXNotSupported = "FieldXNotSupported",
  warnCommentXIgnored = "CommentXIgnored", warnTypelessParam = "TypelessParam",
  warnUseBase = "UseBase", warnWriteToForeignHeap = "WriteToForeignHeap",
  warnUnsafeCode = "UnsafeCode", warnUnusedImportX = "UnusedImport",
  warnInheritFromException = "InheritFromException",
  warnEachIdentIsTuple = "EachIdentIsTuple", warnUnsafeSetLen = "UnsafeSetLen",
  warnUnsafeDefault = "UnsafeDefault", warnProveInit = "ProveInit",
  warnProveField = "ProveField", warnProveIndex = "ProveIndex",
  warnUnreachableElse = "UnreachableElse",
  warnUnreachableCode = "UnreachableCode", warnStaticIndexCheck = "IndexCheck",
  warnGcUnsafe = "GcUnsafe", warnGcUnsafe2 = "GcUnsafe2", warnUninit = "Uninit",
  warnGcMem = "GcMem", warnDestructor = "Destructor",
  warnLockLevel = "LockLevel", warnResultShadowed = "ResultShadowed",
  warnInconsistentSpacing = "Spacing", warnCaseTransition = "CaseTransition",
  warnCycleCreated = "CycleCreated", warnObservableStores = "ObservableStores",
  warnResultUsed = "ResultUsed", warnUser = "User", hintSuccess = "Success",
  hintSuccessX = "SuccessX", hintCC = "CC", hintLineTooLong = "LineTooLong",
  hintXDeclaredButNotUsed = "XDeclaredButNotUsed",
  hintXCannotRaiseY = "XCannotRaiseY",
  hintConvToBaseNotNeeded = "ConvToBaseNotNeeded",
  hintConvFromXtoItselfNotNeeded = "ConvFromXtoItselfNotNeeded",
  hintExprAlwaysX = "ExprAlwaysX", hintQuitCalled = "QuitCalled",
  hintProcessing = "Processing", hintCodeBegin = "CodeBegin",
  hintCodeEnd = "CodeEnd", hintConf = "Conf", hintPath = "Path",
  hintConditionAlwaysTrue = "CondTrue", hintConditionAlwaysFalse = "CondFalse",
  hintName = "Name", hintPattern = "Pattern", hintExecuting = "Exec",
  hintLinking = "Link", hintDependency = "Dependency", hintSource = "Source",
  hintPerformance = "Performance", hintStackTrace = "StackTrace",
  hintGCStats = "GCStats", hintGlobalVar = "GlobalVar",
  hintExpandMacro = "ExpandMacro", hintUser = "User", hintUserRaw = "UserRaw",
  hintExtendedContext = "ExtendedContext", hintMsgOrigin = "MsgOrigin"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L29)  
```
TNoteKind = range[warnMin .. hintMax]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L177)  
```
TNoteKinds = set[TNoteKind]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L178)  
```
TFileInfo = object
  fullPath*: AbsoluteFile
  projPath*: RelativeFile
  shortName*: string
  quotedName*: Rope
  quotedFullName*: Rope
  lines*: seq[string]
  dirtyFile*: AbsoluteFile
  hash*: string
  dirty*: bool
  when defined(nimpretty):
      fullContent*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L195)  
```
FileIndex = distinct int32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L215)  
```
TLineInfo = object
  line*: uint16
  col*: int16
  fileIndex*: FileIndex
  when defined(nimpretty):
      offsetA*, offsetB*: int
      commentOffsetA*, commentOffsetB*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L216)  
```
TErrorOutput = enum
  eStdOut, eStdErr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L229)  
```
TErrorOutputs = set[TErrorOutput]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L233)  
```
ERecoverableError = object of ValueError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L235)  
```
ESuggestDone = object of ValueError
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L236)  
```
Severity {...}{.pure.} = enum
  Hint, Warning, Error
```
  VS Code only supports these three [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L251)  
```
MsgConfig = object
  trackPos*: TLineInfo
  trackPosAttached*: bool    ## whether the tracking position was attached to
                             ## some close token.
  errorOutputs*: TErrorOutputs
  msgContext*: seq[tuple[info: TLineInfo, detail: string]]
  lastError*: TLineInfo
  filenameToIndexTbl*: Table[string, FileIndex]
  fileInfos*: seq[TFileInfo]
  systemFileIdx*: FileIndex
```
  does not need to be stored in the incremental cache [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L260)   Consts
------

  
```
explanationsBaseUrl = "https://nim-lang.github.io/Nim"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L16)  
```
MsgKindToStr: array[TMsgKind, string] = ["unknown error", "internal error: $1",
    "illformed AST: $1", "cannot open \'$1\'", "\'$1\' expected",
    "grid table is not implemented", "general parse error",
    "new section expected", "invalid directive: \'$1\'",
    "Cannot prove that \'$1\' is initialized.", "$1", "$1",
    "cannot open \'$1\'",
    "octal escape sequences do not exist; leading zero is ignored",
    "\'$1\' is never read", "\'$1\' might not have been initialized", "$1",
    "config file \'$1\' is deprecated",
    "\'l\' should not be used as an identifier; may look like \'1\' (one)",
    "unknown magic \'$1\' might crash the compiler",
    "redefinition of label \'$1\'", "unknown substitution \'$1\'",
    "language \'$1\' not supported", "field \'$1\' not supported",
    "comment \'$1\' ignored", "\'$1\' has no type. Typeless parameters are deprecated; only allowed for \'template\'",
    "use {.base.} for base methods; baseless methods are deprecated",
    "write to foreign heap", "unsafe code: \'$1\'",
    "imported and not used: \'$1\'", "inherit from a more precise exception type like ValueError, IOError or OSError. If these don\'t suit, inherit from CatchableError or Defect.",
    "each identifier is a tuple", "setLen can potentially expand the sequence, but the element type \'$1\' doesn\'t have a valid default value",
    "The \'$1\' type doesn\'t have a valid default value", "Cannot prove that \'$1\' is initialized. This will become a compile time error in the future.",
    "cannot prove that field \'$1\' is accessible",
    "cannot prove index \'$1\' is valid",
    "unreachable else, all cases are already covered",
    "unreachable code after \'return\' statement or \'{.noReturn.}\' proc",
    "$1", "not GC-safe: \'$1\'", "$1",
    "use explicit initialization of \'$1\' for clarity",
    "\'$1\' uses GC\'ed memory", "usage of a type with a destructor in a non destructible context. This will become a compile time error in the future.",
    "$1", "Special variable \'result\' is shadowed.",
    "Number of spaces around \'$#\' is not consistent",
    "Potential object case transition, instantiate new object instead", "$1",
    "observable stores to \'$1\'", "used \'result\' variable", "$1",
    "operation successful: $#",
    "${loc} lines; ${sec}s; $mem; $build build; proj: $project; out: $output",
    "CC: $1", "line too long", "\'$1\' is declared but not used", "$1",
    "conversion to base object is not needed",
    "conversion from $1 to itself is pointless",
    "expression evaluates always to \'$1\'", "quit() called", "$1",
    "generated code listing:", "end of listing", "used config file \'$1\'",
    "added path: \'$1\'", "condition is always true: \'$1\'",
    "condition is always false: \'$1\'", "$1", "$1", "$1", "$1", "$1", "$1",
    "$1", "$1", "$1", "global variable declared here", "expanded macro: $1",
    "$1", "$1", "$1", "$1"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L75)  
```
fatalMin = errUnknown
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L167)  
```
fatalMax = errInternal
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L168)  
```
errMin = errUnknown
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L169)  
```
errMax = errUser
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L170)  
```
warnMin = warnCannotOpenFile
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L171)  
```
warnMax = warnUser
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L172)  
```
hintMin = hintSuccess
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L173)  
```
hintMax = hintMsgOrigin
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L174)  
```
NotesVerbosity = [{warnCannotOpenFile..warnProveInit,
                   warnUnreachableElse..warnStaticIndexCheck, warnGcUnsafe2,
                   warnGcMem..warnCycleCreated, warnUser,
                   hintLineTooLong..hintQuitCalled,
                   hintConditionAlwaysTrue..hintName, hintPerformance,
                   hintExpandMacro..hintUserRaw}, {
    warnCannotOpenFile..warnProveInit,
    warnUnreachableElse..warnStaticIndexCheck, warnGcUnsafe2,
    warnGcMem..warnCycleCreated, warnUser..hintProcessing, hintConf,
    hintConditionAlwaysTrue..hintLinking, hintPerformance,
    hintExpandMacro..hintUserRaw}, {warnCannotOpenFile..warnGcUnsafe2,
                                    warnGcMem..warnCycleCreated,
                                    warnUser..hintPerformance,
                                    hintGCStats..hintUserRaw, hintMsgOrigin},
                  {12..49, 52..84}]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L190)  
```
errXMustBeCompileTime = "\'$1\' can only be used in compile-time context"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L191)  
```
errArgsNeedRunOption = "arguments can only be given if the \'--run\' option is selected"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L192)  
```
InvalidFileIdx = -1'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L247)  
```
unknownLineInfo = (line: 0'u, col: -1, fileIndex: -1)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L248) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L248)  
```
trackPosInvalidFileIdx = -2'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L255) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L255)  
```
commandLineIdx = -3'i32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L257)   Procs
-----

  
```
proc createDocLink(urlSuffix: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L20)  
```
proc `==`(a, b: FileIndex): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L238)  
```
proc hash(i: TLineInfo): Hash {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L240)  
```
proc raiseRecoverableError(msg: string) {...}{.noinline, raises: [ERecoverableError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L243)  
```
proc initMsgConfig(): MsgConfig {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lineinfos.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lineinfos.nim#L273)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/lineinfos.html>

linter
======

 This module implements the style checker.

 Imports
-------

  <options>, <ast>, <msgs>, <idents>, <lineinfos>, <wordrecg>  Consts
------

  
```
Letters = {'a'..'z', 'A'..'Z', '0'..'9', '\x80'..'\xFF', '_'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L17)   Procs
-----

  
```
proc identLen(line: string; start: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L19)  
```
proc differ(line: string; a, b: int; x: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L72)  
```
proc styleCheckUse(conf: ConfigRef; info: TLineInfo; s: PSym) {...}{.
    raises: [ValueError, Exception, IOError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L116)  
```
proc checkPragmaUse(conf: ConfigRef; info: TLineInfo; w: TSpecialWord;
                    pragmaName: string) {...}{.
    raises: [ValueError, Exception, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L130)   Templates
---------

  
```
template styleCheckDef(conf: ConfigRef; info: TLineInfo; s: PSym; k: TSymKind)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L95)  
```
template styleCheckDef(conf: ConfigRef; info: TLineInfo; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L99)  
```
template styleCheckDef(conf: ConfigRef; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/linter.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/linter.nim#L101)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/linter.html>

llstream
========

 Low-level streams for high performance.

 Imports
-------

  <pathutils>  Types
-----

  
```
TLLRepl = proc (s: PLLStream; buf: pointer; bufLen: int): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L22)  
```
TLLStreamKind = enum
  llsNone, llsString, llsFile, llsStdIn
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L23)  
```
TLLStream = object of RootObj
  kind*: TLLStreamKind
  f*: File
  s*: string
  rd*, wr*: int
  lineOffset*: int
  repl*: TLLRepl
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L28)  
```
PLLStream = ref TLLStream
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L36)   Procs
-----

  
```
proc llStreamOpen(data: string): PLLStream {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L38)  
```
proc llStreamOpen(f: File): PLLStream {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L43)  
```
proc llStreamOpen(filename: AbsoluteFile; mode: FileMode): PLLStream {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L48)  
```
proc llStreamOpen(): PLLStream {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L53)  
```
proc llStreamOpenStdIn(r: TLLRepl = llReadFromStdin): PLLStream {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L58)  
```
proc llStreamClose(s: PLLStream) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L65)  
```
proc endsWith(x: string; s: set[char]): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L81)  
```
proc endsWithOpr(x: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L92)  
```
proc llStreamRead(s: PLLStream; buf: pointer; bufLen: int): int {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L124)  
```
proc llStreamReadLine(s: PLLStream; line: var string): bool {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L138)  
```
proc llStreamWrite(s: PLLStream; data: string) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L162)  
```
proc llStreamWriteln(s: PLLStream; data: string) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L172)  
```
proc llStreamWrite(s: PLLStream; data: char) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L176)  
```
proc llStreamWrite(s: PLLStream; buf: pointer; buflen: int) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L188)  
```
proc llStreamReadAll(s: PLLStream): string {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/llstream.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/llstream.nim#L200)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/llstream.html>

lookups
=======

 Imports
-------

  <ast>, <astalgo>, <idents>, <semdata>, <types>, <msgs>, <options>, <renderer>, <nimfix/prettybase>, <lineinfos>  Types
-----

  
```
TOverloadIterMode = enum
  oimDone, oimNoQualifier, oimSelfModule, oimOtherModule, oimSymChoice,
  oimSymChoiceLocalLookup
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L146)  
```
TOverloadIter = object
  it*: TIdentIter
  m*: PSym
  mode*: TOverloadIterMode
  symChoiceIndex*: int
  scope*: PScope
  inSymChoice: IntSet
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L149)  
```
TLookupFlag = enum
  checkAmbiguity, checkUndeclared, checkModule, checkPureEnumFields
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L325) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L325)   Procs
-----

  
```
proc considerQuotedIdent(c: PContext; n: PNode; origin: PNode = nil): PIdent {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  Retrieve a PIdent from a PNode, taking into account accent nodes. `origin` can be nil. If it is not nil, it is used for a better error message. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L25)  
```
proc addUniqueSym(scope: PScope; s: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L61)  
```
proc openScope(c: PContext): PScope {...}{.discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L64)  
```
proc rawCloseScope(c: PContext) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L70)  
```
proc closeScope(c: PContext) {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L73)  
```
proc skipAlias(s: PSym; n: PNode; conf: ConfigRef): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L83)  
```
proc isShadowScope(s: PScope): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L94)  
```
proc localSearchInScope(c: PContext; s: PIdent): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L96)  
```
proc searchInScopes(c: PContext; s: PIdent): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L104)  
```
proc debugScopes(c: PContext; limit = 0) {...}{.deprecated, raises: [], tags: [].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L110)  
```
proc searchInScopes(c: PContext; s: PIdent; filter: TSymKinds): PSym {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L120)  
```
proc errorSym(c: PContext; n: PNode): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  creates an error symbol to avoid cascading errors (for IDE support) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L129)  
```
proc getSymRepr(conf: ConfigRef; s: PSym): string {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L157)  
```
proc wrongRedefinition(c: PContext; info: TLineInfo; s: string;
                       conflictsWith: TLineInfo) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L186)  
```
proc addDecl(c: PContext; sym: PSym; info: TLineInfo) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L193)  
```
proc addDecl(c: PContext; sym: PSym) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L198)  
```
proc addPrelimDecl(c: PContext; sym: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L203)  
```
proc addDeclAt(c: PContext; scope: PScope; sym: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L206)  
```
proc addInterfaceDeclAt(c: PContext; scope: PScope; sym: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L217)  
```
proc addOverloadableSymAt(c: PContext; scope: PScope; fn: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L221)  
```
proc addInterfaceDecl(c: PContext; sym: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L231)  
```
proc addInterfaceOverloadableSymAt(c: PContext; scope: PScope; sym: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L236)  
```
proc openShadowScope(c: PContext) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L241)  
```
proc closeShadowScope(c: PContext) {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L246)  
```
proc mergeShadowScope(c: PContext) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L249)  
```
proc errorUseQualifier(c: PContext; info: TLineInfo; s: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L275)  
```
proc errorUndeclaredIdentifier(c: PContext; info: TLineInfo; name: string) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L289) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L289)  
```
proc lookUp(c: PContext; n: PNode): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L298)  
```
proc qualifiedLookUp(c: PContext; n: PNode; flags: set[TLookupFlag]): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L328)  
```
proc initOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L379)  
```
proc lastOverloadScope(o: TOverloadIter): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L429)  
```
proc nextOverloadIter(o: var TOverloadIter; c: PContext; n: PNode): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L436)  
```
proc pickSym(c: PContext; n: PNode; kinds: set[TSymKind]; flags: TSymFlags = {}): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L481)   Iterators
---------

  
```
iterator walkScopes(scope: PScope): PScope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L77)   Templates
---------

  
```
template addSym(scope: PScope; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lookups.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lookups.nim#L58)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/lookups.html>

lowerings
=========

 This module implements common simple lowerings.

 Imports
-------

  <ast>, <astalgo>, <types>, <idents>, <magicsys>, <msgs>, <options>, <modulegraphs>, <lineinfos>  Consts
------

  
```
genPrefix = ":tmp"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L13)   Procs
-----

  
```
proc newDeref(n: PNode): PNode {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L18)  
```
proc newTupleAccess(g: ModuleGraph; tup: PNode; i: int): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L22)  
```
proc addVar(father, v: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L38)  
```
proc addVar(father, v, value: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L45)  
```
proc newAsgnStmt(le, ri: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L52)  
```
proc newFastAsgnStmt(le, ri: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L57)  
```
proc newFastMoveStmt(g: ModuleGraph; le, ri: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L62)  
```
proc lowerTupleUnpacking(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L69)  
```
proc evalOnce(g: ModuleGraph; value: PNode; owner: PSym): PNode {...}{.raises: [],
    tags: [].}
```
  Turns (value) into (let tmp = value; tmp) so that 'value' can be re-used freely, multiple times. This is frequently required and such a builtin would also be handy to have in macros.nim. The value that can be reused is 'result.lastSon'! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L88)  
```
proc newTupleAccessRaw(tup: PNode; i: int): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L104)  
```
proc newTryFinally(body, final: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L111)  
```
proc lowerTupleUnpackingForAsgn(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L114)  
```
proc lowerSwap(g: ModuleGraph; n: PNode; owner: PSym): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L133)  
```
proc createObj(g: ModuleGraph; owner: PSym; info: TLineInfo; final = true): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L154)  
```
proc rawAddField(obj: PType; field: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L174)  
```
proc rawIndirectAccess(a: PNode; field: PSym; info: TLineInfo): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L181)  
```
proc rawDirectAccess(obj, field: PSym): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L192)  
```
proc addField(obj: PType; s: PSym; cache: IdentCache) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L221)  
```
proc addUniqueField(obj: PType; s: PSym; cache: IdentCache): PSym {...}{.discardable,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L236)  
```
proc newDotExpr(obj, b: PSym): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L250)  
```
proc indirectAccess(a: PNode; b: int; info: TLineInfo): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L258)  
```
proc indirectAccess(a: PNode; b: string; info: TLineInfo; cache: IdentCache): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L281)  
```
proc getFieldFromObj(t: PType; v: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L305) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L305)  
```
proc indirectAccess(a: PNode; b: PSym; info: TLineInfo): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L316)  
```
proc indirectAccess(a, b: PSym; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L320)  
```
proc genAddrOf(n: PNode; typeKind = tyPtr): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L323)  
```
proc genDeref(n: PNode; k = nkHiddenDeref): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L329) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L329)  
```
proc callCodegenProc(g: ModuleGraph; name: string;
                     info: TLineInfo = unknownLineInfo;
                     arg1, arg2, arg3, optionalArgs: PNode = nil): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L334)  
```
proc newIntLit(g: ModuleGraph; info: TLineInfo; value: BiggestInt): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L351) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L351)  
```
proc genHigh(g: ModuleGraph; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L355) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L355)  
```
proc genLen(g: ModuleGraph; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/lowerings.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/lowerings.nim#L364)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/lowerings.html>

macrocacheimpl
==============

 This module implements helpers for the macro cache.

 Imports
-------

  <lineinfos>, <ast>, <modulegraphs>, <vmdef>  Procs
-----

  
```
proc recordInc(c: PCtx; info: TLineInfo; key: string; by: BiggestInt) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/macrocacheimpl.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/macrocacheimpl.nim#L14)  
```
proc recordPut(c: PCtx; info: TLineInfo; key: string; k: string; val: PNode) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/macrocacheimpl.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/macrocacheimpl.nim#L21)  
```
proc recordAdd(c: PCtx; info: TLineInfo; key: string; val: PNode) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/macrocacheimpl.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/macrocacheimpl.nim#L29)  
```
proc recordIncl(c: PCtx; info: TLineInfo; key: string; val: PNode) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/macrocacheimpl.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/macrocacheimpl.nim#L36)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/macrocacheimpl.html>

magicsys
========

 Imports
-------

  <ast>, <astalgo>, <msgs>, <platform>, <idents>, <modulegraphs>, <lineinfos>  Procs
-----

  
```
proc nilOrSysInt(g: ModuleGraph): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L18)  
```
proc registerSysType(g: ModuleGraph; t: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L20)  
```
proc getSysSym(g: ModuleGraph; info: TLineInfo; name: string): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L28)  
```
proc getSysMagic(g: ModuleGraph; info: TLineInfo; name: string; m: TMagic): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L36)  
```
proc sysTypeFromName(g: ModuleGraph; info: TLineInfo; name: string): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L51)  
```
proc getSysType(g: ModuleGraph; info: TLineInfo; kind: TTypeKind): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L54)  
```
proc resetSysTypes(g: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L87)  
```
proc getIntLitType(g: ModuleGraph; literal: PNode): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L97)  
```
proc getFloatLitType(g: ModuleGraph; literal: PNode): PType {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L112)  
```
proc skipIntLit(t: PType): PType {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L117)  
```
proc addSonSkipIntLit(father, son: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L124)  
```
proc setIntLitType(g: ModuleGraph; result: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L131)  
```
proc getCompilerProc(g: ModuleGraph; name: string): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L160)  
```
proc registerCompilerProc(g: ModuleGraph; s: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L164)  
```
proc registerNimScriptSymbol(g: ModuleGraph; s: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L167)  
```
proc getNimScriptSymbol(g: ModuleGraph; name: string): PSym {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L176)  
```
proc resetNimScriptSymbols(g: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L179) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L179)  
```
proc getMagicEqSymForType(g: ModuleGraph; t: PType; info: TLineInfo): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/magicsys.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/magicsys.nim#L181)   Exports
-------

  [createMagic](modulegraphs#createMagic,ModuleGraph,string,TMagic) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/magicsys.html>

main
====

 Imports
-------

  <llstream>, <ast>, <lexer>, <syntaxes>, <options>, <msgs>, <condsyms>, <sem>, <idents>, <passes>, <extccomp>, <cgen>, <nversion>, <platform>, <nimconf>, <passaux>, <depends>, <vm>, <idgen>, <modules>, <modulegraphs>, <rod>, <lineinfos>, <pathutils>, <vmprofiler>, <jsgen>, <docgen>, <docgen2>  Procs
-----

  
```
proc mainCommand(graph: ModuleGraph) {...}{.raises: [OSError, ValueError, Exception,
    IOError, ERecoverableError, KeyError, EOFError], tags: [TimeEffect,
    ReadEnvEffect, ReadIOEffect, RootEffect, WriteIOEffect, ReadDirEffect,
    ExecIOEffect, WriteDirEffect, WriteEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/main.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/main.nim#L167)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/main.html>

modulegraphs
============


This module implements the module graph data structure. The module graph represents a complete Nim project. Single modules can either be kept in RAM or stored in a Sqlite database.

 The caching of modules is critical for 'nimsuggest' and is tricky to get right. If module E is being edited, we need autocompletion (and type checking) for E but we don't want to recompile depending modules right away for faster turnaround times. Instead we mark the module's dependencies as 'dirty'. Let D be a dependency of E. If D is dirty, we need to recompile it and all of its dependencies that are marked as 'dirty'. 'nimsuggest sug' actually is invoked for the file being edited so we know its content changed and there is no need to compute any checksums. Instead of a recursive algorithm, we use an iterative algorithm:

 * If a module gets recompiled, its dependencies need to be updated.
* Its dependent module stays the same.

 Imports
-------

  <ast>, <options>, <lineinfos>, <idents>, <incremental>, <btrees>  Types
-----

  
```
SigHash = distinct MD5Digest
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L32)  
```
ModuleGraph {...}{.acyclic.} = ref object
  modules*: seq[PSym]        ## indexed by int32 fileIdx
  packageSyms*: TStrTable
  deps*: IntSet
  importDeps*: Table[FileIndex, seq[FileIndex]]
  suggestMode*: bool
  invalidTransitiveClosure: bool
  inclToMod*: Table[FileIndex, FileIndex]
  importStack*: seq[FileIndex]
  backend*: RootRef
  config*: ConfigRef
  cache*: IdentCache
  vm*: RootRef
  doStopCompile*: proc (): bool {...}{.closure.}
  usageSym*: PSym
  owners*: seq[PSym]
  methods*: seq[tuple[methods: seq[PSym], dispatcher: PSym]]
  systemModule*: PSym
  sysTypes*: array[TTypeKind, PType]
  compilerprocs*: TStrTable
  exposed*: TStrTable
  intTypeCache*: array[-5 .. 64, PType]
  opContains*, opNot*: PSym
  emptyNode*: PNode
  incr*: IncrementalCtx
  canonTypes*: Table[SigHash, PType]
  symBodyHashes*: Table[int, SigHash]
  importModuleCallback*: proc (graph: ModuleGraph; m: PSym; fileIdx: FileIndex): PSym {...}{.
      nimcall.}
  includeFileCallback*: proc (graph: ModuleGraph; m: PSym; fileIdx: FileIndex): PNode {...}{.
      nimcall.}
  recordStmt*: proc (graph: ModuleGraph; m: PSym; n: PNode) {...}{.nimcall.}
  cacheSeqs*: Table[string, PNode]
  cacheCounters*: Table[string, BiggestInt]
  cacheTables*: Table[string, BTree[string, PNode]]
  passes*: seq[TPass]
  onDefinition*: proc (graph: ModuleGraph; s: PSym; info: TLineInfo) {...}{.nimcall.}
  onDefinitionResolveForward*: proc (graph: ModuleGraph; s: PSym;
                                     info: TLineInfo) {...}{.nimcall.}
  onUsage*: proc (graph: ModuleGraph; s: PSym; info: TLineInfo) {...}{.nimcall.}
  globalDestructors*: seq[PNode]
  strongSemCheck*: proc (graph: ModuleGraph; owner: PSym; body: PNode) {...}{.nimcall.}
  compatibleProps*: proc (graph: ModuleGraph; formal, actual: PType): bool {...}{.
      nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L34)  
```
TPassContext = object of RootObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L78)  
```
PPassContext = ref TPassContext
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L79)  
```
TPassOpen = proc (graph: ModuleGraph; module: PSym): PPassContext {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L81)  
```
TPassClose = proc (graph: ModuleGraph; p: PPassContext; n: PNode): PNode {...}{.
    nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L82)  
```
TPassProcess = proc (p: PPassContext; topLevelStmt: PNode): PNode {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L83)  
```
TPass = tuple[open: TPassOpen, process: TPassProcess, close: TPassClose,
              isFrontend: bool]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L85)   Procs
-----

  
```
proc `$`(u: SigHash): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L125)  
```
proc `==`(a, b: SigHash): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L128)  
```
proc hash(u: SigHash): Hash {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L131)  
```
proc hash(x: FileIndex): Hash {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L136)  
```
proc stopCompile(g: ModuleGraph): bool {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L164)  
```
proc createMagic(g: ModuleGraph; name: string; m: TMagic): PSym {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L167)  
```
proc newModuleGraph(cache: IdentCache; config: ConfigRef): ModuleGraph {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L172)  
```
proc resetAllModules(g: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L198)  
```
proc getModule(g: ModuleGraph; fileIdx: FileIndex): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L210)  
```
proc addDep(g: ModuleGraph; m: PSym; dep: FileIndex) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L216)  
```
proc addIncludeDep(g: ModuleGraph; module, includeFile: FileIndex) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L225) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L225)  
```
proc parentModule(g: ModuleGraph; fileIdx: FileIndex): FileIndex {...}{.raises: [],
    tags: [].}
```
  returns 'fileIdx' if the file belonging to this index is directly used as a module or else the module that first references this include file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L229)  
```
proc markDirty(g: ModuleGraph; fileIdx: FileIndex) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L247)  
```
proc markClientsDirty(g: ModuleGraph; fileIdx: FileIndex) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L251)  
```
proc isDirty(g: ModuleGraph; m: PSym): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L265)   Templates
---------

  
```
template onUse(info: TLineInfo; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L160)  
```
template onDef(info: TLineInfo; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L161)  
```
template onDefResolveForward(info: TLineInfo; s: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulegraphs.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulegraphs.nim#L162)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/modulegraphs.html>

modulepaths
===========

 Imports
-------

  <ast>, <renderer>, <msgs>, <options>, <idents>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc getModuleName(conf: ConfigRef; n: PNode): string {...}{.
    raises: [OSError, Exception, ValueError, IOError, ERecoverableError],
    tags: [ReadEnvEffect, ReadIOEffect, RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulepaths.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulepaths.nim#L107)  
```
proc checkModuleName(conf: ConfigRef; n: PNode; doLocalError = true): FileIndex {...}{.raises: [
    OSError, Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    ReadEnvEffect, ReadIOEffect, RootEffect, WriteIOEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modulepaths.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modulepaths.nim#L155)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/modulepaths.html>

modules
=======

 Implements the module handling, including the caching of modules.

 Imports
-------

  <ast>, <astalgo>, <magicsys>, <msgs>, <options>, <idents>, <lexer>, <idgen>, <passes>, <syntaxes>, <llstream>, <modulegraphs>, <rod>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc resetSystemArtifacts(g: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L17)  
```
proc compileModule(graph: ModuleGraph; fileIdx: FileIndex; flags: TSymFlags): PSym {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L79)  
```
proc importModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PSym {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L107)  
```
proc includeModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L122)  
```
proc connectCallbacks(graph: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L127)  
```
proc compileSystemModule(graph: ModuleGraph) {...}{.raises: [KeyError, Exception,
    OSError, ValueError, IOError, ERecoverableError], tags: [ReadDirEffect,
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L131)  
```
proc wantMainModule(conf: ConfigRef) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, KeyError], tags: [RootEffect, WriteIOEffect,
    ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L138)  
```
proc compileProject(graph: ModuleGraph; projectFileIdx = InvalidFileIdx) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L144)  
```
proc makeModule(graph: ModuleGraph; filename: AbsoluteFile): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L162)  
```
proc makeModule(graph: ModuleGraph; filename: string): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L167)  
```
proc makeStdinModule(graph: ModuleGraph): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/modules.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/modules.nim#L170)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/modules.html>

msgs
====

 Imports
-------

  <options>, <ropes>, <lineinfos>, <pathutils>, <strutils2>  Types
-----

  
```
InstantiationInfo = typeof(instantiationInfo())
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L16)  
```
FilenameOption = enum
  foAbs, foRelProject, foMagicSauce, foName, foStacktrace
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L235)  
```
MsgFlag = enum
  msgStdout,                ## force writing to stdout, even stderr is default
  msgSkipHook                ## skip message hook even if it is present
```
  flags altering msgWriteln behavior [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L290)  
```
MsgFlags = set[MsgFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L293)  
```
TErrorHandling = enum
  doNothing, doAbort, doRaise
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L383) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L383)   Consts
------

  
```
gCmdLineInfo = (line: 1'u, col: 1, fileIndex: -3)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L132)  
```
ColOffset = 1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L168)  
```
commandLineDesc = "command line"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L169)   Procs
-----

  
```
proc toCChar(c: char; result: var string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L25)  
```
proc makeCString(s: string): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L36)  
```
proc fileInfoKnown(conf: ConfigRef; filename: AbsoluteFile): bool {...}{.raises: [],
    tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L76)  
```
proc fileInfoIdx(conf: ConfigRef; filename: AbsoluteFile; isKnownFile: var bool): FileIndex {...}{.
    raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L86)  
```
proc fileInfoIdx(conf: ConfigRef; filename: AbsoluteFile): FileIndex {...}{.
    raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L114)  
```
proc newLineInfo(fileInfoIdx: FileIndex; line, col: int): TLineInfo {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L118)  
```
proc newLineInfo(conf: ConfigRef; filename: AbsoluteFile; line, col: int): TLineInfo {...}{.
    inline, raises: [KeyError, Exception], tags: [ReadDirEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L129)  
```
proc suggestWriteln(conf: ConfigRef; s: string) {...}{.raises: [IOError, Exception],
    tags: [WriteIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L140)  
```
proc msgQuit(x: int8) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L148)  
```
proc msgQuit(x: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L149)  
```
proc suggestQuit() {...}{.raises: [ESuggestDone], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L151)  
```
proc getInfoContextLen(conf: ConfigRef): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L171)  
```
proc setInfoContextLen(conf: ConfigRef; L: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L172)  
```
proc pushInfoContext(conf: ConfigRef; info: TLineInfo; detail: string = "") {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L174)  
```
proc popInfoContext(conf: ConfigRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L177)  
```
proc getInfoContext(conf: ConfigRef; index: int): TLineInfo {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L180)  
```
proc toProjPath(conf: ConfigRef; fileIdx: FileIndex): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L191)  
```
proc toFullPath(conf: ConfigRef; fileIdx: FileIndex): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L196)  
```
proc setDirtyFile(conf: ConfigRef; fileIdx: FileIndex; filename: AbsoluteFile) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L202)  
```
proc setHash(conf: ConfigRef; fileIdx: FileIndex; hash: string) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L207)  
```
proc getHash(conf: ConfigRef; fileIdx: FileIndex): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L211)  
```
proc toFullPathConsiderDirty(conf: ConfigRef; fileIdx: FileIndex): AbsoluteFile {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L215)  
```
proc toFilenameOption(conf: ConfigRef; fileIdx: FileIndex; opt: FilenameOption): string {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L242)  
```
proc toMsgFilename(conf: ConfigRef; info: FileIndex): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L263)  
```
proc toLinenumber(info: TLineInfo): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L269) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L269)  
```
proc toColumn(info: TLineInfo): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L272)  
```
proc toFileLineCol(conf: ConfigRef; info: TLineInfo): string {...}{.inline,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L278) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L278)  
```
proc `$`(conf: ConfigRef; info: TLineInfo): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L281)  
```
proc `$`(info: TLineInfo): string {...}{.error.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L283)  
```
proc `??`(conf: ConfigRef; info: TLineInfo; filename: string): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L285)  
```
proc msgWriteln(conf: ConfigRef; s: string; flags: MsgFlags = {}) {...}{.
    raises: [Exception, IOError], tags: [RootEffect, WriteIOEffect].}
```
  Writes given message string to stderr by default. If `--stdout` option is given, writes to stdout instead. If message hook is present, then it is used to output message rather than stderr/stdout. This behavior can be altered by given optional flags. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L295) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L295)  
```
proc msgKindToString(kind: TMsgKind): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L378)  
```
proc log(s: string) {...}{.raises: [IOError],
                      tags: [ReadEnvEffect, ReadIOEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L385)  
```
proc `==`(a, b: TLineInfo): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L418) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L418)  
```
proc exactEquals(a, b: TLineInfo): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L421) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L421)  
```
proc numLines(conf: ConfigRef; fileIdx: FileIndex): int {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  xxx there's an off by 1 error that should be fixed; if a file ends with "foo" or "foon" it will return same number of lines (ie, a trailing empty line is discounted) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L448) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L448)  
```
proc sourceLine(conf: ConfigRef; i: TLineInfo): string {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  1-based index (matches editor line numbers); 1st line is for i.line = 1 last valid line is `numLines` inclusive [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L460) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L460)  
```
proc formatMsg(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string): string {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L476) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L476)  
```
proc liMessage(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg: string;
               eh: TErrorHandling; info2: InstantiationInfo; isRaw = false) {...}{.
    noinline, raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L483) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L483)  
```
proc quotedFilename(conf: ConfigRef; i: TLineInfo): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L603) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L603)  
```
proc listWarnings(conf: ConfigRef) {...}{.raises: [Exception, IOError, ValueError],
                                     tags: [RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L615) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L615)  
```
proc listHints(conf: ConfigRef) {...}{.raises: [Exception, IOError, ValueError],
                                  tags: [RootEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L616) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L616)   Templates
---------

  
```
template toFilename(conf: ConfigRef; fileIdx: FileIndex): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L185)  
```
template toFilename(conf: ConfigRef; info: TLineInfo): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L223) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L223)  
```
template toProjPath(conf: ConfigRef; info: TLineInfo): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L226)  
```
template toFullPath(conf: ConfigRef; info: TLineInfo): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L229)  
```
template toFullPathConsiderDirty(conf: ConfigRef; info: TLineInfo): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L232)  
```
template toMsgFilename(conf: ConfigRef; info: TLineInfo): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L266) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L266)  
```
template styledMsgWriteln(args: varargs[typed])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L360)  
```
template rawMessage(conf: ConfigRef; msg: TMsgKind; args: openArray[string])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L541) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L541)  
```
template rawMessage(conf: ConfigRef; msg: TMsgKind; arg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L545)  
```
template fatal(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L548)  
```
template globalAssert(conf: ConfigRef; cond: untyped;
                      info: TLineInfo = unknownLineInfo; arg = "")
```
  avoids boilerplate [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L553)  
```
template globalError(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")
```
  `local` means compilation keeps going until errorMax is reached (via `doNothing`), `global` means it stops. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L560)  
```
template globalError(conf: ConfigRef; info: TLineInfo; arg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L565) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L565)  
```
template localError(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L568) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L568)  
```
template localError(conf: ConfigRef; info: TLineInfo; arg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L571) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L571)  
```
template localError(conf: ConfigRef; info: TLineInfo; format: string;
                    params: openArray[string])
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L574) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L574)  
```
template message(conf: ConfigRef; info: TLineInfo; msg: TMsgKind; arg = "")
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L577) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L577)  
```
template internalError(conf: ConfigRef; info: TLineInfo; errMsg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L585)  
```
template internalError(conf: ConfigRef; errMsg: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L588) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L588)  
```
template internalAssert(conf: ConfigRef; e: bool)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L591) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L591)  
```
template lintReport(conf: ConfigRef; info: TLineInfo; beau, got: string)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/msgs.nim#L598) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/msgs.nim#L598)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/msgs.html>

ndi
===

 This module implements the generation of `.ndi` files for better debugging support of Nim code. "ndi" stands for "Nim debug info".

 Imports
-------

  <ast>, <msgs>, <ropes>, <options>, <pathutils>  Types
-----

  
```
NdiFile = object
  enabled: bool
  f: File
  buf: string
  filename: AbsoluteFile
  syms: seq[PSym]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ndi.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ndi.nim#L16)   Procs
-----

  
```
proc open(f: var NdiFile; filename: AbsoluteFile; conf: ConfigRef) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ndi.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ndi.nim#L35)  
```
proc close(f: var NdiFile; conf: ConfigRef) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ndi.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ndi.nim#L41)   Templates
---------

  
```
template writeMangledName(f: NdiFile; s: PSym; conf: ConfigRef)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ndi.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ndi.nim#L32)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/ndi.html>

nimblecmd
=========

 Implements some helper procs for Nimble (Nim's package manager) support.

 Imports
-------

  <options>, <msgs>, <lineinfos>, <pathutils>  Types
-----

  
```
Version = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L20)   Procs
-----

  
```
proc addPath(conf: ConfigRef; path: AbsoluteDir; info: TLineInfo) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L15)  
```
proc `$`(ver: Version): string {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L22)  
```
proc newVersion(ver: string): Version {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L24)  
```
proc `<`(ver: Version; ver2: Version): bool {...}{.raises: [ValueError], tags: [].}
```
  This is synced from Nimble's version module. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L36)  
```
proc getPathVersion(p: string): tuple[name, version: string] {...}{.raises: [],
    tags: [].}
```
  Splits path `p` in the format `/home/user/.nimble/pkgs/package-0.1` into `(/home/user/.nimble/pkgs/package, 0.1)` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L65)  
```
proc nimblePath(conf: ConfigRef; path: AbsoluteDir; info: TLineInfo) {...}{.
    raises: [OSError, ValueError, Exception, IOError, ERecoverableError], tags: [
    ReadDirEffect, RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimblecmd.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimblecmd.nim#L130)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimblecmd.html>

nimconf
=======

 Imports
-------

  <llstream>, <commands>, <msgs>, <lexer>, <options>, <idents>, <wordrecg>, <lineinfos>, <pathutils>, <scriptconfig>  Procs
-----

  
```
proc readConfigFile(filename: AbsoluteFile; cache: IdentCache; config: ConfigRef): bool {...}{.raises: [
    IOError, Exception, KeyError, ValueError, ERecoverableError, OSError,
    EOFError], tags: [ReadIOEffect, RootEffect, ReadDirEffect, WriteIOEffect,
                      ReadEnvEffect, WriteEnvEffect, WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimconf.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimconf.nim#L211)  
```
proc getUserConfigPath(filename: RelativeFile): AbsoluteFile {...}{.
    raises: [OSError], tags: [ReadEnvEffect, ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimconf.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimconf.nim#L229)  
```
proc getSystemConfigPath(conf: ConfigRef; filename: RelativeFile): AbsoluteFile {...}{.
    raises: [OSError], tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimconf.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimconf.nim#L232)  
```
proc loadConfigs(cfg: RelativeFile; cache: IdentCache; conf: ConfigRef) {...}{.raises: [
    OSError, IOError, Exception, KeyError, ValueError, ERecoverableError,
    EOFError], tags: [ReadIOEffect, ReadDirEffect, ReadEnvEffect, RootEffect,
                      WriteIOEffect, WriteEnvEffect, WriteDirEffect,
                      ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimconf.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimconf.nim#L241)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimconf.html>

nimfix/prettybase
=================

 Imports
-------

  <../ast>, <../msgs>, <../lineinfos>, <../idents>, <../options>, <../linter>  Procs
-----

  
```
proc replaceDeprecated(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PIdent) {...}{.
    raises: [], tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimfix/prettybase.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimfix/prettybase.nim#L13)  
```
proc replaceDeprecated(conf: ConfigRef; info: TLineInfo; oldSym, newSym: PSym) {...}{.
    raises: [], tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimfix/prettybase.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimfix/prettybase.nim#L29)  
```
proc replaceComment(conf: ConfigRef; info: TLineInfo) {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimfix/prettybase.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimfix/prettybase.nim#L32)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimfix/prettybase.html>

nimlexbase
==========

 Imports
-------

  <llstream>  Types
-----

  
```
TBaseLexer = object of RootObj
  bufpos*: int
  buf*: cstring
  bufStorage: string
  bufLen: int
  stream*: PLLStream
  lineNumber*: int
  sentinel*: int
  lineStart*: int
  offsetBase*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L40)   Consts
------

  
```
Lrz = ' '
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L19)  
```
Apo = '\''
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L20)  
```
Tabulator = '\t'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L21)  
```
ESC = '\e'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L22)  
```
CR = '\c'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L23)  
```
FF = '\f'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L24)  
```
LF = '\n'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L25)  
```
BEL = '\a'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L26)  
```
BACKSPACE = '\b'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L27)  
```
VT = '\v'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L28)  
```
EndOfFile = '\x00'
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L31)  
```
NewLines = {'\c', '\n'}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L37)   Procs
-----

  
```
proc closeBaseLexer(L: var TBaseLexer) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L69)  
```
proc handleCR(L: var TBaseLexer; pos: int): int {...}{.raises: [IOError, Exception],
    tags: [ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L128)  
```
proc handleLF(L: var TBaseLexer; pos: int): int {...}{.raises: [IOError, Exception],
    tags: [ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L135)  
```
proc openBaseLexer(L: var TBaseLexer; inputstream: PLLStream; bufLen: int = 8192) {...}{.
    raises: [IOError, Exception], tags: [ReadIOEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L145)  
```
proc getColNumber(L: TBaseLexer; pos: int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L159)  
```
proc getCurrentLine(L: TBaseLexer; marker: bool = true): string {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimlexbase.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimlexbase.nim#L162)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimlexbase.html>

nimpaths
========


Represents absolute paths, but using a symbolic variables (eg $nimr) which can be resolved at runtime; this avoids hardcoding at compile time absolute paths so that the project root can be relocated.

 xxx consider some refactoring with $nim/testament/lib/stdtest/specialpaths.nim; specialpaths is simpler because it doesn't need variables to be relocatable at runtime (eg for use in testament)

 
interpolation variables: 

$nimr: such that `$nimr/lib/system.nim` exists (avoids confusion with $nim binary) in compiler, it's obtainable via getPrefixDir(); for other tools (eg koch), this could be getCurrentDir() or getAppFilename().parentDir.parentDir, depending on use case    Unstable API 

 Consts
------

  
```
docCss = "$nimr/doc/nimdoc.css"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L22)  
```
docHackNim = "$nimr/tools/dochack/dochack.nim"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L23)  
```
docHackJs = "$nimr/tools/dochack/dochack.js"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L24)  
```
docHackJsFname = "dochack.js"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L25)  
```
theindexFname = "theindex.html"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L26)  
```
nimdocOutCss = "nimdoc.out.css"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L27)  
```
htmldocsDirname = "htmldocs"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L29)  
```
dotdotMangle = "_._"
```
  refs #13223 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L30)   Procs
-----

  
```
proc interp(path: string; nimr: string): string {...}{.raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L34)  
```
proc getDocHacksJs(nimr: string; nim = getCurrentCompilerExe();
                   forceRebuild = false): string {...}{.raises: [ValueError],
    tags: [ReadDirEffect, ExecIOEffect].}
```
  return absolute path to dochack.js, rebuilding if it doesn't exist or if `forceRebuild`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimpaths.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimpaths.nim#L38)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimpaths.html>

nimsets
=======

 Imports
-------

  <ast>, <astalgo>, <lineinfos>, <bitsets>, <types>, <options>  Procs
-----

  
```
proc inSet(s: PNode; elem: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L15)  
```
proc overlap(a, b: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L30)  
```
proc someInSet(s: PNode; a, b: PNode): bool {...}{.raises: [ERecoverableError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L44)  
```
proc toBitSet(conf: ConfigRef; s: PNode): TBitSet {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L61)  
```
proc toTreeSet(conf: ConfigRef; s: TBitSet; settype: PType; info: TLineInfo): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L74)  
```
proc unionSets(conf: ConfigRef; a, b: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L114)  
```
proc diffSets(conf: ConfigRef; a, b: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L115)  
```
proc intersectSets(conf: ConfigRef; a, b: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L116)  
```
proc symdiffSets(conf: ConfigRef; a, b: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L117)  
```
proc containsSets(conf: ConfigRef; a, b: PNode): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L119)  
```
proc equalSets(conf: ConfigRef; a, b: PNode): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L124)  
```
proc complement(conf: ConfigRef; a: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L129)  
```
proc deduplicate(conf: ConfigRef; a: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L134)  
```
proc cardSet(conf: ConfigRef; a: PNode): BiggestInt {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L138)  
```
proc setHasRange(s: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L142)  
```
proc emptyRange(a, b: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nimsets.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nimsets.nim#L151)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nimsets.html>

nodejs
======

 Procs
-----

  
```
proc findNodeJs(): string {...}{.inline, raises: [OSError],
                            tags: [ReadDirEffect, ReadEnvEffect, ReadIOEffect].}
```
  Find NodeJS executable and return it as a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nodejs.nim#L3) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nodejs.nim#L3)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nodejs.html>

nversion
========

 Consts
------

  
```
MaxSetElements = 65536
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nversion.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nversion.nim#L14)  
```
VersionAsString = "1.4.8"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nversion.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nversion.nim#L15)  
```
RodFileVersion = "1223"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nversion.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nversion.nim#L16)  
```
NimCompilerApiVersion = 3
```
  Check for the existence of this before accessing it as older versions of the compiler API do not declare this. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/nversion.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/nversion.nim#L18)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nversion.html>

optimizer
=========

 Optimizer:


* elide 'wasMoved(x); destroy(x)' pairs
* recognize "all paths lead to 'wasMoved(x)'"

 Imports
-------

  <ast>, <renderer>, <idents>, <trees>  Procs
-----

  
```
proc optimize(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/optimizer.nim#L261) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/optimizer.nim#L261)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/optimizer.html>

options
=======

 Imports
-------

  <lineinfos>, <platform>, <prefixmatches>, <pathutils>, <nimpaths>  Types
-----

  
```
TOption = enum
  optNone, optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck,
  optOverflowCheck, optRefCheck, optNaNCheck, optInfCheck, optStaticBoundsCheck,
  optStyleCheck, optAssert, optLineDir, optWarns, optHints, optOptimizeSpeed,
  optOptimizeSize, optStackTrace, optStackTraceMsgs, optLineTrace, optByRef,
  optProfiler, optImplicitStatic, optTrMacros, optMemTracker, optNilSeqs,
  optSinkInference, optCursorInference
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L26)  
```
TOptions = set[TOption]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L47)  
```
TGlobalOption = enum
  gloptNone, optForceFullMake, optWasNimscript, optListCmd, optCompileOnly,
  optNoLinking, optCDebug, optGenDynLib, optGenStaticLib, optGenGuiApp,
  optGenScript, optGenMapping, optRun, optUseNimcache, optStyleHint,
  optStyleError, optStyleUsages, optSkipSystemConfigFile, optSkipProjConfigFile,
  optSkipUserConfigFile, optSkipParentConfigFiles, optNoMain, optUseColors,
  optThreads, optStdout, optThreadAnalysis, optTaintMode, optTlsEmulation,
  optGenIndex, optEmbedOrigSrc, optIdeDebug, optIdeTerse,
  optExcessiveStackTrace, optShowAllMismatches, optWholeProject, optDocInternal,
  optMixedMode, optListFullPaths, optNoNimblePath, optHotCodeReloading,
  optDynlibOverrideAll, optSeqDestructors, optTinyRtti, optOwnedRefs,
  optMultiMethods, optBenchmarkVM, optProduceAsm, optPanics, optNimV1Emulation,
  optNimV12Emulation, optSourcemap, optProfileVM, optEnableDeepCopy
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L48)  
```
TGlobalOptions = set[TGlobalOption]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L103)  
```
TBackend = enum
  backendInvalid = "", backendC = "c", backendCpp = "cpp", backendJs = "js",
  backendObjc = "objc"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L110)  
```
TCommands = enum
  cmdNone, cmdCompileToC, cmdCompileToCpp, cmdCompileToOC, cmdCompileToJS,
  cmdCompileToLLVM, cmdInterpret, cmdPretty, cmdDoc, cmdGenDepend, cmdDump,
  cmdCheck, cmdParse, cmdScan, cmdIdeTools, cmdDef, cmdRst2html, cmdRst2tex,
  cmdInteractive, cmdRun, cmdJsonScript, cmdCompileToBackend
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L120)  
```
TStringSeq = seq[string]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L141)  
```
TGCMode = enum
  gcUnselected, gcNone, gcBoehm, gcRegions, gcArc, gcOrc, gcMarkAndSweep,
  gcHooks, gcRefc, gcV2, gcGo
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L142)  
```
IdeCmd = enum
  ideNone, ideSug, ideCon, ideDef, ideUse, ideDus, ideChk, ideMod, ideHighlight,
  ideOutline, ideKnown, ideMsg, ideProject
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L148)  
```
Feature = enum
  implicitDeref, dotOperators, callOperator, parallel, destructor, notnil,
  dynamicBindSym, forLoopMacros, caseStmtMacros, codeReordering, compiletimeFFI, ## This requires building nim with `-d:nimHasLibFFI`
                                                                                  ## which itself requires `nimble install libffi`, see #10150
                                                                                  ## Note: this feature can't be localized with {.push.}
  vmopsDanger, strictFuncs, views
```
  experimental features; DO NOT RENAME THESE! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L152)  
```
LegacyFeature = enum
  allowSemcheckedAstModification, ## Allows to modify a NimNode where the type has already been
                                   ## flagged with nfSem. If you actually do this, it will cause
                                   ## bugs.
  checkUnsignedConversions ## Historically and especially in version 1.0.0 of the language
                           ## conversions to unsigned numbers were checked. In 1.0.4 they
                           ## are not anymore.
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L171)  
```
SymbolFilesOption = enum
  disabledSf, writeOnlySf, readOnlySf, v2Sf
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L181)  
```
TSystemCC = enum
  ccNone, ccGcc, ccNintendoSwitch, ccLLVM_Gcc, ccCLang, ccBcc, ccVcc, ccTcc,
  ccEnv, ccIcl, ccIcc, ccClangCl
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L184)  
```
ExceptionSystem = enum
  excNone, excSetjmp, excCpp, excGoto, excQuirky
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L188)  
```
CfileFlag {...}{.pure.} = enum
  Cached,                   ## no need to recompile this time
  External                   ## file was introduced via .compile pragma
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L195)  
```
Cfile = object
  nimname*: string
  cname*, obj*: AbsoluteFile
  flags*: set[CfileFlag]
  customArgs*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L199)  
```
CfileList = seq[Cfile]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L204)  
```
Suggest = ref object
  section*: IdeCmd
  qualifiedPath*: seq[string]
  name*: ptr string
  filePath*: string
  line*: int
  column*: int
  doc*: string
  forth*: string
  quality*: range[0 .. 100]
  isGlobal*: bool
  contextFits*: bool
  prefix*: PrefixMatch
  symkind*: byte
  scope*, localUsages*, globalUsages*: int
  tokenLen*: int
  version*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L206)  
```
Suggestions = seq[Suggest]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L224)  
```
ProfileInfo = object
  time*: float
  count*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L226)  
```
ProfileData = ref object
  data*: TableRef[TLineInfo, ProfileInfo]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L230) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L230)  
```
ConfigRef {...}{.acyclic.} = ref object
  backend*: TBackend
  target*: Target
  linesCompiled*: int
  options*: TOptions
  globalOptions*: TGlobalOptions
  macrosToExpand*: StringTableRef
  arcToExpand*: StringTableRef
  m*: MsgConfig
  evalTemplateCounter*: int
  evalMacroCounter*: int
  exitcode*: int8
  cmd*: TCommands
  selectedGC*: TGCMode
  exc*: ExceptionSystem
  verbosity*: int
  numberOfProcessors*: int
  evalExpr*: string
  lastCmdTime*: float
  symbolFiles*: SymbolFilesOption
  cppDefines*: HashSet[string]
  headerFile*: string
  features*: set[Feature]
  legacyFeatures*: set[LegacyFeature]
  arguments*: string         ## the arguments to be passed to the program that
                             ## should be run
  ideCmd*: IdeCmd
  oldNewlines*: bool
  cCompiler*: TSystemCC
  modifiedyNotes*: TNoteKinds
  cmdlineNotes*: TNoteKinds
  foreignPackageNotes*: TNoteKinds
  notes*: TNoteKinds
  warningAsErrors*: TNoteKinds
  mainPackageNotes*: TNoteKinds
  mainPackageId*: int
  errorCounter*: int
  hintCounter*: int
  warnCounter*: int
  errorMax*: int
  maxLoopIterationsVM*: int  ## VM: max iterations of all loops
  configVars*: StringTableRef
  symbols*: StringTableRef   ## We need to use a StringTableRef here as defined
                             ## symbols are always guaranteed to be style
                             ## insensitive. Otherwise hell would break lose.
  packageCache*: StringTableRef
  nimblePaths*: seq[AbsoluteDir]
  searchPaths*: seq[AbsoluteDir]
  lazyPaths*: seq[AbsoluteDir]
  outFile*: RelativeFile
  outDir*: AbsoluteDir
  jsonBuildFile*: AbsoluteFile
  prefixDir*, libpath*, nimcacheDir*: AbsoluteDir
  dllOverrides, moduleOverrides*, cfileSpecificOptions*: StringTableRef
  projectName*: string
  projectPath*: AbsoluteDir
  projectFull*: AbsoluteFile
  projectIsStdin*: bool
  lastMsgWasDot*: bool
  projectMainIdx*: FileIndex
  projectMainIdx2*: FileIndex
  command*: string
  commandArgs*: seq[string]
  commandLine*: string
  extraCmds*: seq[string]
  keepComments*: bool
  implicitImports*: seq[string]
  implicitIncludes*: seq[string]
  docSeeSrcUrl*: string
  docRoot*: string           ## see nim --fullhelp for --docRoot
  docCmd*: string            ## see nim --fullhelp for --docCmd
  cIncludes*: seq[AbsoluteDir]
  cLibs*: seq[AbsoluteDir]
  cLinkedLibs*: seq[string]
  externalToLink*: seq[string]
  linkOptionsCmd*: string
  compileOptionsCmd*: seq[string]
  linkOptions*: string
  compileOptions*: string
  cCompilerPath*: string
  toCompile*: CfileList
  suggestionResultHook*: proc (result: Suggest) {...}{.closure.}
  suggestVersion*: int
  suggestMaxResults*: int
  lastLineInfo*: TLineInfo
  writelnHook*: proc (output: string) {...}{.closure.}
  structuredErrorHook*: proc (config: ConfigRef; info: TLineInfo; msg: string;
                              severity: Severity) {...}{.closure, gcsafe.}
  cppCustomNamespace*: string
  vmProfileData*: ProfileData
```
  every global configuration fields marked with '\*' are subject to the incremental compilation mechanisms (+) means "part of the dependency" [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L233)   Consts
------

  
```
hasTinyCBackend = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L18)  
```
useEffectSystem = true
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L19)  
```
useWriteTracking = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L20)  
```
hasFFI = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L21)  
```
copyrightYear = "2021"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L22)  
```
harmlessOptions = {optForceFullMake, optNoLinking, optRun, optUseColors,
                   optStdout}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L106)  
```
oldExperimentalFeatures = {implicitDeref, dotOperators, callOperator, parallel}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L370)  
```
ChecksOptions = {optObjCheck, optFieldCheck, optRangeCheck, optOverflowCheck,
                 optBoundsCheck, optAssert, optNaNCheck, optInfCheck,
                 optStyleCheck}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L373) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L373)  
```
DefaultOptions = {optObjCheck, optFieldCheck, optRangeCheck, optBoundsCheck,
                  optOverflowCheck, optAssert, optWarns, optRefCheck, optHints,
                  optStackTrace, optLineTrace, optTrMacros, optStyleCheck,
                  optCursorInference}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L377)  
```
DefaultGlobalOptions = {optThreadAnalysis, optExcessiveStackTrace,
                        optListFullPaths}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L381) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L381)  
```
genSubDir = r"nimcache"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L544)  
```
NimExt = "nim"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L545) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L545)  
```
RodExt = "rod"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L546)  
```
HtmlExt = "html"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L547) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L547)  
```
JsonExt = "json"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L548) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L548)  
```
TagsExt = "tags"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L549) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L549)  
```
TexExt = "tex"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L550) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L550)  
```
IniExt = "ini"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L551) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L551)  
```
DefaultConfig = r"nim.cfg"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L552) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L552)  
```
DefaultConfigNims = r"config.nims"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L553) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L553)  
```
DocConfig = r"nimdoc.cfg"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L554) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L554)  
```
DocTexConfig = r"nimdoc.tex.cfg"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L555) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L555)  
```
htmldocsDir = "htmldocs"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L556) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L556)  
```
docRootDefault = "@default"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L557) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L557)  
```
oKeepVariableNames = true
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L558) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L558)   Procs
-----

  
```
proc assignIfDefault[T](result: var T; val: T; def = default(T))
```
  if `result` was already assigned to a value (that wasn't `def`), this is a noop. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L333)  
```
proc setNoteDefaults(conf: ConfigRef; note: TNoteKind; enabled = true) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L341)  
```
proc setNote(conf: ConfigRef; note: TNoteKind; enabled = true) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L348) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L348)  
```
proc hasHint(conf: ConfigRef; note: TNoteKind): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L353) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L353)  
```
proc hasWarn(conf: ConfigRef; note: TNoteKind): bool {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L359) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L359)  
```
proc hcrOn(conf: ConfigRef): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L362) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L362)  
```
proc getDateStr(): string {...}{.raises: [], tags: [ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L396) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L396)  
```
proc getClockStr(): string {...}{.raises: [], tags: [ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L399)  
```
proc newConfigRef(): ConfigRef {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L411) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L411)  
```
proc newPartialConfigRef(): ConfigRef {...}{.raises: [], tags: [].}
```
  create a new ConfigRef that is only good enough for error reporting. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L471)  
```
proc cppDefine(c: ConfigRef; define: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L482) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L482)  
```
proc isDefined(conf: ConfigRef; symbol: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L485) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L485)  
```
proc importantComments(conf: ConfigRef): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L533) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L533)  
```
proc usesWriteBarrier(conf: ConfigRef): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L534) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L534)  
```
proc mainCommandArg(conf: ConfigRef): string {...}{.raises: [], tags: [].}
```
  This is intended for commands like check or parse which will work on the main project file unless explicitly given a specific file argument [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L560)  
```
proc existsConfigVar(conf: ConfigRef; key: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L569) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L569)  
```
proc getConfigVar(conf: ConfigRef; key: string; default = ""): string {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L572) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L572)  
```
proc setConfigVar(conf: ConfigRef; key, val: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L575) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L575)  
```
proc getOutFile(conf: ConfigRef; filename: RelativeFile; ext: string): AbsoluteFile {...}{.
    raises: [OSError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L578) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L578)  
```
proc absOutFile(conf: ConfigRef): AbsoluteFile {...}{.raises: [OSError],
    tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L585) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L585)  
```
proc prepareToWriteOutput(conf: ConfigRef): AbsoluteFile {...}{.
    raises: [OSError, IOError], tags: [ReadDirEffect, WriteDirEffect].}
```
  Create the output directory and returns a full path to the output file [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L592) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L592)  
```
proc getPrefixDir(conf: ConfigRef): AbsoluteDir {...}{.raises: [],
    tags: [ReadIOEffect].}
```
  Gets the prefix dir, usually the parent directory where the binary resides.

 This is overridden by some tools (namely nimsuggest) via the `conf.prefixDir` field.

 
This should resolve to root of nim sources, whether running nim from a local clone or using installed nim, so that these exist: `result/doc/advopt.txt`
  and `result/lib/system.nim`

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L597) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L597)  
```
proc setDefaultLibpath(conf: ConfigRef) {...}{.raises: [OSError],
    tags: [ReadIOEffect, ReadDirEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L608) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L608)  
```
proc canonicalizePath(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile {...}{.
    raises: [OSError], tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L632) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L632)  
```
proc removeTrailingDirSep(path: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L635) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L635)  
```
proc disableNimblePath(conf: ConfigRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L641)  
```
proc clearNimblePath(conf: ConfigRef) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L646) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L646)  
```
proc getNimbleFile(conf: ConfigRef; path: string): string {...}{.raises: [KeyError],
    tags: [ReadDirEffect].}
```
  returns absolute path to nimble file, e.g.: /pathto/cligen.nimble [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/packagehandling.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/packagehandling.nim#L18)  
```
proc getPackageName(conf: ConfigRef; path: string): string {...}{.raises: [KeyError],
    tags: [ReadDirEffect].}
```
  returns nimble package name, e.g.: `cligen` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/packagehandling.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/packagehandling.nim#L37)  
```
proc fakePackageName(conf: ConfigRef; path: AbsoluteFile): string {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/packagehandling.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/packagehandling.nim#L42)  
```
proc demanglePackageName(path: string): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/packagehandling.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/packagehandling.nim#L49)  
```
proc withPackageName(conf: ConfigRef; path: AbsoluteFile): AbsoluteFile {...}{.
    raises: [KeyError, OSError, Exception], tags: [ReadDirEffect, RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/packagehandling.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/packagehandling.nim#L52)  
```
proc getNimcacheDir(conf: ConfigRef): AbsoluteDir {...}{.raises: [OSError],
    tags: [ReadEnvEffect, ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L658) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L658)  
```
proc pathSubs(conf: ConfigRef; p, config: string): string {...}{.
    raises: [ValueError, OSError], tags: [ReadEnvEffect, ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L668)  
```
proc toGeneratedFile(conf: ConfigRef; path: AbsoluteFile; ext: string): AbsoluteFile {...}{.
    raises: [OSError], tags: [ReadEnvEffect, ReadIOEffect].}
```
  converts "/home/a/mymodule.nim", "rod" to "/home/a/nimcache/mymodule.rod" [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L689) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L689)  
```
proc completeGeneratedFilePath(conf: ConfigRef; f: AbsoluteFile;
                               createSubDir: bool = true): AbsoluteFile {...}{.
    raises: [OSError, IOError], tags: [ReadEnvEffect, ReadIOEffect,
                                       WriteDirEffect, ReadDirEffect,
                                       WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L694) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L694)  
```
proc getRelativePathFromConfigPath(conf: ConfigRef; f: AbsoluteFile): RelativeFile {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L741) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L741)  
```
proc findFile(conf: ConfigRef; f: string; suppressStdlib = false): AbsoluteFile {...}{.
    raises: [OSError, KeyError], tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L751) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L751)  
```
proc findModule(conf: ConfigRef; modulename, currentModule: string): AbsoluteFile {...}{.
    raises: [OSError, KeyError], tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L772) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L772)  
```
proc findProjectNimFile(conf: ConfigRef; pkg: string): string {...}{.
    raises: [OSError], tags: [ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L793) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L793)  
```
proc inclDynlibOverride(conf: ConfigRef; lib: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L841) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L841)  
```
proc isDynlibOverride(conf: ConfigRef; lib: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L844) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L844)  
```
proc parseIdeCmd(s: string): IdeCmd {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L848) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L848)  
```
proc `$`(c: IdeCmd): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L864)  
```
proc floatInt64Align(conf: ConfigRef): int16 {...}{.raises: [], tags: [].}
```
  Returns either 4 or 8 depending on reasons. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L880) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L880)  
```
proc setOutFile(conf: ConfigRef) {...}{.raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L890) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L890)   Iterators
---------

  
```
iterator nimbleSubs(conf: ConfigRef; p: string): string {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L680) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L680)   Templates
---------

  
```
template setErrorMaxHighMaybe(conf: ConfigRef)
```
  do not stop after first error (but honor --errorMax if provided) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L337)  
```
template depConfigFields(fn) {...}{.dirty.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L364) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L364)  
```
template newPackageCache(): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L402) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L402)  
```
template compilationCachePresent(conf: ConfigRef): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L536) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L536)  
```
template optPreserveOrigSource(conf: ConfigRef): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/options.nim#L540) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/options.nim#L540)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/options.html>

parampatterns
=============

 This module implements the pattern matching features for term rewriting macro support.

 Imports
-------

  <ast>, <types>, <msgs>, <idents>, <renderer>, <wordrecg>, <trees>, <options>  Types
-----

  
```
TAliasRequest = enum
  aqNone = 1, aqShouldAlias, aqNoAlias
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L20)  
```
TSideEffectAnalysis = enum
  seUnknown, seSideEffect, seNoSideEffect
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L134)  
```
TAssignableResult = enum
  arNone, arLValue, arLocalLValue, arDiscriminant, arLentValue, arStrange
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L173)   Consts
------

  
```
MaxStackSize = 64
```
  max required stack size by the VM [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L43)   Procs
-----

  
```
proc whichAlias(p: PSym): TAliasRequest {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L51)  
```
proc semNodeKindConstraints(n: PNode; conf: ConfigRef; start: Natural): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  does semantic checking for a node kind pattern and compiles it into an efficient internal format. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L118)  
```
proc checkForSideEffects(n: PNode): TSideEffectAnalysis {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L137)  
```
proc exprRoot(n: PNode): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L182)  
```
proc isAssignable(owner: PSym; n: PNode; isUnsafeAddr = false): TAssignableResult {...}{.
    raises: [Exception, ERecoverableError], tags: [RootEffect].}
```
  'owner' can be nil! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L212)  
```
proc isLValue(n: PNode): bool {...}{.raises: [Exception, ERecoverableError],
                                tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L299) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L299)  
```
proc matchNodeKinds(p, n: PNode): bool {...}{.raises: [Exception, ERecoverableError],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parampatterns.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parampatterns.nim#L302)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/parampatterns.html>

parser
======

 Imports
-------

  <llstream>, <lexer>, <idents>, <ast>, <msgs>, <options>, <lineinfos>, <pathutils>  Types
-----

  
```
Parser = object
  currInd: int
  firstTok: bool
  hasProgress: bool
  lex*: Lexer
  tok*: Token
  inPragma*: int
  inSemiStmtList*: int
  emptyNode: PNode
  when defined(nimpretty):
      em*: Emitter
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L40)   Procs
-----

  
```
proc getTok(p: var Parser) {...}{.raises: [Exception, ValueError, IOError,
                                      ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  Get the next token from the parser's lexer, and store it in the parser's `tok` member. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L100)  
```
proc openParser(p: var Parser; fileIdx: FileIndex; inputStream: PLLStream;
                cache: IdentCache; config: ConfigRef) {...}{.
    raises: [IOError, Exception, ValueError, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  Open a parser, using the given arguments to set up its internal state. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L113)  
```
proc openParser(p: var Parser; filename: AbsoluteFile; inputStream: PLLStream;
                cache: IdentCache; config: ConfigRef) {...}{.
    raises: [IOError, Exception, ValueError, ERecoverableError, KeyError], tags: [
    ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L125)  
```
proc closeParser(p: var Parser) {...}{.raises: [], tags: [].}
```
  Close a parser, freeing up its resources. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L129)  
```
proc parMessage(p: Parser; msg: TMsgKind; arg: string = "") {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  Produce and emit the parser message `arg` to output. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L135)  
```
proc skipComment(p: var Parser; node: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L180)  
```
proc skipInd(p: var Parser) {...}{.raises: [Exception, ValueError, IOError,
                                       ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L191)  
```
proc optPar(p: var Parser) {...}{.raises: [Exception, ValueError, IOError,
                                      ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L195)  
```
proc optInd(p: var Parser; n: PNode) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L199)  
```
proc expectIdentOrKeyw(p: Parser) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L207)  
```
proc expectIdent(p: Parser) {...}{.raises: [Exception, ValueError, IOError,
                                       ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L211)  
```
proc eat(p: var Parser; tokType: TokType) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  Move the parser to the next token if the current token is of type `tokType`, otherwise error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L215)  
```
proc parLineInfo(p: Parser): TLineInfo {...}{.raises: [], tags: [].}
```
  Retrieve the line information associated with the parser's current state. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L224)  
```
proc indAndComment(p: var Parser; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L228) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L228)  
```
proc newNodeP(kind: TNodeKind; p: Parser): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L235)  
```
proc newIntNodeP(kind: TNodeKind; intVal: BiggestInt; p: Parser): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L238)  
```
proc newFloatNodeP(kind: TNodeKind; floatVal: BiggestFloat; p: Parser): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L242) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L242)  
```
proc newStrNodeP(kind: TNodeKind; strVal: string; p: Parser): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L247)  
```
proc newIdentNodeP(ident: PIdent; p: Parser): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L251) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L251)  
```
proc isOperator(tok: Token): bool {...}{.raises: [], tags: [].}
```
  Determines if the given token is an operator type token. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L268)  
```
proc parseSymbol(p: var Parser; mode = smNormal): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L322) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L322)  
```
proc setBaseFlags(n: PNode; base: NumericalBase) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L509) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L509)  
```
proc parseAll(p: var Parser): PNode {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  Parses the rest of the input stream held by the parser into a PNode. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L2297) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L2297)  
```
proc parseTopLevelStmt(p: var Parser): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  Implements an iterator which, when called repeatedly, returns the next top-level statement or emptyNode if end of stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L2312) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L2312)  
```
proc parseString(s: string; cache: IdentCache; config: ConfigRef;
                 filename: string = ""; line: int = 0;
                 errorHandler: ErrorHandler = nil): PNode {...}{.
    raises: [IOError, Exception, ValueError, ERecoverableError, KeyError], tags: [
    ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  Parses a string into an AST, returning the top node. `filename` and `line`, although optional, provide info so that the compiler can generate correct error messages referring to the original source. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/parser.nim#L2341) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/parser.nim#L2341)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/parser.html>

passaux
=======

 implements some little helper passes

 Imports
-------

  <ast>, <passes>, <idents>, <msgs>, <options>, <idgen>, <lineinfos>, <modulegraphs>  Consts
------

  
```
verbosePass = (verboseOpen, verboseProcess, nil, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passaux.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passaux.nim#L35)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/passaux.html>

passes
======

 This module implements the passes functionality. A pass must implement the `TPass` interface.

 Imports
-------

  <options>, <ast>, <llstream>, <msgs>, <idents>, <syntaxes>, <idgen>, <modulegraphs>, <reorder>, <rod>, <lineinfos>, <pathutils>  Types
-----

  
```
TPassData = tuple[input: PNode, closeOutput: PNode]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L20)   Procs
-----

  
```
proc makePass(open: TPassOpen = nil; process: TPassProcess = nil;
              close: TPassClose = nil; isFrontend = false): TPass {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L26)  
```
proc skipCodegen(config: ConfigRef; n: PNode): bool {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L35)  
```
proc clearPasses(g: ModuleGraph) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L47)  
```
proc registerPass(g: ModuleGraph; p: TPass) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L50)  
```
proc carryPass(g: ModuleGraph; p: TPass; module: PSym; m: TPassData): TPassData {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L54)  
```
proc carryPasses(g: ModuleGraph; nodes: PNode; module: PSym;
                 passes: openArray[TPass]) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L61)  
```
proc moduleHasChanged(graph: ModuleGraph; module: PSym): bool {...}{.inline,
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L123)  
```
proc processModule(graph: ModuleGraph; module: PSym; stream: PLLStream): bool {...}{.
    discardable, raises: [Exception, ValueError, IOError, ERecoverableError,
                          KeyError, OSError], tags: [RootEffect, WriteIOEffect,
    ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/passes.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/passes.nim#L126)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/passes.html>

pathutils
=========

 Path handling utilities for Nim. Strictly typed code in order to avoid the never ending time sink in getting path handling right.

 Types
-----

  
```
AbsoluteFile = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L16)  
```
AbsoluteDir = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L17)  
```
RelativeFile = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L18)  
```
RelativeDir = distinct string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L19)  
```
AnyPath = AbsoluteFile | AbsoluteDir | RelativeFile | RelativeDir
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L20)   Procs
-----

  
```
proc isEmpty(x: AnyPath): bool {...}{.inline.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L22)  
```
proc copyFile(source, dest: AbsoluteFile) {...}{.raises: [OSError, IOError],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L24)  
```
proc removeFile(x: AbsoluteFile) {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L27)  
```
proc splitFile(x: AbsoluteFile): tuple[dir: AbsoluteDir, name, ext: string] {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L29)  
```
proc extractFilename(x: AbsoluteFile): string {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L33)  
```
proc fileExists(x: AbsoluteFile): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L35)  
```
proc dirExists(x: AbsoluteDir): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L36)  
```
proc quoteShell(x: AbsoluteFile): string {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L38)  
```
proc quoteShell(x: AbsoluteDir): string {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L39)  
```
proc cmpPaths(x, y: AbsoluteDir): int {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L41)  
```
proc createDir(x: AbsoluteDir) {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L43)  
```
proc toAbsoluteDir(path: string): AbsoluteDir {...}{.raises: [OSError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L45)  
```
proc `$`(x: AnyPath): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L49)  
```
proc `==`[T: AnyPath](x, y: T): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L55)  
```
proc `/`(base: AbsoluteDir; f: RelativeFile): AbsoluteFile {...}{.raises: [OSError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L68)  
```
proc `/`(base: AbsoluteDir; f: RelativeDir): AbsoluteDir {...}{.raises: [OSError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L76)  
```
proc relativeTo(fullPath: AbsoluteFile; baseFilename: AbsoluteDir; sep = DirSep): RelativeFile {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L84)  
```
proc toAbsolute(file: string; base: AbsoluteDir): AbsoluteFile {...}{.
    raises: [OSError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L91)  
```
proc changeFileExt(x: AbsoluteFile; ext: string): AbsoluteFile {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L95)  
```
proc changeFileExt(x: RelativeFile; ext: string): RelativeFile {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L96)  
```
proc addFileExt(x: AbsoluteFile; ext: string): AbsoluteFile {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L98)  
```
proc addFileExt(x: RelativeFile; ext: string): RelativeFile {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L99)  
```
proc writeFile(x: AbsoluteFile; content: string) {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pathutils.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pathutils.nim#L101)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/pathutils.html>

patterns
========

 This module implements the pattern matching features for term rewriting macro support.

 Imports
-------

  <ast>, <types>, <semdata>, <sigmatch>, <idents>, <aliases>, <parampatterns>, <trees>  Procs
-----

  
```
proc sameTrees(a, b: PNode): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/patterns.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/patterns.nim#L50)  
```
proc applyRule(c: PContext; s: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ERecoverableError, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  returns a tree to semcheck if the rule triggered; nil otherwise [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/patterns.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/patterns.nim#L247)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/patterns.html>

platform
========

 Types
-----

  
```
TSystemOS = enum
  osNone, osDos, osWindows, osOs2, osLinux, osMorphos, osSkyos, osSolaris,
  osIrix, osNetbsd, osFreebsd, osOpenbsd, osDragonfly, osAix, osPalmos, osQnx,
  osAmiga, osAtari, osNetware, osMacos, osMacosx, osIos, osHaiku, osAndroid,
  osVxWorks, osGenode, osJS, osNimVM, osStandalone, osNintendoSwitch,
  osFreeRTOS, osAny
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L20)  
```
TInfoOSProp = enum
  ospNeedsPIC, ospCaseInsensitive, ospPosix, ospLacksThreadVars
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L28)  
```
TInfoOSProps = set[TInfoOSProp]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L33)  
```
TInfoOS = tuple[name: string, parDir: string, dllFrmt: string,
                altDirSep: string, objExt: string, newLine: string,
                pathSep: string, dirSep: string, scriptExt: string,
                curDir: string, exeExt: string, extSep: string,
                props: TInfoOSProps]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L34)  
```
TSystemCPU = enum
  cpuNone, cpuI386, cpuM68k, cpuAlpha, cpuPowerpc, cpuPowerpc64, cpuPowerpc64el,
  cpuSparc, cpuVm, cpuHppa, cpuIa64, cpuAmd64, cpuMips, cpuMipsel, cpuArm,
  cpuArm64, cpuJS, cpuNimVM, cpuAVR, cpuMSP430, cpuSparc64, cpuMips64,
  cpuMips64el, cpuRiscV32, cpuRiscV64, cpuEsp, cpuWasm32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L191) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L191)  
```
TEndian = enum
  littleEndian, bigEndian
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L199)  
```
TInfoCPU = tuple[name: string, intSize: int, endian: TEndian,
                 floatSize, bit: int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L201)  
```
Target = object
  targetCPU*, hostCPU*: TSystemCPU
  targetOS*, hostOS*: TSystemOS
  intSize*: int
  floatSize*: int
  ptrSize*: int
  tnl*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L235) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L235)   Consts
------

  
```
OS: array[succ(low(TSystemOS)) .. high(TSystemOS), TInfoOS] = [(name: "DOS",
    parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj",
    newLine: "\c\n", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".",
    exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "Windows",
    parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj",
    newLine: "\c\n", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".",
    exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "OS2",
    parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".obj",
    newLine: "\c\n", pathSep: ";", dirSep: "\\", scriptExt: ".bat", curDir: ".",
    exeExt: ".exe", extSep: ".", props: {ospCaseInsensitive}), (name: "Linux",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "MorphOS",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "SkyOS",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Solaris",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Irix",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "NetBSD",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "FreeBSD",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "OpenBSD",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (
    name: "DragonFly", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (
    name: "AIX", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (
    name: "PalmOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC}), (name: "QNX",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "Amiga",
    parDir: "..", dllFrmt: "$1.library", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC}), (name: "Atari",
    parDir: "..", dllFrmt: "$1.dll", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: "", curDir: ".",
    exeExt: ".tpp", extSep: ".", props: {ospNeedsPIC}), (name: "Netware",
    parDir: "..", dllFrmt: "$1.nlm", altDirSep: "/", objExt: "",
    newLine: "\c\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: ".nlm", extSep: ".", props: {ospCaseInsensitive}), (name: "MacOS",
    parDir: "::", dllFrmt: "$1Lib", altDirSep: ":", objExt: ".o", newLine: "\c",
    pathSep: ",", dirSep: ":", scriptExt: "", curDir: ":", exeExt: "",
    extSep: ".", props: {ospCaseInsensitive}), (name: "MacOSX", parDir: "..",
    dllFrmt: "lib$1.dylib", altDirSep: ":", objExt: ".o", newLine: "\n",
    pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "",
    extSep: ".", props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), (
    name: "iOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (
    name: "Haiku", parDir: "..", dllFrmt: "lib$1.so", altDirSep: ":",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".",
    props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), (name: "Android",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospPosix}), (name: "VxWorks",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ";", dirSep: "\\", scriptExt: ".sh", curDir: ".",
    exeExt: ".vxe", extSep: ".",
    props: {ospNeedsPIC, ospPosix, ospLacksThreadVars}), (name: "Genode",
    pardir: "..", dllFrmt: "$1.lib.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: "", curDir: "/",
    exeExt: "", extSep: ".", props: {ospNeedsPIC, ospLacksThreadVars}), (
    name: "JS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {}), (name: "NimVM", parDir: "..",
    dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o", newLine: "\n",
    pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".", exeExt: "",
    extSep: ".", props: {}), (name: "Standalone", parDir: "..",
                              dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
                              newLine: "\n", pathSep: ":", dirSep: "/",
                              scriptExt: ".sh", curDir: ".", exeExt: "",
                              extSep: ".", props: {}), (name: "NintendoSwitch",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: ".elf", extSep: ".", props: {ospNeedsPIC, ospPosix}), (
    name: "FreeRTOS", parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/",
    objExt: ".o", newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh",
    curDir: ".", exeExt: "", extSep: ".", props: {ospPosix}), (name: "Any",
    parDir: "..", dllFrmt: "lib$1.so", altDirSep: "/", objExt: ".o",
    newLine: "\n", pathSep: ":", dirSep: "/", scriptExt: ".sh", curDir: ".",
    exeExt: "", extSep: ".", props: {})]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L41)  
```
EndianToStr: array[TEndian, string] = ["littleEndian", "bigEndian"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L205)  
```
CPU: array[succ(low(TSystemCPU)) .. high(TSystemCPU), TInfoCPU] = [
    (name: "i386", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
    (name: "m68k", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (
    name: "alpha", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
    (name: "powerpc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (
    name: "powerpc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64), (
    name: "powerpc64el", intSize: 64, endian: littleEndian, floatSize: 64,
    bit: 64),
    (name: "sparc", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
    (name: "vm", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
    (name: "hppa", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
    (name: "ia64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64), (
    name: "amd64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
    (name: "mips", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32), (
    name: "mipsel", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32),
    (name: "arm", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (
    name: "arm64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
    (name: "js", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
    (name: "nimvm", intSize: 32, endian: bigEndian, floatSize: 64, bit: 32),
    (name: "avr", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16), (
    name: "msp430", intSize: 16, endian: littleEndian, floatSize: 32, bit: 16),
    (name: "sparc64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64),
    (name: "mips64", intSize: 64, endian: bigEndian, floatSize: 64, bit: 64), (
    name: "mips64el", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64), (
    name: "riscv32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (
    name: "riscv64", intSize: 64, endian: littleEndian, floatSize: 64, bit: 64),
    (name: "esp", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32), (
    name: "wasm32", intSize: 32, endian: littleEndian, floatSize: 64, bit: 32)]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L206)   Procs
-----

  
```
proc setTarget(t: var Target; o: TSystemOS; c: TSystemCPU) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L243)  
```
proc nameToOS(name: string): TSystemOS {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L254)  
```
proc listOSnames(): seq[string] {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L260)  
```
proc nameToCPU(name: string): TSystemCPU {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L264) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L264)  
```
proc listCPUnames(): seq[string] {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L270)  
```
proc setTargetFromSystem(t: var Target) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/platform.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/platform.nim#L274)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/platform.html>

plugins/active
==============

 Include file that imports all plugins that are active.

 Imports
-------

  <../pluginsupport>, <../idents>, <../ast>, <locals>, <itersgen>  Procs
-----

  
```
proc getPlugin(ic: IdentCache; fn: PSym): Transformation {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/plugins/active.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/plugins/active.nim#L21)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/plugins/active.html>

plugins/itersgen
================

 Plugin to transform an inline iterator into a data structure.

 Imports
-------

  <../ast>, <../lookups>, <../semdata>, <../lambdalifting>, <../msgs>  Procs
-----

  
```
proc iterToProcImpl(c: PContext; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/plugins/itersgen.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/plugins/itersgen.nim#L14)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/plugins/itersgen.html>

plugins/locals
==============

 The builtin 'system.locals' implemented as a plugin.

 Imports
-------

  <../ast>, <../astalgo>, <../magicsys>, <../lookups>, <../semdata>, <../lowerings>  Procs
-----

  
```
proc semLocals(c: PContext; n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/plugins/locals.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/plugins/locals.nim#L15)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/plugins/locals.html>

pluginsupport
=============

 Plugin support for the Nim compiler. Right now plugins need to be built with the compiler only: plugins using DLLs or the FFI will not work.

 Imports
-------

  <ast>, <semdata>, <idents>  Types
-----

  
```
Transformation = proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pluginsupport.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pluginsupport.nim#L17)  
```
Plugin = tuple[package, module, fn: string, t: Transformation]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pluginsupport.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pluginsupport.nim#L18)   Procs
-----

  
```
proc pluginMatches(ic: IdentCache; p: Plugin; s: PSym): bool {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pluginsupport.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pluginsupport.nim#L22)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/pluginsupport.html>

pragmas
=======

 Imports
-------

  <condsyms>, <ast>, <astalgo>, <idents>, <semdata>, <msgs>, <renderer>, <wordrecg>, <ropes>, <options>, <extccomp>, <magicsys>, <trees>, <types>, <lookups>, <lineinfos>, <pathutils>, <linter>  Consts
------

  
```
FirstCallConv = wNimcall
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L18)  
```
LastCallConv = wNoconv
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L19)  
```
procPragmas = {wMagic..wThread, wConstructor, wDelegator,
               wImportCpp..wExportNims, wNodecl, wSideEffect..wMerge,
               wDynlib..wProcVar, wUsed, wError, wStackTrace..wLineTrace,
               wDeprecated..wVarargs, wNimcall..wNoconv, wNonReloadable,
               wRaises, wTags..wEnsures, wNoDestroy, wCompileTime..wNoInit,
               wBorrow..wDiscardable, wGensym..wInject, wAsmNoStackFrame,
               wCodegenDecl, wLocks, wLiftLocals, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L25)  
```
converterPragmas = {wMagic..wThread, wConstructor, wDelegator,
                    wImportCpp..wExportNims, wNodecl, wSideEffect..wMerge,
                    wDynlib..wProcVar, wUsed, wError, wStackTrace..wLineTrace,
                    wDeprecated..wVarargs, wNimcall..wNoconv, wNonReloadable,
                    wRaises, wTags..wEnsures, wNoDestroy, wCompileTime..wNoInit,
                    wBorrow..wDiscardable, wGensym..wInject, wAsmNoStackFrame,
                    wCodegenDecl, wLocks, wLiftLocals, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L33)  
```
methodPragmas = {wMagic..wThread, wConstructor, wDelegator,
                 wImportObjC..wExportNims, wNodecl, wSideEffect..wMerge,
                 wDynlib..wUsed, wError, wStackTrace..wLineTrace,
                 wDeprecated..wVarargs, wNimcall..wNoconv, wNonReloadable,
                 wRaises, wTags..wEnsures, wNoDestroy, wCompileTime..wNoInit,
                 wBorrow..wDiscardable, wGensym..wInject, wAsmNoStackFrame,
                 wCodegenDecl, wLocks, wLiftLocals, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L34)  
```
templatePragmas = {wDeprecated, wError, wGensym, wInject, wDirty, wDelegator,
                   wExportNims, wUsed, wPragma}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L35)  
```
macroPragmas = {wMagic, wDelegator, wImportCpp..wImportObjC,
                wImportc..wExportNims, wNodecl, wNoSideEffect,
                wCompilerProc..wCore, wUsed, wError, wDeprecated,
                wNimcall..wNoconv, wNonReloadable, wDiscardable,
                wGensym..wInject, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L37)  
```
iteratorPragmas = {wMagic, wImportCpp..wImportObjC, wImportc..wExportNims,
                   wNodecl, wSideEffect, wNoSideEffect..wGcSafe, wUsed, wError,
                   wDeprecated, wNimcall..wNoconv, wRaises, wTags..wEnsures,
                   wBorrow..wDiscardable, wGensym..wInject, wLocks, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L40)  
```
exprPragmas = {wLine, wLocks, wNoRewrite, wGcSafe, wNoSideEffect}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L44)  
```
stmtPragmas = {wChecks, wObjChecks, wFieldChecks, wRangeChecks, wBoundChecks,
               wOverflowChecks, wNilChecks, wStaticBoundchecks, wStyleChecks,
               wAssertions, wWarnings, wHints, wLineDir, wStackTrace,
               wLineTrace, wOptimization, wHint, wWarning, wError, wFatal,
               wDefine, wUndef, wCompile, wLink, wLinksys, wPure, wPush, wPop,
               wPassl, wPassc, wLocalPassc, wDeadCodeElimUnused, wDeprecated,
               wFloatChecks, wInfChecks, wNanChecks, wPragma, wEmit, wUnroll,
               wLinearScanEnd, wPatterns, wTrMacros, wEffects, wNoForward,
               wReorder, wComputedGoto, wInjectStmt, wExperimental, wThis,
               wUsed, wInvariant, wAssume, wAssert}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L45)  
```
lambdaPragmas = {wNimcall..wNoconv, wNoSideEffect, wSideEffect, wNoreturn,
                 wNosinks, wDynlib, wHeader, wThread, wAsmNoStackFrame, wRaises,
                 wLocks, wTags, wRequires, wEnsures, wGcSafe, wCodegenDecl,
                 wNoInit}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L57)  
```
typePragmas = {wMagic, wFinal, wImportCpp..wImportObjC, wImportc..wRequiresInit,
               wNodecl..wPure, wHeader, wGcSafe, wCompilerProc..wCore, wUsed,
               wError, wDeprecated, wSize, wPackage, wBorrow,
               wAcyclic..wShallow, wGensym..wInject, wInheritable, wUnchecked,
               wPartial..wExplain, wExtern, wUnion..wPacked, wByCopy..wByRef}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L62)  
```
fieldPragmas = {wCursor..wNoalias, wImportCpp..wImportObjC,
                wImportc..wExportCpp, wRequiresInit..wAlign, wUsed, wError,
                wDeprecated, wGuard, wExtern, wBitsize}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L67)  
```
varPragmas = {wMagic, wCursor..wNoalias, wImportCpp..wImportObjC,
              wImportc..wExportNims, wAlign..wNodecl, wHeader, wDynlib..wCore,
              wUsed, wError, wDeprecated, wCompileTime..wNoInit,
              wGensym..wInject, wThreadVar, wGlobal..wCodegenDecl, wGuard,
              wExtern, wGoto, wRegister, wVolatile}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L69)  
```
constPragmas = {wMagic, wIntDefine..wBoolDefine, wImportCpp..wImportObjC,
                wImportc..wExportNims, wNodecl, wHeader, wCompilerProc..wCore,
                wUsed, wError, wDeprecated, wGensym..wInject, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L74)  
```
paramPragmas = {wNoalias, wInject, wGensym}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L77)  
```
letPragmas = {wMagic, wCursor..wNoalias, wImportCpp..wImportObjC,
              wImportc..wExportNims, wAlign..wNodecl, wHeader, wDynlib..wCore,
              wUsed, wError, wDeprecated, wCompileTime..wNoInit,
              wGensym..wInject, wThreadVar, wGlobal..wCodegenDecl, wGuard,
              wExtern, wGoto, wRegister, wVolatile}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L78)  
```
procTypePragmas = {wNimcall..wNoconv, wVarargs, wNoSideEffect, wThread, wRaises,
                   wLocks, wTags, wGcSafe, wRequires, wEnsures}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L79)  
```
forVarPragmas = {wInject, wGensym}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L82)  
```
allRoutinePragmas = {wMagic..wThread, wConstructor, wDelegator,
                     wImportCpp..wExportNims, wNodecl, wSideEffect..wMerge,
                     wDynlib..wUsed, wError, wStackTrace..wLineTrace,
                     wDeprecated..wVarargs, wNimcall..wNoconv, wNonReloadable,
                     wRaises, wTags..wEnsures, wNoDestroy,
                     wCompileTime..wNoInit, wBorrow..wDiscardable,
                     wGensym..wInject, wAsmNoStackFrame, wCodegenDecl, wLocks,
                     wLiftLocals, wExtern}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L83)  
```
enumFieldPragmas = {wDeprecated}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L84)   Procs
-----

  
```
proc getPragmaVal(procAst: PNode; name: TSpecialWord): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L86)  
```
proc invalidPragma(c: PContext; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L107)  
```
proc illegalCustomPragma(c: PContext; n: PNode; s: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L109)  
```
proc pragmaAsm(c: PContext; n: PNode): char {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L132)  
```
proc semAsmOrEmit(con: PContext; n: PNode; marker: char): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L544) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L544)  
```
proc implicitPragmas(c: PContext; sym: PSym; n: PNode;
                     validPragmas: TSpecialWords) {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, OSError, KeyError, EOFError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect,
    WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L1241) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L1241)  
```
proc hasPragma(n: PNode; pragma: TSpecialWord): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L1265) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L1265)  
```
proc pragma(c: PContext; sym: PSym; n: PNode; validPragmas: TSpecialWords;
            isStatement: bool = false) {...}{.raises: [Exception, ValueError,
    IOError, ERecoverableError, OSError, KeyError, EOFError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect, WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/pragmas.nim#L1283) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/pragmas.nim#L1283)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/pragmas.html>

prefixmatches
=============

 Types
-----

  
```
PrefixMatch {...}{.pure.} = enum
  None,                     ## no prefix detected
  Abbrev,                   ## prefix is an abbreviation of the symbol
  Substr,                   ## prefix is a substring of the symbol
  Prefix                     ## prefix does match the symbol
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/prefixmatches.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/prefixmatches.nim#L13)   Procs
-----

  
```
proc prefixMatch(p, s: string): PrefixMatch {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/prefixmatches.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/prefixmatches.nim#L19)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/prefixmatches.html>

procfind
========

 Imports
-------

  <ast>, <astalgo>, <msgs>, <semdata>, <types>, <trees>, <lookups>  Procs
-----

  
```
proc searchForProc(c: PContext; scope: PScope; fn: PSym): tuple[proto: PSym,
    comesFromShadowScope: bool] {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/procfind.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/procfind.nim#L53)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/procfind.html>

renderer
========

 Imports
-------

  <lexer>, <options>, <idents>, <ast>, <msgs>, <lineinfos>  Types
-----

  
```
TRenderFlag = enum
  renderNone, renderNoBody, renderNoComments, renderDocComments,
  renderNoPragmas, renderIds, renderNoProcDefs, renderSyms,
  renderRunnableExamples, renderIr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L21)  
```
TRenderFlags = set[TRenderFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L25)  
```
TRenderTok = object
  kind*: TokType
  length*: int16
  sym*: PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L26)  
```
TRenderTokSeq = seq[TRenderTok]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L31)  
```
TSrcGen = object
  indent*: int
  lineLen*: int
  col: int
  pos*: int
  idx*: int
  tokens*: TRenderTokSeq
  buf*: string
  pendingNL*: int
  pendingWhitespace: int
  comStack*: seq[PNode]
  flags*: TRenderFlags
  inGenericParams: bool
  checkAnon: bool
  inPragma: int
  when defined(nimpretty):
      pendingNewlineCount: int

  fid*: FileIndex
  config*: ConfigRef
  mangler: seq[PSym]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L32)   Procs
-----

  
```
proc isKeyword(i: PIdent): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L66)  
```
proc renderDefinitionName(s: PSym; noQuotes = false): string {...}{.raises: [],
    tags: [].}
```
  Returns the definition name of the symbol.

 If noQuotes is false the symbol may be returned in backticks. This will happen if the name happens to be a keyword or the first character is not part of the SymStartChars set.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L71)  
```
proc bracketKind(g: TSrcGen; n: PNode): BracketKind {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L906) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L906)  
```
proc renderTree(n: PNode; renderFlags: TRenderFlags = {}): string {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1621) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1621)  
```
proc `$`(n: PNode): string {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1634) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1634)  
```
proc renderModule(n: PNode; infile, outfile: string;
                  renderFlags: TRenderFlags = {}; fid = FileIndex(-1);
                  conf: ConfigRef = nil) {...}{.
    raises: [Exception, IOError, ValueError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1636) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1636)  
```
proc initTokRender(r: var TSrcGen; n: PNode; renderFlags: TRenderFlags = {}) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1659) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1659)  
```
proc getNextTok(r: var TSrcGen; kind: var TokType; literal: var string) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1663) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1663)  
```
proc getTokSym(r: TSrcGen): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1673) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1673)  
```
proc quoteExpr(a: string): string {...}{.inline, raises: [], tags: [].}
```
  can be used for quoting expressions in error msgs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1679) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1679)  
```
proc genFieldDefect(field: PSym; disc: PSym): string {...}{.raises: [], tags: [].}
```
  this needs to be in a module accessible by jsgen, ccgexprs, and vm to provide this error msg FieldDefect; msgs would be better but it does not import ast [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderer.nim#L1683) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderer.nim#L1683)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/renderer.html>

renderverbatim
==============

 Imports
-------

  <ast>, <options>, <msgs>  Procs
-----

  
```
proc extractRunnableExamplesSource(conf: ConfigRef; n: PNode): string {...}{.
    raises: [], tags: [ReadIOEffect].}
```
  TLineInfo.offsetA,offsetB would be cleaner but it's only enabled for nimpretty, we'd need to check performance impact to enable it for nimdoc. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderverbatim.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderverbatim.nim#L88)  
```
proc renderNimCode(result: var string; code: string; isLatex = false) {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/renderverbatim.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/renderverbatim.nim#L134)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/renderverbatim.html>

reorder
=======

 Imports
-------

  <ast>, <idents>, <renderer>, <msgs>, <modulegraphs>, <syntaxes>, <options>, <modulepaths>, <lineinfos>  Procs
-----

  
```
proc includeModule(graph: ModuleGraph; s: PSym; fileIdx: FileIndex): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/reorder.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/reorder.nim#L117)  
```
proc reorder(graph: ModuleGraph; n: PNode; module: PSym): PNode {...}{.raises: [
    OSError, Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    ReadEnvEffect, ReadIOEffect, RootEffect, WriteIOEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/reorder.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/reorder.nim#L405)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/reorder.html>

rod
===

 This module implements the canonalization for the various caching mechanisms.

 Imports
-------

  <ast>, <idgen>, <lineinfos>, <incremental>, <modulegraphs>, <pathutils>  Procs
-----

  
```
proc loadModuleSym(g: ModuleGraph; fileIdx: FileIndex; fullpath: AbsoluteFile): (
    PSym, int) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L19)   Templates
---------

  
```
template setupModuleCache(g: ModuleGraph)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L15)  
```
template storeNode(g: ModuleGraph; module: PSym; n: PNode)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L16)  
```
template loadNode(g: ModuleGraph; module: PSym): PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L17)  
```
template addModuleDep(g: ModuleGraph; module, fileIdx: FileIndex;
                      isIncludeFile: bool)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L21)  
```
template storeRemaining(g: ModuleGraph; module: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L23)  
```
template registerModule(g: ModuleGraph; module: PSym)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rod.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rod.nim#L25)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/rod.html>

rodutils
========

 Serialization utilities for the compiler.

 Procs
-----

  
```
proc toStrMaxPrecision(f: BiggestFloat; literalPostfix = ""): string {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L36)  
```
proc encodeStr(s: string; result: var string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L53)  
```
proc decodeStr(s: cstring; pos: var int): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L66)  
```
proc encodeVBiggestInt(x: BiggestInt; result: var string) {...}{.raises: [], tags: [].}
```
  encode a biggest int as a variable length base 190 int. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L112)  
```
proc encodeVInt(x: int; result: var string) {...}{.raises: [], tags: [].}
```
  encode an int as a variable length base 190 int. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L121)  
```
proc decodeVInt(s: cstring; pos: var int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L144)  
```
proc decodeVBiggestInt(s: cstring; pos: var int): BiggestInt {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L147)   Iterators
---------

  
```
iterator decodeVIntArray(s: cstring): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L152)  
```
iterator decodeStrArray(s: cstring): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/rodutils.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/rodutils.nim#L158)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/rodutils.html>

ropes
=====

 Imports
-------

  <pathutils>  Types
-----

  
```
FormatStr = string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L64)  
```
Rope = ref RopeObj
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L68)  
```
RopeObj {...}{.acyclic.} = object of RootObj
  left, right: Rope
  L: int
  data*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L69)   Vars
----

  
```
gCacheTries = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L106)  
```
gCacheMisses = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L107)  
```
gCacheIntTries = 0
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L108)   Procs
-----

  
```
proc len(a: Rope): int {...}{.raises: [], tags: [].}
```
  the rope's length [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L75)  
```
proc resetRopeCache() {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L89)  
```
proc rope(s: string): Rope {...}{.raises: [], tags: [].}
```
  Converts a string to a rope. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L122)  
```
proc rope(i: BiggestInt): Rope {...}{.raises: [], tags: [].}
```
  Converts an int to a rope. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L130)  
```
proc rope(f: BiggestFloat): Rope {...}{.raises: [], tags: [].}
```
  Converts a float to a rope. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L135)  
```
proc `&`(a, b: Rope): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L139)  
```
proc `&`(a: Rope; b: string): Rope {...}{.raises: [], tags: [].}
```
  the concatenation operator for ropes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L150)  
```
proc `&`(a: string; b: Rope): Rope {...}{.raises: [], tags: [].}
```
  the concatenation operator for ropes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L154)  
```
proc `&`(a: openArray[Rope]): Rope {...}{.raises: [], tags: [].}
```
  the concatenation operator for an openarray of ropes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L158)  
```
proc add(a: var Rope; b: Rope) {...}{.raises: [], tags: [].}
```
  adds `b` to the rope `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L162)  
```
proc add(a: var Rope; b: string) {...}{.raises: [], tags: [].}
```
  adds `b` to the rope `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L166)  
```
proc writeRope(f: File; r: Rope) {...}{.raises: [IOError], tags: [WriteIOEffect].}
```
  writes a rope to a file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L188)  
```
proc writeRope(head: Rope; filename: AbsoluteFile): bool {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L192)  
```
proc `$`(r: Rope): string {...}{.raises: [], tags: [].}
```
  converts a rope back to a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L201)  
```
proc ropeConcat(a: varargs[Rope]): Rope {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L207)  
```
proc prepend(a: var Rope; b: Rope) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L211)  
```
proc prepend(a: var Rope; b: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L212) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L212)  
```
proc runtimeFormat(frmt: FormatStr; args: openArray[Rope]): Rope {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L214) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L214)  
```
proc `%`(frmt: static[FormatStr]; args: openArray[Rope]): Rope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L271)  
```
proc equalsFile(r: Rope; f: File): bool {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  returns true if the contents of the file `f` equal `r`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L292)  
```
proc equalsFile(r: Rope; filename: AbsoluteFile): bool {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  returns true if the contents of the file `f` equal `r`. If `f` does not exist, false is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L324) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L324)  
```
proc writeRopeIfNotEqual(r: Rope; filename: AbsoluteFile): bool {...}{.
    raises: [IOError], tags: [ReadIOEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L333) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L333)   Iterators
---------

  
```
iterator leaves(r: Rope): string {...}{.raises: [], tags: [].}
```
  iterates over any leaf string in the rope `r`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L170)  
```
iterator items(r: Rope): char {...}{.raises: [], tags: [].}
```
  iterates over any character in the rope `r`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L183)   Templates
---------

  
```
template addf(c: var Rope; frmt: FormatStr; args: openArray[Rope])
```
  shortcut for `add(c, frmt % args)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L274)  
```
template `~`(r: string): Rope
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/ropes.nim#L279) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/ropes.nim#L279)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/ropes.html>

saturate
========

 Saturated arithmetic routines. XXX Make part of the stdlib?

 Procs
-----

  
```
proc `|+|`(a, b: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  saturated addition. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L12)  
```
proc `|-|`(a, b: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L22)  
```
proc `|abs|`(a: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L31)  
```
proc `|div|`(a, b: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L38)  
```
proc `|mod|`(a, b: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L48)  
```
proc `|*|`(a, b: BiggestInt): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/saturate.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/saturate.nim#L54)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/saturate.html>

scriptconfig
============

 Implements the new configuration system for Nim. Uses Nim as a scripting language.

 Imports
-------

  <ast>, <modules>, <idents>, <passes>, <condsyms>, <options>, <sem>, <llstream>, <vm>, <vmdef>, <commands>, <wordrecg>, <modulegraphs>, <pathutils>  Procs
-----

  
```
proc setupVM(module: PSym; cache: IdentCache; scriptName: string;
             graph: ModuleGraph): PEvalContext {...}{.raises: [OSError, IOError,
    EOFError, ValueError, Exception, ERecoverableError, KeyError], tags: [
    ReadEnvEffect, WriteEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect,
    ExecIOEffect, RootEffect, TimeEffect, WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/scriptconfig.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/scriptconfig.nim#L29)  
```
proc runNimScript(cache: IdentCache; scriptName: AbsoluteFile;
                  freshDefines = true; conf: ConfigRef) {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, KeyError, OSError, EOFError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect,
    WriteEnvEffect, ExecIOEffect, TimeEffect, WriteDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/scriptconfig.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/scriptconfig.nim#L200)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/scriptconfig.html>

sem
===

 This module implements semantic checking for calls.this module does the semantic checking of statementsThis module does the semantic transformation of the fields\* iterators.This module implements Nim's object construction rules.

 Imports
-------

  <ast>, <options>, <astalgo>, <trees>, <wordrecg>, <ropes>, <msgs>, <idents>, <renderer>, <types>, <platform>, <magicsys>, <nversion>, <nimsets>, <semfold>, <modulepaths>, <importer>, <procfind>, <lookups>, <pragmas>, <passes>, <semdata>, <semtypinst>, <sigmatch>, <transf>, <vmdef>, <vm>, <idgen>, <aliases>, <cgmeth>, <lambdalifting>, <evaltempl>, <patterns>, <parampatterns>, <sempass2>, <linter>, <semmacrosanity>, <lowerings>, <plugins/active>, <rod>, <lineinfos>, <int128>, <isolation_check>, <typeallowed>, <modulegraphs>, <spawn>  Consts
------

  
```
tyUserDefinedGenerics = {tyGenericInst, tyGenericInvocation, tyUserTypeClassInst}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semmagic.nim#L105) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semmagic.nim#L105)  
```
tyMagicGenerics = {tySet, tySequence, tyArray, tyOpenArray}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semmagic.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semmagic.nim#L108)  
```
tyGenericLike = {tyGenericInvocation, tyGenericInst, tyArray, tySet, tySequence,
                 tyOpenArray, tyUserTypeClassInst..tyCompositeTypeClass}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semmagic.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semmagic.nim#L110)  
```
semPass = (myOpen, myProcess, myClose, true)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sem.nim#L641) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sem.nim#L641)   Procs
-----

  
```
proc commonType(x, y: PType): PType {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sem.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sem.nim#L111)  
```
proc commonType(x: PType; y: PNode): PType {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sem.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sem.nim#L190)  
```
proc newSymG(kind: TSymKind; n: PNode; c: PContext): PSym {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sem.nim#L200) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sem.nim#L200)  
```
proc pushProcCon(c: PContext; owner: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/seminst.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/seminst.nim#L53)  
```
proc notFoundError(c: PContext; n: PNode; errors: CandidateErrors) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semcall.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semcall.nim#L277)  
```
proc instGenericConvertersArg(c: PContext; a: PNode; x: TCandidate) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, OSError, KeyError,
    EOFError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
                      ReadDirEffect, WriteDirEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semcall.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semcall.nim#L447)  
```
proc instGenericConvertersSons(c: PContext; n: PNode; x: TCandidate) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, OSError, KeyError,
    EOFError], tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect,
                      ReadDirEffect, WriteDirEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semcall.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semcall.nim#L457)   Templates
---------

  
```
template commonTypeBegin(): PType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sem.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sem.nim#L109)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/sem.html>

semdata
=======

 This module contains the data structures for the semantic checking phase.

 Imports
-------

  <options>, <ast>, <astalgo>, <msgs>, <idents>, <renderer>, <magicsys>, <vmdef>, <modulegraphs>, <lineinfos>  Types
-----

  
```
TOptionEntry = object
  options*: TOptions
  defaultCC*: TCallingConvention
  dynlib*: PLib
  notes*: TNoteKinds
  features*: set[Feature]
  otherPragmas*: PNode
  warningAsErrors*: TNoteKinds
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L17)  
```
POptionEntry = ref TOptionEntry
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L26)  
```
PProcCon = ref TProcCon
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L27)  
```
TProcCon {...}{.acyclic.} = object
  owner*: PSym
  resultSym*: PSym
  selfSym*: PSym
  nestedLoopCounter*: int
  nestedBlockCounter*: int
  inTryStmt*: int
  next*: PProcCon
  mappingExists*: bool
  mapping*: TIdTable
  caseContext*: seq[tuple[n: PNode, idx: int]]
  localBindStmts*: seq[PNode]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L28)  
```
TMatchedConcept = object
  candidateType*: PType
  prev*: ptr TMatchedConcept
  depth*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L43)  
```
TInstantiationPair = object
  genericSym*: PSym
  inst*: PInstantiation
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L48)  
```
TExprFlag = enum
  efLValue, efWantIterator, efInTypeof, efNeedStatic, efPreferStatic,
  efPreferNilResult, efWantStmt, efAllowStmt, efDetermineType, efExplain,
  efAllowDestructor, efWantValue, efOperand, efNoSemCheck, efNoEvaluateGeneric,
  efInCall, efFromHlo, efNoSem2Check, efNoUndeclared
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L52)  
```
TExprFlags = set[TExprFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L72)  
```
PContext = ref TContext
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L74)  
```
TContext = object of TPassContext
  enforceVoidContext*: PType
  module*: PSym
  currentScope*: PScope
  importTable*: PScope
  topLevelScope*: PScope
  p*: PProcCon
  matchedConcept*: ptr TMatchedConcept
  friendModules*: seq[PSym]
  instCounter*: int
  templInstCounter*: ref int
  ambiguousSymbols*: IntSet
  inGenericContext*: int
  inStaticContext*: int
  inUnrolledContext*: int
  compilesContextId*: int
  compilesContextIdGenerator*: int
  inGenericInst*: int
  converters*: seq[PSym]
  patterns*: seq[PSym]
  optionStack*: seq[POptionEntry]
  symMapping*: TIdTable
  libs*: seq[PLib]
  semConstExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
  semExpr*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
      nimcall.}
  semTryExpr*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
      nimcall.}
  semTryConstExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
  computeRequiresInit*: proc (c: PContext; t: PType): bool {...}{.nimcall.}
  hasUnresolvedArgs*: proc (c: PContext; n: PNode): bool
  semOperand*: proc (c: PContext; n: PNode; flags: TExprFlags = {}): PNode {...}{.
      nimcall.}
  semConstBoolExpr*: proc (c: PContext; n: PNode): PNode {...}{.nimcall.}
  semOverloadedCall*: proc (c: PContext; n, nOrig: PNode; filter: TSymKinds;
                            flags: TExprFlags): PNode {...}{.nimcall.}
  semTypeNode*: proc (c: PContext; n: PNode; prev: PType): PType {...}{.nimcall.}
  semInferredLambda*: proc (c: PContext; pt: TIdTable; n: PNode): PNode
  semGenerateInstance*: proc (c: PContext; fn: PSym; pt: TIdTable;
                              info: TLineInfo): PSym
  includedFiles*: IntSet
  pureEnumFields*: TStrTable
  userPragmas*: TStrTable
  evalContext*: PEvalContext
  unknownIdents*: IntSet
  generics*: seq[TInstantiationPair]
  topStmts*: int
  lastGenericIdx*: int
  hloLoopDetector*: int
  inParallelStmt*: int
  instTypeBoundOp*: proc (c: PContext; dc: PSym; t: PType; info: TLineInfo;
                          op: TTypeAttachedOp; col: int): PSym {...}{.nimcall.}
  selfName*: PIdent
  cache*: IdentCache
  graph*: ModuleGraph
  signatures*: TStrTable
  recursiveDep*: string
  suggestionsMade*: bool
  features*: set[Feature]
  inTypeContext*: int
  typesWithOps*: seq[(PType, PType)]
  unusedImports*: seq[(PSym, TLineInfo)]
  exportIndirections*: HashSet[(int, int)]
  lastTLineInfo*: TLineInfo
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L75)   Procs
-----

  
```
proc makeInstPair(s: PSym; inst: PInstantiation): TInstantiationPair {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L151) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L151)  
```
proc filename(c: PContext): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L155)  
```
proc scopeDepth(c: PContext): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L159)  
```
proc getCurrOwner(c: PContext): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L163)  
```
proc pushOwner(c: PContext; owner: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L170)  
```
proc popOwner(c: PContext) {...}{.raises: [Exception, ValueError, IOError,
                                      ERecoverableError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L173)  
```
proc lastOptionEntry(c: PContext): POptionEntry {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L177)  
```
proc popProcCon(c: PContext) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L180)  
```
proc put(p: PProcCon; key, val: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L182)  
```
proc get(p: PProcCon; key: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L189)  
```
proc getGenSym(c: PContext; s: PSym): PSym {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L193) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L193)  
```
proc considerGenSyms(c: PContext; n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L204)  
```
proc newOptionEntry(conf: ConfigRef): POptionEntry {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L213)  
```
proc pushOptionEntry(c: PContext): POptionEntry {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L221) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L221)  
```
proc popOptionEntry(c: PContext) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L232)  
```
proc newContext(graph: ModuleGraph; module: PSym): PContext {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L239)  
```
proc addConverter(c: PContext; conv: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L265) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L265)  
```
proc addPattern(c: PContext; p: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L268)  
```
proc newLib(kind: TLibKind): PLib {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L271) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L271)  
```
proc addToLib(lib: PLib; sym: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L275) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L275)  
```
proc newTypeS(kind: TTypeKind; c: PContext): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L280) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L280)  
```
proc makePtrType(owner: PSym; baseType: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L283)  
```
proc makePtrType(c: PContext; baseType: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L287)  
```
proc makeTypeWithModifier(c: PContext; modifier: TTypeKind; baseType: PType): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L290)  
```
proc makeVarType(c: PContext; baseType: PType; kind = tyVar): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L301)  
```
proc makeVarType(owner: PSym; baseType: PType; kind = tyVar): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L308)  
```
proc makeTypeDesc(c: PContext; typ: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L315)  
```
proc makeTypeSymNode(c: PContext; typ: PType; info: TLineInfo): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L323) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L323)  
```
proc makeTypeFromExpr(c: PContext; n: PNode): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L332) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L332)  
```
proc newTypeWithSons(owner: PSym; kind: TTypeKind; sons: seq[PType]): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L337)  
```
proc newTypeWithSons(c: PContext; kind: TTypeKind; sons: seq[PType]): PType {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L341)  
```
proc makeStaticExpr(c: PContext; n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L346)  
```
proc makeAndType(c: PContext; t1, t2: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L352) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L352)  
```
proc makeOrType(c: PContext; t1, t2: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L360)  
```
proc makeNotType(c: PContext; t1: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L377)  
```
proc makeRangeWithStaticExpr(c: PContext; n: PNode): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L388)  
```
proc errorType(c: PContext): PType {...}{.raises: [], tags: [].}
```
  creates a type representing an error state [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L400) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L400)  
```
proc errorNode(c: PContext; n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L405) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L405)  
```
proc fillTypeS(dest: PType; kind: TTypeKind; c: PContext) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L409)  
```
proc makeRangeType(c: PContext; first, last: BiggestInt; info: TLineInfo;
                   intType: PType = nil): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L414) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L414)  
```
proc markIndirect(c: PContext; s: PSym) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L424)  
```
proc illFormedAst(n: PNode; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L429)  
```
proc illFormedAstLocal(n: PNode; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L432) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L432)  
```
proc checkSonsLen(n: PNode; length: int; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L435) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L435)  
```
proc checkMinSonsLen(n: PNode; length: int; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L438) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L438)  
```
proc isTopLevel(c: PContext): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L441)  
```
proc pushCaseContext(c: PContext; caseNode: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L444)  
```
proc popCaseContext(c: PContext) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L447)  
```
proc setCaseContextIdx(c: PContext; idx: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L450) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L450)   Templates
---------

  
```
template config(c: PContext): ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L149)  
```
template rangeHasUnresolvedStatic(t: PType): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semdata.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semdata.nim#L397)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/semdata.html>

semfold
=======

 Imports
-------

  <options>, <ast>, <trees>, <nimsets>, <platform>, <msgs>, <idents>, <renderer>, <types>, <commands>, <magicsys>, <modulegraphs>, <lineinfos>  Procs
-----

  
```
proc errorType(g: ModuleGraph): PType {...}{.raises: [], tags: [].}
```
  creates a type representing an error state [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L18)  
```
proc newIntNodeT(intVal: Int128; n: PNode; g: ModuleGraph): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L23)  
```
proc newFloatNodeT(floatVal: BiggestFloat; n: PNode; g: ModuleGraph): PNode {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L32)  
```
proc newStrNodeT(strVal: string; n: PNode; g: ModuleGraph): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L40)  
```
proc ordinalValToString(a: PNode; g: ModuleGraph): string {...}{.
    raises: [ERecoverableError, Exception, ValueError, IOError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L76)  
```
proc evalOp(m: TMagic; n, a, b, c: PNode; g: ModuleGraph): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L155)  
```
proc leValueConv(a, b: PNode): bool {...}{.raises: [ERecoverableError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L360) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L360)  
```
proc newSymNodeTypeDesc(s: PSym; info: TLineInfo): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L515)  
```
proc getConstExpr(m: PSym; n: PNode; g: ModuleGraph): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, Exception, IOError,
    ValueError, ERecoverableError, KeyError, Exception, IOError, ValueError,
    ERecoverableError, KeyError, Exception, ValueError, IOError,
    ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semfold.nim#L523) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semfold.nim#L523)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/semfold.html>

semmacrosanity
==============

 Implements type sanity checking for ASTs resulting from macros. Lots of room for improvement here.

 Imports
-------

  <ast>, <msgs>, <types>, <options>  Procs
-----

  
```
proc annotateType(n: PNode; t: PType; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semmacrosanity.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semmacrosanity.nim#L46)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/semmacrosanity.html>

semparallel
===========

 Semantic checking for 'parallel'.

 Imports
-------

  <ast>, <astalgo>, <idents>, <lowerings>, <magicsys>, <guards>, <msgs>, <renderer>, <types>, <modulegraphs>, <options>, <spawn>, <lineinfos>, <trees>  Procs
-----

  
```
proc liftParallel(g: ModuleGraph; owner: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semparallel.nim#L468) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semparallel.nim#L468)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/semparallel.html>

sempass2
========

 Imports
-------

  <ast>, <astalgo>, <msgs>, <renderer>, <magicsys>, <types>, <idents>, <trees>, <wordrecg>, <options>, <guards>, <lineinfos>, <semfold>, <semdata>, <modulegraphs>, <varpartitions>, <typeallowed>, <liftdestructors>  Procs
-----

  
```
proc checkForSink(config: ConfigRef; owner: PSym; arg: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sinkparameter_inference.nim#L10) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sinkparameter_inference.nim#L10)  
```
proc checkMethodEffects(g: ModuleGraph; disp, branch: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  checks for consistent effects for multi methods. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sempass2.nim#L1170) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sempass2.nim#L1170)  
```
proc setEffectsForProcType(g: ModuleGraph; t: PType; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sempass2.nim#L1203) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sempass2.nim#L1203)  
```
proc trackProc(c: PContext; s: PSym; body: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sempass2.nim#L1255) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sempass2.nim#L1255)  
```
proc trackStmt(c: PContext; module: PSym; n: PNode; isTopLevel: bool) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sempass2.nim#L1349) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sempass2.nim#L1349)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/sempass2.html>

semtypinst
==========

 Imports
-------

  <ast>, <astalgo>, <msgs>, <types>, <magicsys>, <semdata>, <renderer>, <options>, <lineinfos>  Types
-----

  
```
LayeredIdTable {...}{.acyclic.} = ref object
  topLayer*: TIdTable
  nextLayer*: LayeredIdTable
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L70)  
```
TReplTypeVars = object
  c*: PContext
  typeMap*: LayeredIdTable
  symMap*: TIdTable
  localCache*: TIdTable
  info*: TLineInfo
  allowMetaTypes*: bool
  skipTypedesc*: bool
  isReturnType*: bool
  owner*: PSym
  recursionLimit: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L74)   Procs
-----

  
```
proc checkConstructedType(conf: ConfigRef; info: TLineInfo; typ: PType) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L21)  
```
proc searchInstTypes(key: PType): PType {...}{.
    raises: [Exception, ERecoverableError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L33)  
```
proc cacheTypeInst(inst: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L60)  
```
proc initLayeredTypeMap(pt: TIdTable): LayeredIdTable {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L93)  
```
proc newTypeMapLayer(cl: var TReplTypeVars): LayeredIdTable {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L97)  
```
proc replaceTypeVarsT(cl: var TReplTypeVars; t: PType): PType {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L120)  
```
proc replaceTypeVarsN(cl: var TReplTypeVars; n: PNode; start = 0): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L196)  
```
proc instCopyType(cl: var TReplTypeVars; t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L303)  
```
proc eraseVoidParams(t: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L443) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L443)  
```
proc skipIntLiteralParams(t: PType) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L462) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L462)  
```
proc instAllTypeBoundOp(c: PContext; info: TLineInfo) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L647)  
```
proc initTypeVars(p: PContext; typeMap: LayeredIdTable; info: TLineInfo;
                  owner: PSym): TReplTypeVars {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L657) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L657)  
```
proc replaceTypesInBody(p: PContext; pt: TIdTable; n: PNode; owner: PSym;
                        allowMetaTypes = false): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L666) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L666)  
```
proc recomputeFieldPositions(t: PType; obj: PNode; currPosition: var int) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L686) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L686)  
```
proc generateTypeInstance(p: PContext; pt: TIdTable; info: TLineInfo; t: PType): PType {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L702) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L702)  
```
proc prepareMetatypeForSigmatch(p: PContext; pt: TIdTable; info: TLineInfo;
                                t: PType): PType {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L718)   Templates
---------

  
```
template generateTypeInstance(p: PContext; pt: TIdTable; arg: PNode; t: PType): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/semtypinst.nim#L727) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/semtypinst.nim#L727)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/semtypinst.html>

sighashes
=========

 Computes hash values for routine (proc, method etc) signatures.

 Imports
-------

  <ast>, <ropes>, <modulegraphs>, <types>  Types
-----

  
```
ConsiderFlag = enum
  CoProc, CoType, CoOwnerSig, CoIgnoreRange, CoConsiderOwned, CoDistinct,
  CoHashTypeInsideNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L31)   Procs
-----

  
```
proc hashType(t: PType; flags: set[ConsiderFlag] = {CoType}): SigHash {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L245) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L245)  
```
proc hashProc(s: PSym): SigHash {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L254)  
```
proc hashNonProc(s: PSym): SigHash {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L274) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L274)  
```
proc hashOwner(s: PSym): SigHash {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L290) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L290)  
```
proc sigHash(s: PSym): SigHash {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L303)  
```
proc symBodyDigest(graph: ModuleGraph; sym: PSym): SigHash {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  compute unique digest of the proc/func/method symbols recursing into invoked symbols as well [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L356) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L356)  
```
proc idOrSig(s: PSym; currentModule: string;
             sigCollisions: var CountTable[SigHash]): Rope {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sighashes.nim#L378) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sighashes.nim#L378)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/sighashes.html>

sigmatch
========

 This module implements the signature matching for resolving the call to overloaded procs, generic procs and operators.


This file implements features required for IDE support.

 Due to Nim's nature and the fact that `system.nim` is always imported, there are lots of potential symbols. Furthermore thanks to templates and macros even context based analysis does not help much: In a context like `let x: |` where a type has to follow, that type might be constructed from a template like `extractField(MyObject, fieldName)`. We deal with this problem by smart sorting so that the likely symbols come first. This sorting is done this way:

 * If there is a prefix (foo|), symbols starting with this prefix come first.
* If the prefix is part of the name (but the name doesn't start with it), these symbols come second.
* If we have a prefix, only symbols matching this prefix are returned and nothing else.
* If we have no prefix, consider the context. We currently distinguish between type and non-type contexts.
* Finally, sort matches by relevance. The relevance is determined by the number of usages, so `strutils.replace` comes before `strutils.wordWrap`.
* In any case, sorting also considers scoping information. Local variables get high priority.

 Imports
-------

  <ast>, <astalgo>, <semdata>, <types>, <msgs>, <renderer>, <lookups>, <semtypinst>, <magicsys>, <idents>, <lexer>, <options>, <parampatterns>, <trees>, <linter>, <lineinfos>, <lowerings>, <modulegraphs>, <prefixmatches>, <lineinfos>, <linter>, <wordrecg>  Types
-----

  
```
MismatchKind = enum
  kUnknown, kAlreadyGiven, kUnknownNamedParam, kTypeMismatch, kVarNeeded,
  kMissingParam, kExtraArg, kPositionalAlreadyGiven
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L19)  
```
MismatchInfo = object
  kind*: MismatchKind
  arg*: int
  formal*: PSym
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L23)  
```
TCandidateState = enum
  csEmpty, csMatch, csNoMatch
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L29)  
```
CandidateError = object
  sym*: PSym
  firstMismatch*: MismatchInfo
  diagnostics*: seq[string]
  enabled*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L32)  
```
CandidateErrors = seq[CandidateError]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L38)  
```
TCandidate = object
  c*: PContext
  exactMatches*: int
  genericMatches: int
  subtypeMatches: int
  intConvMatches: int
  convMatches: int
  state*: TCandidateState
  callee*: PType
  calleeSym*: PSym
  calleeScope*: int
  call*: PNode
  bindings*: TIdTable
  magic*: TMagic
  baseTypeMatch: bool
  fauxMatch*: TTypeKind
  genericConverter*: bool
  coerceDistincts*: bool
  typedescMatched*: bool
  isNoCall*: bool
  inferredTypes: seq[PType]
  diagnostics*: seq[string]
  inheritancePenalty: int
  firstMismatch*: MismatchInfo
  diagnosticsEnabled*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L40) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L40)  
```
TTypeRelFlag = enum
  trDontBind, trNoCovariance, trBindGenericParam
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L82)  
```
TTypeRelFlags = set[TTypeRelFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L87)  
```
TTypeRelation = enum
  isNone, isConvertible, isIntConv, isSubtype, isSubrange,
  isBothMetaConvertible, isInferred, isInferredConvertible, isGeneric,
  isFromIntLit, isEqual
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L89)  
```
TCheckPointResult = enum
  cpNone, cpFuzzy, cpExact
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L423)   Procs
-----

  
```
proc initCandidate(ctx: PContext; c: var TCandidate; callee: PType) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L129)  
```
proc initCandidate(ctx: PContext; c: var TCandidate; callee: PSym;
                   binding: PNode; calleeScope = -1; diagnosticsEnabled = false) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L148)  
```
proc newCandidate(ctx: PContext; callee: PSym; binding: PNode; calleeScope = -1): TCandidate {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L182)  
```
proc newCandidate(ctx: PContext; callee: PType): TCandidate {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L186)  
```
proc writeMatches(c: TCandidate) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L293) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L293)  
```
proc cmpCandidates(a, b: TCandidate): int {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L302)  
```
proc describeArgs(c: PContext; n: PNode; startIdx = 1; prefer = preferName): string {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L336) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L336)  
```
proc matchUserTypeClass(m: var TCandidate; ff, a: PType): PType {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L691) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L691)  
```
proc inferStaticParam(c: var TCandidate; lhs: PNode; rhs: BiggestInt): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L833) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L833)  
```
proc typeRel(c: var TCandidate; f, aOrig: PType; flags: TTypeRelFlags = {}): TTypeRelation {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L991) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L991)  
```
proc cmpTypes(c: PContext; f, a: PType): TTypeRelation {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L1862) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L1862)  
```
proc paramTypesMatch(m: var TCandidate; f, a: PType; arg, argOrig: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2186)  
```
proc semFinishOperands(c: PContext; n: PNode) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2507) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2507)  
```
proc partialMatch(c: PContext; n, nOrig: PNode; m: var TCandidate) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2513) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2513)  
```
proc matches(c: PContext; n, nOrig: PNode; m: var TCandidate) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2518) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2518)  
```
proc argtypeMatches(c: PContext; f, a: PType; fromHlo = false): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2577) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2577)  
```
proc instTypeBoundOp(c: PContext; dc: PSym; t: PType; info: TLineInfo;
                     op: TTypeAttachedOp; col: int): PSym {...}{.nosinks,
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L2592) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L2592)  
```
proc `$`(suggest: Suggest): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L174)  
```
proc fieldVisible(c: PContext; f: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L253) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L253)  
```
proc inCheckpoint(current, trackPos: TLineInfo): TCheckPointResult {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L426)  
```
proc isTracked(current, trackPos: TLineInfo; tokenLen: int): bool {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L434) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L434)  
```
proc suggestSym(conf: ConfigRef; info: TLineInfo; s: PSym; usageSym: var PSym;
                isDecl = true) {...}{.inline, raises: [], tags: [].}
```
  misnamed: should be 'symDeclared' [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L486)  
```
proc markOwnerModuleAsUsed(c: PContext; s: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L546) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L546)  
```
proc markUsed(c: PContext; info: TLineInfo; s: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L560) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L560)  
```
proc safeSemExpr(c: PContext; n: PNode): PNode {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L581) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L581)  
```
proc suggestExprNoCheck(c: PContext; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, ESuggestDone],
    tags: [RootEffect, ReadIOEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L605) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L605)  
```
proc suggestExpr(c: PContext; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, ESuggestDone],
    tags: [RootEffect, ReadIOEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L634) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L634)  
```
proc suggestDecl(c: PContext; n: PNode; s: PSym) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, ESuggestDone],
    tags: [RootEffect, ReadIOEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L637) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L637)  
```
proc suggestStmt(c: PContext; n: PNode) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, ESuggestDone],
    tags: [RootEffect, ReadIOEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L644) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L644)  
```
proc suggestEnum(c: PContext; n: PNode; t: PType) {...}{.
    raises: [Exception, ValueError, IOError, ESuggestDone],
    tags: [RootEffect, ReadIOEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L647) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L647)  
```
proc suggestSentinel(c: PContext) {...}{.raises: [Exception, ValueError, IOError], tags: [
    RootEffect, ReadIOEffect, WriteIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/suggest.nim#L653) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/suggest.nim#L653)   Templates
---------

  
```
template hasFauxMatch(c: TCandidate): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sigmatch.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sigmatch.nim#L111)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/sigmatch.html>

sourcemap
=========

 Imports
-------

  <ropes>  Types
-----

  
```
SourceNode = ref object
  line*: int
  column*: int
  source*: string
  name*: string
  children*: seq[Child]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L4) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L4)  
```
Child = ref object
  case kind*: C
  of cSourceNode:
      node*: SourceNode

  of cString:
      s*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L13)  
```
SourceMap = ref object
  version*: int
  sources*: seq[string]
  names*: seq[string]
  mappings*: string
  file*: string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L20)  
```
Mapping = ref object
  source*: string
  original*: tuple[line: int, column: int]
  generated*: tuple[line: int, column: int]
  name*: string
  noSource*: bool
  noName*: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L37)   Procs
-----

  
```
proc child(s: string): Child {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L46)  
```
proc child(node: SourceNode): Child {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L50)  
```
proc text(sourceNode: SourceNode; depth: int): string {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L71)  
```
proc `$`(sourceNode: SourceNode): string {...}{.raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L81)  
```
proc encode(i: int): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L90)  
```
proc parse(source: string; path: string): SourceNode {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L159)  
```
proc index[T](elements: seq[T]; element: T): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L234)  
```
proc gen(map: SourceMapGenerator): SourceMap {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L286) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L286)  
```
proc addMapping(map: SourceMapGenerator; mapping: Mapping) {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L298) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L298)  
```
proc walk(node: SourceNode; fn: proc (line: string; original: SourceNode)) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L309) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L309)  
```
proc toSourceMap(node: SourceNode; file: string): SourceMapGenerator {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L317) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L317)  
```
proc genSourceMap(source: string; outFile: string): (Rope, SourceMap) {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L379)   Iterators
---------

  
```
iterator tokenize(line: string): (bool, string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sourcemap.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sourcemap.nim#L111)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/sourcemap.html>

spawn
=====

 This module implements threadpool's `spawn`.

 Imports
-------

  <ast>, <types>, <idents>, <magicsys>, <msgs>, <options>, <modulegraphs>, <lowerings>, <liftdestructors>, <renderer>, <trees>  Types
-----

  
```
TSpawnResult = enum
  srVoid, srFlowVar, srByVar
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/spawn.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/spawn.nim#L27)   Procs
-----

  
```
proc spawnResult(t: PType; inParallel: bool): TSpawnResult {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/spawn.nim#L34) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/spawn.nim#L34)  
```
proc wrapProcForSpawn(g: ModuleGraph; owner: PSym; spawnExpr: PNode;
                      retType: PType; barrier, dest: PNode = nil): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/spawn.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/spawn.nim#L306)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/spawn.html>

strutils2
=========


internal API for now, subject to modifications and moving around

 string API's focusing on performance, that can be used as building blocks for other routines.

 Un-necessary allocations are avoided and appropriate algorithms are used at the expense of code clarity when justified. 

 Procs
-----

  
```
proc dataPointer[T](a: T): pointer
```
  same as C++ `data` that works with std::string, std::vector etc. Note: safe to use when a.len == 0 but whether the result is nil or not is implementation defined for performance reasons. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/strutils2.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/strutils2.nim#L11)  
```
proc setLen(result: var string; n: int; isInit: bool) {...}{.raises: [], tags: [].}
```
  when isInit = false, elements are left uninitialized, analog to `{.noinit.}` else, there are 0-initialized. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/strutils2.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/strutils2.nim#L26)  
```
proc forceCopy(result: var string; a: string) {...}{.raises: [], tags: [].}
```
  also forces a copy if `a` is shallow [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/strutils2.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/strutils2.nim#L38)  
```
proc toLowerAscii(a: var string) {...}{.raises: [], tags: [].}
```
  optimized and inplace overload of strutils.toLowerAscii [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/strutils2.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/strutils2.nim#L49)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/strutils2.html>

syntaxes
========

 Implements the dispatcher for the different parsers.

 Imports
-------

  <llstream>, <ast>, <idents>, <lexer>, <options>, <msgs>, <parser>, <filters>, <filter_tmpl>, <renderer>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc openParser(p: var Parser; fileIdx: FileIndex; inputstream: PLLStream;
                cache: IdentCache; config: ConfigRef) {...}{.
    raises: [IOError, Exception, ValueError, ERecoverableError, KeyError], tags: [
    ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/syntaxes.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/syntaxes.nim#L111)  
```
proc setupParser(p: var Parser; fileIdx: FileIndex; cache: IdentCache;
                 config: ConfigRef): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/syntaxes.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/syntaxes.nim#L121)  
```
proc parseFile(fileIdx: FileIndex; cache: IdentCache; config: ConfigRef): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, ReadDirEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/syntaxes.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/syntaxes.nim#L131)   Exports
-------

  [Parser](parser#Parser), [parseAll](parser#parseAll,Parser), [parseTopLevelStmt](parser#parseTopLevelStmt,Parser), [closeParser](parser#closeParser,Parser) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/syntaxes.html>

transf
======

 Imports
-------

  <options>, <ast>, <astalgo>, <trees>, <msgs>, <idents>, <renderer>, <types>, <semfold>, <magicsys>, <cgmeth>, <lowerings>, <liftlocals>, <modulegraphs>, <lineinfos>, <closureiters>, <lambdalifting>  Procs
-----

  
```
proc commonOptimizations(g: ModuleGraph; c: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/transf.nim#L853) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/transf.nim#L853)  
```
proc transformBody(g: ModuleGraph; prc: PSym; cache: bool): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/transf.nim#L1083) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/transf.nim#L1083)  
```
proc transformStmt(g: ModuleGraph; module: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/transf.nim#L1113) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/transf.nim#L1113)  
```
proc transformExpr(g: ModuleGraph; module: PSym; n: PNode): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError, KeyError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/transf.nim#L1123) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/transf.nim#L1123)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/transf.html>

trees
=====

 Imports
-------

  <ast>, <wordrecg>, <idents>  Procs
-----

  
```
proc cyclicTree(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L25)  
```
proc exprStructuralEquivalent(a, b: PNode; strictSymEquality = false): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L33)  
```
proc sameTree(a, b: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L57)  
```
proc getMagic(op: PNode): TMagic {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L80)  
```
proc isConstExpr(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L89)  
```
proc isCaseObj(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L93)  
```
proc isDeepConstExpr(n: PNode; preventInheritance = false): bool {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L98)  
```
proc isRange(n: PNode): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L122)  
```
proc whichPragma(n: PNode): TSpecialWord {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L131)  
```
proc isNoSideEffectPragma(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L141)  
```
proc findPragma(n: PNode; which: TSpecialWord): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L147)  
```
proc effectSpec(n: PNode; effectType: TSpecialWord): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L153)  
```
proc propSpec(n: PNode; effectType: TSpecialWord): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L163)  
```
proc flattenStmts(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L175) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L175)  
```
proc extractRange(k: TNodeKind; n: PNode; a, b: int): PNode {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L181)  
```
proc isTrue(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L185)  
```
proc getRoot(n: PNode): PSym {...}{.raises: [], tags: [].}
```
  `getRoot` takes a *path* `n`. A path is an lvalue expression like `obj.x[i].y`. The *root* of a path is the symbol that can be determined as the owner; `obj` in the example. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L189)  
```
proc stupidStmtListExpr(n: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L206)  
```
proc dontInlineConstant(orig, cnst: PNode): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/trees.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/trees.nim#L211)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/trees.html>

treetab
=======

 Imports
-------

  <ast>, <astalgo>, <types>  Procs
-----

  
```
proc nodeTableGet(t: TNodeTable; key: PNode): int {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/treetab.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/treetab.nim#L63)  
```
proc nodeTablePut(t: var TNodeTable; key: PNode; val: int) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/treetab.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/treetab.nim#L77)  
```
proc nodeTableTestOrSet(t: var TNodeTable; key: PNode; val: int): int {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/treetab.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/treetab.nim#L94)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/treetab.html>

typeallowed
===========

 This module contains 'typeAllowed' and friends which check for invalid types like 'openArray[var int]'.

 Imports
-------

  <ast>, <renderer>, <options>, <semdata>, <types>  Types
-----

  
```
TTypeAllowedFlag = enum
  taField, taHeap, taConcept, taIsOpenArray, taNoUntyped, taIsTemplateOrMacro,
  taProcContextIsNotMacro
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L17)  
```
TTypeAllowedFlags = set[TTypeAllowedFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L26)  
```
ViewTypeKind = enum
  noView, immutableView, mutableView
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L199)   Procs
-----

  
```
proc typeAllowed(t: PType; kind: TSymKind; c: PContext;
                 flags: TTypeAllowedFlags = {}): PType {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L192)  
```
proc classifyViewType(t: PType): ViewTypeKind {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L254) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L254)  
```
proc directViewType(t: PType): ViewTypeKind {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L258)  
```
proc requiresInit(t: PType): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typeallowed.nim#L270) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typeallowed.nim#L270)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/typeallowed.html>

types
=====

 code owner: Arne Döring e-mail: arne.doering@gmx.net included from types.nim

 Imports
-------

  <ast>, <astalgo>, <trees>, <msgs>, <platform>, <renderer>, <options>, <lineinfos>, <int128>  Types
-----

  
```
TPreferedDesc = enum
  preferName, preferDesc, preferExported, preferModuleInfo, preferGenericArg,
  preferTypeName, preferResolved, preferMixed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L17)  
```
TTypeIter = proc (t: PType; closure: RootRef): bool {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L37)  
```
TTypeMutator = proc (t: PType; closure: RootRef): PType {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L38)  
```
TTypePredicate = proc (t: PType): bool {...}{.nimcall.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L39)  
```
TParamsEquality = enum
  paramsNotEqual, paramsEqual, paramsIncompatible
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L47)  
```
TTypeFieldResult = enum
  frNone, frHeader, frEmbedded
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L272) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L272)  
```
TDistinctCompare = enum
  dcEq,                     ## a and b should be the same type
  dcEqIgnoreDistinct,       ## compare symmetrically: (distinct a) == b, a == b
                             ## or a == (distinct b)
  dcEqOrDistinctOf           ## a equals b or a is distinct of b
```
  how distinct types are to be compared [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L854) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L854)  
```
TTypeCmpFlag = enum
  IgnoreTupleFields,        ## NOTE: Only set this flag for backends!
  IgnoreCC, ExactTypeDescValues, ExactGenericParams, ExactConstraints,
  ExactGcSafety, AllowCommonBase
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L860) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L860)  
```
TTypeCmpFlags = set[TTypeCmpFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L869) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L869)  
```
EffectsCompat = enum
  efCompat, efRaisesDiffer, efRaisesUnknown, efTagsDiffer, efTagsUnknown,
  efLockLevelsDiffer
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1328) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1328)  
```
OrdinalType = enum
  NoneLike, IntLike, FloatLike
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1387) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1387)   Consts
------

  
```
abstractPtrs = {tyVar, tyPtr, tyRef, tyGenericInst, tyDistinct, tyOrdinal,
                tyTypeDesc, tyAlias, tyInferred, tySink, tyLent, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L62)  
```
abstractVar = {tyVar, tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias,
               tyInferred, tySink, tyLent, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L64)  
```
abstractRange = {tyGenericInst, tyRange, tyDistinct, tyOrdinal, tyTypeDesc,
                 tyAlias, tyInferred, tySink, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L66)  
```
abstractInst = {tyGenericInst, tyDistinct, tyOrdinal, tyTypeDesc, tyAlias,
                tyInferred, tySink, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L69)  
```
abstractInstOwned = {tyAlias, tyTypeDesc, tyGenericInst, tyDistinct, tyOrdinal,
                     tyOwned..tySink, tyInferred}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L71)  
```
skipPtrs = {tyVar, tyPtr, tyRef, tyGenericInst, tyTypeDesc, tyAlias, tyInferred,
            tySink, tyLent, tyOwned}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L72)  
```
typedescPtrs = {tyAlias, tyTypeDesc, tyGenericInst, tyDistinct, tyOrdinal,
                tyPtr..tyVar, tyOwned..tyLent, tyInferred}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L75)  
```
typedescInst = {tyAlias, tyTypeDesc, tyGenericInst, tyDistinct, tyOrdinal,
                tyOwned..tySink, tyUserTypeClass, tyInferred}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L76)  
```
szUnknownSize = -3
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L21)  
```
szIllegalRecursion = -2
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L22)  
```
szUncomputedSize = -1
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L23)  
```
szTooBigSize = -4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L24)   Procs
-----

  
```
proc base(t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L32)  
```
proc invalidGenericInst(f: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L78)  
```
proc isPureObject(typ: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L81)  
```
proc isUnsigned(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L87)  
```
proc getOrdValue(n: PNode; onError = high(Int128)): Int128 {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L90)  
```
proc getFloatValue(n: PNode): BiggestFloat {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L114)  
```
proc isIntLit(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L120)  
```
proc isFloatLit(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L123)  
```
proc addTypeHeader(result: var string; conf: ConfigRef; typ: PType;
                   prefer: TPreferedDesc = preferMixed;
                   getDeclarationPath = true) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L129)  
```
proc getProcHeader(conf: ConfigRef; sym: PSym;
                   prefer: TPreferedDesc = preferName; getDeclarationPath = true): string {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L133)  
```
proc elemType(t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L154) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L154)  
```
proc enumHasHoles(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L163)  
```
proc isOrdinalType(t: PType; allowEnumWithHoles: bool = false): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L167) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L167)  
```
proc iterOverType(t: PType; iter: TTypeIter; closure: RootRef): bool {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L205) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L205)  
```
proc searchTypeFor(t: PType; predicate: TTypePredicate): bool {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L256) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L256)  
```
proc containsObject(t: PType): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L263)  
```
proc analyseObjectWithTypeField(t: PType): TTypeFieldResult {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L306)  
```
proc containsGarbageCollectedRef(typ: PType): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L319) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L319)  
```
proc containsManagedMemory(typ: PType): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L328)  
```
proc containsTyRef(typ: PType): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L334)  
```
proc containsHiddenPointer(typ: PType): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L341) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L341)  
```
proc isFinal(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L384) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L384)  
```
proc canFormAcycle(typ: PType): bool {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L388) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L388)  
```
proc mutateType(t: PType; iter: TTypeMutator; closure: RootRef): PType {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L420)  
```
proc typeToString(typ: PType; prefer: TPreferedDesc = preferName): string {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L471) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L471)  
```
proc firstOrd(conf: ConfigRef; t: PType): Int128 {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L712) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L712)  
```
proc firstFloat(t: PType): BiggestFloat {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L752) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L752)  
```
proc lastOrd(conf: ConfigRef; t: PType): Int128 {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L767) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L767)  
```
proc lastFloat(t: PType): BiggestFloat {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L811) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L811)  
```
proc floatRangeCheck(x: BiggestFloat; t: PType): bool {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L826) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L826)  
```
proc lengthOrd(conf: ConfigRef; t: PType): Int128 {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L843) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L843)  
```
proc sameType(a, b: PType; flags: TTypeCmpFlags = {}): bool {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L897) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L897)  
```
proc sameTypeOrNil(a, b: PType; flags: TTypeCmpFlags = {}): bool {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L902) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L902)  
```
proc equalParams(a, b: PNode): TParamsEquality {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L933) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L933)  
```
proc sameObjectTypes(a, b: PType): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1008) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1008)  
```
proc sameDistinctTypes(a, b: PType): bool {...}{.inline, raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1014) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1014)  
```
proc sameEnumTypes(a, b: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1017) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1017)  
```
proc isGenericAlias(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1060) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1060)  
```
proc skipGenericAlias(t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1063) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1063)  
```
proc sameFlags(a, b: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1066) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1066)  
```
proc sameBackendType(x, y: PType): bool {...}{.
    raises: [Exception, ERecoverableError], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1188) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1188)  
```
proc compareTypes(x, y: PType; cmp: TDistinctCompare = dcEq;
                  flags: TTypeCmpFlags = {}): bool {...}{.
    raises: [Exception, ERecoverableError], tags: [RootEffect].}
```
  compares two type for equality (modulo type distinction) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1194) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1194)  
```
proc inheritanceDiff(a, b: PType): int {...}{.raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1205) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1205)  
```
proc commonSuperclass(a, b: PType): PType {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1229) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1229)  
```
proc matchType(a: PType; pattern: openArray[tuple[k: TTypeKind, i: int]];
               last: TTypeKind): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1253) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1253)  
```
proc computeSize(conf: ConfigRef; typ: PType): BiggestInt {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1264) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1264)  
```
proc getReturnType(s: PSym): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1268)  
```
proc getAlign(conf: ConfigRef; typ: PType): BiggestInt {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1273) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1273)  
```
proc getSize(conf: ConfigRef; typ: PType): BiggestInt {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1277) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1277)  
```
proc containsGenericType(t: PType): bool {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1294) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1294)  
```
proc baseOfDistinct(t: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1297) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1297)  
```
proc safeInheritanceDiff(a, b: PType): int {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1310) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1310)  
```
proc compatibleEffects(formal, actual: PType): EffectsCompat {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1336) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1336)  
```
proc isCompileTimeOnly(t: PType): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1369) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1369)  
```
proc containsCompileTimeOnly(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1372) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1372)  
```
proc safeSkipTypes(t: PType; kinds: TTypeKinds): PType {...}{.raises: [], tags: [].}
```
  same as 'skipTypes' but with a simple cycle detector. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1379) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1379)  
```
proc classify(t: PType): OrdinalType {...}{.raises: [], tags: [].}
```
  for convenient type checking: [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1390) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1390)  
```
proc skipConv(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1401) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1401)  
```
proc skipHidden(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1414) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1414)  
```
proc skipConvTakeType(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1426) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1426)  
```
proc isEmptyContainer(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1430) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1430)  
```
proc takeType(formal, arg: PType): PType {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1439) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1439)  
```
proc skipHiddenSubConv(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1455) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1455)  
```
proc typeMismatch(conf: ConfigRef; info: TLineInfo; formal, actual: PType) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1472) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1472)  
```
proc isTupleRecursive(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1514) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1514)  
```
proc isException(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1518) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1518)  
```
proc isDefectException(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1529) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1529)  
```
proc isSinkTypeForParam(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L1540) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L1540)   Templates
---------

  
```
template `$`(typ: PType): string
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L30)  
```
template bindConcreteTypeToUserTypeClass(tc, concrete: PType)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L455) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L455)  
```
template isResolvedUserTypeClass(t: PType): bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/types.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/types.nim#L465)  
```
template foldSizeOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L453) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L453)  
```
template foldAlignOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L467) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L467)  
```
template foldOffsetOf(conf: ConfigRef; n: PNode; fallback: PNode): PNode
```
  Returns an int literal node of the given offsetof expression in `n`. Falls back to `fallback`, if the `offsetof` expression can't be processed. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/sizealignoffsetimpl.nim#L481) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/sizealignoffsetimpl.nim#L481)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/types.html>

typesrenderer
=============

 Imports
-------

  <renderer>, <ast>, <types>  Consts
------

  
```
defaultParamSeparator = ","
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typesrenderer.nim#L12) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typesrenderer.nim#L12)   Procs
-----

  
```
proc renderPlainSymbolName(n: PNode): string {...}{.raises: [], tags: [].}
```
  Returns the first non '\*' nkIdent node from the tree.

 Use this on documentation name nodes to extract the *raw* symbol name, without decorations, parameters, or anything. That can be used as the base for the HTML hyperlinks.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typesrenderer.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typesrenderer.nim#L14)  
```
proc renderParamTypes(n: PNode; sep = defaultParamSeparator): string {...}{.
    raises: [Exception, ValueError], tags: [RootEffect].}
```
  Returns the types contained in `n` joined by `sep`.

 This proc expects to be passed as `n` the parameters of any callable. The string output is meant for the HTML renderer. If there are no parameters, the empty string is returned. The parameters will be joined by `sep` but other characters may appear too, like `[]` or `|`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/typesrenderer.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/typesrenderer.nim#L114)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/typesrenderer.html>

varpartitions
=============

 Partition variables into different graphs. Used for Nim's write tracking, borrow checking and also for the cursor inference. The algorithm is a reinvention / variation of Steensgaard's algorithm. The used data structure is "union find" with path compression.We perform two passes over the AST:


* Pass one (`computeLiveRanges`): collect livetimes of local variables and whether they are potentially re-assigned.
* Pass two (`traverse`): combine local variables to abstract "graphs". Strict func checking: Ensure that graphs that are connected to const parameters are not mutated.
Cursor inference: Ensure that potential cursors are not borrowed from locations that are connected to a graph that is mutated during the liveness of the cursor. (We track all possible mutations of a graph.)

 See <https://nim-lang.github.io/Nim/manual_experimental.html#view-types-algorithm> for a high-level description of how borrow checking works.

 Imports
-------

  <ast>, <types>, <lineinfos>, <options>, <msgs>, <renderer>, <typeallowed>, <trees>, <isolation_check>  Types
-----

  
```
MutationInfo = object
  param: PSym
  mutatedHere, connectedVia: TLineInfo
  flags: set[SubgraphFlag]
  maxMutation, minConnection: AbstractTime
  mutations: seq[AbstractTime]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L83)  
```
Goal = enum
  constParameters, borrowChecking, cursorInference
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L90)  
```
Partitions = object
  abstractTime: AbstractTime
  s: seq[VarIndex]
  graphs: seq[MutationInfo]
  goals: set[Goal]
  unanalysableMutation: bool
  inAsgnSource, inConstructor, inNoSideEffectSection: int
  inConditional, inLoop: int
  owner: PSym
  config: ConfigRef
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L95)   Procs
-----

  
```
proc `$`(config: ConfigRef; g: MutationInfo): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L110)  
```
proc hasSideEffect(c: var Partitions; info: var MutationInfo): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L125)  
```
proc computeGraphPartitions(s: PSym; n: PNode; config: ConfigRef;
                            goals: set[Goal]): Partitions {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L845) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L845)  
```
proc checkBorrowedLocations(par: var Partitions; body: PNode; config: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L882) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L882)  
```
proc computeCursors(s: PSym; n: PNode; config: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/varpartitions.nim#L911) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/varpartitions.nim#L911)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/varpartitions.html>

vm
==

 This file implements the new evaluation engine for Nim code. An instruction is 1-3 int32s in memory, it is a register based VM.

 Imports
-------

  <ast>, <msgs>, <vmdef>, <vmgen>, <nimsets>, <types>, <passes>, <parser>, <vmdeps>, <idents>, <trees>, <renderer>, <options>, <transf>, <vmmarshal>, <gorgeimpl>, <lineinfos>, <btrees>, <macrocacheimpl>, <modulegraphs>, <sighashes>, <int128>, <vmprofiler>, <semfold>, <evaltempl>, <pathutils>, <sighashes>, <vmconv>  Consts
------

  
```
evalPass = (myOpen, myProcess, myClose, false)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2158) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2158)   Procs
-----

  
```
proc setResult(a: VmArgs; v: BiggestInt) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L16)  
```
proc setResult(a: VmArgs; v: BiggestFloat) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L17)  
```
proc setResult(a: VmArgs; v: bool) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L18)  
```
proc setResult(a: VmArgs; v: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L22)  
```
proc setResult(a: VmArgs; n: PNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L27)  
```
proc setResult(a: VmArgs; v: AbsoluteDir) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L31)  
```
proc setResult(a: VmArgs; v: seq[string]) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L33)  
```
proc getInt(a: VmArgs; i: Natural): BiggestInt {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L44)  
```
proc getBool(a: VmArgs; i: Natural): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L45)  
```
proc getFloat(a: VmArgs; i: Natural): BiggestFloat {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L46)  
```
proc getString(a: VmArgs; i: Natural): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L47)  
```
proc getNode(a: VmArgs; i: Natural): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmhooks.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmhooks.nim#L52)  
```
proc execProc(c: PCtx; sym: PSym; args: openArray[PNode]): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                              ReadEnvEffect, TimeEffect, ReadDirEffect,
                              ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2083) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2083)  
```
proc evalStmt(c: PCtx; n: PNode) {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, KeyError, OSError, JsonParsingError], tags: [RootEffect,
    WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect, ReadDirEffect,
    ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2109) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2109)  
```
proc evalExpr(c: PCtx; n: PNode): PNode {...}{.raises: [Exception, ValueError,
    IOError, ERecoverableError, KeyError, OSError, JsonParsingError], tags: [
    RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect, TimeEffect,
    ReadDirEffect, ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2117) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2117)  
```
proc getGlobalValue(c: PCtx; s: PSym): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2123) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2123)  
```
proc registerAdditionalOps(c: PCtx) {...}{.raises: [OSError, IOError, EOFError,
    ValueError, Exception, ERecoverableError], tags: [ReadEnvEffect,
    WriteEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect, ExecIOEffect,
    RootEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmops.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmops.nim#L141)  
```
proc setupGlobalCtx(module: PSym; graph: ModuleGraph) {...}{.raises: [OSError,
    IOError, EOFError, ValueError, Exception, ERecoverableError], tags: [
    ReadEnvEffect, WriteEnvEffect, ReadDirEffect, WriteIOEffect, ReadIOEffect,
    ExecIOEffect, RootEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2129) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2129)  
```
proc evalConstExpr(module: PSym; g: ModuleGraph; e: PNode): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2180) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2180)  
```
proc evalStaticExpr(module: PSym; g: ModuleGraph; e: PNode; prc: PSym): PNode {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2183) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2183)  
```
proc evalStaticStmt(module: PSym; g: ModuleGraph; e: PNode; prc: PSym) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2186) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2186)  
```
proc setupCompileTimeVar(module: PSym; g: ModuleGraph; n: PNode) {...}{.raises: [
    Exception, ValueError, IOError, ERecoverableError, KeyError, OSError,
    EOFError, JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                                        ReadEnvEffect, TimeEffect,
                                        WriteEnvEffect, ReadDirEffect,
                                        ExecIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2189) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2189)  
```
proc evalMacroCall(module: PSym; g: ModuleGraph; templInstCounter: ref int;
                   n, nOrig: PNode; sym: PSym): PNode {...}{.raises: [Exception,
    ValueError, IOError, ERecoverableError, OSError, EOFError, KeyError,
    JsonParsingError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                              ReadEnvEffect, WriteEnvEffect, ReadDirEffect,
                              ExecIOEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2239) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2239)   Iterators
---------

  
```
iterator genericParamsInMacroCall(macroSym: PSym; call: PNode): (PSym, PNode) {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vm.nim#L2223) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vm.nim#L2223)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vm.html>

vmconv
======

 Imports
-------

  <ast>  Procs
-----

  
```
proc fromLit(a: PNode; T: typedesc): auto
```
  generic PNode => type see also reverse operation `toLit` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmconv.nim#L8) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmconv.nim#L8)  
```
proc toLit[T](a: T): PNode
```
  generic type => PNode see also reverse operation `fromLit` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmconv.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmconv.nim#L19)   Templates
---------

  
```
template elementType(T: typedesc): typedesc
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmconv.nim#L3) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmconv.nim#L3)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmconv.html>

vmdef
=====

 This module contains the type definitions for the new evaluation engine. An instruction is 1-3 int32s in memory, it is a register based VM.

 Imports
-------

  <ast>, <idents>, <options>, <modulegraphs>, <lineinfos>  Types
-----

  
```
TInstrType = uint64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L15) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L15)  
```
TRegister = range[0 .. 65535'u64.int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L46)  
```
TDest = range[-1 .. 65535'u64.int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L47)  
```
TInstr = distinct TInstrType
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L48)  
```
TOpcode = enum
  opcEof, opcRet, opcYldYoid, opcYldVal, opcAsgnInt, opcAsgnFloat, opcAsgnRef,
  opcAsgnComplex, opcCastIntToFloat32, opcCastIntToFloat64, opcCastFloatToInt32,
  opcCastFloatToInt64, opcCastPtrToInt, opcCastIntToPtr, opcFastAsgnComplex,
  opcNodeToReg, opcLdArr, opcLdArrAddr, opcWrArr, opcLdObj, opcLdObjAddr,
  opcWrObj, opcAddrReg, opcAddrNode, opcLdDeref, opcWrDeref, opcWrStrIdx,
  opcLdStrIdx, opcAddInt, opcAddImmInt, opcSubInt, opcSubImmInt, opcLenSeq,
  opcLenStr, opcIncl, opcInclRange, opcExcl, opcCard, opcMulInt, opcDivInt,
  opcModInt, opcAddFloat, opcSubFloat, opcMulFloat, opcDivFloat, opcShrInt,
  opcShlInt, opcAshrInt, opcBitandInt, opcBitorInt, opcBitxorInt, opcAddu,
  opcSubu, opcMulu, opcDivu, opcModu, opcEqInt, opcLeInt, opcLtInt, opcEqFloat,
  opcLeFloat, opcLtFloat, opcLeu, opcLtu, opcEqRef, opcEqNimNode,
  opcSameNodeType, opcXor, opcNot, opcUnaryMinusInt, opcUnaryMinusFloat,
  opcBitnotInt, opcEqStr, opcLeStr, opcLtStr, opcEqSet, opcLeSet, opcLtSet,
  opcMulSet, opcPlusSet, opcMinusSet, opcConcatStr, opcContainsSet, opcRepr,
  opcSetLenStr, opcSetLenSeq, opcIsNil, opcOf, opcIs, opcSubStr, opcParseFloat,
  opcConv, opcCast, opcQuit, opcInvalidField, opcNarrowS, opcNarrowU,
  opcSignExtend, opcAddStrCh, opcAddStrStr, opcAddSeqElem, opcRangeChck,
  opcNAdd, opcNAddMultiple, opcNKind, opcNSymKind, opcNIntVal, opcNFloatVal,
  opcNSymbol, opcNIdent, opcNGetType, opcNStrVal, opcNSigHash, opcNGetSize,
  opcNSetIntVal, opcNSetFloatVal, opcNSetSymbol, opcNSetIdent, opcNSetType,
  opcNSetStrVal, opcNNewNimNode, opcNCopyNimNode, opcNCopyNimTree, opcNDel,
  opcGenSym, opcNccValue, opcNccInc, opcNcsAdd, opcNcsIncl, opcNcsLen, opcNcsAt,
  opcNctPut, opcNctLen, opcNctGet, opcNctHasNext, opcNctNext, opcNodeId,
  opcSlurp, opcGorge, opcParseExprToAst, opcParseStmtToAst, opcQueryErrorFlag,
  opcNError, opcNWarning, opcNHint, opcNGetLineInfo, opcNSetLineInfo,
  opcEqIdent, opcStrToIdent, opcGetImpl, opcGetImplTransf, opcEcho, opcIndCall,
  opcIndCallAsgn, opcRaise, opcNChild, opcNSetChild, opcCallSite, opcNewStr,
  opcTJmp, opcFJmp, opcJmp, opcJmpBack, opcBranch, opcTry, opcExcept,
  opcFinally, opcFinallyEnd, opcNew, opcNewSeq, opcLdNull, opcLdNullReg,
  opcLdConst, opcAsgnConst, opcLdGlobal, opcLdGlobalAddr, opcLdGlobalDerefFFI,
  opcLdGlobalAddrDerefFFI, opcLdImmInt, opcNBindSym, opcNDynBindSym, opcSetType,
  opcTypeTrait, opcMarshalLoad, opcMarshalStore, opcSymOwner,
  opcSymIsInstantiationOf
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L50)  
```
TBlock = object
  label*: PSym
  fixups*: seq[TPosition]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L183)  
```
TEvalMode = enum
  emRepl,                   ## evaluate because in REPL mode
  emConst,                  ## evaluate for 'const' according to spec
  emOptimize,               ## evaluate for optimization purposes (same as
                             ## emConst?)
  emStaticExpr,             ## evaluate for enforced compile time eval
                             ## ('static' context)
  emStaticStmt               ## 'static' as an expression
```
  reason for evaluation [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L187) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L187)  
```
TSandboxFlag = enum
  allowCast,                ## allow unsafe language feature: 'cast'
  allowInfiniteLoops         ## allow endless loops
```
  what the evaluation engine should allow [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L196) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L196)  
```
TSandboxFlags = set[TSandboxFlag]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L199)  
```
TSlotKind = enum
  slotEmpty, slotFixedVar, slotFixedLet, slotTempUnknown, slotTempInt,
  slotTempFloat, slotTempStr, slotTempComplex, slotTempPerm
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L201) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L201)  
```
TRegisterKind = enum
  rkNone, rkNode, rkInt, rkFloat, rkRegisterAddr, rkNodeAddr
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L215)  
```
TFullReg = object
  case kind*: TRegisterKind
  of rkNone:
    nil
  of rkInt:
    intVal*: BiggestInt
  of rkFloat:
    floatVal*: BiggestFloat
  of rkNode:
    node*: PNode
  of rkRegisterAddr:
    regAddr*: ptr TFullReg
  of rkNodeAddr:
    nodeAddr*: ptr PNode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L217) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L217)  
```
PProc = ref object
  blocks*: seq[TBlock]
  sym*: PSym
  slots*: array[TRegister, tuple[inUse: bool, kind: TSlotKind]]
  maxSlots*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L227)  
```
VmArgs = object
  ra*, rb*, rc*: Natural
  slots*: ptr UncheckedArray[TFullReg]
  currentException*: PNode
  currentLineInfo*: TLineInfo
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L233) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L233)  
```
VmCallback = proc (args: VmArgs) {...}{.closure.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L238)  
```
PCtx = ref TCtx
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L240)  
```
TCtx = object of TPassContext
  code*: seq[TInstr]
  debug*: seq[TLineInfo]
  globals*: PNode
  constants*: PNode
  types*: seq[PType]
  currentExceptionA*, currentExceptionB*: PNode
  exceptionInstr*: int
  prc*: PProc
  module*: PSym
  callsite*: PNode
  mode*: TEvalMode
  features*: TSandboxFlags
  traceActive*: bool
  loopIterations*: int
  comesFromHeuristic*: TLineInfo
  callbacks*: seq[tuple[key: string, value: VmCallback]]
  errorFlag*: string
  cache*: IdentCache
  config*: ConfigRef
  graph*: ModuleGraph
  oldErrorCount*: int
  profiler*: Profiler
  templInstCounter*: ref int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L241)  
```
PStackFrame = ref TStackFrame
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L267)  
```
TStackFrame {...}{.acyclic.} = object
  prc*: PSym
  slots*: seq[TFullReg]
  next*: PStackFrame
  comesFrom*: int
  safePoints*: seq[int]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L268)  
```
Profiler = object
  tEnter*: float
  tos*: PStackFrame
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L277) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L277)  
```
TPosition = distinct int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L281) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L281)  
```
PEvalContext = PCtx
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L283)   Consts
------

  
```
byteExcess = 128
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L24)  
```
regOShift = 0'u
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L29)  
```
regAShift = 8'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L30)  
```
regBShift = 24'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L31) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L31)  
```
regCShift = 40'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L32)  
```
regBxShift = 24'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L33)  
```
regOMask = 255'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L35)  
```
regAMask = 65535'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L36)  
```
regBMask = 65535'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L37)  
```
regCMask = 65535'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L38)  
```
regBxMask = 16777215'u64
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L39)  
```
wordExcess = 8388608
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L41)  
```
regBxMin = -8388607
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L42)  
```
regBxMax = 8388607
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L43)  
```
firstABxInstr = opcTJmp
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L302)  
```
largeInstrs = {opcSubStr, opcConv, opcCast, opcNewSeq, opcOf, opcMarshalLoad,
               opcMarshalStore}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L303)  
```
slotSomeTemp = slotTempUnknown
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L306)  
```
relativeJumps = {opcTJmp, opcFJmp, opcJmp, opcJmpBack}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L307)  
```
nimNodeFlag = 16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L310) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L310)   Procs
-----

  
```
proc newCtx(module: PSym; cache: IdentCache; g: ModuleGraph): PCtx {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L285) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L285)  
```
proc refresh(c: PCtx; module: PSym) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L292) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L292)  
```
proc registerCallback(c: PCtx; name: string; callback: VmCallback): int {...}{.
    discardable, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L297) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L297)   Templates
---------

  
```
template opcode(x: TInstr): TOpcode
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L312)  
```
template regA(x: TInstr): TRegister
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L313) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L313)  
```
template regB(x: TInstr): TRegister
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L314) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L314)  
```
template regC(x: TInstr): TRegister
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L315) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L315)  
```
template regBx(x: TInstr): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L316)  
```
template jmpDiff(x: TInstr): int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdef.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdef.nim#L318)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmdef.html>

vmdeps
======

 Imports
-------

  <ast>, <types>, <msgs>, <options>, <idents>, <lineinfos>, <pathutils>  Procs
-----

  
```
proc opSlurp(file: string; info: TLineInfo; module: PSym; conf: ConfigRef): string {...}{.raises: [
    OSError, KeyError, Exception, ValueError, IOError, ERecoverableError], tags: [
    ReadDirEffect, ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdeps.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdeps.nim#L13)  
```
proc opMapTypeToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdeps.nim#L301) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdeps.nim#L301)  
```
proc opMapTypeInstToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdeps.nim#L306) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdeps.nim#L306)  
```
proc opMapTypeImplToAst(cache: IdentCache; t: PType; info: TLineInfo): PNode {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmdeps.nim#L311) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmdeps.nim#L311)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmdeps.html>

vmgen
=====

 This module implements the code generator for the VM.

 Imports
-------

  <ast>, <types>, <msgs>, <renderer>, <vmdef>, <magicsys>, <options>, <lowerings>, <lineinfos>, <transf>  Consts
------

  
```
debugEchoCode = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L35) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L35)   Procs
-----

  
```
proc echoCode(c: PCtx; start = 0; last = -1) {...}{.deprecated,
    raises: [ValueError, Exception], tags: [RootEffect].}
```
   **Deprecated**  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L109)  
```
proc canonValue(n: PNode): PNode {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L437) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L437)  
```
proc sameConstant(a, b: PNode): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L447) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L447)  
```
proc fitsRegister(t: PType): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L961) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L961)  
```
proc importcCondVar(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L1459) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L1459)  
```
proc importcCond(s: PSym): bool {...}{.inline, raises: [], tags: [].}
```
  return true to importc `s`, false to execute its body instead (refs #8405) [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L1570) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L1570)  
```
proc getNullValue(typ: PType; info: TLineInfo; conf: ConfigRef): PNode {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L1780) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L1780)  
```
proc genStmt(c: PCtx; n: PNode): int {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError], tags: [RootEffect, WriteIOEffect, ReadIOEffect,
                               ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L2138) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L2138)  
```
proc genExpr(c: PCtx; n: PNode; requiresValue = true): int {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L2147) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L2147)  
```
proc genProc(c: PCtx; s: PSym): int {...}{.raises: [Exception, ValueError, IOError,
    ERecoverableError, KeyError], tags: [RootEffect, WriteIOEffect,
    ReadIOEffect, ReadEnvEffect, TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmgen.nim#L2224) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmgen.nim#L2224)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmgen.html>

vmmarshal
=========

 Implements marshaling for the VM.

 Imports
-------

  <ast>, <astalgo>, <idents>, <types>, <msgs>, <options>, <lineinfos>  Procs
-----

  
```
proc storeAny(s: var string; t: PType; a: PNode; conf: ConfigRef) {...}{.
    raises: [Exception, ValueError, IOError, ERecoverableError],
    tags: [RootEffect, WriteIOEffect, ReadIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmmarshal.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmmarshal.nim#L132)  
```
proc loadAny(s: string; t: PType; cache: IdentCache; conf: ConfigRef): PNode {...}{.raises: [
    IOError, OSError, JsonParsingError, ValueError, Exception, ERecoverableError],
    tags: [ReadIOEffect, RootEffect, WriteIOEffect, ReadEnvEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmmarshal.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmmarshal.nim#L283)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmmarshal.html>

vmprofiler
==========

 Imports
-------

  <options>, <vmdef>, <lineinfos>, <msgs>  Procs
-----

  
```
proc enter(prof: var Profiler; c: PCtx; tos: PStackFrame) {...}{.inline, raises: [],
    tags: [TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmprofiler.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmprofiler.nim#L6)  
```
proc leave(prof: var Profiler; c: PCtx) {...}{.inline, raises: [KeyError],
    tags: [TimeEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmprofiler.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmprofiler.nim#L25)  
```
proc dump(conf: ConfigRef; pd: ProfileData): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/vmprofiler.nim#L29) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/vmprofiler.nim#L29)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/vmprofiler.html>

wordrecg
========

 Types
-----

  
```
TSpecialWord = enum
  wInvalid = "", wAddr = "addr", wAnd = "and", wAs = "as", wAsm = "asm",
  wBind = "bind", wBlock = "block", wBreak = "break", wCase = "case",
  wCast = "cast", wConcept = "concept", wConst = "const",
  wContinue = "continue", wConverter = "converter", wDefer = "defer",
  wDiscard = "discard", wDistinct = "distinct", wDiv = "div", wDo = "do",
  wElif = "elif", wElse = "else", wEnd = "end", wEnum = "enum",
  wExcept = "except", wExport = "export", wFinally = "finally", wFor = "for",
  wFrom = "from", wFunc = "func", wIf = "if", wImport = "import", wIn = "in",
  wInclude = "include", wInterface = "interface", wIs = "is", wIsnot = "isnot",
  wIterator = "iterator", wLet = "let", wMacro = "macro", wMethod = "method",
  wMixin = "mixin", wMod = "mod", wNil = "nil", wNot = "not", wNotin = "notin",
  wObject = "object", wOf = "of", wOr = "or", wOut = "out", wProc = "proc",
  wPtr = "ptr", wRaise = "raise", wRef = "ref", wReturn = "return",
  wShl = "shl", wShr = "shr", wStatic = "static", wTemplate = "template",
  wTry = "try", wTuple = "tuple", wType = "type", wUsing = "using",
  wVar = "var", wWhen = "when", wWhile = "while", wXor = "xor",
  wYield = "yield", wColon = ":", wColonColon = "::", wEquals = "=", wDot = ".",
  wDotDot = "..", wStar = "*", wMinus = "-", wMagic = "magic",
  wThread = "thread", wFinal = "final", wProfiler = "profiler",
  wMemTracker = "memtracker", wObjChecks = "objchecks",
  wIntDefine = "intdefine", wStrDefine = "strdefine",
  wBoolDefine = "booldefine", wCursor = "cursor", wNoalias = "noalias",
  wImmediate = "immediate", wConstructor = "constructor",
  wDestructor = "destructor", wDelegator = "delegator", wOverride = "override",
  wImportCpp = "importcpp", wImportObjC = "importobjc",
  wImportCompilerProc = "importcompilerproc", wImportc = "importc",
  wImportJs = "importjs", wExportc = "exportc", wExportCpp = "exportcpp",
  wExportNims = "exportnims", wIncompleteStruct = "incompleteStruct",
  wCompleteStruct = "completeStruct", wRequiresInit = "requiresInit",
  wAlign = "align", wNodecl = "nodecl", wPure = "pure",
  wSideEffect = "sideEffect", wHeader = "header",
  wNoSideEffect = "noSideEffect", wGcSafe = "gcsafe", wNoreturn = "noreturn",
  wNosinks = "nosinks", wMerge = "merge", wLib = "lib", wDynlib = "dynlib",
  wCompilerProc = "compilerproc", wCore = "core", wProcVar = "procvar",
  wBase = "base", wUsed = "used", wFatal = "fatal", wError = "error",
  wWarning = "warning", wHint = "hint", wWarningAsError = "warningAsError",
  wLine = "line", wPush = "push", wPop = "pop", wDefine = "define",
  wUndef = "undef", wLineDir = "lineDir", wStackTrace = "stackTrace",
  wLineTrace = "lineTrace", wLink = "link", wCompile = "compile",
  wLinksys = "linksys", wDeprecated = "deprecated", wVarargs = "varargs",
  wCallconv = "callconv", wDebugger = "debugger", wNimcall = "nimcall",
  wStdcall = "stdcall", wCdecl = "cdecl", wSafecall = "safecall",
  wSyscall = "syscall", wInline = "inline", wNoInline = "noinline",
  wFastcall = "fastcall", wThiscall = "thiscall", wClosure = "closure",
  wNoconv = "noconv", wOn = "on", wOff = "off", wChecks = "checks",
  wRangeChecks = "rangeChecks", wBoundChecks = "boundChecks",
  wOverflowChecks = "overflowChecks", wNilChecks = "nilChecks",
  wFloatChecks = "floatChecks", wNanChecks = "nanChecks",
  wInfChecks = "infChecks", wStyleChecks = "styleChecks",
  wStaticBoundchecks = "staticBoundChecks", wNonReloadable = "nonReloadable",
  wExecuteOnReload = "executeOnReload", wAssertions = "assertions",
  wPatterns = "patterns", wTrMacros = "trmacros",
  wSinkInference = "sinkInference", wWarnings = "warnings", wHints = "hints",
  wOptimization = "optimization", wRaises = "raises", wWrites = "writes",
  wReads = "reads", wSize = "size", wEffects = "effects", wTags = "tags",
  wRequires = "requires", wEnsures = "ensures", wInvariant = "invariant",
  wAssume = "assume", wAssert = "assert", wDeadCodeElimUnused = "deadCodeElim",
  wSafecode = "safecode", wPackage = "package", wNoForward = "noforward",
  wReorder = "reorder", wNoRewrite = "norewrite", wNoDestroy = "nodestroy",
  wPragma = "pragma", wCompileTime = "compileTime", wNoInit = "noinit",
  wPassc = "passc", wPassl = "passl", wLocalPassc = "localPassC",
  wBorrow = "borrow", wDiscardable = "discardable",
  wFieldChecks = "fieldChecks", wSubsChar = "subschar", wAcyclic = "acyclic",
  wShallow = "shallow", wUnroll = "unroll", wLinearScanEnd = "linearScanEnd",
  wComputedGoto = "computedGoto", wInjectStmt = "injectStmt",
  wExperimental = "experimental", wWrite = "write", wGensym = "gensym",
  wInject = "inject", wDirty = "dirty", wInheritable = "inheritable",
  wThreadVar = "threadvar", wEmit = "emit",
  wAsmNoStackFrame = "asmNoStackFrame", wImplicitStatic = "implicitStatic",
  wGlobal = "global", wCodegenDecl = "codegenDecl", wUnchecked = "unchecked",
  wGuard = "guard", wLocks = "locks", wPartial = "partial",
  wExplain = "explain", wLiftLocals = "liftlocals", wAuto = "auto",
  wBool = "bool", wCatch = "catch", wChar = "char", wClass = "class",
  wCompl = "compl", wConst_cast = "const_cast", wDefault = "default",
  wDelete = "delete", wDouble = "double", wDynamic_cast = "dynamic_cast",
  wExplicit = "explicit", wExtern = "extern", wFalse = "false",
  wFloat = "float", wFriend = "friend", wGoto = "goto", wInt = "int",
  wLong = "long", wMutable = "mutable", wNamespace = "namespace", wNew = "new",
  wOperator = "operator", wPrivate = "private", wProtected = "protected",
  wPublic = "public", wRegister = "register",
  wReinterpret_cast = "reinterpret_cast", wRestrict = "restrict",
  wShort = "short", wSigned = "signed", wSizeof = "sizeof",
  wStatic_cast = "static_cast", wStruct = "struct", wSwitch = "switch",
  wThis = "this", wThrow = "throw", wTrue = "true", wTypedef = "typedef",
  wTypeid = "typeid", wTypeof = "typeof", wTypename = "typename",
  wUnion = "union", wPacked = "packed", wUnsigned = "unsigned",
  wVirtual = "virtual", wVoid = "void", wVolatile = "volatile",
  wWchar_t = "wchar_t", wAlignas = "alignas", wAlignof = "alignof",
  wConstexpr = "constexpr", wDecltype = "decltype", wNullptr = "nullptr",
  wNoexcept = "noexcept", wThread_local = "thread_local",
  wStatic_assert = "static_assert", wChar16_t = "char16_t",
  wChar32_t = "char32_t", wStdIn = "stdin", wStdOut = "stdout",
  wStdErr = "stderr", wInOut = "inout", wByCopy = "bycopy", wByRef = "byref",
  wOneWay = "oneway", wBitsize = "bitsize"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L19) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L19)  
```
TSpecialWords = set[TSpecialWord]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L112)   Consts
------

  
```
oprLow = 67
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L115)  
```
oprHigh = 71
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L116)  
```
nimKeywordsLow = 4
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L118)  
```
nimKeywordsHigh = 66
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L119)  
```
ccgKeywordsLow = 222
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L121)  
```
ccgKeywordsHigh = 287
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L122)  
```
cppNimSharedKeywords = {wAsm, wBreak, wCase, wConst, wContinue, wDo, wElse,
                        wEnum, wExport, wFor, wIf, wReturn, wStatic, wTemplate,
                        wTry, wWhile, wUsing}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L124)   Procs
-----

  
```
proc findStr[T: enum](a: Slice[T]; s: string; default: T): T
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/compiler/wordrecg.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/compiler/wordrecg.nim#L128)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/wordrecg.html>

since
=====

 Templates
---------

  
```
template since(version: (int, int); body: untyped) {...}{.dirty.}
```
  Evaluates `body` if the `(NimMajor, NimMinor)` is greater than or equal to `version`. Usage:
```
proc fun*() {.since: (1, 3).}
since (1, 3): fun()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/private/since.nim#L1) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/private/since.nim#L1)  
```
template since(version: (int, int, int); body: untyped) {...}{.dirty.}
```
  Evaluates `body` if `(NimMajor, NimMinor, NimPatch)` is greater than or equal to `version`. Usage:
```
proc fun*() {.since: (1, 3, 1).}
since (1, 3, 1): fun()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/private/since.nim#L11) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/private/since.nim#L11)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/since.html>

iterators
=========

 Iterators
---------

  
```
iterator items[T: not char](a: openArray[T]): lent2 T {...}{.inline.}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L6) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L6)  
```
iterator items[T: char](a: openArray[T]): T {...}{.inline.}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L13)  
```
iterator mitems[T](a: var openArray[T]): var T {...}{.inline.}
```
  Iterates over each item of `a` so that you can modify the yielded value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L23)  
```
iterator items[IX, T](a: array[IX, T]): T {...}{.inline.}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L30) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L30)  
```
iterator mitems[IX, T](a: var array[IX, T]): var T {...}{.inline.}
```
  Iterates over each item of `a` so that you can modify the yielded value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L39) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L39)  
```
iterator items[T](a: set[T]): T {...}{.inline.}
```
  Iterates over each element of `a`. `items` iterates only over the elements that are really in the set (and not over the ones the set is able to hold). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L48)  
```
iterator items(a: cstring): char {...}{.inline, raises: [], tags: [].}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L57)  
```
iterator mitems(a: var cstring): var char {...}{.inline, raises: [], tags: [].}
```
  Iterates over each item of `a` so that you can modify the yielded value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L71)  
```
iterator items(E: typedesc[enum]): E:type
```
  Iterates over the values of the enum `E`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L85)  
```
iterator items[T](s: HSlice[T, T]): T
```
  Iterates over the slice `s`, yielding each value between `s.a` and `s.b` (inclusively). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L90)  
```
iterator pairs[T](a: openArray[T]): tuple[key: int, val: T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L96)  
```
iterator mpairs[T](a: var openArray[T]): tuple[key: int, val: var T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. `a[index]` can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L103)  
```
iterator pairs[IX, T](a: array[IX, T]): tuple[key: IX, val: T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L111)  
```
iterator mpairs[IX, T](a: var array[IX, T]): tuple[key: IX, val: var T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. `a[index]` can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L120)  
```
iterator pairs[T](a: seq[T]): tuple[key: int, val: T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L130)  
```
iterator mpairs[T](a: var seq[T]): tuple[key: int, val: var T] {...}{.inline.}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. `a[index]` can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L139)  
```
iterator pairs(a: string): tuple[key: int, val: char] {...}{.inline, raises: [],
    tags: [].}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L149)  
```
iterator mpairs(a: var string): tuple[key: int, val: var char] {...}{.inline,
    raises: [], tags: [].}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. `a[index]` can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L158)  
```
iterator pairs(a: cstring): tuple[key: int, val: char] {...}{.inline, raises: [],
    tags: [].}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L168)  
```
iterator mpairs(a: var cstring): tuple[key: int, val: var char] {...}{.inline,
    raises: [], tags: [].}
```
  Iterates over each item of `a`. Yields `(index, a[index])` pairs. `a[index]` can be modified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L182) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L182)  
```
iterator items[T](a: seq[T]): lent2 T {...}{.inline.}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L197)  
```
iterator mitems[T](a: var seq[T]): var T {...}{.inline.}
```
  Iterates over each item of `a` so that you can modify the yielded value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L206) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L206)  
```
iterator items(a: string): char {...}{.inline, raises: [], tags: [].}
```
  Iterates over each item of `a`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L215)  
```
iterator mitems(a: var string): var char {...}{.inline, raises: [], tags: [].}
```
  Iterates over each item of `a` so that you can modify the yielded value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L224) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L224)  
```
iterator fields[T: tuple | object](x: T): RootObj {...}{.magic: "Fields",
    noSideEffect.}
```
  Iterates over every field of `x`.

 **Warning**: This really transforms the 'for' and unrolls the loop. The current implementation also has a bug that affects symbol binding in the loop body.

 **Example:**

 
```
var t = (1, "foo")
for v in fields(t): v = default(type(v))
doAssert t == (0, "")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L234) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L234)  
```
iterator fields[S: tuple | object; T: tuple | object](x: S; y: T): tuple[
    key: string, val: RootObj] {...}{.magic: "Fields", noSideEffect.}
```
  Iterates over every field of `x` and `y`.

 **Warning**: This really transforms the 'for' and unrolls the loop. The current implementation also has a bug that affects symbol binding in the loop body.

 **Example:**

 
```
var t1 = (1, "foo")
var t2 = default(type(t1))
for v1, v2 in fields(t1, t2): v2 = v1
doAssert t1 == t2
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L246)  
```
iterator fieldPairs[T: tuple | object](x: T): tuple[key: string, val: RootObj] {...}{.
    magic: "FieldPairs", noSideEffect.}
```
  Iterates over every field of `x` returning their name and value.

 When you iterate over objects with different field types you have to use the compile time `when` instead of a runtime `if` to select the code you want to run for each type. To perform the comparison use the [is operator](manual#generics-is-operator). Another way to do the same without `when` is to leave the task of picking the appropriate code to a secondary proc which you overload for each field type and pass the `value` to.

 **Warning**: This really transforms the 'for' and unrolls the loop. The current implementation also has a bug that affects symbol binding in the loop body.

 **Example:**

 
```
type
  Custom = object
    foo: string
    bar: bool
proc `$`(x: Custom): string =
  result = "Custom:"
  for name, value in x.fieldPairs:
    when value is bool:
      result.add("\n\t" & name & " is " & $value)
    else:
      result.add("\n\t" & name & " '" & value & "'")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L259) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L259)  
```
iterator fieldPairs[S: tuple | object; T: tuple | object](x: S; y: T): tuple[
    key: string, a, b: RootObj] {...}{.magic: "FieldPairs", noSideEffect.}
```
  Iterates over every field of `x` and `y`.

 **Warning**: This really transforms the 'for' and unrolls the loop. The current implementation also has a bug that affects symbol binding in the loop body.

 **Example:**

 
```
type Foo = object
  x1: int
  x2: string
var a1 = Foo(x1: 12, x2: "abc")
var a2: Foo
for name, v1, v2 in fieldPairs(a1, a2):
  when name == "x2": v2 = v1
doAssert a2 == Foo(x1: 0, x2: "abc")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/iterators.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/iterators.nim#L287)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/iterators.html>

assertions
==========

 Imports
-------

  <miscdollars>  Procs
-----

  
```
proc raiseAssert(msg: string) {...}{.noinline, noreturn, nosinks, raises: [],
                                tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L22)  
```
proc failedAssertImpl(msg: string) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L25)   Templates
---------

  
```
template assert(cond: untyped; msg = "")
```
  Raises `AssertionDefect` with `msg` if `cond` is false. Note that `AssertionDefect` is hidden from the effect system, so it doesn't produce `{.raises: [AssertionDefect].}`. This exception is only supposed to be caught by unit testing frameworks.

 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#compiler-usage-command-line-switches).

 
```
static: assert 1 == 9, "This assertion generates code when not built with -d:danger or --assertions:off"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L43)  
```
template doAssert(cond: untyped; msg = "")
```
  Similar to `assert` but is always turned on regardless of `--assertions`.
```
static: doAssert 1 == 9, "This assertion generates code when built with/without -d:danger or --assertions:off"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L57)  
```
template onFailedAssert(msg, code: untyped): untyped {...}{.dirty.}
```
  Sets an assertion failure handler that will intercept any assert statements following `onFailedAssert` in the current module scope.
```
# module-wide policy to change the failed assert
# exception type in order to include a lineinfo
onFailedAssert(msg):
  var e = new(TMyError)
  e.msg = msg
  e.lineinfo = instantiationInfo(-2)
  raise e
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L65)  
```
template doAssertRaises(exception: typedesc; code: untyped)
```
  Raises `AssertionDefect` if specified `code` does not raise the specified exception. Example:
```
doAssertRaises(ValueError):
  raise newException(ValueError, "Hello World")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/assertions.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/assertions.nim#L82)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/assertions.html>

dollars
=======

 Imports
-------

  <since>  Procs
-----

  
```
proc `$`(x: int): string {...}{.magic: "IntToStr", noSideEffect.}
```
  The stringify operator for an integer argument. Returns `x` converted to a decimal string. `$` is Nim's general way of spelling toString. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L3) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L3)  
```
proc `$`(x: uint64): string {...}{.noSideEffect, raises: [], tags: [].}
```
  The stringify operator for an unsigned integer argument. Returns `x` converted to a decimal string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L23)  
```
proc `$`(x: int64): string {...}{.magic: "Int64ToStr", noSideEffect.}
```
  The stringify operator for an integer argument. Returns `x` converted to a decimal string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L43)  
```
proc `$`(x: float): string {...}{.magic: "FloatToStr", noSideEffect.}
```
  The stringify operator for a float argument. Returns `x` converted to a decimal string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L47)  
```
proc `$`(x: bool): string {...}{.magic: "BoolToStr", noSideEffect.}
```
  The stringify operator for a boolean argument. Returns `x` converted to the string "false" or "true". [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L51)  
```
proc `$`(x: char): string {...}{.magic: "CharToStr", noSideEffect.}
```
  The stringify operator for a character argument. Returns `x` converted to a string.
```
assert $'c' == "c"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L55)  
```
proc `$`(x: cstring): string {...}{.magic: "CStrToStr", noSideEffect.}
```
  The stringify operator for a CString argument. Returns `x` converted to a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L62)  
```
proc `$`(x: string): string {...}{.magic: "StrToStr", noSideEffect.}
```
  The stringify operator for a string argument. Returns `x` as it is. This operator is useful for generic code, so that `$expr` also works if `expr` is already a string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L66)  
```
proc `$`[Enum: enum](x: Enum): string {...}{.magic: "EnumToStr", noSideEffect.}
```
  The stringify operator for an enumeration argument. This works for any enumeration type thanks to compiler magic.

 If a `$` operator for a concrete enumeration is provided, this is used instead. (In other words: *Overwriting* is possible.)

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L71)  
```
proc `$`(t: typedesc): string {...}{.magic: "TypeTrait".}
```
  Returns the name of the given type.

 For more procedures dealing with `typedesc`, see [typetraits module](typetraits).

 
```
doAssert $(typeof(42)) == "int"
doAssert $(typeof("Foo")) == "string"
static: doAssert $(typeof(@['A', 'B'])) == "seq[char]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L78)  
```
proc `$`[T: tuple | object](x: T): string
```
  Generic `$` operator for tuples that is lifted from the components of `x`. Example:
```
$(23, 45) == "(23, 45)"
$(a: 23, b: 45) == "(a: 23, b: 45)"
$() == "()"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L106) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L106)  
```
proc `$`[T](x: set[T]): string
```
  Generic `$` operator for sets that is lifted from the components of `x`. Example:
```
${23, 45} == "{23, 45}"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L156)  
```
proc `$`[T](x: seq[T]): string
```
  Generic `$` operator for seqs that is lifted from the components of `x`. Example:
```
$(@[23, 45]) == "@[23, 45]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L164) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L164)  
```
proc `$`[T, U](x: HSlice[T, U]): string
```
  Generic `$` operator for slices that is lifted from the components of `x`. Example:
```
$(1 .. 5) == "1 .. 5"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L172) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L172)  
```
proc `$`[T, IDX](x: array[IDX, T]): string
```
  Generic `$` operator for arrays that is lifted from the components. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L184)  
```
proc `$`[T](x: openArray[T]): string
```
  Generic `$` operator for openarrays that is lifted from the components of `x`. Example:
```
$(@[23, 45].toOpenArray(0, 1)) == "[23, 45]"
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/dollars.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/dollars.nim#L188)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/dollars.html>

io
==

 This is a part of `system.nim`, you should not manually import it.

 Imports
-------

  <since>, <formatfloat>  Types
-----

  
```
File = ptr CFile
```
  The type representing a file handle. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L21)  
```
FileMode = enum
  fmRead,                   ## Open the file for read access only.
  fmWrite,                  ## Open the file for write access only.
                             ## If the file does not exist, it will be
                             ## created. Existing files will be cleared!
  fmReadWrite,              ## Open the file for read and write access.
                             ## If the file does not exist, it will be
                             ## created. Existing files will be cleared!
  fmReadWriteExisting,      ## Open the file for read and write access.
                             ## If the file does not exist, it will not be
                             ## created. The existing file will not be cleared.
  fmAppend                   ## Open the file for writing only; append data
                             ## at the end.
```
  The file mode when opening a file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L23)  
```
FileHandle = cint
```
  type that represents an OS file handle; this is useful for low-level file access [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L37)   Vars
----

  
```
stdin: File
```
  The standard input stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L49)  
```
stdout: File
```
  The standard output stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L51)  
```
stderr: File
```
  The standard error stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L53)   Procs
-----

  
```
proc readBuffer(f: File; buffer: pointer; len: Natural): int {...}{.
    tags: [ReadIOEffect], gcsafe, locks: 0, raises: [IOError].}
```
  reads `len` bytes into the buffer pointed to by `buffer`. Returns the actual number of bytes that have been read which may be less than `len` (if not as many bytes are remaining), but not greater. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L162)  
```
proc readBytes(f: File; a: var openArray[int8 | uint8]; start, len: Natural): int {...}{.
    tags: [ReadIOEffect], gcsafe, locks: 0.}
```
  reads `len` bytes into the buffer `a` starting at `a[start]`. Returns the actual number of bytes that have been read which may be less than `len` (if not as many bytes are remaining), but not greater. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L170)  
```
proc readChars(f: File; a: var openArray[char]; start, len: Natural): int {...}{.
    tags: [ReadIOEffect], gcsafe, locks: 0, raises: [IOError].}
```
  reads `len` bytes into the buffer `a` starting at `a[start]`. Returns the actual number of bytes that have been read which may be less than `len` (if not as many bytes are remaining), but not greater.

 **Warning:** The buffer `a` must be pre-allocated. This can be done using, for example, `newString`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L177)  
```
proc write(f: File; c: cstring) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                                  raises: [IOError].}
```
  Writes a value to the file `f`. May throw an IO exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L189) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L189)  
```
proc writeBuffer(f: File; buffer: pointer; len: Natural): int {...}{.
    tags: [WriteIOEffect], gcsafe, locks: 0, raises: [IOError].}
```
  writes the bytes of buffer pointed to by the parameter `buffer` to the file `f`. Returns the number of actual written bytes, which may be less than `len` in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L194) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L194)  
```
proc writeBytes(f: File; a: openArray[int8 | uint8]; start, len: Natural): int {...}{.
    tags: [WriteIOEffect], gcsafe, locks: 0.}
```
  writes the bytes of `a[start..start+len-1]` to the file `f`. Returns the number of actual written bytes, which may be less than `len` in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L202)  
```
proc writeChars(f: File; a: openArray[char]; start, len: Natural): int {...}{.
    tags: [WriteIOEffect], gcsafe, locks: 0, raises: [IOError].}
```
  writes the bytes of `a[start..start+len-1]` to the file `f`. Returns the number of actual written bytes, which may be less than `len` in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L210) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L210)  
```
proc write(f: File; s: string) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                                 raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L240) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L240)  
```
proc close(f: File) {...}{.tags: [], gcsafe, raises: [].}
```
  Closes the file. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L302) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L302)  
```
proc readChar(f: File): char {...}{.tags: [ReadIOEffect], raises: [IOError, EOFError].}
```
  Reads a single character from the stream `f`. Should not be used in performance sensitive code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L307) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L307)  
```
proc flushFile(f: File) {...}{.tags: [WriteIOEffect], raises: [].}
```
  Flushes `f`'s buffer. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L316) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L316)  
```
proc getFileHandle(f: File): FileHandle {...}{.raises: [], tags: [].}
```
  returns the file handle of the file `f`. This is only useful for platform specific programming. Note that on Windows this doesn't return the Windows-specific handle, but the C library's notion of a handle, whatever that means. Use `getOsFileHandle` instead. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L320)  
```
proc getOsFileHandle(f: File): FileHandle {...}{.raises: [], tags: [].}
```
  returns the OS file handle of the file `f`. This is only useful for platform specific programming. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L328)  
```
proc setInheritable(f: FileHandle; inheritable: bool): bool {...}{.raises: [],
    tags: [].}
```
  control whether a file handle can be inherited by child processes. Returns `true` on success. This requires the OS file handle, which can be retrieved via [getOsFileHandle](#getOsFileHandle,File).

 This procedure is not guaranteed to be available for all platforms. Test for availability with `declared() <system.html#declared,untyped>`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L337) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L337)  
```
proc readLine(f: File; line: var TaintedString): bool {...}{.tags: [ReadIOEffect],
    gcsafe, locks: 0, raises: [IOError].}
```
  reads a line of text from the file `f` into `line`. May throw an IO exception. A line of text may be delimited by `LF` or `CRLF`. The newline character(s) are not part of the returned string. Returns `false` if the end of the file has been reached, `true` otherwise. If `false` is returned `line` contains no new data. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L358)  
```
proc readLine(f: File): TaintedString {...}{.tags: [ReadIOEffect], gcsafe, locks: 0,
                                        raises: [IOError, EOFError].}
```
  reads a line of text from the file `f`. May throw an IO exception. A line of text may be delimited by `LF` or `CRLF`. The newline character(s) are not part of the returned string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L479) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L479)  
```
proc write(f: File; i: int) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                              raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L486) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L486)  
```
proc write(f: File; i: BiggestInt) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                                     raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L492) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L492)  
```
proc write(f: File; b: bool) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                               raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L498) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L498)  
```
proc write(f: File; r: float32) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                                  raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L502) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L502)  
```
proc write(f: File; r: BiggestFloat) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                                       raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L507) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L507)  
```
proc write(f: File; c: char) {...}{.tags: [WriteIOEffect], gcsafe, locks: 0,
                               raises: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L512) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L512)  
```
proc write(f: File; a: varargs[string, `$`]) {...}{.tags: [WriteIOEffect], gcsafe,
    locks: 0, raises: [IOError].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L515) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L515)  
```
proc endOfFile(f: File): bool {...}{.tags: [], gcsafe, locks: 0, raises: [].}
```
  Returns true if `f` is at the end. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L539) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L539)  
```
proc readAll(file: File): TaintedString {...}{.tags: [ReadIOEffect], gcsafe,
    locks: 0, raises: [IOError].}
```
  Reads all data from the stream `file`.

 Raises an IO exception in case of an error. It is an error if the current file position is not at the beginning of the file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L563) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L563)  
```
proc writeLine[Ty](f: File; x: varargs[Ty, `$`]) {...}{.inline,
    tags: [WriteIOEffect], gcsafe, locks: 0.}
```
  writes the values `x` to `f` and then writes "\n". May throw an IO exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L580) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L580)  
```
proc open(f: var File; filename: string; mode: FileMode = fmRead;
          bufSize: int = -1): bool {...}{.tags: [], raises: [], gcsafe, locks: 0.}
```
  Opens a file named `filename` with given `mode`.

 Default mode is readonly. Returns true if the file could be opened. This throws no exception if the file could not be opened.

 The file handle associated with the resulting `File` is not inheritable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L668) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L668)  
```
proc reopen(f: File; filename: string; mode: FileMode = fmRead): bool {...}{.
    tags: [], gcsafe, locks: 0, raises: [].}
```
  reopens the file `f` with given `filename` and `mode`. This is often used to redirect the `stdin`, `stdout` or `stderr` file variables.

 Default mode is readonly. Returns true if the file could be reopened.

 The file handle associated with `f` won't be inheritable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L701) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L701)  
```
proc open(f: var File; filehandle: FileHandle; mode: FileMode = fmRead): bool {...}{.
    tags: [], raises: [], gcsafe, locks: 0.}
```
  Creates a `File` from a `filehandle` with given `mode`.

 Default mode is readonly. Returns true if the file could be opened.

 The passed file handle will no longer be inheritable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L718) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L718)  
```
proc open(filename: string; mode: FileMode = fmRead; bufSize: int = -1): File {...}{.
    raises: [IOError], tags: [].}
```
  Opens a file named `filename` with given `mode`.

 Default mode is readonly. Raises an `IOError` if the file could not be opened.

 The file handle associated with the resulting `File` is not inheritable.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L732) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L732)  
```
proc setFilePos(f: File; pos: int64; relativeTo: FileSeekPos = fspSet) {...}{.gcsafe,
    locks: 0, raises: [IOError], tags: [].}
```
  sets the position of the file pointer that is used for read/write operations. The file's first byte has the index zero. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L743) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L743)  
```
proc getFilePos(f: File): int64 {...}{.gcsafe, locks: 0, raises: [IOError], tags: [].}
```
  retrieves the current position of the file pointer that is used to read from the file `f`. The file's first byte has the index zero. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L749) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L749)  
```
proc getFileSize(f: File): int64 {...}{.tags: [ReadIOEffect], gcsafe, locks: 0,
                                   raises: [IOError].}
```
  retrieves the file size (in bytes) of `f`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L755) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L755)  
```
proc setStdIoUnbuffered() {...}{.tags: [], gcsafe, locks: 0, raises: [].}
```
  Configures `stdin`, `stdout` and `stderr` to be unbuffered. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L762) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L762)  
```
proc readFile(filename: string): TaintedString {...}{.tags: [ReadIOEffect], gcsafe,
    locks: 0, raises: [IOError].}
```
  Opens a file named `filename` for reading, calls [readAll](#readAll,File) and closes the file afterwards. Returns the string. Raises an IO exception in case of an error. If you need to call this inside a compile time macro you can use [staticRead](system#staticRead,string). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L836) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L836)  
```
proc writeFile(filename, content: string) {...}{.tags: [WriteIOEffect], gcsafe,
    locks: 0, raises: [IOError].}
```
  Opens a file named `filename` for writing. Then writes the `content` completely to the file and closes the file afterwards. Raises an IO exception in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L851) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L851)  
```
proc writeFile(filename: string; content: openArray[byte]) {...}{.raises: [IOError],
    tags: [WriteIOEffect].}
```
  Opens a file named `filename` for writing. Then writes the `content` completely to the file and closes the file afterwards. Raises an IO exception in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L864) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L864)  
```
proc readLines(filename: string; n: Natural): seq[TaintedString] {...}{.
    raises: [IOError, EOFError], tags: [ReadIOEffect].}
```
  read `n` lines from the file named `filename`. Raises an IO exception in case of an error. Raises EOF if file does not contain at least `n` lines. Available at compile time. A line of text may be delimited by `LF` or `CRLF`. The newline character(s) are not part of the returned strings. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L877) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L877)   Iterators
---------

  
```
iterator lines(filename: string): TaintedString {...}{.tags: [ReadIOEffect],
    raises: [IOError, IOError].}
```
  Iterates over any line in the file named `filename`.

 If the file does not exist `IOError` is raised. The trailing newline character(s) are removed from the iterated lines. Example:

 
```
import strutils

proc transformLetters(filename: string) =
  var buffer = ""
  for line in filename.lines:
    buffer.add(line.replace("a", "0") & '\x0A')
  writeFile(filename, buffer)
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L897) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L897)  
```
iterator lines(f: File): TaintedString {...}{.tags: [ReadIOEffect], raises: [IOError].}
```
  Iterate over any line in the file `f`.

 The trailing newline character(s) are removed from the iterated lines. Example:

 
```
proc countZeros(filename: File): tuple[lines, zeros: int] =
  for line in filename.lines:
    for letter in line:
      if letter == '0':
        result.zeros += 1
    result.lines += 1
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L918) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L918)   Templates
---------

  
```
template stdmsg(): File
```
  Template which expands to either stdout or stderr depending on `useStdoutAsStdmsg` compile-time switch. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L59)  
```
template readLines(filename: string): seq[TaintedString] {...}{.
    deprecated: "use readLines with two arguments".}
```
   **Deprecated:** use readLines with two arguments  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/io.nim#L894) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/io.nim#L894)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/io.html>

widestrs
========

 Types
-----

  
```
Utf16Char = distinct int16
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L17)  
```
WideCString = ref UncheckedArray[Utf16Char]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L60)  
```
WideCStringObj = WideCString
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L61)   Procs
-----

  
```
proc len(w: WideCString): int {...}{.raises: [], tags: [].}
```
  returns the length of a widestring. This traverses the whole string to find the binary zero end marker! [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L68)  
```
proc newWideCString(source: cstring; L: int): WideCStringObj {...}{.raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L145)  
```
proc newWideCString(s: cstring): WideCStringObj {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L165)  
```
proc newWideCString(s: string): WideCStringObj {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L170)  
```
proc `$`(w: WideCString; estimate: int; replacement: int = 0x0000FFFD): string {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L173)  
```
proc `$`(s: WideCString): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/widestrs.nim#L215) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/widestrs.nim#L215)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/widestrs.html>

miscdollars
===========

 Templates
---------

  
```
template toLocation(result: var string; file: string | cstring; line: int;
                    col: int)
```
  avoids spurious allocations [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/private/miscdollars.nim#L1) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/private/miscdollars.nim#L1)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/miscdollars.html>

exitprocs
=========

 Imports
-------

  <locks>  Procs
-----

  
```
proc addExitProc(cl: proc () {...}{.closure.}) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  Adds/registers a quit procedure. Each call to `addExitProc` registers another quit procedure. They are executed on a last-in, first-out basis. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/exitprocs.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/exitprocs.nim#L51)  
```
proc addExitProc(cl: proc () {...}{.noconv.}) {...}{.raises: [Exception],
    tags: [RootEffect].}
```
  overload for `noconv` procs. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/exitprocs.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/exitprocs.nim#L61)  
```
proc getProgramResult(): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/exitprocs.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/exitprocs.nim#L68)  
```
proc setProgramResult(a: int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/exitprocs.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/exitprocs.nim#L78)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/exitprocs.html>

pathnorm
========


OS-Path normalization. Used by `os.nim` but also generally useful for dealing with paths.

 Unstable API.

 Imports
-------

  <osseps>  Types
-----

  
```
PathIter = object
  i, prev: int
  notFirst: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pathnorm.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pathnorm.nim#L20)   Procs
-----

  
```
proc hasNext(it: PathIter; x: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pathnorm.nim#L24) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pathnorm.nim#L24)  
```
proc next(it: var PathIter; x: string): (int, int) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pathnorm.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pathnorm.nim#L27)  
```
proc addNormalizePath(x: string; result: var string; state: var int;
                      dirSep = DirSep) {...}{.raises: [], tags: [].}
```
  Low level proc. Undocumented. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pathnorm.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pathnorm.nim#L59)  
```
proc normalizePath(path: string; dirSep = DirSep): string {...}{.raises: [], tags: [].}
```
  **Example:**

 
```
when defined(posix):
  doAssert normalizePath("./foo//bar/../baz") == "foo/baz"
```

* Turns multiple slashes into single slashes.
* Resolves `'/foo/../bar'` to `'/bar'`.
* Removes `'./'` from the path, but `"foo/.."` becomes `"."`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/pathnorm.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/pathnorm.nim#L102)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/pathnorm.html>

streamwrapper
=============


This module implements stream wrapper.

 **Since** version 1.2.

 Imports
-------

  <deques>, <streams>  Types
-----

  
```
PipeOutStream[T] = ref object of T
  buffer: Deque[char]
  baseReadLineImpl: typeof(StreamObj.readLineImpl)
  baseReadDataImpl: typeof(StreamObj.readDataImpl)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streamwrapper.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streamwrapper.nim#L17)   Procs
-----

  
```
proc newPipeOutStream[T](s: sink (ref T)): owned PipeOutStream[T]
```
  Wrap pipe for reading with PipeOutStream so that you can use peek\* procs and generate runtime error when setPosition/getPosition is called or write operation is performed.

 Example:

 
```
import osproc, streamwrapper
var
  p = startProcess(exePath)
  outStream = p.outputStream().newPipeOutStream()
echo outStream.peekChar
p.close()
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/streamwrapper.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/streamwrapper.nim#L85)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/streamwrapper.html>

termios
=======

 Imports
-------

  <posix>  Types
-----

  
```
Speed = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L13) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L13)  
```
Cflag = cuint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L14)  
```
Termios {...}{.importc: "struct termios", header: "<termios.h>".} = object
  c_iflag*: Cflag
  c_oflag*: Cflag
  c_cflag*: Cflag
  c_lflag*: Cflag
  c_line*: cuchar
  c_cc*: array[NCCS, cuchar]
  c_ispeed*: Speed
  c_ospeed*: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L21) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L21)  
```
IOctl_WinSize = object
  ws_row*, ws_col*, ws_xpixel*, ws_ypixel*: cushort
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L246) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L246)   Vars
----

  
```
VINTR: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L42) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L42)  
```
VQUIT: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L43) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L43)  
```
VERASE: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L44)  
```
VKILL: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L45) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L45)  
```
VEOF: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L46) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L46)  
```
VTIME: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L47)  
```
VMIN: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L48)  
```
VSTART: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L49) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L49)  
```
VSTOP: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L50)  
```
VSUSP: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L51) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L51)  
```
VEOL: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L52) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L52)  
```
IGNBRK: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L57)  
```
BRKINT: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L58)  
```
IGNPAR: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L59)  
```
PARMRK: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L60)  
```
INPCK: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L61)  
```
ISTRIP: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L62)  
```
INLCR: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L63)  
```
IGNCR: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L64)  
```
ICRNL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L65)  
```
IUCLC: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L66)  
```
IXON: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L67)  
```
IXANY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L68)  
```
IXOFF: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L69)  
```
OPOST: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L74)  
```
ONLCR: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L75)  
```
OCRNL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L76)  
```
ONOCR: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L77)  
```
ONLRET: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L78)  
```
OFILL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L79)  
```
OFDEL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L80)  
```
NLDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L81)  
```
NL0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L82)  
```
NL1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L83)  
```
CRDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L84)  
```
CR0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L85)  
```
CR1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L86)  
```
CR2: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L87)  
```
CR3: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L88)  
```
TABDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L89)  
```
TAB0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L90)  
```
TAB1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L91)  
```
TAB2: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L92)  
```
TAB3: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L93)  
```
BSDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L94)  
```
BS0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L95)  
```
BS1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L96)  
```
FFDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L97)  
```
FF0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L98)  
```
FF1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L99)  
```
VTDLY: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L100)  
```
VT0: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L101) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L101)  
```
VT1: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L102)  
```
B0: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L107) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L107)  
```
B50: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L108) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L108)  
```
B75: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L109) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L109)  
```
B110: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L110)  
```
B134: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L111) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L111)  
```
B150: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L112) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L112)  
```
B200: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L113) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L113)  
```
B300: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L114)  
```
B600: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L115)  
```
B1200: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L116) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L116)  
```
B1800: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L117)  
```
B2400: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L118)  
```
B4800: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L119) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L119)  
```
B9600: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L120) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L120)  
```
B19200: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L121)  
```
B38400: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L122)  
```
B57600: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L123) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L123)  
```
B115200: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L124) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L124)  
```
B230400: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L125)  
```
B460800: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L126)  
```
B500000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L127)  
```
B576000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L128) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L128)  
```
B921600: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L129) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L129)  
```
B1000000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L130)  
```
B1152000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L131) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L131)  
```
B1500000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L132)  
```
B2000000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L133) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L133)  
```
B2500000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L134)  
```
B3000000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L135)  
```
B3500000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L136) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L136)  
```
B4000000: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L137)  
```
EXTA: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L138)  
```
EXTB: Speed
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L139)  
```
CSIZE: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L140) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L140)  
```
CS5: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L141)  
```
CS6: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L142)  
```
CS7: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L143) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L143)  
```
CS8: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L144)  
```
CSTOPB: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L145)  
```
CREAD: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L146) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L146)  
```
PARENB: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L147)  
```
PARODD: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L148) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L148)  
```
HUPCL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L149)  
```
CLOCAL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L150) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L150)  
```
ISIG: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L155) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L155)  
```
ICANON: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L156)  
```
ECHO: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L157) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L157)  
```
ECHOE: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L158) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L158)  
```
ECHOK: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L159)  
```
ECHONL: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L160) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L160)  
```
NOFLSH: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L161) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L161)  
```
TOSTOP: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L162) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L162)  
```
IEXTEN: Cflag
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L163) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L163)  
```
TCOOFF: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L168) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L168)  
```
TCOON: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L169)  
```
TCIOFF: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L170) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L170)  
```
TCION: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L171)  
```
TCIFLUSH: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L176) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L176)  
```
TCOFLUSH: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L177) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L177)  
```
TCIOFLUSH: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L178) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L178)  
```
TCSANOW: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L183) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L183)  
```
TCSADRAIN: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L184) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L184)  
```
TCSAFLUSH: cint
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L185) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L185)  
```
TIOCGWINSZ: culong
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L241) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L241)   Consts
------

  
```
NCCS = 32
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L17) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L17)   Procs
-----

  
```
proc cfGetOspeed(termios: ptr Termios): Speed {...}{.importc: "cfgetospeed",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L195) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L195)  
```
proc cfGetIspeed(termios: ptr Termios): Speed {...}{.importc: "cfgetispeed",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L199) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L199)  
```
proc cfSetOspeed(termios: ptr Termios; speed: Speed): cint {...}{.
    importc: "cfsetospeed", header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L203) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L203)  
```
proc cfSetIspeed(termios: ptr Termios; speed: Speed): cint {...}{.
    importc: "cfsetispeed", header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L207)  
```
proc tcGetAttr(fd: cint; termios: ptr Termios): cint {...}{.importc: "tcgetattr",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L211)  
```
proc tcSetAttr(fd: cint; optional_actions: cint; termios: ptr Termios): cint {...}{.
    importc: "tcsetattr", header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L216)  
```
proc tcSendBreak(fd: cint; duration: cint): cint {...}{.importc: "tcsendbreak",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L220)  
```
proc tcDrain(fd: cint): cint {...}{.importc: "tcdrain", header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L227) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L227)  
```
proc tcFlush(fd: cint; queue_selector: cint): cint {...}{.importc: "tcflush",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L231) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L231)  
```
proc tcFlow(fd: cint; action: cint): cint {...}{.importc: "tcflow",
    header: "<termios.h>".}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L236) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L236)  
```
proc ioctl(fd: cint; request: culong; reply: ptr IOctl_WinSize): int {...}{.
    importc: "ioctl", header: "<stdio.h>", varargs.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L252) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L252)   Templates
---------

  
```
template cceq(val, c): untyped
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/posix/termios.nim#L190) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/posix/termios.nim#L190)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/termios.html>

asyncfutures
============

 Imports
-------

  <os>, <tables>, <strutils>, <times>, <heapqueue>, <options>, <deques>, <cstrutils>, <stacktraces>  Types
-----

  
```
FutureBase = ref object of RootObj
  callbacks: CallbackList
  finished: bool
  error*: ref Exception      ## Stored exception
  errorStackTrace*: string
  when not false:
      stackTrace: seq[StackTraceEntry] ## For debugging purposes only.
      id: int
      fromProc: string
```
  Untyped future. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L22)  
```
Future[T] = ref object of FutureBase
  value: T                   ## Stored value
```
  Typed future. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L33)  
```
FutureVar[T] = distinct Future[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L36)  
```
FutureError = object of Defect
  cause*: FutureBase
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L38) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L38)   Consts
------

  
```
isFutureLoggingEnabled = false
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L44) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L44)  
```
NimAsyncContinueSuffix = "NimAsyncContinue"
```
  For internal usage. Do not use. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L47) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L47)   Procs
-----

  
```
proc getCallSoonProc(): (proc (cbproc: proc ()) {...}{.gcsafe.}) {...}{.raises: [],
    tags: [].}
```
  Get current implementation of `callSoon`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L88)  
```
proc setCallSoonProc(p: (proc (cbproc: proc ()) {...}{.gcsafe.})) {...}{.raises: [],
    tags: [].}
```
  Change current implementation of `callSoon`. This is normally called when dispatcher from `asyncdispatcher` is initialized. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L92)  
```
proc callSoon(cbproc: proc ()) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Call `cbproc` "soon".

 If async dispatcher is running, `cbproc` will be executed during next dispatcher tick.

 If async dispatcher is not running, `cbproc` will be executed immediately.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L96)  
```
proc newFuture[T](fromProc: string = "unspecified"): owned(Future[T])
```
  Creates a new future.

 Specifying `fromProc`, which is a string specifying the name of the proc that this future belongs to, is a good habit as it helps with debugging.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L117)  
```
proc newFutureVar[T](fromProc = "unspecified"): owned(FutureVar[T])
```
  Create a new `FutureVar`. This Future type is ideally suited for situations where you want to avoid unnecessary allocations of Futures.

 Specifying `fromProc`, which is a string specifying the name of the proc that this future belongs to, is a good habit as it helps with debugging.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L125) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L125)  
```
proc clean[T](future: FutureVar[T])
```
  Resets the `finished` status of `future`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L135) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L135)  
```
proc complete[T](future: Future[T]; val: T)
```
  Completes `future` with value `val`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L192)  
```
proc complete(future: Future[void]) {...}{.raises: [Exception], tags: [RootEffect].}
```
  Completes a void `future`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L202)  
```
proc complete[T](future: FutureVar[T])
```
  Completes a `FutureVar`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L211) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L211)  
```
proc complete[T](future: FutureVar[T]; val: T)
```
  Completes a `FutureVar` with value `val`.

 Any previously stored value will be overwritten.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L220) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L220)  
```
proc fail[T](future: Future[T]; error: ref Exception)
```
  Completes `future` with `error`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L232)  
```
proc clearCallbacks(future: FutureBase) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L243) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L243)  
```
proc addCallback(future: FutureBase; cb: proc () {...}{.closure, gcsafe.}) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Adds the callbacks proc to be called when the future completes.

 If future has already completed then `cb` will be called immediately.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L247) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L247)  
```
proc addCallback[T](future: Future[T];
                    cb: proc (future: Future[T]) {...}{.closure, gcsafe.})
```
  Adds the callbacks proc to be called when the future completes.

 If future has already completed then `cb` will be called immediately.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L257) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L257)  
```
proc callback=(future: FutureBase; cb: proc () {...}{.closure, gcsafe.}) {...}{.
    raises: [Exception], tags: [RootEffect].}
```
  Clears the list of callbacks and sets the callback proc to be called when the future completes.

 If future has already completed then `cb` will be called immediately.

 It's recommended to use `addCallback` or `then` instead.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L267) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L267)  
```
proc callback=[T](future: Future[T];
                  cb: proc (future: Future[T]) {...}{.closure, gcsafe.})
```
  Sets the callback proc to be called when the future completes.

 If future has already completed then `cb` will be called immediately.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L276) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L276)  
```
proc `$`(stackTraceEntries: seq[StackTraceEntry]): string {...}{.
    raises: [ValueError], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L312)  
```
proc read[T](future: Future[T] | FutureVar[T]): T
```
  Retrieves the value of `future`. Future must be finished otherwise this function will fail with a `ValueError` exception.

 If the result of the future is an error then that error will be raised.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L379) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L379)  
```
proc readError[T](future: Future[T]): ref Exception
```
  Retrieves the exception stored in `future`.

 An `ValueError` exception will be thrown if no exception exists in the specified Future.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L397) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L397)  
```
proc mget[T](future: FutureVar[T]): var T
```
  Returns a mutable value stored in `future`.

 Unlike `read`, this function will not raise an exception if the Future has not been finished.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L406) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L406)  
```
proc finished(future: FutureBase | FutureVar): bool
```
  Determines whether `future` has completed.

 `True` may indicate an error or a value. Use `failed` to distinguish.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L413) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L413)  
```
proc failed(future: FutureBase): bool {...}{.raises: [], tags: [].}
```
  Determines whether `future` completed with an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L422) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L422)  
```
proc asyncCheck[T](future: Future[T])
```
  Sets a callback on `future` which raises an exception if the future finished with an error.

 This should be used instead of `discard` to discard void futures, or use `waitFor` if you need to wait for the future's completion.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L426)  
```
proc `and`[T, Y](fut1: Future[T]; fut2: Future[Y]): Future[void]
```
  Returns a future which will complete once both `fut1` and `fut2` complete. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L441) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L441)  
```
proc `or`[T, Y](fut1: Future[T]; fut2: Future[Y]): Future[void]
```
  Returns a future which will complete once either `fut1` or `fut2` complete. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L457) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L457)  
```
proc all[T](futs: varargs[Future[T]]): auto
```
  Returns a future which will complete once all futures in `futs` complete. If the argument is empty, the returned future completes immediately.

 If the awaited futures are not `Future[void]`, the returned future will hold the values of all awaited futures in a sequence.

 If the awaited futures *are* `Future[void]`, this proc returns `Future[void]`.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/asyncfutures.nim#L469) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/asyncfutures.nim#L469)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/asyncfutures.html>

httpcore
========


Contains functionality shared between the `httpclient` and `asynchttpserver` modules.

 Unstable API.

 Imports
-------

  <tables>, <strutils>, <parseutils>  Types
-----

  
```
HttpHeaders = ref object
  table*: TableRef[string, seq[string]]
  isTitleCase: bool
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L18)  
```
HttpHeaderValues = distinct seq[string]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L22)  
```
HttpCode = distinct range[0 .. 599]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L26) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L26)  
```
HttpVersion = enum
  HttpVer11, HttpVer10
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L28)  
```
HttpMethod = enum
  HttpHead, ## Asks for the response identical to the one that would
             ## correspond to a GET request, but without the response
             ## body.
  HttpGet,                  ## Retrieves the specified resource.
  HttpPost,                 ## Submits data to be processed to the identified
                             ## resource. The data is included in the body of the
                             ## request.
  HttpPut,                  ## Uploads a representation of the specified resource.
  HttpDelete,               ## Deletes the specified resource.
  HttpTrace,                ## Echoes back the received request, so that a client
                             ## can see what intermediate servers are adding or
                             ## changing in the request.
  HttpOptions,              ## Returns the HTTP methods that the server supports
                             ## for specified address.
  HttpConnect,              ## Converts the request connection to a transparent
                             ## TCP/IP tunnel, usually used for proxies.
  HttpPatch                  ## Applies partial modifications to a resource.
```
  the requested HttpMethod [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L32)   Consts
------

  
```
Http100 = 100
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L53) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L53)  
```
Http101 = 101
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L54) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L54)  
```
Http200 = 200
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L55) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L55)  
```
Http201 = 201
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L56) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L56)  
```
Http202 = 202
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L57) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L57)  
```
Http203 = 203
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L58) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L58)  
```
Http204 = 204
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L59)  
```
Http205 = 205
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L60) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L60)  
```
Http206 = 206
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L61) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L61)  
```
Http300 = 300
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L62) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L62)  
```
Http301 = 301
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L63)  
```
Http302 = 302
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L64) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L64)  
```
Http303 = 303
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L65)  
```
Http304 = 304
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L66) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L66)  
```
Http305 = 305
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L67)  
```
Http307 = 307
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L68) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L68)  
```
Http308 = 308
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L69) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L69)  
```
Http400 = 400
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L70) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L70)  
```
Http401 = 401
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L71) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L71)  
```
Http403 = 403
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L72)  
```
Http404 = 404
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L73) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L73)  
```
Http405 = 405
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L74)  
```
Http406 = 406
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L75) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L75)  
```
Http407 = 407
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L76)  
```
Http408 = 408
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L77)  
```
Http409 = 409
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L78) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L78)  
```
Http410 = 410
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L79)  
```
Http411 = 411
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L80) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L80)  
```
Http412 = 412
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L81) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L81)  
```
Http413 = 413
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L82)  
```
Http414 = 414
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L83) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L83)  
```
Http415 = 415
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L84) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L84)  
```
Http416 = 416
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L85) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L85)  
```
Http417 = 417
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L86) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L86)  
```
Http418 = 418
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L87) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L87)  
```
Http421 = 421
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L88) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L88)  
```
Http422 = 422
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L89) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L89)  
```
Http426 = 426
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L90) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L90)  
```
Http428 = 428
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L91) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L91)  
```
Http429 = 429
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L92) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L92)  
```
Http431 = 431
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L93) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L93)  
```
Http451 = 451
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L94)  
```
Http500 = 500
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L95) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L95)  
```
Http501 = 501
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L96) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L96)  
```
Http502 = 502
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L97)  
```
Http503 = 503
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L98) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L98)  
```
Http504 = 504
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L99)  
```
Http505 = 505
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L100)  
```
httpNewLine = "\c\n"
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L102)  
```
headerLimit = 10000
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L103) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L103)   Procs
-----

  
```
proc clear(headers: HttpHeaders) {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L142) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L142)  
```
proc `[]=`(headers: HttpHeaders; key, value: string) {...}{.raises: [], tags: [].}
```
  Sets the header entries associated with `key` to the specified value. Replaces any existing values. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L166) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L166)  
```
proc `[]=`(headers: HttpHeaders; key: string; value: seq[string]) {...}{.raises: [],
    tags: [].}
```
  Sets the header entries associated with `key` to the specified list of values. Replaces any existing values. If `value` is empty, deletes the header entries associated with `key`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L171) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L171)  
```
proc add(headers: HttpHeaders; key, value: string) {...}{.raises: [KeyError],
    tags: [].}
```
  Adds the specified value to the specified key. Appends to any existing values associated with the key. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L180) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L180)  
```
proc del(headers: HttpHeaders; key: string) {...}{.raises: [], tags: [].}
```
  Deletes the header entries associated with `key` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L188)  
```
proc `==`(rawCode: string; code: HttpCode): bool {...}{.
    deprecated: "Deprecated since v1.2; use rawCode == $code instead",
    raises: [], tags: [].}
```
   **Deprecated:** Deprecated since v1.2; use rawCode == $code instead  Compare the string form of the status code with a HttpCode

**Note**: According to HTTP/1.1 specification, the reason phrase is optional and should be ignored by the client, making this proc only suitable for comparing the `HttpCode` against the string form of itself.  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L320) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L320)   Funcs
-----

  
```
func newHttpHeaders(titleCase = false): HttpHeaders {...}{.raises: [], tags: [].}
```
  Returns a new `HttpHeaders` object. if `titleCase` is set to true, headers are passed to the server in title case (e.g. "Content-Length") [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L115) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L115)  
```
func newHttpHeaders(keyValuePairs: openArray[tuple[key: string, val: string]];
                    titleCase = false): HttpHeaders {...}{.raises: [KeyError],
    tags: [].}
```
  Returns a new `HttpHeaders` object from an array. if `titleCase` is set to true, headers are passed to the server in title case (e.g. "Content-Length") [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L122)  
```
func `$`(headers: HttpHeaders): string {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L139)  
```
func `[]`(headers: HttpHeaders; key: string): HttpHeaderValues {...}{.
    raises: [KeyError], tags: [].}
```
  Returns the values associated with the given `key`. If the returned values are passed to a procedure expecting a `string`, the first value is automatically picked. If there are no values associated with the key, an exception is raised.

 To access multiple values of a key, use the overloaded `[]` below or to get all of them access the `table` field directly.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L145)  
```
func `[]`(headers: HttpHeaders; key: string; i: int): string {...}{.
    raises: [KeyError], tags: [].}
```
  Returns the `i`'th value associated with the given key. If there are no values associated with the key or the `i`'th value doesn't exist, an exception is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L159)  
```
func contains(values: HttpHeaderValues; value: string): bool {...}{.raises: [],
    tags: [].}
```
  Determines if `value` is one of the values inside `values`. Comparison is performed without case sensitivity. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L198) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L198)  
```
func hasKey(headers: HttpHeaders; key: string): bool {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L204) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L204)  
```
func getOrDefault(headers: HttpHeaders; key: string;
                  default = @[""].HttpHeaderValues): HttpHeaderValues {...}{.
    raises: [KeyError], tags: [].}
```
  Returns the values associated with the given `key`. If there are no values associated with the key, then `default` is returned. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L207)  
```
func len(headers: HttpHeaders): int {...}{.inline, raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L216) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L216)  
```
func parseHeader(line: string): tuple[key: string, value: seq[string]] {...}{.
    raises: [], tags: [].}
```
  Parses a single raw header HTTP line into key value pairs.

 Used by `asynchttpserver` and `httpclient` internally and should not be used by you.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L229) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L229)  
```
func `==`(protocol: tuple[orig: string, major, minor: int]; ver: HttpVersion): bool {...}{.
    raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L249) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L249)  
```
func contains(methods: set[HttpMethod]; x: string): bool {...}{.raises: [ValueError],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L260) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L260)  
```
func `$`(code: HttpCode): string {...}{.raises: [], tags: [].}
```
  Converts the specified `HttpCode` into a HTTP status. **Example:**

 
```
doAssert($Http404 == "404 Not Found")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L263)  
```
func `==`(a, b: HttpCode): bool {...}{.borrow.}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L318)  
```
func is2xx(code: HttpCode): bool {...}{.inline, raises: [], tags: [].}
```
  Determines whether `code` is a 2xx HTTP status code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L330) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L330)  
```
func is3xx(code: HttpCode): bool {...}{.inline, raises: [], tags: [].}
```
  Determines whether `code` is a 3xx HTTP status code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L334)  
```
func is4xx(code: HttpCode): bool {...}{.inline, raises: [], tags: [].}
```
  Determines whether `code` is a 4xx HTTP status code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L338) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L338)  
```
func is5xx(code: HttpCode): bool {...}{.inline, raises: [], tags: [].}
```
  Determines whether `code` is a 5xx HTTP status code. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L342) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L342)  
```
func `$`(httpMethod: HttpMethod): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L346) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L346)   Iterators
---------

  
```
iterator pairs(headers: HttpHeaders): tuple[key, value: string] {...}{.raises: [],
    tags: [].}
```
  Yields each key, value pair. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L192) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L192)   Converters
----------

  
```
converter toString(values: HttpHeaderValues): string {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/httpcore.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/httpcore.nim#L156)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/httpcore.html>

ssl\_certs
==========

 Scan for SSL/TLS CA certificates on disk The default locations can be overridden using the SSL\_CERT\_FILE and SSL\_CERT\_DIR environment variables.

 Imports
-------

  <os>, <strutils>  Iterators
---------

  
```
iterator scanSSLCertificates(useEnvVars = false): string {...}{.raises: [],
    tags: [ReadEnvEffect, ReadDirEffect].}
```
  Scan for SSL/TLS CA certificates on disk.

 if `useEnvVars` is true, the SSL\_CERT\_FILE and SSL\_CERT\_DIR environment variables can be used to override the certificate directories to scan or specify a CA certificate file.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ssl_certs.nim#L94) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ssl_certs.nim#L94)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/ssl_certs.html>

ssl\_config
===========


This module contains SSL configuration parameters obtained from [Mozilla OpSec](https://wiki.mozilla.org/Security/Server_Side_TLS).

 The configuration file used to generate this module: <https://ssl-config.mozilla.org/guidelines/5.4.json>

 Consts
------

  
```
CiphersModern = "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256"
```
  An OpenSSL-compatible list of secure ciphers for `modern` compatibility per Mozilla's recommendations.

 Oldest clients supported by this list:

 * Firefox 63
* Android 10.0
* Chrome 70
* Edge 75
* Java 11
* OpenSSL 1.1.1
* Opera 57
* Safari 12.1

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ssl_config.nim#L8) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ssl_config.nim#L8)  
```
CiphersIntermediate = "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384"
```
  An OpenSSL-compatible list of secure ciphers for `intermediate` compatibility per Mozilla's recommendations.

 Oldest clients supported by this list:

 * Firefox 27
* Android 4.4.2
* Chrome 31
* Edge
* IE 11 on Windows 7
* Java 8u31
* OpenSSL 1.0.1
* Opera 20
* Safari 9

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ssl_config.nim#L22) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ssl_config.nim#L22)  
```
CiphersOld = "TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES256-SHA256:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA"
```
  An OpenSSL-compatible list of secure ciphers for `old` compatibility per Mozilla's recommendations.

 Oldest clients supported by this list:

 * Firefox 1
* Android 2.3
* Chrome 1
* Edge 12
* IE8 on Windows XP
* Java 6
* OpenSSL 0.9.8
* Opera 5
* Safari 1

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/ssl_config.nim#L37) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/ssl_config.nim#L37)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/ssl_config.html>

cpuload
=======


This module implements a helper for a thread pool to determine whether creating a thread is a good idea.

 Unstable API.

 Imports
-------

  <cpuinfo>  Types
-----

  
```
ThreadPoolAdvice = enum
  doNothing, doCreateThread, doShutdownThread
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/cpuload.nim#L23) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/cpuload.nim#L23)  
```
ThreadPoolState = object
  when defined(windows):
      prevSysKernel, prevSysUser, prevProcKernel, prevProcUser: FILETIME

  calls*: int
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/cpuload.nim#L28) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/cpuload.nim#L28)   Procs
-----

  
```
proc advice(s: var ThreadPoolState): ThreadPoolAdvice {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/concurrency/cpuload.nim#L33) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/concurrency/cpuload.nim#L33)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/cpuload.html>

parsejson
=========

 This module implements a json parser. It is used and exported by the `json` standard library module, but can also be used in its own right.

 Imports
-------

  <strutils>, <lexbase>, <streams>, <unicode>  Types
-----

  
```
JsonEventKind = enum
  jsonError,                ## an error occurred during parsing
  jsonEof,                  ## end of file reached
  jsonString,               ## a string literal
  jsonInt,                  ## an integer literal
  jsonFloat,                ## a float literal
  jsonTrue,                 ## the value ``true``
  jsonFalse,                ## the value ``false``
  jsonNull,                 ## the value ``null``
  jsonObjectStart,          ## start of an object: the ``{`` token
  jsonObjectEnd,            ## end of an object: the ``}`` token
  jsonArrayStart,           ## start of an array: the ``[`` token
  jsonArrayEnd               ## end of an array: the ``]`` token
```
  enumeration of all events that may occur when parsing [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L18) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L18)  
```
TokKind = enum
  tkError, tkEof, tkString, tkInt, tkFloat, tkTrue, tkFalse, tkNull, tkCurlyLe,
  tkCurlyRi, tkBracketLe, tkBracketRi, tkColon, tkComma
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L32)  
```
JsonError = enum
  errNone,                  ## no error
  errInvalidToken,          ## invalid token
  errStringExpected,        ## string expected
  errColonExpected,         ## ``:`` expected
  errCommaExpected,         ## ``,`` expected
  errBracketRiExpected,     ## ``]`` expected
  errCurlyRiExpected,       ## ``}`` expected
  errQuoteExpected,         ## ``"`` or ``'`` expected
  errEOC_Expected,          ## ``*/`` expected
  errEofExpected,           ## EOF expected
  errExprExpected            ## expr expected
```
  enumeration that lists all errors that can occur [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L48) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L48)  
```
JsonParser = object of BaseLexer
  a*: string
  tok*: TokKind
  kind: JsonEventKind
  err: JsonError
  state: seq[ParserState]
  filename: string
  rawStringLiterals: bool
```
  the parser object. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L65) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L65)  
```
JsonKindError = object of ValueError
```
  raised by the `to` macro if the JSON kind is incorrect. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L74) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L74)  
```
JsonParsingError = object of ValueError
```
  is raised for a JSON error [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L76) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L76)   Consts
------

  
```
errorMessages: array[JsonError, string] = ["no error", "invalid token",
    "string expected", "\':\' expected", "\',\' expected", "\']\' expected",
    "\'}\' expected", "\'\"\' or \"\'\" expected", "\'*/\' expected",
    "EOF expected", "expression expected"]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L79) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L79)   Procs
-----

  
```
proc open(my: var JsonParser; input: Stream; filename: string;
          rawStringLiterals = false) {...}{.raises: [IOError, OSError],
                                       tags: [ReadIOEffect].}
```
  initializes the parser with an input stream. `Filename` is only used for nice error messages. If `rawStringLiterals` is true, string literals are kept with their surrounding quotes and escape sequences in them are left untouched too. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L104) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L104)  
```
proc close(my: var JsonParser) {...}{.inline, raises: [Exception, IOError, OSError],
                                 tags: [WriteIOEffect].}
```
  closes the parser `my` and its associated input stream. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L117) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L117)  
```
proc str(my: JsonParser): string {...}{.inline, raises: [], tags: [].}
```
  returns the character data for the events: `jsonInt`, `jsonFloat`, `jsonString` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L121) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L121)  
```
proc getInt(my: JsonParser): BiggestInt {...}{.inline, raises: [ValueError], tags: [].}
```
  returns the number for the event: `jsonInt` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L127) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L127)  
```
proc getFloat(my: JsonParser): float {...}{.inline, raises: [ValueError], tags: [].}
```
  returns the number for the event: `jsonFloat` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L132) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L132)  
```
proc kind(my: JsonParser): JsonEventKind {...}{.inline, raises: [], tags: [].}
```
  returns the current event type for the JSON parser [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L137) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L137)  
```
proc getColumn(my: JsonParser): int {...}{.inline, raises: [], tags: [].}
```
  get the current column the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L141) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L141)  
```
proc getLine(my: JsonParser): int {...}{.inline, raises: [], tags: [].}
```
  get the current line the parser has arrived at. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L145) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L145)  
```
proc getFilename(my: JsonParser): string {...}{.inline, raises: [], tags: [].}
```
  get the filename of the file that the parser processes. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L149) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L149)  
```
proc errorMsg(my: JsonParser): string {...}{.raises: [ValueError], tags: [].}
```
  returns a helpful error message for the event `jsonError` [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L153) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L153)  
```
proc errorMsgExpected(my: JsonParser; e: string): string {...}{.raises: [ValueError],
    tags: [].}
```
  returns an error message "`e` expected" in the same format as the other error messages [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L159) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L159)  
```
proc parseEscapedUTF16(buf: cstring; pos: var int): int {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L173) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L173)  
```
proc getTok(my: var JsonParser): TokKind {...}{.raises: [IOError, OSError],
    tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L358)  
```
proc next(my: var JsonParser) {...}{.raises: [IOError, OSError], tags: [ReadIOEffect].}
```
  retrieves the first/next event. This controls the parser. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L403) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L403)  
```
proc raiseParseErr(p: JsonParser; msg: string) {...}{.noinline, noreturn,
    raises: [JsonParsingError, ValueError], tags: [].}
```
  raises an `EJsonParsingError` exception. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L520) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L520)  
```
proc eat(p: var JsonParser; tok: TokKind) {...}{.
    raises: [IOError, OSError, JsonParsingError, ValueError],
    tags: [ReadIOEffect].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/parsejson.nim#L524) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/parsejson.nim#L524)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/parsejson.html>

underscored\_calls
==================

 This is an internal helper module. Do not use.

 Imports
-------

  <macros>  Procs
-----

  
```
proc underscoredCalls(result, calls, arg0: NimNode) {...}{.raises: [], tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/std/private/underscored_calls.nim#L41) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/std/private/underscored_calls.nim#L41)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/underscored_calls.html>

rtarrays
========


Module that implements a fixed length array whose size is determined at runtime. Note: This is not ready for other people to use!

 Unstable API.

 Types
-----

  
```
RtArray[T] = object
  L: Natural
  spart: seq[T]
  apart: array[ArrayPartSize, T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/rtarrays.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/rtarrays.nim#L20)   Procs
-----

  
```
proc initRtArray[T](len: Natural): RtArray[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/rtarrays.nim#L27) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/rtarrays.nim#L27)  
```
proc getRawData[T](x: var RtArray[T]): ptr UncheckedArray[T]
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/rtarrays.nim#L32) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/rtarrays.nim#L32)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/rtarrays.html>

db\_odbc
========


A higher level `ODBC` database wrapper.

 This is the same interface that is implemented for other databases.

 This has NOT yet been (extensively) tested against ODBC drivers for Teradata, Oracle, Sybase, MSSqlvSvr, et. al. databases.

 Currently all queries are ANSI calls, not Unicode.

 See also: <db_postgres>, <db_sqlite>, <db_mysql>.

 Parameter substitution
----------------------


All `db_*` modules support the same form of parameter substitution. That is, using the `?` (question mark) to signify the place where a value should be placed. For example:

 
```
sql"INSERT INTO myTable (colA, colB, colC) VALUES (?, ?, ?)"
```
 Examples
--------

 ### Opening a connection to a database



```
import db_odbc
var db = open("localhost", "user", "password", "dbname")
db.close()
```
 ### Creating a table



```
db.exec(sql"DROP TABLE IF EXISTS myTable")
db.exec(sql("""CREATE TABLE myTable (
                 id integer,
                 name varchar(50) not null)"""))
```
 ### Inserting data



```
db.exec(sql"INSERT INTO myTable (id, name) VALUES (0, ?)",
        "Andreas")
```
 ### Large example



```
import db_odbc, math

var theDb = open("localhost", "nim", "nim", "test")

theDb.exec(sql"Drop table if exists myTestTbl")
theDb.exec(sql("create table myTestTbl (" &
    " Id    INT(11)     NOT NULL AUTO_INCREMENT PRIMARY KEY, " &
    " Name  VARCHAR(50) NOT NULL, " &
    " i     INT(11), " &
    " f     DECIMAL(18,10))"))

theDb.exec(sql"START TRANSACTION")
for i in 1..1000:
  theDb.exec(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
        "Item#" & $i, i, sqrt(i.float))
theDb.exec(sql"COMMIT")

for x in theDb.fastRows(sql"select * from myTestTbl"):
  echo x

let id = theDb.tryInsertId(sql"INSERT INTO myTestTbl (name,i,f) VALUES (?,?,?)",
        "Item#1001", 1001, sqrt(1001.0))
echo "Inserted item: ", theDb.getValue(sql"SELECT name FROM myTestTbl WHERE id=?", id)

theDb.close()
```
 Imports
-------

  <strutils>, <odbcsql>, <db_common>, <since>  Types
-----

  
```
DbConn = OdbcConnTyp
```
  encapsulates a database connection [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L99) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L99)  
```
Row = seq[string]
```
  a row of a dataset. NULL database values will be converted to nil. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L100) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L100)  
```
InstantRow = tuple[row: seq[string], len: int]
```
  a handle that can be used to get a row's column text on demand [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L102)   Procs
-----

  
```
proc dbError(db: var DbConn) {...}{.tags: [ReadDbEffect, WriteDbEffect],
                               raises: [DbError].}
```
  Raises an `[DbError]` exception with ODBC error information [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L138) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L138)  
```
proc dbQuote(s: string): string {...}{.noSideEffect, raises: [], tags: [].}
```
  DB quotes the string. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L188) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L188)  
```
proc tryExec(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  Tries to execute the query and returns true if successful, false otherwise. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L239) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L239)  
```
proc exec(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]) {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query and raises EDB if not successful. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L258) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L258)  
```
proc `[]`(row: InstantRow; col: int): string {...}{.inline, raises: [], tags: [].}
```
  Returns text for given column of the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L331) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L331)  
```
proc unsafeColumnAt(row: InstantRow; index: int): cstring {...}{.inline, raises: [],
    tags: [].}
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L335) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L335)  
```
proc len(row: InstantRow): int {...}{.inline, raises: [], tags: [].}
```
  Returns number of columns in the row [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L339) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L339)  
```
proc getRow(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Retrieves a single row. If the query doesn't return any rows, this proc will return a Row with empty strings for each column. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L343) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L343)  
```
proc getAllRows(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): seq[
    Row] {...}{.tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query and returns the whole result dataset. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L370) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L370)  
```
proc getValue(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): string {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  Executes the query and returns the first column of the first row of the result dataset. Returns "" if the dataset contains no rows or the database value is NULL. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L409) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L409)  
```
proc tryInsertId(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  Executes the query (typically "INSERT") and returns the generated ID for the row or -1 in case of an error. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L420)  
```
proc insertId(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query (typically "INSERT") and returns the generated ID for the row. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L444) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L444)  
```
proc tryInsert(db: var DbConn; query: SqlQuery; pkName: string;
               args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [].}
```
  same as tryInsertID [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L452) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L452)  
```
proc insert(db: var DbConn; query: SqlQuery; pkName: string;
            args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  same as insertId [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L458) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L458)  
```
proc execAffectedRows(db: var DbConn; query: SqlQuery;
                      args: varargs[string, `$`]): int64 {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Runs the query (typically "UPDATE") and returns the number of affected rows [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L465) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L465)  
```
proc close(db: var DbConn) {...}{.tags: [WriteDbEffect], raises: [].}
```
  Closes the database connection. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L480) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L480)  
```
proc open(connection, user, password, database: string): DbConn {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Opens a database connection.

 Raises `EDb` if the connection could not be established.

 Currently the database parameter is ignored, but included to match `open()` in the other db\_xxxxx library modules.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L494) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L494)  
```
proc setEncoding(connection: DbConn; encoding: string): bool {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Currently not implemented for ODBC.

 Sets the encoding of a database connection, returns true for success, false for failure. result = set\_character\_set(connection, encoding) == 0

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L525) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L525)   Iterators
---------

  
```
iterator fastRows(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Executes the query and iterates over the result dataset.

 This is very fast, but potentially dangerous. Use this iterator only if you require **ALL** the rows.

 Breaking the fastRows() iterator during a loop may cause a driver error for subsequent queries

 Rows are retrieved from the server at each iteration.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L268) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L268)  
```
iterator instantRows(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): InstantRow {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Same as fastRows but returns a handle that can be used to get column text on demand using []. Returned handle is valid only within the iterator body. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L303) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L303)  
```
iterator rows(db: var DbConn; query: SqlQuery; args: varargs[string, `$`]): Row {...}{.
    tags: [ReadDbEffect, WriteDbEffect], raises: [DbError].}
```
  Same as `fastRows`, but slower and safe.

 This retrieves ALL rows into memory before iterating through the rows. Large dataset queries will impact on memory usage.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/impure/db_odbc.nim#L399) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/impure/db_odbc.nim#L399)   Exports
-------

  [DbTypeKind](db_common#DbTypeKind), [sql](db_common#sql.t,string), [DbType](db_common#DbType), [SqlQuery](db_common#SqlQuery), [DbColumn](db_common#DbColumn), [ReadDbEffect](db_common#ReadDbEffect), [DbError](db_common#DbError), [WriteDbEffect](db_common#WriteDbEffect), [dbError](db_common#dbError,string), [DbColumns](db_common#DbColumns), [DbEffect](db_common#DbEffect) 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/db_odbc.html>

Nim IDE Integration Guide
=========================


Nim differs from many other compilers in that it is really fast, and being so fast makes it suited to provide external queries for text editors about the source code being written. Through the `nimsuggest` tool, any IDE can query a `.nim` source file and obtain useful information like definition of symbols or suggestions for completion.

 This document will guide you through the available options. If you want to look at practical examples of nimsuggest support you can look at the [various editor integrations](https://github.com/Araq/Nim/wiki/Editor-Support) already available.

 Installation
------------


Nimsuggest is part of Nim's core. Build it via:



```
koch nimsuggest
```
 Nimsuggest invocation
---------------------


Run it via `nimsuggest --stdin --debug myproject.nim`. Nimsuggest is a server that takes queries that are related to `myproject`. There is some support so that you can throw random `.nim` files which are not part of `myproject` at Nimsuggest too, but usually the query refer to modules/files that are part of `myproject`.

 `--stdin` means that Nimsuggest reads the query from `stdin`. This is great for testing things out and playing with it but for an editor communication via sockets is more reasonable so that is the default. It listens to port 6000 by default.

 ### Specifying the location of the query


Nimsuggest then waits for queries to process. A query consists of a cryptic 3 letter "command" `def` or `con` or `sug` or `use` followed by a location. A query location consists of:

 
`file.nim` This is the name of the module or include file the query refers to. `dirtyfile.nim` 
This is optional.

 The `file` parameter is enough for static analysis, but IDEs tend to have *unsaved buffers* where the user may still be in the middle of typing a line. In such situations the IDE can save the current contents to a temporary file and then use the `dirtyfile.nim` option to tell Nimsuggest that `foobar.nim` should be taken from `temporary/foobar.nim`.

   
`line` An integer with the line you are going to query. For the compiler lines start at **1**. `col` An integer with the column you are going to query. For the compiler columns start at **0**.  ### Definitions


The `def` Nimsuggest command performs a query about the definition of a specific symbol. If available, Nimsuggest will answer with the type, source file, line/column information and other accessory data if available like a docstring. With this information an IDE can provide the typical *Jump to definition* where a user puts the cursor on a symbol or uses the mouse to select it and is redirected to the place where the symbol is located.

 Since Nim is implemented in Nim, one of the nice things of this feature is that any user with an IDE supporting it can quickly jump around the standard library implementation and see exactly what a proc does, learning about the language and seeing real life examples of how to write/implement specific features.

 Nimsuggest will always answer with a single definition or none if it can't find any valid symbol matching the position of the query.

 ### Suggestions


The `sug` Nimsuggest command performs a query about possible completion symbols at some point in the file.

 The typical usage scenario for this option is to call it after the user has typed the dot character for [the object oriented call syntax](https://nim-lang.org/docs/tut2.html#object-oriented-programming-method-call-syntax). Nimsuggest will try to return the suggestions sorted first by scope (from innermost to outermost) and then by item name.

 ### Invocation context


The `con` Nimsuggest command is very similar to the suggestions command, but instead of being used after the user has typed a dot character, this one is meant to be used after the user has typed an opening brace to start typing parameters.

 ### Symbol usages


The `use` Nimsuggest command lists all usages of the symbol at a position. IDEs can use this to find all the places in the file where the symbol is used and offer the user to rename it in all places at the same time.

 For this kind of query the IDE will most likely ignore all the type/signature info provided by Nimsuggest and concentrate on the filename, line and column position of the multiple returned answers.

 Parsing nimsuggest output
-------------------------


Nimsuggest output is always returned on single lines separated by tab characters (`\t`). The values of each column are:

 1. Three characters indicating the type of returned answer (e.g. `def` for definition, `sug` for suggestion, etc).
2. Type of the symbol. This can be `skProc`, `skLet`, and just about any of the enums defined in the module `compiler/ast.nim`.
3. Fully qualified path of the symbol. If you are querying a symbol defined in the `proj.nim` file, this would have the form `proj.symbolName`.
4. Type/signature. For variables and enums this will contain the type of the symbol, for procs, methods and templates this will contain the full unique signature (e.g. `proc (File)`).
5. Full path to the file containing the symbol.
6. Line where the symbol is located in the file. Lines start to count at **1**.
7. Column where the symbol is located in the file. Columns start to count at **0**.
8. Docstring for the symbol if available or the empty string. To differentiate the docstring from end of answer, the docstring is always provided enclosed in double quotes, and if the docstring spans multiple lines, all following lines of the docstring will start with a blank space to align visually with the starting quote.

 Also, you won't find raw `\n` characters breaking the one answer per line format. Instead you will need to parse sequences in the form `\xHH`, where *HH* is a hexadecimal value (e.g. newlines generate the sequence `\x0A`).



 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nimsuggest.html>

nimscript
=========

 To learn about scripting in Nim see [NimScript](nims)

 Types
-----

  
```
ScriptMode {...}{.pure.} = enum
  Silent,                   ## Be silent.
  Verbose,                  ## Be verbose.
  Whatif                     ## Do not run commands, instead just echo what
                             ## would have been done.
```
  Controls the behaviour of the script. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L174) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L174)   Vars
----

  
```
mode: ScriptMode
```
  Set this to influence how mkDir, rmDir, rmFile etc. behave [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L181) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L181)  
```
packageName = ""
```
  Nimble support: Set this to the package name. It is usually not required to do that, nims' filename is the default. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L420) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L420)  
```
version: string
```
  Nimble support: The package's version. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L423) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L423)  
```
author: string
```
  Nimble support: The package's author. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L424) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L424)  
```
description: string
```
  Nimble support: The package's description. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L425) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L425)  
```
license: string
```
  Nimble support: The package's license. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L426) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L426)  
```
srcDir: string
```
  Nimble support: The package's source directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L427) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L427)  
```
binDir: string
```
  Nimble support: The package's binary directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L428) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L428)  
```
backend: string
```
  Nimble support: The package's backend. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L429) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L429)  
```
skipDirs: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
skipFiles: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
skipExt: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
installDirs: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
installFiles: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
installExt: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
bin: seq[string] = @[]
```
  Nimble metadata. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L431) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L431)  
```
requiresData: seq[string] = @[]
```
  Exposes the list of requirements for read and write accesses. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L433) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L433)   Consts
------

  
```
buildOS: string = ""
```
  The OS this build is running on. Can be different from `system.hostOS` for cross compilations. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L16) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L16)  
```
buildCPU: string = ""
```
  The CPU this build is running on. Can be different from `system.hostCPU` for cross compilations. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L20) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L20)   Procs
-----

  
```
proc getCurrentDir(): string {...}{.raises: [], tags: [].}
```
  Retrieves the current working directory. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L50) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L50)  
```
proc paramStr(i: int): string {...}{.raises: [], tags: [].}
```
  Retrieves the `i`'th command line parameter. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L59) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L59)  
```
proc paramCount(): int {...}{.raises: [], tags: [].}
```
  Retrieves the number of command line parameters. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L63) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L63)  
```
proc switch(key: string; val = "") {...}{.raises: [], tags: [].}
```
  Sets a Nim compiler command line switch, for example `switch("checks", "on")`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L67) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L67)  
```
proc warning(name: string; val: bool) {...}{.raises: [], tags: [].}
```
  Disables or enables a specific warning. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L72) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L72)  
```
proc hint(name: string; val: bool) {...}{.raises: [], tags: [].}
```
  Disables or enables a specific hint. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L77) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L77)  
```
proc patchFile(package, filename, replacement: string) {...}{.raises: [], tags: [].}
```
  Overrides the location of a given file belonging to the passed package. If the `replacement` is not an absolute path, the path is interpreted to be local to the Nimscript file that contains the call to `patchFile`, Nim's `--path` is not used at all to resolve the filename!

 Example:

 
```
patchFile("stdlib", "asyncdispatch", "patches/replacement")
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L82) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L82)  
```
proc getCommand(): string {...}{.raises: [], tags: [].}
```
  Gets the Nim command that the compiler has been invoked with, for example "c", "js", "build", "help". [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L97) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L97)  
```
proc setCommand(cmd: string; project = "") {...}{.raises: [], tags: [].}
```
  Sets the Nim command that should be continued with after this Nimscript has finished. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L102) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L102)  
```
proc cmpic(a, b: string): int {...}{.raises: [], tags: [].}
```
  Compares `a` and `b` ignoring case. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L110) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L110)  
```
proc getEnv(key: string; default = ""): string {...}{.tags: [ReadIOEffect],
    raises: [].}
```
  Retrieves the environment variable of name `key`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L114) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L114)  
```
proc existsEnv(key: string): bool {...}{.tags: [ReadIOEffect], raises: [].}
```
  Checks for the existence of an environment variable named `key`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L118) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L118)  
```
proc putEnv(key, val: string) {...}{.tags: [WriteIOEffect], raises: [].}
```
  Sets the value of the environment variable named `key` to `val`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L122) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L122)  
```
proc delEnv(key: string) {...}{.tags: [WriteIOEffect], raises: [].}
```
  Deletes the environment variable named `key`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L126) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L126)  
```
proc fileExists(filename: string): bool {...}{.tags: [ReadIOEffect], raises: [].}
```
  Checks if the file exists. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L130) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L130)  
```
proc dirExists(dir: string): bool {...}{.tags: [ReadIOEffect], raises: [].}
```
  Checks if the directory `dir` exists. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L134) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L134)  
```
proc selfExe(): string {...}{.raises: [], tags: [].}
```
  Returns the currently running nim or nimble executable. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L147) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L147)  
```
proc toExe(filename: string): string {...}{.raises: [], tags: [].}
```
  On Windows adds ".exe" to `filename`, else returns `filename` unmodified. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L152) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L152)  
```
proc toDll(filename: string): string {...}{.raises: [], tags: [].}
```
  On Windows adds ".dll" to `filename`, on Posix produces "lib$filename.so". [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L156) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L156)  
```
proc listDirs(dir: string): seq[string] {...}{.raises: [OSError],
    tags: [ReadIOEffect].}
```
  Lists all the subdirectories (non-recursively) in the directory `dir`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L197) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L197)  
```
proc listFiles(dir: string): seq[string] {...}{.raises: [OSError],
    tags: [ReadIOEffect].}
```
  Lists all the files (non-recursively) in the directory `dir`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L202) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L202)  
```
proc rmDir(dir: string; checkDir = false) {...}{.raises: [OSError],
    tags: [ReadIOEffect, WriteIOEffect].}
```
  Removes the directory `dir`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L207) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L207)  
```
proc rmFile(file: string) {...}{.raises: [OSError],
                            tags: [ReadIOEffect, WriteIOEffect].}
```
  Removes the `file`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L213) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L213)  
```
proc mkDir(dir: string) {...}{.raises: [OSError], tags: [WriteIOEffect].}
```
  Creates the directory `dir` including all necessary subdirectories. If the directory already exists, no error is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L219) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L219)  
```
proc mvFile(from, to: string) {...}{.raises: [OSError],
                                tags: [ReadIOEffect, WriteIOEffect].}
```
  Moves the file `from` to `to`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L226) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L226)  
```
proc mvDir(from, to: string) {...}{.raises: [OSError],
                               tags: [ReadIOEffect, WriteIOEffect].}
```
  Moves the dir `from` to `to`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L232) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L232)  
```
proc cpFile(from, to: string) {...}{.raises: [OSError],
                                tags: [ReadIOEffect, WriteIOEffect].}
```
  Copies the file `from` to `to`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L238) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L238)  
```
proc cpDir(from, to: string) {...}{.raises: [OSError],
                               tags: [ReadIOEffect, WriteIOEffect].}
```
  Copies the dir `from` to `to`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L244) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L244)  
```
proc exec(command: string) {...}{.raises: [OSError], tags: [ExecIOEffect].}
```
  Executes an external process. If the external process terminates with a non-zero exit code, an OSError exception is raised.

 **Note:** If you need a version of `exec` that returns the exit code and text output of the command, you can use [system.gorgeEx](system#gorgeEx,string,string,string).

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L250) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L250)  
```
proc exec(command: string; input: string; cache = "") {...}{.raises: [OSError],
    tags: [ExecIOEffect].}
```
  Executes an external process. If the external process terminates with a non-zero exit code, an OSError exception is raised. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L263) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L263)  
```
proc selfExec(command: string) {...}{.raises: [OSError], tags: [ExecIOEffect].}
```
  Executes an external command with the current nim/nimble executable. `Command` must not contain the "nim " part. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L273) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L273)  
```
proc put(key, value: string) {...}{.raises: [], tags: [].}
```
  Sets a configuration 'key' like 'gcc.options.always' to its value. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L283) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L283)  
```
proc get(key: string): string {...}{.raises: [], tags: [].}
```
  Retrieves a configuration 'key' like 'gcc.options.always'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L287) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L287)  
```
proc exists(key: string): bool {...}{.raises: [], tags: [].}
```
  Checks for the existence of a configuration 'key' like 'gcc.options.always'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L291) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L291)  
```
proc nimcacheDir(): string {...}{.raises: [], tags: [].}
```
  Retrieves the location of 'nimcache'. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L296) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L296)  
```
proc projectName(): string {...}{.raises: [], tags: [].}
```
  Retrieves the name of the current project [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L300) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L300)  
```
proc projectDir(): string {...}{.raises: [], tags: [].}
```
  Retrieves the absolute directory of the current project [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L304) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L304)  
```
proc projectPath(): string {...}{.raises: [], tags: [].}
```
  Retrieves the absolute path of the current project [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L308) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L308)  
```
proc thisDir(): string {...}{.raises: [], tags: [].}
```
  Retrieves the directory of the current `nims` script file. Its path is obtained via `currentSourcePath` (although, currently, `currentSourcePath` resolves symlinks, unlike `thisDir`). [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L312) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L312)  
```
proc cd(dir: string) {...}{.raises: [OSError], tags: [].}
```
  Changes the current directory.

 The change is permanent for the rest of the execution, since this is just a shortcut for [os.setCurrentDir()](os#setCurrentDir,string) . Use the [withDir()](#withDir.t,string,untyped) template if you want to perform a temporary change only.

 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L318) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L318)  
```
proc findExe(bin: string): string {...}{.raises: [], tags: [].}
```
  Searches for bin in the current working directory and then in directories listed in the PATH environment variable. Returns "" if the exe cannot be found. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L328) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L328)  
```
proc cppDefine(define: string) {...}{.raises: [], tags: [].}
```
  tell Nim that `define` is a C preprocessor `#define` and so always needs to be mangled. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L358) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L358)  
```
proc readLineFromStdin(): TaintedString {...}{.raises: [IOError],
    tags: [ReadIOEffect].}
```
  Reads a line of data from stdin - blocks until n or EOF which happens when stdin is closed [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L371) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L371)  
```
proc readAllFromStdin(): TaintedString {...}{.raises: [IOError], tags: [ReadIOEffect].}
```
  Reads all data from stdin - blocks until EOF which happens when stdin is closed [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L377) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L377)  
```
proc requires(deps: varargs[string]) {...}{.raises: [], tags: [].}
```
  Nimble support: Call this to set the list of requirements of your Nimble package. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L436) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L436)   Templates
---------

  
```
template existsFile(args: varargs[untyped]): untyped {...}{.
    deprecated: "use fileExists".}
```
   **Deprecated:** use fileExists  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L139) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L139)  
```
template existsDir(args: varargs[untyped]): untyped {...}{.
    deprecated: "use dirExists".}
```
   **Deprecated:** use dirExists  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L144) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L144)  
```
template `--`(key, val: untyped)
```
  A shortcut for `switch(astToStr(key), astToStr(val))`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L165) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L165)  
```
template `--`(key: untyped)
```
  A shortcut for `switch(astToStr(key)`. [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L169) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L169)  
```
template withDir(dir: string; body: untyped): untyped
```
  Changes the current directory temporarily.

 If you need a permanent change, use the [cd()](#cd,string) proc. Usage example:

 
```
withDir "foo":
  # inside foo
#back to last dir
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L334) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L334)  
```
template task(name: untyped; description: string; body: untyped): untyped
```
  Defines a task. Hidden tasks are supported via an empty description.

 Example:

 
```
task build, "default build is via the C backend":
  setCommand "c"
```

For a task named `foo`, this template generates a `proc` named `fooTask`. This is useful if you need to call one task in another in your Nimscript.

 Example:

 
```
task foo, "foo":        # > nim foo
  echo "Running foo"    # Running foo

task bar, "bar":        # > nim bar
  echo "Running bar"    # Running bar
  fooTask()             # Running foo
```
 [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/system/nimscript.nim#L385) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/system/nimscript.nim#L385)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/nimscript.html>

chains
======

 Template based implementation of singly and doubly linked lists. The involved types should have 'prev' or 'next' fields and the list header should have 'head' or 'tail' fields.

 Templates
---------

  
```
template prepend(header, node)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/chains.nim#L14) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/chains.nim#L14)  
```
template append(header, node)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/chains.nim#L25) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/chains.nim#L25)  
```
template unlink(header, node)
```
  [Source](https://github.com/nim-lang/Nim/tree/version-1-4/lib/pure/collections/chains.nim#L36) [Edit](https://github.com/nim-lang/Nim/edit/devel/lib/pure/collections/chains.nim#L36)  

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/chains.html>

nim
===

 Imports
-------

  <commands>, <options>, <msgs>, <extccomp>, <main>, <idents>, <lineinfos>, <cmdlinehelper>, <pathutils>, <modulegraphs>, <nodejs> 

 © 2006–2021 Andreas Rumpf  
Licensed under the MIT License.  

<https://nim-lang.org/docs/compiler/nim.html>

nim