system.nim: documentation improvements

This commit is contained in:
Andreas Rumpf 2019-03-23 10:55:26 +01:00
commit 7c08303faf
2 changed files with 22 additions and 20 deletions

View file

@ -1322,13 +1322,16 @@ when defined(nimAshr):
## Shifts right by pushing copies of the leftmost bit in from the left, ## Shifts right by pushing copies of the leftmost bit in from the left,
## and let the rightmost bits fall off. ## 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: ## See also:
## * `shr proc <#shr,int,SomeInteger>`_ ## * `shr proc <#shr,int,SomeInteger>`_
## ##
## .. code-block:: Nim ## .. code-block:: Nim
## 0b0001_0000'i8 shr 2 == 0b0000_0100'i8 ## ashr(0b0001_0000'i8, 2) == 0b0000_0100'i8
## 0b1000_0000'i8 shr 8 == 0b1111_1111'i8 ## ashr(0b1000_0000'i8, 8) == 0b1111_1111'i8
## 0b1000_0000'i8 shr 1 == 0b1100_0000'i8 ## ashr(0b1000_0000'i8, 1) == 0b1100_0000'i8
proc ashr*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.} proc ashr*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.}
proc ashr*(x: int16, y: SomeInteger): int16 {.magic: "AshrI", noSideEffect.} proc ashr*(x: int16, y: SomeInteger): int16 {.magic: "AshrI", noSideEffect.}
proc ashr*(x: int32, y: SomeInteger): int32 {.magic: "AshrI", noSideEffect.} proc ashr*(x: int32, y: SomeInteger): int32 {.magic: "AshrI", noSideEffect.}
@ -3726,7 +3729,7 @@ proc quit*(errormsg: string, errorcode = QuitFailure) {.noReturn.} =
{.pop.} # hints {.pop.} # hints
proc `/`*(x, y: int): float {.inline, noSideEffect.} = proc `/`*(x, y: int): float {.inline, noSideEffect.} =
## Division of intergers that results in a float. ## Division of integers that results in a float.
## ##
## See also: ## See also:
## * `div <#div,int,int>`_ ## * `div <#div,int,int>`_

View file

@ -1,5 +1,6 @@
System module imports several separate modules, and their documentation The System module imports several separate modules, and their documentation
is in separate files: is in separate files:
* `iterators <iterators.html>`_ * `iterators <iterators.html>`_
* `assertions <assertions.html>`_ * `assertions <assertions.html>`_
* `dollars <dollars.html>`_ * `dollars <dollars.html>`_
@ -31,15 +32,13 @@ Proc Usage
============================= ======================================= ============================= =======================================
**See also:** **See also:**
* `strutils module<strutils.html>`_ for common string functions * `strutils module <strutils.html>`_ for common string functions
* `strformat module<strformat.html>`_ for string interpolation and formatting * `strformat module <strformat.html>`_ for string interpolation and formatting
* `unicode module<unicode.html>`_ for Unicode UTF-8 handling * `unicode module <unicode.html>`_ for Unicode UTF-8 handling
* `strscans<strscans.html>`_ for ``scanf`` and ``scanp`` macros, which offer * `strscans <strscans.html>`_ for ``scanf`` and ``scanp`` macros, which offer
easier substring extraction than regular expressions easier substring extraction than regular expressions
* `strtabs module<strtabs.html>`_ for efficient hash tables * `strtabs module <strtabs.html>`_ for efficient hash tables
(dictionaries, in some programming languages) mapping from strings to strings (dictionaries, in some programming languages) mapping from strings to strings
* `ropes module<ropes.html>`_ for rope data type, which can represent very
long strings efficiently
@ -62,14 +61,14 @@ Proc Usage
`del<#del,seq[T][T],Natural>`_ `O(1)` removal, doesn't preserve the order `del<#del,seq[T][T],Natural>`_ `O(1)` removal, doesn't preserve the order
`pop<#pop,seq[T][T]>`_ Remove and return last item of a sequence `pop<#pop,seq[T][T]>`_ Remove and return last item of a sequence
`x & y<#&,seq[T][T],seq[T][T]>`_ Concatenate two sequences `x & y<#&,seq[T][T],seq[T][T]>`_ Concatenate two sequences
`x[a..b]<#[],openArray[T],HSlice[U,V]>`_ Slice of a seqence (both ends included) `x[a..b]<#[],openArray[T],HSlice[U,V]>`_ Slice of a sequence (both ends included)
======================================== ========================================== ======================================== ==========================================
**See also:** **See also:**
* `sequtils module<collections/sequtils.html>`_ for operations on container * `sequtils module <collections/sequtils.html>`_ for operations on container
types (including strings) types (including strings)
* `json module<json.html>`_ for a structure which allows heterogeneous members * `json module <json.html>`_ for a structure which allows heterogeneous members
* `lists module<lists.html>`_ for linked lists * `lists module <lists.html>`_ for linked lists
@ -120,10 +119,10 @@ Proc Usage Also kn
============================== ================================== ===================== ============================== ================================== =====================
**See also:** **See also:**
* `math module<math.html>`_ for mathematical operations like trigonometric * `math module <math.html>`_ for mathematical operations like trigonometric
functions, logarithms, square and cubic roots, etc. functions, logarithms, square and cubic roots, etc.
* `complex module<complex.html>`_ for operations on complex numbers * `complex module <complex.html>`_ for operations on complex numbers
* `rationals module<rationals.html>`_ for rational numbers * `rationals module <rationals.html>`_ for rational numbers
@ -163,6 +162,6 @@ Proc Usage
`not T<#not,bool>`_ Boolean `not` `not T<#not,bool>`_ Boolean `not`
`a .. b<#..,T,U>`_ Binary slice that constructs an interval `a .. b<#..,T,U>`_ Binary slice that constructs an interval
`[a, b]` `[a, b]`
[a ..< b](#..<.t,untyped,untyped) Interval `[a, b>` (excluded upper bound) [a ..< b](#..<.t,untyped,untyped) Interval `[a, b)` (excluded upper bound)
[runnableExamples](#runnableExamples,untyped) Create testable documentation [runnableExamples](#runnableExamples,untyped) Create testable documentation
============================================= ============================================ ============================================= ============================================