comparison website/src/diff.html.luan @ 1092:a26fbde7ee28

documentation
author Franklin Schmidt <fschmidt@gmail.com>
date Sun, 08 Jan 2017 17:23:06 -0700
parents 616761e0b9f6
children 5dbb552075ff
comparison
equal deleted inserted replaced
1091:20d5968e65cc 1092:a26fbde7ee28
130 <p> 130 <p>
131 By default, there are no global variables and an undefined variable produces a compile error. To enable global variables, one must define <code>_ENV</code>. Avoiding global variables makes it much easier to catch errors at compile time. 131 By default, there are no global variables and an undefined variable produces a compile error. To enable global variables, one must define <code>_ENV</code>. Avoiding global variables makes it much easier to catch errors at compile time.
132 132
133 <h3 heading><a name="stmt">Statements</a></h3> 133 <h3 heading><a name="stmt">Statements</a></h3>
134 134
135 <p>Luan adds the block terminators <b>end_do</b>, <b>end_for</b>, <b>end_function</b>, <b>end_if</b>, and <b>end_while</b>. These can be used to end the appropriate block type, but <b>end</b> can also be used to end any block.</p>
136
135 <p>Most statements in Luan are the same as Lua. Only those statements that differ will be listed here.</p> 137 <p>Most statements in Luan are the same as Lua. Only those statements that differ will be listed here.</p>
136 138
137 <h4 heading><a name="control">Control Structures</a></h4> 139 <h4 heading><a name="control">Control Structures</a></h4>
138 140
139 <p>The Luan <b>if</b>, <b>while</b>, and <b>repeat</b> statement are the same as in Lua except that the condition expression must return a boolean value. Any other value type will produce an error. This helps catch errors and makes code more readable.</p> 141 <p>The Luan <b>if</b>, <b>while</b>, and <b>repeat</b> statement are the same as in Lua except that the condition expression must return a boolean value. Any other value type will produce an error. This helps catch errors and makes code more readable.</p>