diff options
author | quantimnot <54247259+quantimnot@users.noreply.github.com> | 2021-03-18 23:37:55 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-18 20:37:55 -0700 |
commit | 83ae70cb540661934b263d38f0a3864a982c0681 (patch) | |
tree | 2c7dab75410062ad06a0b6f40bee41e3f0bb3cff /doc/apis.rst | |
parent | 15586c7a7a54f9d573eed9ec4ec90994e1e0c483 (diff) | |
download | Nim-83ae70cb540661934b263d38f0a3864a982c0681.tar.gz |
RST backtick refactor (all *.rst except manual.rst and rst_examples.rst) (#17258)
Co-authored-by: quantimnot <quantimnot@users.noreply.github.com>
Diffstat (limited to 'doc/apis.rst')
-rw-r--r-- | doc/apis.rst | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/doc/apis.rst b/doc/apis.rst index 03374c2db..d01e75d78 100644 --- a/doc/apis.rst +++ b/doc/apis.rst @@ -1,3 +1,5 @@ +.. default-role:: code + ================= API naming design ================= @@ -18,22 +20,22 @@ been renamed to fit this scheme. The ultimate goal is that the programmer can ------------------- ------------ -------------------------------------- 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`` +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`` + 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`` + `< 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 @@ -44,7 +46,7 @@ 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`` +remove-and-return pop `Table`/`TableRef` alias to `take` include incl exclude excl command cmd |