summary refs log tree commit diff stats
path: root/lib/pure/strtabs.nim
Commit message (Expand)AuthorAgeFilesLines
* refactor os imports into corresponding small modules (#20720)ringabout2022-11-011-1/+1
* move assertions out of system (#19599)flywind2022-03-231-0/+4
* remove outdated codes (#17140)flywind2021-02-221-1/+0
* fix some warnings (#16952)flywind2021-02-081-1/+1
* move tests to testament (#16101)flywind2020-11-241-12/+0
* Don't use os for Standalone (#15944)wilypomegranate2020-11-131-2/+2
* string is not nil anymore (#15352)flywind2020-09-181-4/+2
* Add some enhancements to `jsonutils.nim` (#15133)Ivan Bobev2020-09-091-19/+1
* better strict funcs, WIP (#15199)Andreas Rumpf2020-08-181-5/+8
* [FIX] strtabs interpolation in nimscript (#15172)haxscramper2020-08-091-1/+1
* Remove `noSideEffect` pragmas (#15143)sschwarzer2020-08-011-1/+1
* `toJson`, `jsonTo`, json (de)serialization for custom types; remove dependenc...Timothee Cour2020-06-081-1/+19
* Improve JSON serialisation of strtabs (#14549)PMunch2020-06-051-1/+1
* fixes #13946 (#14302)Andreas Rumpf2020-05-111-1/+1
* move since from inclrtl to std/private/since (#14188)hlaaftana2020-05-021-0/+1
* StringStream & more stdlib modules support for JS/NimScript (#14095)hlaaftana2020-04-281-2/+2
* fixes #12996Araq2020-01-051-1/+2
* add a StringTable.clear that requires no mode specification (#12853)Andy Davidoff2019-12-091-1/+5
* use system.move instead of system.shallowCopy if the GC mode requires itAndreas Rumpf2019-10-041-0/+2
* [backport] run nimpretty on string stuffnarimiran2019-09-301-24/+26
* Fix spellings (#12277) [backport]Federico Ceratto2019-09-271-1/+1
* makes koch.nim sem'check with --newruntimeAraq2019-04-061-1/+1
* see what appveyor thinks about thisAraq2019-04-011-2/+2
* newruntime: progressAraq2019-04-011-6/+3
* Initial version of the hot-code reloading support for native targets (#10729)zah2019-02-261-45/+42
* better docs: strtabs (#10704)Miran2019-02-191-104/+209
* Change strtabs.nextTry to match the assumption in strtabs.delOscar Nihlgård2019-02-031-1/+1
* Implement {.booldefine.} (#10533)Oscar Nihlgård2019-02-031-1/+27
* Added examples to strtabs module (#10160)Ico Doornekamp2019-01-071-0/+31
* remove deprecated stuff from the stdlib; introduce better deprecation warningsAraq2018-05-051-16/+3
* strtabs: fixes stupid typoAndreas Rumpf2018-04-301-1/+1
* make VM tests greenAraq2018-04-301-9/+9
* Support `in` operator on StringTableRefLynn C. Rees2017-09-081-0/+4
* added default param to strtabs.getOrDefault (#5280)David Krause2017-01-261-2/+2
* make tests greenAraq2016-11-081-1/+1
* Allow to use strtabs module with js targetAnatoly Galiulin2016-09-081-14/+24
* udpated the compiler and tester to use getOrDefaultAraq2015-10-131-2/+2
* added getOrDefault; bootstrapping works againAraq2015-10-131-0/+5
* Merge branch 'mget' of https://github.com/def-/Nim into def--mgetAraq2015-10-131-12/+17
|\
| * Rename mget to `[]`def2015-03-311-13/+18
* | add assert test to end of moduleJamesP2015-10-061-6/+9
* | bug fix #3416 add wrapper around `[]=` to account forJamesP2015-10-051-3/+6
* | lib/pure/p-t - Dropped 'T' from typespdw2015-06-041-4/+4
* | Rename clearStringTable to cleardef2015-03-171-2/+2
* | Rename resetStringTable to clearStringTabledef2015-03-171-1/+1
* | Make strtabs module usable when avoiding allocationsdef2015-03-171-0/+6
|/
* configuration system supports %= to access environment variablesAraq2015-02-071-1/+1
* compiler distinguishes between 2 different 'var' types for C++ interop; code ...Araq2015-02-071-1/+1
* more modules updatedAraq2014-08-281-18/+18
* big renameAraq2014-08-281-3/+3

                                                                                                 
                        
                             

                             
                            
                              













                                                                                                       
                                                  
                                                                                                                                                                                         
                                                                                           
                                                                                  


                                                        
                                           
                                                                                                                                                                                                                                                
                                                                                           

                                                                                                                                         


                                           
                                           
                                          
                                                                                                          
                                          
                                                                                                          
                                                                          


                                                                                                        
                                              
                                                            

                                                                                                
                                                                                                                                      





                                     
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Mu - counters.mu</title>
<meta name="Generator" content="Vim/7.4">
<meta name="plugin-version" content="vim7.4_v1">
<meta name="syntax" content="none">
<meta name="settings" content="use_css,pre_wrap,no_foldcolumn,expand_tabs,prevent_copy=">
<meta name="colorscheme" content="minimal">
<style type="text/css">
<!--
pre { white-space: pre-wrap; font-family: monospace; color: #eeeeee; background-color: #080808; }
body { font-family: monospace; color: #eeeeee; background-color: #080808; }
* { font-size: 1.05em; }
.muRecipe { color: #ff8700; }
.Comment { color: #9090ff; }
.Constant { color: #00a0a0; }
.Special { color: #ff6060; }
.muControl { color: #c0a020; }
-->
</style>

<script type='text/javascript'>
<!--

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="Comment"># example program: maintain multiple counters with isolated lexical scopes</span>
<span class="Comment"># (spaces)</span>

<span class="muRecipe">recipe</span> new-counter [
  <span class="Constant">default-space</span>:address:array:location<span class="Special"> &lt;- </span>new <span class="Constant">location:type</span>, <span class="Constant">30</span>
  n:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
  <span class="muControl">reply</span> <span class="Constant">default-space</span>
]

<span class="muRecipe">recipe</span> increment-counter [
  <span class="Constant">local-scope</span>
  <span class="Constant">0</span>:address:array:location/names:new-counter<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>  <span class="Comment"># setup outer space; it *must* come from 'new-counter'</span>
  x:number<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
  n:number/space:<span class="Constant">1</span><span class="Special"> &lt;- </span>add n:number/space:<span class="Constant">1</span>, x
  <span class="muControl">reply</span> n:number/space:<span class="Constant">1</span>
]

<span class="muRecipe">recipe</span> main [
  <span class="Constant">local-scope</span>
  <span class="Comment"># counter A</span>
  a:address:array:location<span class="Special"> &lt;- </span>new-counter <span class="Constant">34</span>
  <span class="Comment"># counter B</span>
  b:address:array:location<span class="Special"> &lt;- </span>new-counter <span class="Constant">23</span>
  <span class="Comment"># increment both by 2 but in different ways</span>
  increment-counter a, <span class="Constant">1</span>
  b-value:number<span class="Special"> &lt;- </span>increment-counter b, <span class="Constant">2</span>
  a-value:number<span class="Special"> &lt;- </span>increment-counter a, <span class="Constant">1</span>
  <span class="Comment"># check results</span>
  $print <span class="Constant">[Contents of counters</span>
<span class="Constant">]</span>
  <span class="Comment"># trailing space in next line is to help with syntax highlighting</span>
  $print <span class="Constant">[a: ]</span>, a-value, <span class="Constant">[ b: ]</span>, b-value, <span class="Constant">[ </span>
<span class="Constant">]</span>
]
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->