Changeset 2161 for trunk/kBuild/doc


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.

Location:
trunk/kBuild/doc
Files:
2 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>,
  • trunk/kBuild/doc/QuickReference-kmk.txt

    r2155 r2161  
    555555        $(value var)
    556556
    557     Evaluate ``text`` with ``var`` bound to each word in ``words``, and
     557    Evaluate ``body`` with ``var`` bound to each word in ``words``, and
    558558    concatenate the results (spaced)::
    559559
    560         $(foreach var,words,text)
     560        $(foreach var,words,body)
     561
     562    C-style for-loop. Start by evaluating ``init``. Each iteration will
     563    first check whether the ``condition`` (``kmk``-expression) is true,
     564    then expand ``body`` concatenating the result to the previous iterations
     565    (spaced), and finally evaluate ``next``::
     566
     567        $(for init,conditions,next,body)
     568
     569    C-style while-loop. Each iteration will check whether the ``condition``
     570    (``kmk``-expression) is true, then expand ``body`` concatenating the
     571    result to the previous iterations::
     572
     573        $(while conditions,body)
    561574
    562575    Evaluate the variable ``var`` replacing any references to ``$(1)``,
Note: See TracChangeset for help on using the changeset viewer.