Skip to content

Commit 93f22dc

Browse files
Deploy to GitHub pages
0 parents  commit 93f22dc

File tree

878 files changed

+351823
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

878 files changed

+351823
-0
lines changed

algorithm.html

Lines changed: 978 additions & 0 deletions
Large diffs are not rendered by default.

algorithm.idx

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
nimTitle algorithm algorithm.html module std/algorithm 0
2+
nim Descending algorithm.html#Descending SortOrder.Descending 52
3+
nim Ascending algorithm.html#Ascending SortOrder.Ascending 52
4+
nim SortOrder algorithm.html#SortOrder enum SortOrder 52
5+
nim `*` algorithm.html#*,int,SortOrder proc `*`(x: int; order: SortOrder): int 55
6+
nim fill algorithm.html#fill,openArray[T],Natural,Natural,T proc fill[T](a: var openArray[T]; first, last: Natural; value: T) 77
7+
nim fill algorithm.html#fill,openArray[T],T proc fill[T](a: var openArray[T]; value: T) 90
8+
nim reverse algorithm.html#reverse,openArray[T],Natural,Natural proc reverse[T](a: var openArray[T]; first, last: Natural) 101
9+
nim reverse algorithm.html#reverse,openArray[T] proc reverse[T](a: var openArray[T]) 123
10+
nim reversed algorithm.html#reversed,openArray[T] proc reversed[T](a: openArray[T]): seq[T] 138
11+
nim reversed algorithm.html#reversed,openArray[T],Natural,int proc reversed[T](a: openArray[T]; first: Natural; last: int): seq[T] 151
12+
nim binarySearch algorithm.html#binarySearch,openArray[T],K,proc(T,K) proc binarySearch[T, K](a: openArray[T]; key: K;\n cmp: proc (x: T; y: K): int {.closure.}): int 160
13+
nim binarySearch algorithm.html#binarySearch,openArray[T],T proc binarySearch[T](a: openArray[T]; key: T): int 211
14+
nim lowerBound algorithm.html#lowerBound,openArray[T],K,proc(T,K) proc lowerBound[T, K](a: openArray[T]; key: K; cmp: proc (x: T; k: K): int {.closure.}): int 222
15+
nim lowerBound algorithm.html#lowerBound,openArray[T],T proc lowerBound[T](a: openArray[T]; key: T): int 258
16+
nim upperBound algorithm.html#upperBound,openArray[T],K,proc(T,K) proc upperBound[T, K](a: openArray[T]; key: K; cmp: proc (x: T; k: K): int {.closure.}): int 272
17+
nim upperBound algorithm.html#upperBound,openArray[T],T proc upperBound[T](a: openArray[T]; key: T): int 308
18+
nim sort algorithm.html#sort,openArray[T],proc(T,T) proc sort[T](a: var openArray[T]; cmp: proc (x, y: T): int {.closure.};\n order = SortOrder.Ascending) 369
19+
nim sort algorithm.html#sort,openArray[T] proc sort[T](a: var openArray[T]; order = SortOrder.Ascending) 422
20+
nim sorted algorithm.html#sorted,openArray[T],proc(T,T) proc sorted[T](a: openArray[T]; cmp: proc (x, y: T): int {.closure.};\n order = SortOrder.Ascending): seq[T] 432
21+
nim sorted algorithm.html#sorted,openArray[T] proc sorted[T](a: openArray[T]; order = SortOrder.Ascending): seq[T] 454
22+
nim sortedByIt algorithm.html#sortedByIt.t,untyped,untyped template sortedByIt(seq1, op: untyped): untyped 472
23+
nim isSorted algorithm.html#isSorted,openArray[T],proc(T,T) proc isSorted[T](a: openArray[T]; cmp: proc (x, y: T): int {.closure.};\n order = SortOrder.Ascending): bool 508
24+
nim isSorted algorithm.html#isSorted,openArray[T] proc isSorted[T](a: openArray[T]; order = SortOrder.Ascending): bool 535
25+
nim merge algorithm.html#merge,seq[T],openArray[T],openArray[T],proc(T,T) proc merge[T](result: var seq[T]; x, y: openArray[T];\n cmp: proc (x, y: T): int {.closure.}) 555
26+
nim merge algorithm.html#merge,seq[T],openArray[T],openArray[T] proc merge[T](result: var seq[T]; x, y: openArray[T]) 632
27+
nim product algorithm.html#product,openArray[seq[T]] proc product[T](x: openArray[seq[T]]): seq[seq[T]] 647
28+
nim nextPermutation algorithm.html#nextPermutation,openArray[T] proc nextPermutation[T](x: var openArray[T]): bool 684
29+
nim prevPermutation algorithm.html#prevPermutation,openArray[T] proc prevPermutation[T](x: var openArray[T]): bool 724
30+
nim rotateLeft algorithm.html#rotateLeft,openArray[T],HSlice[int,int],int proc rotateLeft[T](arg: var openArray[T]; slice: HSlice[int, int]; dist: int): int 813
31+
nim rotateLeft algorithm.html#rotateLeft,openArray[T],int proc rotateLeft[T](arg: var openArray[T]; dist: int): int 851
32+
nim rotatedLeft algorithm.html#rotatedLeft,openArray[T],HSlice[int,int],int proc rotatedLeft[T](arg: openArray[T]; slice: HSlice[int, int]; dist: int): seq[T] 871
33+
nim rotatedLeft algorithm.html#rotatedLeft,openArray[T],int proc rotatedLeft[T](arg: openArray[T]; dist: int): seq[T] 901
34+
heading Basic usage algorithm.html#basic-usage Basic usage 0
35+
heading See also algorithm.html#see-also See also 0
36+
nimgrp rotateleft algorithm.html#rotateLeft-procs-all proc 813
37+
nimgrp sort algorithm.html#sort-procs-all proc 369
38+
nimgrp issorted algorithm.html#isSorted-procs-all proc 508
39+
nimgrp lowerbound algorithm.html#lowerBound-procs-all proc 222
40+
nimgrp reverse algorithm.html#reverse-procs-all proc 101
41+
nimgrp sorted algorithm.html#sorted-procs-all proc 432
42+
nimgrp reversed algorithm.html#reversed-procs-all proc 138
43+
nimgrp binarysearch algorithm.html#binarySearch-procs-all proc 160
44+
nimgrp merge algorithm.html#merge-procs-all proc 555
45+
nimgrp rotatedleft algorithm.html#rotatedLeft-procs-all proc 871
46+
nimgrp fill algorithm.html#fill-procs-all proc 77
47+
nimgrp upperbound algorithm.html#upperBound-procs-all proc 272

apis.html

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8" ?>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3+
<!-- This file is generated by Nim. -->
4+
<html xmlns="https://www.w3.org/1999/xhtml" xml:lang="en" lang="en" data-theme="auto">
5+
<head>
6+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
7+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
8+
<title>API naming design</title>
9+
10+
<!-- Google fonts -->
11+
<link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
12+
<link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
13+
14+
<!-- Favicon -->
15+
<link rel="shortcut icon" href="data:image/x-icon;base64,AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAUAAAAF////AP///wD///8A////AP///wD///8A////AP///wD///8A////AAAAAAIAAABbAAAAlQAAAKIAAACbAAAAmwAAAKIAAACVAAAAWwAAAAL///8A////AP///wD///8A////AAAAABQAAADAAAAAYwAAAA3///8A////AP///wD///8AAAAADQAAAGMAAADAAAAAFP///wD///8A////AP///wAAAACdAAAAOv///wD///8A////AP///wD///8A////AP///wD///8AAAAAOgAAAJ3///8A////AP///wAAAAAnAAAAcP///wAAAAAoAAAASv///wD///8A////AP///wAAAABKAAAAKP///wAAAABwAAAAJ////wD///8AAAAAgQAAABwAAACIAAAAkAAAAJMAAACtAAAAFQAAABUAAACtAAAAkwAAAJAAAACIAAAAHAAAAIH///8A////AAAAAKQAAACrAAAAaP///wD///8AAAAARQAAANIAAADSAAAARf///wD///8AAAAAaAAAAKsAAACk////AAAAADMAAACcAAAAnQAAABj///8A////AP///wAAAAAYAAAAGP///wD///8A////AAAAABgAAACdAAAAnAAAADMAAAB1AAAAwwAAAP8AAADpAAAAsQAAAE4AAAAb////AP///wAAAAAbAAAATgAAALEAAADpAAAA/wAAAMMAAAB1AAAAtwAAAOkAAAD/AAAA/wAAAP8AAADvAAAA3gAAAN4AAADeAAAA3gAAAO8AAAD/AAAA/wAAAP8AAADpAAAAtwAAAGUAAAA/AAAA3wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAAD/AAAA/wAAAP8AAADfAAAAPwAAAGX///8A////AAAAAEgAAADtAAAAvwAAAL0AAADGAAAA7wAAAO8AAADGAAAAvQAAAL8AAADtAAAASP///wD///8A////AP///wD///8AAAAAO////wD///8A////AAAAAIcAAACH////AP///wD///8AAAAAO////wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A////AP///wD///8A//8AAP//AAD4HwAA7/cAAN/7AAD//wAAoYUAAJ55AACf+QAAh+EAAAAAAADAAwAA4AcAAP5/AAD//wAA//8AAA=="/>
16+
<link rel="icon" type="image/png" sizes="32x32" href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAA3XAAAN1wFCKJt4AAAAB3RJTUUH4QQQEwksSS9ZWwAAAk1JREFUWMPtll2ITVEUx39nn/O7Y5qR8f05wtCUUr6ZIS++8pEnkZInPImneaCQ5METNdOkeFBKUhMPRIkHKfEuUZSUlGlKPN2TrgfncpvmnntnmlEyq1Z7t89/rf9a6+y99oZxGZf/XeIq61EdtgKXgdXA0xrYAvBjOIF1AI9zvjcC74BSpndrJPkBWDScTF8Aa4E3wDlgHbASaANmVqlcCnwHvgDvgVfAJ+AikAAvgfVZwLnSVZHZaOuKoQi3ZOMi4NkYkpe1p4J7A8BpYAD49hfIy/oqG0+hLomiKP2L5L+1ubn5115S+3OAn4EnwBlgMzCjyt6ZAnQCJ4A7wOs88iRJHvw50HoujuPBoCKwHWiosy8MdfZnAdcHk8dxXFJ3VQbQlCTJvRBCGdRbD4M6uc5glpY3eAihpN5S5w12diSEcCCEcKUO4ljdr15T76ur1FDDLIQQ3qv71EdDOe3Kxj3leRXyk+pxdWnFWod6Wt2bY3de3aSuUHcPBVimHs7mK9WrmeOF6lR1o9qnzskh2ar2qm1qizpfXaPeVGdlmGN5pb09qMxz1Xb1kLqgzn1RyH7JUXW52lr5e/Kqi9qpto7V1atuUzfnARrV7jEib1T76gG2qxdGmXyiekkt1GswPTtek0aBfJp6YySGBfWg2tPQ0FAYgf1stUfdmdcjarbYJEniKIq6gY/Aw+zWHAC+p2labGpqiorFYgGYCEzN7oQdQClN07O1/EfDyGgC0ALMBdYAi4FyK+4H3gLPsxfR1zRNi+NP7nH5J+QntnXe5B5mpfQAAAAASUVORK5CYII=">
17+
18+
<!-- CSS -->
19+
<link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
20+
21+
<!-- JS -->
22+
<script type="text/javascript" src="dochack.js?v=2.3.1"></script>
23+
</head>
24+
<body>
25+
<div class="document" id="documentId">
26+
<div class="container">
27+
<h1 class="title">API naming design</h1>
28+
<p>The API is designed to be <strong>easy to use</strong> and consistent. Ease of use is measured by the number of calls to achieve a concrete high-level action.</p>
29+
30+
<h1 id="naming-scheme">Naming scheme</h1><p>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 <em>guess</em> a name.</p>
31+
<table border="1" class="docutils"><tr><th>English word</th><th>To use</th><th>Notes</th></tr>
32+
<tr><td>initialize</td><td>initT </td><td><tt class="docutils literal"><span class="pre"><span class="Identifier">init</span></span></tt> is used to create a value type <tt class="docutils literal"><span class="pre"><span class="Identifier">T</span></span></tt></td></tr>
33+
<tr><td>new</td><td>newP </td><td><tt class="docutils literal"><span class="pre"><span class="Identifier">new</span></span></tt> is used to create a reference type <tt class="docutils literal"><span class="pre"><span class="Identifier">P</span></span></tt></td></tr>
34+
<tr><td>find</td><td>find</td><td>should return the position where something was found; for a bool result use <tt class="docutils literal"><span class="pre"><span class="Identifier">contains</span></span></tt></td></tr>
35+
<tr><td>contains</td><td>contains</td><td>often short for <tt class="docutils literal"><span class="pre"><span class="Identifier">find</span><span class="Punctuation">(</span><span class="Punctuation">)</span> <span class="Operator">&gt;=</span> <span class="DecNumber">0</span></span></tt></td></tr>
36+
<tr><td>append</td><td>add</td><td>use <tt class="docutils literal"><span class="pre"><span class="Identifier">add</span></span></tt> instead of <tt class="docutils literal"><span class="pre"><span class="Identifier">append</span></span></tt></td></tr>
37+
<tr><td>compare</td><td>cmp</td><td>should return an int with the <tt class="docutils literal"><span class="pre"><span class="Operator">&lt;</span> <span class="DecNumber">0</span></span></tt> <tt class="docutils literal"><span class="pre"><span class="Operator">==</span> <span class="DecNumber">0</span></span></tt> or <tt class="docutils literal"><span class="pre"><span class="Operator">&gt;</span> <span class="DecNumber">0</span></span></tt> semantics; for a bool result use <tt class="docutils literal"><span class="pre"><span class="Identifier">sameXYZ</span></span></tt></td></tr>
38+
<tr><td>put</td><td>put, <tt class="docutils literal"><span class="pre"><span class="Punctuation">[</span><span class="Punctuation">]</span><span class="Operator">=</span></span></tt></td><td>consider overloading <tt class="docutils literal"><span class="pre"><span class="Punctuation">[</span><span class="Punctuation">]</span><span class="Operator">=</span></span></tt> for put</td></tr>
39+
<tr><td>get</td><td>get, <tt class="docutils literal"><span class="pre"><span class="Punctuation">[</span><span class="Punctuation">]</span></span></tt></td><td>consider overloading <tt class="docutils literal"><span class="pre"><span class="Punctuation">[</span><span class="Punctuation">]</span></span></tt> for get; consider to not use <tt class="docutils literal"><span class="pre"><span class="Identifier">get</span></span></tt> as a prefix: <tt class="docutils literal"><span class="pre"><span class="Identifier">len</span></span></tt> instead of <tt class="docutils literal"><span class="pre"><span class="Identifier">getLen</span></span></tt></td></tr>
40+
<tr><td>length</td><td>len</td><td>also used for <em>number of elements</em></td></tr>
41+
<tr><td>size</td><td>size, len</td><td>size should refer to a byte size</td></tr>
42+
<tr><td>capacity</td><td>cap</td><td></td></tr>
43+
<tr><td>memory</td><td>mem</td><td>implies a low-level operation</td></tr>
44+
<tr><td>items</td><td>items</td><td>default iterator over a collection</td></tr>
45+
<tr><td>pairs</td><td>pairs</td><td>iterator over (key, value) pairs</td></tr>
46+
<tr><td>delete</td><td>delete, del</td><td>del is supposed to be faster than delete, because it does not keep the order; delete keeps the order</td></tr>
47+
<tr><td>remove</td><td>delete, del</td><td>inconsistent right now</td></tr>
48+
<tr><td>remove-and-return</td><td>pop</td><td><tt class="docutils literal"><span class="pre"><span class="Identifier">Table</span></span></tt>/<tt class="docutils literal"><span class="pre"><span class="Identifier">TableRef</span></span></tt> alias to <tt class="docutils literal"><span class="pre"><span class="Identifier">take</span></span></tt></td></tr>
49+
<tr><td>include</td><td>incl</td><td></td></tr>
50+
<tr><td>exclude</td><td>excl</td><td></td></tr>
51+
<tr><td>command</td><td>cmd</td><td></td></tr>
52+
<tr><td>execute</td><td>exec</td><td></td></tr>
53+
<tr><td>environment</td><td>env</td><td></td></tr>
54+
<tr><td>variable</td><td>var</td><td></td></tr>
55+
<tr><td>value</td><td>value, val </td><td>val is preferred, inconsistent right now</td></tr>
56+
<tr><td>executable</td><td>exe</td><td></td></tr>
57+
<tr><td>directory</td><td>dir</td><td></td></tr>
58+
<tr><td>path</td><td>path</td><td>path is the string &quot;/usr/bin&quot; (for example), dir is the content of &quot;/usr/bin&quot;; inconsistent right now</td></tr>
59+
<tr><td>extension</td><td>ext</td><td></td></tr>
60+
<tr><td>separator</td><td>sep</td><td></td></tr>
61+
<tr><td>column</td><td>col, column </td><td>col is preferred, inconsistent right now</td></tr>
62+
<tr><td>application</td><td>app</td><td></td></tr>
63+
<tr><td>configuration</td><td>cfg</td><td></td></tr>
64+
<tr><td>message</td><td>msg</td><td></td></tr>
65+
<tr><td>argument</td><td>arg</td><td></td></tr>
66+
<tr><td>object</td><td>obj</td><td></td></tr>
67+
<tr><td>parameter</td><td>param</td><td></td></tr>
68+
<tr><td>operator</td><td>opr</td><td></td></tr>
69+
<tr><td>procedure</td><td>proc</td><td></td></tr>
70+
<tr><td>function</td><td>func</td><td></td></tr>
71+
<tr><td>coordinate</td><td>coord</td><td></td></tr>
72+
<tr><td>rectangle</td><td>rect</td><td></td></tr>
73+
<tr><td>point</td><td>point</td><td></td></tr>
74+
<tr><td>symbol</td><td>sym</td><td></td></tr>
75+
<tr><td>literal</td><td>lit</td><td></td></tr>
76+
<tr><td>string</td><td>str</td><td></td></tr>
77+
<tr><td>identifier</td><td>ident</td><td></td></tr>
78+
<tr><td>indentation</td><td>indent</td><td></td></tr>
79+
</table>
80+
81+
82+
<div class="twelve-columns footer">
83+
<span class="nim-sprite"></span>
84+
<br>
85+
<small style="color: var(--hint);">Made with Nim. Generated: 2025-12-04 23:54:47 UTC</small>
86+
</div>
87+
</div>
88+
</div>
89+
<script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
90+
91+
</body>
92+
</html>

apis.idx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
markupTitle API naming design apis.html API naming design 0
2+
heading Naming scheme apis.html#naming-scheme Naming scheme 0

0 commit comments

Comments
 (0)