Ignore:
Timestamp:
Dec 29, 2008, 11:20:11 PM (17 years ago)
Author:
bird
Message:

kmk: Implemented $(for ) and $(while ) loops (C-style). Fixes #73.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/kBuild/doc/QuickReference-kmk.html

    r2155 r2161  
    913913$(value var)
    914914</pre>
    915 <p>Evaluate <tt class="docutils literal"><span class="pre">text</span></tt> with <tt class="docutils literal"><span class="pre">var</span></tt> bound to each word in <tt class="docutils literal"><span class="pre">words</span></tt>, and
     915<p>Evaluate <tt class="docutils literal"><span class="pre">body</span></tt> with <tt class="docutils literal"><span class="pre">var</span></tt> bound to each word in <tt class="docutils literal"><span class="pre">words</span></tt>, and
    916916concatenate the results (spaced):</p>
    917917<pre class="literal-block">
    918 $(foreach var,words,text)
     918$(foreach var,words,body)
     919</pre>
     920<p>C-style for-loop. Start by evaluating <tt class="docutils literal"><span class="pre">init</span></tt>. Each iteration will
     921first check whether the <tt class="docutils literal"><span class="pre">condition</span></tt> (<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) is true,
     922then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the result to the previous iterations
     923(spaced), and finally evaluate <tt class="docutils literal"><span class="pre">next</span></tt>:</p>
     924<pre class="literal-block">
     925$(for init,conditions,next,body)
     926</pre>
     927<p>C-style while-loop. Each iteration will check whether the <tt class="docutils literal"><span class="pre">condition</span></tt>
     928(<tt class="docutils literal"><span class="pre">kmk</span></tt>-expression) is true, then expand <tt class="docutils literal"><span class="pre">body</span></tt> concatenating the
     929result to the previous iterations:</p>
     930<pre class="literal-block">
     931$(while conditions,body)
    919932</pre>
    920933<p>Evaluate the variable <tt class="docutils literal"><span class="pre">var</span></tt> replacing any references to <tt class="docutils literal"><span class="pre">$(1)</span></tt>,
Note: See TracChangeset for help on using the changeset viewer.