diff options
author | ringabout <43030857+ringabout@users.noreply.github.com> | 2023-10-31 00:03:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-30 17:03:04 +0100 |
commit | 4d11d0619d11d8aecdaff998981efcd054de9760 (patch) | |
tree | d098736002228d600e3232f6ab6d8347872224c8 /doc | |
parent | 403e0118ae8d099384e9bd6a046c2114538503b8 (diff) | |
download | Nim-4d11d0619d11d8aecdaff998981efcd054de9760.tar.gz |
complete std prefixes for stdlib (#22887)
follow up https://github.com/nim-lang/Nim/pull/22851 follow up https://github.com/nim-lang/Nim/pull/22873
Diffstat (limited to 'doc')
-rw-r--r-- | doc/astspec.txt | 12 | ||||
-rw-r--r-- | doc/docgen_sample.nim | 2 | ||||
-rw-r--r-- | doc/estp.md | 2 | ||||
-rw-r--r-- | doc/manual.md | 6 | ||||
-rw-r--r-- | doc/manual_experimental.md | 2 |
5 files changed, 12 insertions, 12 deletions
diff --git a/doc/astspec.txt b/doc/astspec.txt index 9929d8ccd..7a7053a2d 100644 --- a/doc/astspec.txt +++ b/doc/astspec.txt @@ -893,7 +893,7 @@ on what keywords are present. Let's start with the simplest form. Concrete syntax: ```nim - import math + import std/math ``` AST: @@ -907,7 +907,7 @@ With ``except``, we get ``nnkImportExceptStmt``. Concrete syntax: ```nim - import math except pow + import std/math except pow ``` AST: @@ -916,13 +916,13 @@ AST: nnkImportExceptStmt(nnkIdent("math"),nnkIdent("pow")) ``` -Note that ``import math as m`` does not use a different node; rather, +Note that ``import std/math as m`` does not use a different node; rather, we use ``nnkImportStmt`` with ``as`` as an infix operator. Concrete syntax: ```nim - import strutils as su + import std/strutils as su ``` AST: @@ -945,7 +945,7 @@ If we use ``from ... import``, the result is different, too. Concrete syntax: ```nim - from math import pow + from std/math import pow ``` AST: @@ -954,7 +954,7 @@ AST: nnkFromStmt(nnkIdent("math"), nnkIdent("pow")) ``` -Using ``from math as m import pow`` works identically to the ``as`` modifier +Using ``from std/math as m import pow`` works identically to the ``as`` modifier with the ``import`` statement, but wrapped in ``nnkFromStmt``. Export statement diff --git a/doc/docgen_sample.nim b/doc/docgen_sample.nim index 7a167cb45..06b8d7f8e 100644 --- a/doc/docgen_sample.nim +++ b/doc/docgen_sample.nim @@ -1,6 +1,6 @@ ## This module is a sample. -import strutils +import std/strutils proc helloWorld*(times: int) = ## Takes an integer and outputs diff --git a/doc/estp.md b/doc/estp.md index d0ef4f1ba..8a986bdf3 100644 --- a/doc/estp.md +++ b/doc/estp.md @@ -28,7 +28,7 @@ Otherwise your program is profiled. ```nim when compileOption("profiler"): - import nimprof + import std/nimprof ``` After your program has finished the profiler will create a diff --git a/doc/manual.md b/doc/manual.md index 0e447fd12..0e167be04 100644 --- a/doc/manual.md +++ b/doc/manual.md @@ -655,7 +655,7 @@ string containing the literal. The callable identifier needs to be declared with a special ``'`` prefix: ```nim - import strutils + import std/strutils type u4 = distinct uint8 # a 4-bit unsigned integer aka "nibble" proc `'u4`(n: string): u4 = # The leading ' is required. @@ -670,7 +670,7 @@ corresponds to this transformation. The transformation naturally handles the case that additional parameters are passed to the callee: ```nim - import strutils + import std/strutils type u4 = distinct uint8 # a 4-bit unsigned integer aka "nibble" proc `'u4`(n: string; moreData: int): u4 = result = (parseInt(n) and 0x0F).u4 @@ -5231,7 +5231,7 @@ conservative in its effect analysis: ```nim test = "nim c $1" status = 1 {.push warningAsError[Effect]: on.} - import algorithm + import std/algorithm type MyInt = distinct int diff --git a/doc/manual_experimental.md b/doc/manual_experimental.md index 4ba56205a..071668aa1 100644 --- a/doc/manual_experimental.md +++ b/doc/manual_experimental.md @@ -1368,7 +1368,7 @@ to be computed dynamically. ```nim {.experimental: "dynamicBindSym".} - import macros + import std/macros macro callOp(opName, arg1, arg2): untyped = result = newCall(bindSym($opName), arg1, arg2) |