summary refs log tree commit diff stats
Commit message (Expand)AuthorAgeFilesLines
...
* added license informationhut2010-01-0863-3/+888
* directory: fixed non reloading symlinked directorieshut2010-01-072-3/+3
* applications: fixed bad redirection of stdouthut2010-01-071-1/+1
* random cleanups and fixeshut2010-01-076-13/+15
* directory: fixed wrong mtime comparisonhut2010-01-071-2/+5
* loader: fixed some issues with updating/redrawinghut2010-01-064-64/+82
* updated TODOhut2010-01-061-0/+7
* loader: don't pop items from queue which were added while loadinghut2010-01-061-1/+1
* actions: added reload_cwd + keybinding + helphut2010-01-063-0/+9
* curses_shortcuts: catch TypeError at addstrhut2010-01-061-2/+2
* help: extendedhut2010-01-062-6/+28
* help: improvedhut2010-01-062-5/+3
* color: added docstringhut2010-01-062-2/+17
* colorscheme: clean uphut2010-01-061-33/+56
* pager/help: added help markuphut2010-01-055-9/+69
* help: extended + reformattedhut2010-01-052-45/+91
* help: extendedhut2010-01-051-14/+54
* pager: open and close it properlyhut2010-01-051-0/+2
* help: fixed typohut2010-01-051-1/+1
* actions: fixed import errorhut2010-01-051-1/+0
* help: implemented help framework, started writinghut2010-01-056-2/+93
* pager: added narg for move_horizontalhut2010-01-051-1/+7
* keyapi: fixed unwanted destructive operationhut2010-01-051-0/+1
* keyapi: a different approach to passing through typed numbershut2010-01-035-83/+116
* applications: clean uphut2010-01-031-10/+17
* actions: use inspect.cleandoc instead of a custom functionhut2010-01-032-32/+2
* applications: improved run function, catch errorshut2010-01-032-12/+32
* browser: fixed scrollinghut2010-01-022-2/+3
* new minor version v1.0.1hut2010-01-024-7/+7
* updated pydoc documentationhut2010-01-0248-788/+3167
* cleanupshut2010-01-027-11/+1
* pager: fixed unicode decode errorhut2010-01-011-4/+7
* actions: reversed default cylce order for search("size")hut2010-01-011-1/+1
* actions: fixed cyclinghut2010-01-012-3/+5
* keys: fixed key 'cs'hut2010-01-011-1/+1
* settings: corrected preview_files optionhut2010-01-012-2/+2
* pager: fixed G keyhut2010-01-011-1/+4
* random stuffhut2010-01-013-1/+9
* actions: fixed handling of unknown types at move_righthut2010-01-012-4/+6
* ui: redraw when marking/tags changehut2010-01-012-0/+12
* browser: corrected color taghut2010-01-011-1/+1
* commands: added grep commandhut2010-01-011-0/+17
* readme: updatedhut2010-01-011-4/+77
* actions: adjusted delete messagehut2010-01-011-1/+1
* browsercolumn: fixed redrawinghut2010-01-012-3/+9
* actions: adapted delete function to new notify systemhut2010-01-011-2/+1
* pager: fixed scrolling rangehut2010-01-011-2/+2
* keys: improved/fixed bindings for pagerhut2010-01-014-13/+28
* options: rearranged lineshut2010-01-011-8/+8
* taskview: fixed redrawinghut2010-01-011-26/+33
f='#n41'>41 42 43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77



                                                                                          
                               






                                                                                         

                                                                                                 
                        

                               
                            
                             
                            

                              










                               
                                                          
       

                                                                                                                                                                                                         

                         



                                                                                                                                                   

   

                                                                           



                                                                                         
                                                        





                                                                                                                            
                    

                                                                                  
                                                        
                                                                                 


                                                                                                                         
                                                                                    




                                                                               
 



                                     
<!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 - 062array.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; }
.muScenario { color: #00af00; }
.muRecipe { color: #ff8700; }
.Comment { color: #9090ff; }
.Constant { color: #00a0a0; }
.Special { color: #ff6060; }
.Delimiter { color: #a04060; }
.muControl { color: #c0a020; }
-->
</style>

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

-->
</script>
</head>
<body>
<pre id='vimCodeElement'>
<span class="muScenario">scenario</span> array-from-args [
  run [
    <span class="Constant">1</span>:address:array:location<span class="Special"> &lt;- </span>new-array <span class="Constant">0</span>, <span class="Constant">1</span>, <span class="Constant">2</span>
    <span class="Constant">2</span>:array:location<span class="Special"> &lt;- </span>copy *<span class="Constant">1</span>:address:array:location
  ]
  memory-should-contain [
    <span class="Constant">2</span><span class="Special"> &lt;- </span><span class="Constant">3</span>  <span class="Comment"># array length</span>
    <span class="Constant">3</span><span class="Special"> &lt;- </span><span class="Constant">0</span>
    <span class="Constant">4</span><span class="Special"> &lt;- </span><span class="Constant">1</span>
    <span class="Constant">5</span><span class="Special"> &lt;- </span><span class="Constant">2</span>
  ]
]

<span class="Comment"># create an array out of a list of scalar args</span>
<span class="muRecipe">recipe</span> new-array [
  <span class="Constant">local-scope</span>
  capacity:number<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
  <span class="Delimiter">{</span>
    <span class="Comment"># while read curr-value</span>
    curr-value:location, exists?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
    <span class="muControl">break-unless</span> exists?
    capacity<span class="Special"> &lt;- </span>add capacity, <span class="Constant">1</span>
    <span class="muControl">loop</span>
  <span class="Delimiter">}</span>
  result:address:array:location<span class="Special"> &lt;- </span>new <span class="Constant">location:type</span>, capacity
  rewind-ingredients
  i:number<span class="Special"> &lt;- </span>copy <span class="Constant">0</span>
  <span class="Delimiter">{</span>
    <span class="Comment"># while read curr-value</span>
    done?:boolean<span class="Special"> &lt;- </span>greater-or-equal i, capacity
    <span class="muControl">break-if</span> done?
    curr-value:location, exists?:boolean<span class="Special"> &lt;- </span><span class="Constant">next-ingredient</span>
    assert exists?, <span class="Constant">[error in rewinding ingredients to new-array]</span>
    tmp:address:location<span class="Special"> &lt;- </span>index-address *result, i
    *tmp<span class="Special"> &lt;- </span>copy curr-value
    i<span class="Special"> &lt;- </span>add i, <span class="Constant">1</span>
    <span class="muControl">loop</span>
  <span class="Delimiter">}</span>
  <span class="muControl">reply</span> result
]
</pre>
</body>
</html>
<!-- vim: set foldmethod=manual : -->