packedsets.html 87 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812
  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>std/packedsets</title>
  9. <!-- Google fonts -->
  10. <link href='https://fonts.googleapis.com/css?family=Lato:400,600,900' rel='stylesheet' type='text/css'/>
  11. <link href='https://fonts.googleapis.com/css?family=Source+Code+Pro:400,500,600' rel='stylesheet' type='text/css'/>
  12. <!-- Favicon -->
  13. <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=="/>
  14. <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=">
  15. <!-- CSS -->
  16. <link rel="stylesheet" type="text/css" href="nimdoc.out.css?v=2.3.1">
  17. <!-- JS -->
  18. <script type="text/javascript" src="dochack.js?v=2.3.1"></script>
  19. </head>
  20. <body>
  21. <div class="document" id="documentId">
  22. <div class="container">
  23. <h1 class="title">std/packedsets</h1>
  24. <div class="row">
  25. <div class="three columns">
  26. <div class="theme-select-wrapper">
  27. <label for="theme-select">Theme:&nbsp;</label>
  28. <select id="theme-select" onchange="setTheme(this.value)">
  29. <option value="auto">🌗 Match OS</option>
  30. <option value="dark">🌑 Dark</option>
  31. <option value="light">🌕 Light</option>
  32. </select>
  33. </div>
  34. <div id="global-links">
  35. <ul class="simple-boot">
  36. <li><a href="manual.html">Manual</a></li>
  37. <li><a href="lib.html">Standard library</a></li>
  38. <li> <a id="indexLink" href="theindex.html">Index</a></li>
  39. <li><a href="compiler/theindex.html">Compiler docs</a></li>
  40. <li><a href="https://nim-lang.github.io/fusion/theindex.html">Fusion docs</a></li>
  41. <li><a href="https://nim-lang.github.io/Nim/">devel</a>, <a href="https://nim-lang.org/documentation.html">stable</a></li>
  42. </ul>
  43. </div>
  44. <div id="searchInputDiv">
  45. Search: <input type="search" id="searchInput"
  46. oninput="search()" />
  47. </div>
  48. <ul class="simple simple-toc" id="toc-list">
  49. <li><a class="reference" id="see-also_toc" href="#see-also">See also</a></li>
  50. <li>
  51. <a class="reference reference-toplevel" href="#6" id="56">Imports</a>
  52. </li>
  53. <li>
  54. <details open>
  55. <summary><a class="reference reference-toplevel" href="#7" id="57">Types</a></summary>
  56. <ul class="simple simple-toc-section">
  57. <li><a class="reference" href="#PackedSet" title="PackedSet[A] = object">PackedSet</a></li>
  58. </ul>
  59. </details>
  60. </li>
  61. <li>
  62. <details open>
  63. <summary><a class="reference reference-toplevel" href="#12" id="62">Procs</a></summary>
  64. <ul class="simple simple-toc-section">
  65. <ul class="simple nested-toc-section">$
  66. <li><a class="reference" href="#%24%2CPackedSet%5BA%5D" title="`$`[A](s: PackedSet[A]): string">`$`[A](s: PackedSet[A]): string</a></li>
  67. </ul>
  68. <ul class="simple nested-toc-section">*
  69. <li><a class="reference" href="#%2A%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`*`[A](s1, s2: PackedSet[A]): PackedSet[A]">`*`[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  70. </ul>
  71. <ul class="simple nested-toc-section">+
  72. <li><a class="reference" href="#%2B%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`+`[A](s1, s2: PackedSet[A]): PackedSet[A]">`+`[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  73. </ul>
  74. <ul class="simple nested-toc-section">-
  75. <li><a class="reference" href="#-%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`-`[A](s1, s2: PackedSet[A]): PackedSet[A]">`-`[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  76. </ul>
  77. <ul class="simple nested-toc-section"><
  78. <li><a class="reference" href="#%3C%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`&lt;`[A](s1, s2: PackedSet[A]): bool">`&lt;`[A](s1, s2: PackedSet[A]): bool</a></li>
  79. </ul>
  80. <ul class="simple nested-toc-section"><=
  81. <li><a class="reference" href="#%3C%3D%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`&lt;=`[A](s1, s2: PackedSet[A]): bool">`&lt;=`[A](s1, s2: PackedSet[A]): bool</a></li>
  82. </ul>
  83. <ul class="simple nested-toc-section">==
  84. <li><a class="reference" href="#%3D%3D%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`==`[A](s1, s2: PackedSet[A]): bool">`==`[A](s1, s2: PackedSet[A]): bool</a></li>
  85. </ul>
  86. <ul class="simple nested-toc-section">=copy
  87. <li><a class="reference" href="#%3Dcopy%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="`=copy`[A](dest: var PackedSet[A]; src: PackedSet[A])">`=copy`[A](dest: var PackedSet[A]; src: PackedSet[A])</a></li>
  88. </ul>
  89. <ul class="simple nested-toc-section">assign
  90. <li><a class="reference" href="#assign%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="assign[A](dest: var PackedSet[A]; src: PackedSet[A])">assign[A](dest: var PackedSet[A]; src: PackedSet[A])</a></li>
  91. </ul>
  92. <ul class="simple nested-toc-section">card
  93. <li><a class="reference" href="#card%2CPackedSet%5BA%5D" title="card[A](s: PackedSet[A]): int">card[A](s: PackedSet[A]): int</a></li>
  94. </ul>
  95. <ul class="simple nested-toc-section">clear
  96. <li><a class="reference" href="#clear%2CPackedSet%5BA%5D" title="clear[A](result: var PackedSet[A])">clear[A](result: var PackedSet[A])</a></li>
  97. </ul>
  98. <ul class="simple nested-toc-section">contains
  99. <li><a class="reference" href="#contains%2CPackedSet%5BA%5D%2CA" title="contains[A](s: PackedSet[A]; key: A): bool">contains[A](s: PackedSet[A]; key: A): bool</a></li>
  100. </ul>
  101. <ul class="simple nested-toc-section">containsOrIncl
  102. <li><a class="reference" href="#containsOrIncl%2CPackedSet%5BA%5D%2CA" title="containsOrIncl[A](s: var PackedSet[A]; key: A): bool">containsOrIncl[A](s: var PackedSet[A]; key: A): bool</a></li>
  103. </ul>
  104. <ul class="simple nested-toc-section">difference
  105. <li><a class="reference" href="#difference%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="difference[A](s1, s2: PackedSet[A]): PackedSet[A]">difference[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  106. </ul>
  107. <ul class="simple nested-toc-section">disjoint
  108. <li><a class="reference" href="#disjoint%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="disjoint[A](s1, s2: PackedSet[A]): bool">disjoint[A](s1, s2: PackedSet[A]): bool</a></li>
  109. </ul>
  110. <ul class="simple nested-toc-section">excl
  111. <li><a class="reference" href="#excl%2CPackedSet%5BA%5D%2CA" title="excl[A](s: var PackedSet[A]; key: A)">excl[A](s: var PackedSet[A]; key: A)</a></li>
  112. <li><a class="reference" href="#excl%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="excl[A](s: var PackedSet[A]; other: PackedSet[A])">excl[A](s: var PackedSet[A]; other: PackedSet[A])</a></li>
  113. </ul>
  114. <ul class="simple nested-toc-section">incl
  115. <li><a class="reference" href="#incl%2CPackedSet%5BA%5D%2CA" title="incl[A](s: var PackedSet[A]; key: A)">incl[A](s: var PackedSet[A]; key: A)</a></li>
  116. <li><a class="reference" href="#incl%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="incl[A](s: var PackedSet[A]; other: PackedSet[A])">incl[A](s: var PackedSet[A]; other: PackedSet[A])</a></li>
  117. </ul>
  118. <ul class="simple nested-toc-section">initPackedSet
  119. <li><a class="reference" href="#initPackedSet" title="initPackedSet[A](): PackedSet[A]">initPackedSet[A](): PackedSet[A]</a></li>
  120. </ul>
  121. <ul class="simple nested-toc-section">intersection
  122. <li><a class="reference" href="#intersection%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="intersection[A](s1, s2: PackedSet[A]): PackedSet[A]">intersection[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  123. </ul>
  124. <ul class="simple nested-toc-section">isNil
  125. <li><a class="reference" href="#isNil%2CPackedSet%5BA%5D" title="isNil[A](x: PackedSet[A]): bool">isNil[A](x: PackedSet[A]): bool</a></li>
  126. </ul>
  127. <ul class="simple nested-toc-section">len
  128. <li><a class="reference" href="#len%2CPackedSet%5BA%5D" title="len[A](s: PackedSet[A]): int">len[A](s: PackedSet[A]): int</a></li>
  129. </ul>
  130. <ul class="simple nested-toc-section">missingOrExcl
  131. <li><a class="reference" href="#missingOrExcl%2CPackedSet%5BA%5D%2CA" title="missingOrExcl[A](s: var PackedSet[A]; key: A): bool">missingOrExcl[A](s: var PackedSet[A]; key: A): bool</a></li>
  132. </ul>
  133. <ul class="simple nested-toc-section">symmetricDifference
  134. <li><a class="reference" href="#symmetricDifference%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="symmetricDifference[A](s1, s2: PackedSet[A]): PackedSet[A]">symmetricDifference[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  135. </ul>
  136. <ul class="simple nested-toc-section">toPackedSet
  137. <li><a class="reference" href="#toPackedSet%2CopenArray%5BA%5D" title="toPackedSet[A](x: openArray[A]): PackedSet[A]">toPackedSet[A](x: openArray[A]): PackedSet[A]</a></li>
  138. </ul>
  139. <ul class="simple nested-toc-section">union
  140. <li><a class="reference" href="#union%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D" title="union[A](s1, s2: PackedSet[A]): PackedSet[A]">union[A](s1, s2: PackedSet[A]): PackedSet[A]</a></li>
  141. </ul>
  142. </ul>
  143. </details>
  144. </li>
  145. <li>
  146. <details open>
  147. <summary><a class="reference reference-toplevel" href="#15" id="65">Iterators</a></summary>
  148. <ul class="simple simple-toc-section">
  149. <ul class="simple nested-toc-section">items
  150. <li><a class="reference" href="#items.i%2CPackedSet%5BA%5D" title="items[A](s: PackedSet[A]): A">items[A](s: PackedSet[A]): A</a></li>
  151. </ul>
  152. </ul>
  153. </details>
  154. </li>
  155. </ul>
  156. </div>
  157. <div class="nine columns" id="content">
  158. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L1" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  159. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L1" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  160. <div id="tocRoot"></div>
  161. <p class="module-desc"><p>The <tt class="docutils literal"><span class="pre"><span class="Identifier">packedsets</span></span></tt> module implements an efficient <tt class="docutils literal"><span class="pre"><span class="Identifier">Ordinal</span></span></tt> set implemented as a <span id="sparse-bit-set_1">sparse bit set</span>.</p>
  162. <p>Supports any Ordinal type.</p>
  163. <h1><a class="toc-backref" id="see-also" href="#see-also">See also</a></h1><ul class="simple"><li><a class="reference external" href="sets.html">sets module</a> for more general hash sets</li>
  164. </ul>
  165. </p>
  166. <div class="section" id="6">
  167. <h1><a class="toc-backref" href="#6">Imports</a></h1>
  168. <dl class="item">
  169. <a class="reference external" href="since.html">since</a>, <a class="reference external" href="hashes.html">hashes</a>, <a class="reference external" href="assertions.html">assertions</a>
  170. </dl>
  171. </div>
  172. <div class="section" id="7">
  173. <h1><a class="toc-backref" href="#7">Types</a></h1>
  174. <dl class="item">
  175. <div id="PackedSet">
  176. <dt><pre><a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span> <span class="Other">=</span> <span class="Keyword">object</span></pre></dt>
  177. <dd>
  178. An efficient set of <tt class="docutils literal"><span class="pre"><span class="Identifier">Ordinal</span></span></tt> types implemented as a sparse bit set.
  179. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L46" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  180. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L46" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  181. </dd>
  182. </div>
  183. </dl>
  184. </div>
  185. <div class="section" id="12">
  186. <h1><a class="toc-backref" href="#12">Procs</a></h1>
  187. <dl class="item">
  188. <div id="$-procs-all">
  189. <div id="$,PackedSet[A]">
  190. <dt><pre><span class="Keyword">proc</span> <a href="#%24%2CPackedSet%5BA%5D"><span class="Identifier">`$`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#string"><span class="Identifier">string</span></a></pre></dt>
  191. <dd>
  192. Converts <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> to a string.
  193. <p><strong class="examples_text">Example:</strong></p>
  194. <pre class="listing"><span class="Keyword">let</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  195. <span class="Identifier">assert</span> <span class="Operator">$</span><span class="Identifier">a</span> <span class="Operator">==</span> <span class="StringLit">&quot;{1, 2, 3}&quot;</span></pre>
  196. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L595" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  197. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L595" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  198. </dd>
  199. </div>
  200. </div>
  201. <div id="*-procs-all">
  202. <div id="*,PackedSet[A],PackedSet[A]">
  203. <dt><pre><span class="Keyword">proc</span> <a href="#%2A%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`*`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span> {.<span class="Identifier">inline</span>.}</pre></dt>
  204. <dd>
  205. Alias for <a class="reference external" href="#intersection,PackedSet[A],PackedSet[A]">intersection(s1, s2)</a>.
  206. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L522" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  207. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L522" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  208. </dd>
  209. </div>
  210. </div>
  211. <div id="+-procs-all">
  212. <div id="+,PackedSet[A],PackedSet[A]">
  213. <dt><pre><span class="Keyword">proc</span> <a href="#%2B%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`+`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span> {.<span class="Identifier">inline</span>.}</pre></dt>
  214. <dd>
  215. Alias for <a class="reference external" href="#union,PackedSet[A],PackedSet[A]">union(s1, s2)</a>.
  216. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L518" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  217. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L518" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  218. </dd>
  219. </div>
  220. </div>
  221. <div id="--procs-all">
  222. <div id="-,PackedSet[A],PackedSet[A]">
  223. <dt><pre><span class="Keyword">proc</span> <a href="#-%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`-`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span> {.<span class="Identifier">inline</span>.}</pre></dt>
  224. <dd>
  225. Alias for <a class="reference external" href="#difference,PackedSet[A],PackedSet[A]">difference(s1, s2)</a>.
  226. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L526" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  227. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L526" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  228. </dd>
  229. </div>
  230. </div>
  231. <div id="&lt;-procs-all">
  232. <div id="<,PackedSet[A],PackedSet[A]">
  233. <dt><pre><span class="Keyword">proc</span> <a href="#%3C%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`&lt;`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  234. <dd>
  235. <p>Returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> is a proper subset of <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  236. <p>A strict or proper subset <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> has all of its elements in <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>, but <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt> has more elements than <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt>.</p>
  237. <p><strong class="examples_text">Example:</strong></p>
  238. <pre class="listing"><span class="Keyword">let</span>
  239. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  240. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  241. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  242. <span class="Identifier">assert</span> <span class="Identifier">a</span> <span class="Operator">&lt;</span> <span class="Identifier">b</span>
  243. <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Punctuation">(</span><span class="Identifier">b</span> <span class="Operator">&lt;</span> <span class="Identifier">b</span><span class="Punctuation">)</span>
  244. <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Punctuation">(</span><span class="Identifier">c</span> <span class="Operator">&lt;</span> <span class="Identifier">b</span><span class="Punctuation">)</span></pre>
  245. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L571" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  246. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L571" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  247. </dd>
  248. </div>
  249. </div>
  250. <div id="&lt;=-procs-all">
  251. <div id="<=,PackedSet[A],PackedSet[A]">
  252. <dt><pre><span class="Keyword">proc</span> <a href="#%3C%3D%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`&lt;=`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  253. <dd>
  254. <p>Returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> is a subset of <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  255. <p>A subset <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> has all of its elements in <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>, but <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt> doesn't necessarily have more elements than <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt>. That is, <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> can be equal to <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  256. <p><strong class="examples_text">Example:</strong></p>
  257. <pre class="listing"><span class="Keyword">let</span>
  258. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  259. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  260. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  261. <span class="Identifier">assert</span> <span class="Identifier">a</span> <span class="Operator">&lt;=</span> <span class="Identifier">b</span>
  262. <span class="Identifier">assert</span> <span class="Identifier">b</span> <span class="Operator">&lt;=</span> <span class="Identifier">b</span>
  263. <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Punctuation">(</span><span class="Identifier">c</span> <span class="Operator">&lt;=</span> <span class="Identifier">b</span><span class="Punctuation">)</span></pre>
  264. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L552" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  265. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L552" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  266. </dd>
  267. </div>
  268. </div>
  269. <div id="==-procs-all">
  270. <div id="==,PackedSet[A],PackedSet[A]">
  271. <dt><pre><span class="Keyword">proc</span> <a href="#%3D%3D%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`==`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  272. <dd>
  273. Returns true if both <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt> have the same elements and set size.
  274. <p><strong class="examples_text">Example:</strong></p>
  275. <pre class="listing"><span class="Identifier">assert</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">1</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  276. <span class="Identifier">assert</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span></pre>
  277. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L587" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  278. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L587" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  279. </dd>
  280. </div>
  281. </div>
  282. <div id="=copy-procs-all">
  283. <div id="=copy,PackedSet[A],PackedSet[A]">
  284. <dt><pre><span class="Keyword">proc</span> <a href="#%3Dcopy%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">`=copy`</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">dest</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">src</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
  285. <dd>
  286. Copies <tt class="docutils literal"><span class="pre"><span class="Identifier">src</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">dest</span></span></tt>. <tt class="docutils literal"><span class="pre"><span class="Identifier">dest</span></span></tt> does not need to be initialized by the <a class="reference external" href="#initPackedSet">initPackedSet proc</a>.
  287. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L410" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  288. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L410" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  289. </dd>
  290. </div>
  291. </div>
  292. <div id="assign-procs-all">
  293. <div id="assign,PackedSet[A],PackedSet[A]">
  294. <dt><pre><span class="Keyword">proc</span> <a href="#assign%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">assign</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">dest</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">src</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span> {.<span class="Identifier">inline</span><span class="Other">,</span> <span><span class="Other pragmadots">...</span></span><span class="pragmawrap"><span class="Identifier">deprecated</span></span>.}</pre></dt>
  295. <dd>
  296. <div class="deprecation-message">
  297. <b>Deprecated</b>
  298. </div>
  299. Copies <tt class="docutils literal"><span class="pre"><span class="Identifier">src</span></span></tt> to <tt class="docutils literal"><span class="pre"><span class="Identifier">dest</span></span></tt>. <tt class="docutils literal"><span class="pre"><span class="Identifier">dest</span></span></tt> does not need to be initialized by the <a class="reference external" href="#initPackedSet">initPackedSet proc</a>.
  300. <p><strong class="examples_text">Example:</strong></p>
  301. <pre class="listing"><span class="Keyword">var</span>
  302. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  303. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  304. <span class="Identifier">b</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="DecNumber">5</span><span class="Punctuation">)</span>
  305. <span class="Identifier">b</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="DecNumber">7</span><span class="Punctuation">)</span>
  306. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">assign</span><span class="Punctuation">(</span><span class="Identifier">b</span><span class="Punctuation">)</span>
  307. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">2</span></pre>
  308. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L441" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  309. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L441" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  310. </dd>
  311. </div>
  312. </div>
  313. <div id="card-procs-all">
  314. <div id="card,PackedSet[A]">
  315. <dt><pre><span class="Keyword">proc</span> <a href="#card%2CPackedSet%5BA%5D"><span class="Identifier">card</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span class="Identifier">inline</span>.}</pre></dt>
  316. <dd>
  317. <p>Alias for <a class="reference external" href="#len,PackedSet[A]">len()</a>.</p>
  318. <p>Card stands for the <a class="reference external" href="https://en.wikipedia.org/wiki/Cardinality">cardinality</a> of a set.</p>
  319. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L545" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  320. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L545" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  321. </dd>
  322. </div>
  323. </div>
  324. <div id="clear-procs-all">
  325. <div id="clear,PackedSet[A]">
  326. <dt><pre><span class="Keyword">proc</span> <a href="#clear%2CPackedSet%5BA%5D"><span class="Identifier">clear</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">result</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
  327. <dd>
  328. Clears the <tt class="docutils literal"><span class="pre"><span class="Identifier">PackedSet</span><span class="Punctuation">[</span><span class="Identifier">A</span><span class="Punctuation">]</span></span></tt> back to an empty state.
  329. <p><strong class="examples_text">Example:</strong></p>
  330. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">,</span> <span class="DecNumber">7</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  331. <span class="Identifier">clear</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span>
  332. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span></pre>
  333. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L382" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  334. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L382" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  335. </dd>
  336. </div>
  337. </div>
  338. <div id="contains-procs-all">
  339. <div id="contains,PackedSet[A],A">
  340. <dt><pre><span class="Keyword">proc</span> <a href="#contains%2CPackedSet%5BA%5D%2CA"><span class="Identifier">contains</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">key</span><span class="Other">:</span> <span class="Identifier">A</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  341. <dd>
  342. <p>Returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> is in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  343. <p>This allows the usage of the <tt class="docutils literal"><span class="pre"><span class="Keyword">in</span></span></tt> operator.</p>
  344. <p><strong class="examples_text">Example:</strong></p>
  345. <pre class="listing"><span class="Keyword">type</span> <span class="Identifier">ABCD</span> <span class="Operator">=</span> <span class="Keyword">enum</span> <span class="Identifier">A</span><span class="Punctuation">,</span> <span class="Identifier">B</span><span class="Punctuation">,</span> <span class="Identifier">C</span><span class="Punctuation">,</span> <span class="Identifier">D</span>
  346. <span class="Keyword">let</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  347. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">contains</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span>
  348. <span class="Identifier">assert</span> <span class="DecNumber">3</span> <span class="Keyword">in</span> <span class="Identifier">a</span>
  349. <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">contains</span><span class="Punctuation">(</span><span class="DecNumber">8</span><span class="Punctuation">)</span>
  350. <span class="Identifier">assert</span> <span class="DecNumber">8</span> <span class="Keyword">notin</span> <span class="Identifier">a</span>
  351. <span class="Keyword">let</span> <span class="Identifier">letters</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="Identifier">A</span><span class="Punctuation">,</span> <span class="Identifier">C</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  352. <span class="Identifier">assert</span> <span class="Identifier">A</span> <span class="Keyword">in</span> <span class="Identifier">letters</span>
  353. <span class="Identifier">assert</span> <span class="Identifier">C</span> <span class="Keyword">in</span> <span class="Identifier">letters</span>
  354. <span class="Identifier">assert</span> <span class="Identifier">B</span> <span class="Keyword">notin</span> <span class="Identifier">letters</span></pre>
  355. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L182" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  356. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L182" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  357. </dd>
  358. </div>
  359. </div>
  360. <div id="containsOrIncl-procs-all">
  361. <div id="containsOrIncl,PackedSet[A],A">
  362. <dt><pre><span class="Keyword">proc</span> <a href="#containsOrIncl%2CPackedSet%5BA%5D%2CA"><span class="Identifier">containsOrIncl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">key</span><span class="Other">:</span> <span class="Identifier">A</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  363. <dd>
  364. <p>Includes <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> in the set <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> and tells if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> was already in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  365. <p>The difference with regards to the <a class="reference external" href="#incl,PackedSet[A],A">incl proc</a> is that this proc returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> already contained <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt>. The proc will return false if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> was added as a new value to <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> during this call.</p>
  366. <p><strong>See also:</strong></p>
  367. <ul class="simple"><li><a class="reference external" href="#incl,PackedSet[A],A">incl proc</a> for including an element</li>
  368. <li><a class="reference external" href="#missingOrExcl,PackedSet[A],A">missingOrExcl proc</a></li>
  369. </ul>
  370. <p><strong class="examples_text">Example:</strong></p>
  371. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  372. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">containsOrIncl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">false</span>
  373. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">containsOrIncl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">true</span>
  374. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">containsOrIncl</span><span class="Punctuation">(</span><span class="DecNumber">4</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">false</span></pre>
  375. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L276" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  376. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L276" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  377. </dd>
  378. </div>
  379. </div>
  380. <div id="difference-procs-all">
  381. <div id="difference,PackedSet[A],PackedSet[A]">
  382. <dt><pre><span class="Keyword">proc</span> <a href="#difference%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">difference</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  383. <dd>
  384. <p>Returns the difference of the sets <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  385. <p>The same as <a class="reference external" href="#-,PackedSet[A],PackedSet[A]">s1 - s2</a>.</p>
  386. <p><strong class="examples_text">Example:</strong></p>
  387. <pre class="listing"><span class="Keyword">let</span>
  388. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  389. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  390. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Identifier">difference</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span>
  391. <span class="Identifier">assert</span> <span class="Identifier">c</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">==</span> <span class="DecNumber">2</span>
  392. <span class="Identifier">assert</span> <span class="Identifier">c</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span></pre>
  393. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L486" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  394. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L486" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  395. </dd>
  396. </div>
  397. </div>
  398. <div id="disjoint-procs-all">
  399. <div id="disjoint,PackedSet[A],PackedSet[A]">
  400. <dt><pre><span class="Keyword">proc</span> <a href="#disjoint%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">disjoint</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  401. <dd>
  402. Returns true if the sets <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt> have no items in common.
  403. <p><strong class="examples_text">Example:</strong></p>
  404. <pre class="listing"><span class="Keyword">let</span>
  405. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  406. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  407. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  408. <span class="Identifier">assert</span> <span class="Identifier">disjoint</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">false</span>
  409. <span class="Identifier">assert</span> <span class="Identifier">disjoint</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">c</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">true</span></pre>
  410. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L530" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  411. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L530" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  412. </dd>
  413. </div>
  414. </div>
  415. <div id="excl-procs-all">
  416. <div id="excl,PackedSet[A],A">
  417. <dt><pre><span class="Keyword">proc</span> <a href="#excl%2CPackedSet%5BA%5D%2CA"><span class="Identifier">excl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">key</span><span class="Other">:</span> <span class="Identifier">A</span><span class="Other">)</span></pre></dt>
  418. <dd>
  419. <p>Excludes <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> from the set <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  420. <p>This doesn't do anything if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> is not found in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  421. <p><strong>See also:</strong></p>
  422. <ul class="simple"><li><a class="reference external" href="#incl,PackedSet[A],A">incl proc</a> for including an element</li>
  423. <li><a class="reference external" href="#excl,PackedSet[A],PackedSet[A]">excl proc</a> for excluding a set</li>
  424. <li><a class="reference external" href="#missingOrExcl,PackedSet[A],A">missingOrExcl proc</a></li>
  425. </ul>
  426. <p><strong class="examples_text">Example:</strong></p>
  427. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  428. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">excl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span>
  429. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">excl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span>
  430. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">excl</span><span class="Punctuation">(</span><span class="DecNumber">99</span><span class="Punctuation">)</span>
  431. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span></pre>
  432. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L311" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  433. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L311" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  434. </dd>
  435. </div>
  436. <div id="excl,PackedSet[A],PackedSet[A]">
  437. <dt><pre><span class="Keyword">proc</span> <a href="#excl%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">excl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
  438. <dd>
  439. <p>Excludes all elements from <tt class="docutils literal"><span class="pre"><span class="Identifier">other</span></span></tt> from <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  440. <p>This is the in-place version of <a class="reference external" href="#-,PackedSet[A],PackedSet[A]">s - other</a>.</p>
  441. <p><strong>See also:</strong></p>
  442. <ul class="simple"><li><a class="reference external" href="#incl,PackedSet[A],PackedSet[A]">incl proc</a> for including a set</li>
  443. <li><a class="reference external" href="#excl,PackedSet[A],A">excl proc</a> for excluding an element</li>
  444. <li><a class="reference external" href="#missingOrExcl,PackedSet[A],A">missingOrExcl proc</a></li>
  445. </ul>
  446. <p><strong class="examples_text">Example:</strong></p>
  447. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  448. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">excl</span><span class="Punctuation">(</span><span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span><span class="Punctuation">)</span>
  449. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">1</span>
  450. <span class="Identifier">assert</span> <span class="DecNumber">5</span> <span class="Keyword">notin</span> <span class="Identifier">a</span></pre>
  451. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L329" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  452. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L329" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  453. </dd>
  454. </div>
  455. </div>
  456. <div id="incl-procs-all">
  457. <div id="incl,PackedSet[A],A">
  458. <dt><pre><span class="Keyword">proc</span> <a href="#incl%2CPackedSet%5BA%5D%2CA"><span class="Identifier">incl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">key</span><span class="Other">:</span> <span class="Identifier">A</span><span class="Other">)</span></pre></dt>
  459. <dd>
  460. <p>Includes an element <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  461. <p>This doesn't do anything if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> is already in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  462. <p><strong>See also:</strong></p>
  463. <ul class="simple"><li><a class="reference external" href="#excl,PackedSet[A],A">excl proc</a> for excluding an element</li>
  464. <li><a class="reference external" href="#incl,PackedSet[A],PackedSet[A]">incl proc</a> for including a set</li>
  465. <li><a class="reference external" href="#containsOrIncl,PackedSet[A],A">containsOrIncl proc</a></li>
  466. </ul>
  467. <p><strong class="examples_text">Example:</strong></p>
  468. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  469. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span>
  470. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="DecNumber">3</span><span class="Punctuation">)</span>
  471. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">1</span></pre>
  472. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L213" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  473. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L213" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  474. </dd>
  475. </div>
  476. <div id="incl,PackedSet[A],PackedSet[A]">
  477. <dt><pre><span class="Keyword">proc</span> <a href="#incl%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">incl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">other</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span></pre></dt>
  478. <dd>
  479. <p>Includes all elements from <tt class="docutils literal"><span class="pre"><span class="Identifier">other</span></span></tt> into <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  480. <p>This is the in-place version of <a class="reference external" href="#+,PackedSet[A],PackedSet[A]">s + other</a>.</p>
  481. <p><strong>See also:</strong></p>
  482. <ul class="simple"><li><a class="reference external" href="#excl,PackedSet[A],PackedSet[A]">excl proc</a> for excluding a set</li>
  483. <li><a class="reference external" href="#incl,PackedSet[A],A">incl proc</a> for including an element</li>
  484. <li><a class="reference external" href="#containsOrIncl,PackedSet[A],A">containsOrIncl proc</a></li>
  485. </ul>
  486. <p><strong class="examples_text">Example:</strong></p>
  487. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  488. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span><span class="Punctuation">)</span>
  489. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">2</span>
  490. <span class="Identifier">assert</span> <span class="DecNumber">5</span> <span class="Keyword">in</span> <span class="Identifier">a</span></pre>
  491. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L243" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  492. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L243" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  493. </dd>
  494. </div>
  495. </div>
  496. <div id="initPackedSet-procs-all">
  497. <div id="initPackedSet">
  498. <dt><pre><span class="Keyword">proc</span> <a href="#initPackedSet"><span class="Identifier">initPackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  499. <dd>
  500. <p>Returns an empty <tt class="docutils literal"><span class="pre"><span class="Identifier">PackedSet</span><span class="Punctuation">[</span><span class="Identifier">A</span><span class="Punctuation">]</span></span></tt>. <tt class="docutils literal"><span class="pre"><span class="Identifier">A</span></span></tt> must be <tt class="docutils literal"><span class="pre"><span class="Identifier">Ordinal</span></span></tt>.</p>
  501. <p><strong>See also:</strong></p>
  502. <ul class="simple"><li><a class="reference external" href="#toPackedSet,openArray[A]">toPackedSet proc</a></li>
  503. </ul>
  504. <p><strong class="examples_text">Example:</strong></p>
  505. <pre class="listing"><span class="Keyword">let</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  506. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">0</span>
  507. <span class="Keyword">type</span> <span class="Identifier">Id</span> <span class="Operator">=</span> <span class="Keyword">distinct</span> <span class="Identifier">int</span>
  508. <span class="Keyword">var</span> <span class="Identifier">ids</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">Id</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  509. <span class="Identifier">ids</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="FloatNumber">3.</span><span class="Identifier">Id</span><span class="Punctuation">)</span></pre>
  510. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L160" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  511. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L160" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  512. </dd>
  513. </div>
  514. </div>
  515. <div id="intersection-procs-all">
  516. <div id="intersection,PackedSet[A],PackedSet[A]">
  517. <dt><pre><span class="Keyword">proc</span> <a href="#intersection%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">intersection</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  518. <dd>
  519. <p>Returns the intersection of the sets <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  520. <p>The same as <a class="reference external" href="#*,PackedSet[A],PackedSet[A]">s1 * s2</a>.</p>
  521. <p><strong class="examples_text">Example:</strong></p>
  522. <pre class="listing"><span class="Keyword">let</span>
  523. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  524. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  525. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Identifier">intersection</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span>
  526. <span class="Identifier">assert</span> <span class="Identifier">c</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">==</span> <span class="DecNumber">1</span>
  527. <span class="Identifier">assert</span> <span class="Identifier">c</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span></pre>
  528. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L469" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  529. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L469" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  530. </dd>
  531. </div>
  532. </div>
  533. <div id="isNil-procs-all">
  534. <div id="isNil,PackedSet[A]">
  535. <dt><pre><span class="Keyword">proc</span> <a href="#isNil%2CPackedSet%5BA%5D"><span class="Identifier">isNil</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a> {.<span class="Identifier">inline</span>.}</pre></dt>
  536. <dd>
  537. Returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">x</span></span></tt> is empty, false otherwise.
  538. <p><strong class="examples_text">Example:</strong></p>
  539. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Identifier">initPackedSet</span><span class="Punctuation">[</span><span class="Identifier">int</span><span class="Punctuation">]</span><span class="Punctuation">(</span><span class="Punctuation">)</span>
  540. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">isNil</span>
  541. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">incl</span><span class="Punctuation">(</span><span class="DecNumber">2</span><span class="Punctuation">)</span>
  542. <span class="Identifier">assert</span> <span class="Keyword">not</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">isNil</span>
  543. <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">excl</span><span class="Punctuation">(</span><span class="DecNumber">2</span><span class="Punctuation">)</span>
  544. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">isNil</span></pre>
  545. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L398" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  546. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L398" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  547. </dd>
  548. </div>
  549. </div>
  550. <div id="len-procs-all">
  551. <div id="len,PackedSet[A]">
  552. <dt><pre><span class="Keyword">proc</span> <a href="#len%2CPackedSet%5BA%5D"><span class="Identifier">len</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#int"><span class="Identifier">int</span></a> {.<span class="Identifier">inline</span>.}</pre></dt>
  553. <dd>
  554. Returns the number of elements in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.
  555. <p><strong class="examples_text">Example:</strong></p>
  556. <pre class="listing"><span class="Keyword">let</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  557. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">3</span></pre>
  558. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L347" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  559. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L347" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  560. </dd>
  561. </div>
  562. </div>
  563. <div id="missingOrExcl-procs-all">
  564. <div id="missingOrExcl,PackedSet[A],A">
  565. <dt><pre><span class="Keyword">proc</span> <a href="#missingOrExcl%2CPackedSet%5BA%5D%2CA"><span class="Identifier">missingOrExcl</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <span class="Keyword">var</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">;</span> <span class="Identifier">key</span><span class="Other">:</span> <span class="Identifier">A</span><span class="Other">)</span><span class="Other">:</span> <a href="system.html#bool"><span class="Identifier">bool</span></a></pre></dt>
  566. <dd>
  567. <p>Excludes <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> from the set <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> and tells if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> was already missing from <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.</p>
  568. <p>The difference with regards to the <a class="reference external" href="#excl,PackedSet[A],A">excl proc</a> is that this proc returns true if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> was missing from <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>. The proc will return false if <tt class="docutils literal"><span class="pre"><span class="Identifier">key</span></span></tt> was in <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt> and it was removed during this call.</p>
  569. <p><strong>See also:</strong></p>
  570. <ul class="simple"><li><a class="reference external" href="#excl,PackedSet[A],A">excl proc</a> for excluding an element</li>
  571. <li><a class="reference external" href="#excl,PackedSet[A],PackedSet[A]">excl proc</a> for excluding a set</li>
  572. <li><a class="reference external" href="#containsOrIncl,PackedSet[A],A">containsOrIncl proc</a></li>
  573. </ul>
  574. <p><strong class="examples_text">Example:</strong></p>
  575. <pre class="listing"><span class="Keyword">var</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  576. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">missingOrExcl</span><span class="Punctuation">(</span><span class="DecNumber">5</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">false</span>
  577. <span class="Identifier">assert</span> <span class="Identifier">a</span><span class="Operator">.</span><span class="Identifier">missingOrExcl</span><span class="Punctuation">(</span><span class="DecNumber">5</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="Identifier">true</span></pre>
  578. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L361" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  579. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L361" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  580. </dd>
  581. </div>
  582. </div>
  583. <div id="symmetricDifference-procs-all">
  584. <div id="symmetricDifference,PackedSet[A],PackedSet[A]">
  585. <dt><pre><span class="Keyword">proc</span> <a href="#symmetricDifference%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">symmetricDifference</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  586. <dd>
  587. Returns the symmetric difference of the sets <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.
  588. <p><strong class="examples_text">Example:</strong></p>
  589. <pre class="listing"><span class="Keyword">let</span>
  590. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  591. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  592. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Identifier">symmetricDifference</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span>
  593. <span class="Identifier">assert</span> <span class="Identifier">c</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">==</span> <span class="DecNumber">4</span>
  594. <span class="Identifier">assert</span> <span class="Identifier">c</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span></pre>
  595. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L503" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  596. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L503" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  597. </dd>
  598. </div>
  599. </div>
  600. <div id="toPackedSet-procs-all">
  601. <div id="toPackedSet,openArray[A]">
  602. <dt><pre><span class="Keyword">proc</span> <a href="#toPackedSet%2CopenArray%5BA%5D"><span class="Identifier">toPackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">x</span><span class="Other">:</span> <a href="system.html#openArray"><span class="Identifier">openArray</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  603. <dd>
  604. <p>Creates a new <tt class="docutils literal"><span class="pre"><span class="Identifier">PackedSet</span><span class="Punctuation">[</span><span class="Identifier">A</span><span class="Punctuation">]</span></span></tt> that contains the elements of <tt class="docutils literal"><span class="pre"><span class="Identifier">x</span></span></tt>.</p>
  605. <p>Duplicates are removed.</p>
  606. <p><strong>See also:</strong></p>
  607. <ul class="simple"><li><a class="reference external" href="#initPackedSet">initPackedSet proc</a></li>
  608. </ul>
  609. <p><strong class="examples_text">Example:</strong></p>
  610. <pre class="listing"><span class="Keyword">let</span> <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">5</span><span class="Punctuation">,</span> <span class="DecNumber">6</span><span class="Punctuation">,</span> <span class="DecNumber">7</span><span class="Punctuation">,</span> <span class="DecNumber">8</span><span class="Punctuation">,</span> <span class="DecNumber">8</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  611. <span class="Identifier">assert</span> <span class="Identifier">len</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">)</span> <span class="Operator">==</span> <span class="DecNumber">4</span>
  612. <span class="Identifier">assert</span> <span class="Operator">$</span><span class="Identifier">a</span> <span class="Operator">==</span> <span class="StringLit">&quot;{5, 6, 7, 8}&quot;</span></pre>
  613. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L260" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  614. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L260" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  615. </dd>
  616. </div>
  617. </div>
  618. <div id="union-procs-all">
  619. <div id="union,PackedSet[A],PackedSet[A]">
  620. <dt><pre><span class="Keyword">proc</span> <a href="#union%2CPackedSet%5BA%5D%2CPackedSet%5BA%5D"><span class="Identifier">union</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s1</span><span class="Other">,</span> <span class="Identifier">s2</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span></pre></dt>
  621. <dd>
  622. <p>Returns the union of the sets <tt class="docutils literal"><span class="pre"><span class="Identifier">s1</span></span></tt> and <tt class="docutils literal"><span class="pre"><span class="Identifier">s2</span></span></tt>.</p>
  623. <p>The same as <a class="reference external" href="#+,PackedSet[A],PackedSet[A]">s1 + s2</a>.</p>
  624. <p><strong class="examples_text">Example:</strong></p>
  625. <pre class="listing"><span class="Keyword">let</span>
  626. <span class="Identifier">a</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  627. <span class="Identifier">b</span> <span class="Operator">=</span> <span class="Punctuation">[</span><span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span>
  628. <span class="Identifier">c</span> <span class="Operator">=</span> <span class="Identifier">union</span><span class="Punctuation">(</span><span class="Identifier">a</span><span class="Punctuation">,</span> <span class="Identifier">b</span><span class="Punctuation">)</span>
  629. <span class="Identifier">assert</span> <span class="Identifier">c</span><span class="Operator">.</span><span class="Identifier">len</span> <span class="Operator">==</span> <span class="DecNumber">5</span>
  630. <span class="Identifier">assert</span> <span class="Identifier">c</span> <span class="Operator">==</span> <span class="Punctuation">[</span><span class="DecNumber">1</span><span class="Punctuation">,</span> <span class="DecNumber">2</span><span class="Punctuation">,</span> <span class="DecNumber">3</span><span class="Punctuation">,</span> <span class="DecNumber">4</span><span class="Punctuation">,</span> <span class="DecNumber">5</span><span class="Punctuation">]</span><span class="Operator">.</span><span class="Identifier">toPackedSet</span></pre>
  631. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L454" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  632. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L454" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  633. </dd>
  634. </div>
  635. </div>
  636. </dl>
  637. </div>
  638. <div class="section" id="15">
  639. <h1><a class="toc-backref" href="#15">Iterators</a></h1>
  640. <dl class="item">
  641. <div id="items-iterators-all">
  642. <div id="items.i,PackedSet[A]">
  643. <dt><pre><span class="Keyword">iterator</span> <a href="#items.i%2CPackedSet%5BA%5D"><span class="Identifier">items</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">(</span><span class="Identifier">s</span><span class="Other">:</span> <a href="packedsets.html#PackedSet"><span class="Identifier">PackedSet</span></a><span class="Other">[</span><span class="Identifier">A</span><span class="Other">]</span><span class="Other">)</span><span class="Other">:</span> <span class="Identifier">A</span> {.<span class="Identifier">inline</span>.}</pre></dt>
  644. <dd>
  645. Iterates over any included element of <tt class="docutils literal"><span class="pre"><span class="Identifier">s</span></span></tt>.
  646. <a href="https://github.com/nim-lang/Nim/tree/devel/lib/std/packedsets.nim#L138" class="link-seesrc" target="_blank">Source</a>&nbsp;&nbsp;
  647. <a href="https://github.com/nim-lang/Nim/edit/devel/lib/std/packedsets.nim#L138" class="link-seesrc" target="_blank" >Edit</a>&nbsp;&nbsp;
  648. </dd>
  649. </div>
  650. </div>
  651. </dl>
  652. </div>
  653. </div>
  654. </div>
  655. <div class="twelve-columns footer">
  656. <span class="nim-sprite"></span>
  657. <br>
  658. <small style="color: var(--hint);">Made with Nim. Generated: 2025-02-03 14:57:22 UTC</small>
  659. </div>
  660. </div>
  661. </div>
  662. <script defer data-domain="nim-lang.org" src="https://plausible.io/js/plausible.js"></script>
  663. </body>
  664. </html>