(file) Return to fibonacci-recursion.xml CVS log (file) (dir) Up to [pingdynasty] / ObjectBox / examples

File: [pingdynasty] / ObjectBox / examples / fibonacci-recursion.xml (download) / (as text)
Revision: 1.4, Fri Feb 23 11:57:42 2007 UTC (3 years, 6 months ago) by mars
Branch: MAIN
CVS Tags: version-1-1-7, version-1-1-6, HEAD
Changes since 1.3: +12 -14 lines
updated examples

<?xml version="1.0"?>
<o:program xmlns:o="http://www.o-xml.org/lang/">

  <o:function name="fib">
    <o:param name="n"/>
    <o:do>
      <o:if test="$n &lt;= 1"><o:return select="1"/></o:if>
      <o:log msg="{$n}"/>
      <fib><o:eval select="fib($n - 1) + fib($n - 2)"/></fib>
    </o:do>
  </o:function>

  <fibonacci>
    <o:eval select="fib(20)"/>
<!--     <o:for-each name="i" to="21"> -->
<!--       <o:log msg="{$i} {fib($i)}"/> -->
<!--       <number index="{$i}"><o:eval select="fib($i)"/></number> -->
<!--     </o:for-each> -->
  </fibonacci>
    
</o:program>

Email CVS Admin
Powered by
ViewCVS 0.9.3