开发者

I'm trying to implement factorial in an xml language

开发者 https://www.devze.com 2022-12-18 03:50 出处:网络
I\'m trying to implement factoria开发者_开发知识库l in the xml language of xcerion. <step id=\"fac\">

I'm trying to implement factoria开发者_开发知识库l in the xml language of xcerion.


     <step id="fac">
       <alias name="p" value="={$n}*{$p}" />
       <alias name="n" value="={$n}-1" />
       <operation name="decision">
         <when test="'{$n}'>'0'" step="fac" />
       </operation>
     </step>

     <alias name="p" value="1" />
     <alias name="n" value="4" />
     <operation name="call" value="fac" />

My code works, but I think it's a bit wordy.

How does this language compare with other xml languages?

Especially handling of variables, selection, loops and subroutine calling.

0

精彩评论

暂无评论...
验证码 换一张
取 消