*** empty log message ***
[m17n/m17n-lib-cs.git] / xex.xml
1 <?xml version='1.0'?>
2 <expr xmlns="http://www.m17n.org/MIM">
3   <defun fname="factorial">
4     <args><fixed vname="x"/></args>
5     <if><lt><varref vname="x"/><integer>2</integer></lt>
6       <varref vname="x"/>
7       <mul>
8         <varref vname="x"/>
9         <funcall fname="factorial">
10           <sub vname="x"><integer>1</integer></sub>
11         </funcall>
12       </mul>
13     </if>
14   </defun>
15
16   <defun fname="temp">
17     <set vname="y"><varref vname="SELECT"/></set>
18     <varref vname="y"/>
19   </defun>
20
21   <defun fname="looptest">
22     <args-unevalled><fixed vname="l"/></args-unevalled>
23     <loop><loop>
24       <foreach vname="term"><varref vname="l"/>
25         <eval><varref vname="term"/></eval>
26       </foreach>
27     </loop></loop>
28     <symbol>looptest-finished</symbol>
29   </defun>
30
31   <set vname="x"><integer>10</integer></set>
32   <set vname="str"><string>ABC</string></set>
33   <append>
34     <catch><symbol>tag</symbol>
35       <funcall fname="looptest">
36         <list>
37           <set vname="i"><integer>0</integer></set>
38           <throw><symbol>tag</symbol><symbol>returned</symbol></throw>
39           <add vname="i"><integer>1</integer></add>
40           <varref vname="i"/>
41         </list>
42       </funcall>
43     </catch>
44     <funcall fname="factorial"><varref vname="x"/></funcall>
45     <ins vname="str"><integer>1</integer><string>123</string></ins>
46     <del vname="str"><integer>2</integer><integer>4</integer></del>
47     <cond>
48       <list><gt><integer>0</integer><integer>1</integer></gt>
49         <string>1st</string></list>
50       <list><integer>1</integer>
51         <string>2nd</string></list>
52     </cond>
53     <foreach vname="a">
54       <list><integer>10</integer><integer>11</integer></list>
55       <funcall fname="add" vname="x"><varref vname="a"/></funcall>
56     </foreach>
57     <varref vname="x"/>
58     <eval><varref vname="x"/></eval>
59     <eval>
60       <eval>
61         <quote><add><varref vname="x"/><integer>1</integer></add></quote>
62       </eval>
63     </eval>
64     <concat><integer>?a</integer><integer>?b</integer></concat>
65     <quote><add><varref vname="x"/><integer>1</integer></add></quote>
66     <set vname="SELECT"><integer>11</integer></set>
67     <temp/>
68   </append>
69 </expr>