diff options
author | Andreas Rumpf <rumpf_a@web.de> | 2019-03-23 10:55:26 +0100 |
---|---|---|
committer | Andreas Rumpf <rumpf_a@web.de> | 2019-03-23 10:55:26 +0100 |
commit | 7c08303faf941da9faec8e7e31dd772b2f5b5acf (patch) | |
tree | 008fd2a375120e7513641c564e587070d9513d8d | |
parent | 714c4f0d6756e4e8a9ed0858a569286fe82a28e5 (diff) | |
download | Nim-7c08303faf941da9faec8e7e31dd772b2f5b5acf.tar.gz |
system.nim: documentation improvements
-rw-r--r-- | lib/system.nim | 11 | ||||
-rw-r--r-- | lib/system_overview.rst | 31 |
2 files changed, 22 insertions, 20 deletions
diff --git a/lib/system.nim b/lib/system.nim index 3641271cf..b468c23a4 100644 --- a/lib/system.nim +++ b/lib/system.nim @@ -1322,13 +1322,16 @@ when defined(nimAshr): ## 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>`_ ## ## .. code-block:: Nim - ## 0b0001_0000'i8 shr 2 == 0b0000_0100'i8 - ## 0b1000_0000'i8 shr 8 == 0b1111_1111'i8 - ## 0b1000_0000'i8 shr 1 == 0b1100_0000'i8 + ## ashr(0b0001_0000'i8, 2) == 0b0000_0100'i8 + ## ashr(0b1000_0000'i8, 8) == 0b1111_1111'i8 + ## ashr(0b1000_0000'i8, 1) == 0b1100_0000'i8 proc ashr*(x: int8, y: SomeInteger): int8 {.magic: "AshrI", noSideEffect.} proc ashr*(x: int16, y: SomeInteger): int16 {.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 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: ## * `div <#div,int,int>`_ diff --git a/lib/system_overview.rst b/lib/system_overview.rst index e7622339f..a2e5b7887 100644 --- a/lib/system_overview.rst +++ b/lib/system_overview.rst @@ -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: + * `iterators <iterators.html>`_ * `assertions <assertions.html>`_ * `dollars <dollars.html>`_ @@ -31,15 +32,13 @@ Proc Usage ============================= ======================================= **See also:** -* `strutils module<strutils.html>`_ for common string functions -* `strformat module<strformat.html>`_ for string interpolation and formatting -* `unicode module<unicode.html>`_ for Unicode UTF-8 handling -* `strscans<strscans.html>`_ for ``scanf`` and ``scanp`` macros, which offer +* `strutils module <strutils.html>`_ for common string functions +* `strformat module <strformat.html>`_ for string interpolation and formatting +* `unicode module <unicode.html>`_ for Unicode UTF-8 handling +* `strscans <strscans.html>`_ for ``scanf`` and ``scanp`` macros, which offer 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 -* `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 `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[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:** -* `sequtils module<collections/sequtils.html>`_ for operations on container +* `sequtils module <collections/sequtils.html>`_ for operations on container types (including strings) -* `json module<json.html>`_ for a structure which allows heterogeneous members -* `lists module<lists.html>`_ for linked lists +* `json module <json.html>`_ for a structure which allows heterogeneous members +* `lists module <lists.html>`_ for linked lists @@ -120,10 +119,10 @@ Proc Usage Also kn ============================== ================================== ===================== **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. -* `complex module<complex.html>`_ for operations on complex numbers -* `rationals module<rationals.html>`_ for rational numbers +* `complex module <complex.html>`_ for operations on complex numbers +* `rationals module <rationals.html>`_ for rational numbers @@ -163,6 +162,6 @@ Proc Usage `not T<#not,bool>`_ Boolean `not` `a .. b<#..,T,U>`_ Binary slice that constructs an interval `[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 ============================================= ============================================ |