Mercurial Hosting > luan
annotate website/src/diff.html.luan @ 629:35dde32c02ab 0.15
change String.matches()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 18 Jan 2016 23:07:52 -0700 |
parents | b73f005f3735 |
children | 1e4b0bc0202d |
rev | line source |
---|---|
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
1 local Io = require "luan:Io" |
494
2b9bc97f0439
change luan:web to luan:http
Franklin Schmidt <fschmidt@gmail.com>
parents:
483
diff
changeset
|
2 local Http = require "luan:http/Http" |
387
23d075ce1e48
add website/src/Shared.luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
386
diff
changeset
|
3 local Shared = require "site:/Shared" |
353 | 4 |
503 | 5 |
505
7bc63886d4f2
web page modules now return a function
Franklin Schmidt <fschmidt@gmail.com>
parents:
503
diff
changeset
|
6 return function() |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
7 Io.stdout = Http.response.text_writer() |
391
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
8 %> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
9 <html> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
10 <head> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
11 <title>How Luan differs from Lua</title> |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
12 <style> |
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
13 @import "/site.css"; |
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
14 </style> |
391
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
15 </head> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
16 <body> |
353 | 17 |
387
23d075ce1e48
add website/src/Shared.luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
386
diff
changeset
|
18 <% Shared.header() %> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
19 <h1>How Luan differs from Lua</h1> |
353 | 20 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
21 <p>This document explains how Luan differs from <a href="http://www.lua.org">Lua</a> as described in the <a href="http://www.lua.org/manual/5.3/">Lua 5.3 Reference Manual</a>.</p> |
372 | 22 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
23 <hr/> |
353 | 24 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
25 <h2>Contents</h2> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
26 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
27 <div contents><a href="#intro">Introduction</a></div> |
353 | 28 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
29 <div contents> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
30 <a href="#basic">Basic Concepts</a> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
31 <ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
32 <li><a href="#types">Values and Types</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
33 <li><a href="#env">Environments</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
34 <li><a href="#error">Error Handling</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
35 <li><a href="#meta">Metatables and Metamethods</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
36 <li><a href="#gc">Garbage Collection</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
37 <li><a href="#coroutines">Coroutines</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
38 </ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
39 </div> |
353 | 40 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
41 <div contents> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
42 <a href="#lang">The Language</a> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
43 <ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
44 <li><a href="#lex">Lexical Conventions</a></li> |
512
d96944467ffc
update documentation for luan changes
Franklin Schmidt <fschmidt@gmail.com>
parents:
505
diff
changeset
|
45 <li><a href="#vars">Variables</a></li> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
46 <li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
47 <a href="#stmt">Statements</a> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
48 <ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
49 <li><a href="#control">Control Structures</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
50 <li><a href="#for">For Statement</a></li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
51 <li><a href="#logical">Logical Statements</a></li> |
465 | 52 <li><a href="#template_stmt">Template Statements</a></li> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
53 </ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
54 </li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
55 <li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
56 <a href="#expr">Expressions</a> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
57 <ul> |
465 | 58 <li><a href="#conversions">Coercions and Conversions</a></li> |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
59 <li><a href="#bit">Bitwise Operators</a></li> |
465 | 60 <li><a href="#logical_ops">Logical Operators</a></li> |
61 <li><a href="#concatenation">Concatenation</a></li> | |
62 <li><a href="#fn_calls">Function Calls</a></li> | |
63 <li><a href="#template_expr">Template Expressions</a></li> | |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
64 </ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
65 </li> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
66 </ul> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
67 </div> |
353 | 68 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
69 <hr/> |
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
70 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
71 <h2 heading><a name="intro">Introduction</a></h2> |
372 | 72 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
73 <p>Lua is one of the simplest languages available, but Luan is even simpler. This means Luan removes more than it adds. Most of what is added is added in the library, not in the language itself.</p> |
353 | 74 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
75 <p>Luan is implemented in Java and is tightly integrated with Java. This makes it an excellent scripting language for Java.</p> |
353 | 76 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
77 <h2 heading><a name="basic">Basic Concepts</a></h2> |
353 | 78 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
79 <h3 heading><a name="types">Values and Types</a></h3> |
353 | 80 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
81 <p>Luan does not have the Lua <em>thread</em> type. Luan adds a <em>binary</em> type that Lua doesn't have. This is because Lua strings can represent binary while Luan strings cannot.</p> |
353 | 82 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
83 <p>The Luan <em>Nil</em> type is implemented as the Java <em>null</em>. The Luan <em>Boolean</em> type is implemented as the Java <em>Boolean</em> type. The Luan <em>Number</em> type is implemented as the Java <em>Number</em> type. The Luan <em>String</em> type is implemented as the Java <em>String</em> type. Actual numbers may be any subclass of the Java <em>Number</em> class.</p> |
353 | 84 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
85 <p>Luan functions may be written in Luan or may be wrappers around native Java methods. Any Java method may be called as a Luan function.</p> |
353 | 86 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
87 <p>The Luan <em>java</em> type is a replacement for Lua's <em>userdata</em>. A Luan <em>java</em> value is nothing more than a Java object that doesn't fall into one of the other recognized types.</p> |
353 | 88 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
89 <p>The Luan <em>binary</em> type is the Java <em>byte[ ]</em> type which is an array of bytes.</p> |
353 | 90 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
91 <p>The Luan <em>table</em> type is just like its Lua equivalent, but implemented in Java.</p> |
353 | 92 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
93 <h3 heading><a name="env">Environments</a></h3> |
353 | 94 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
95 <p>Luan has no global environment at all, no <code>_G</code>. By default, Luan doesn't define <code>_ENV</code> either, but if you define it as a local table in a chunk, then it acts like it does in Lua. When <code>_ENV</code> isn't defined, there are no global variables and an unrecognized variable name produces a compile error.</p> |
353 | 96 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
97 <p>Every module is initialized with two local functions: <code>require</code> and <code>java</code>. The module then uses these functions to get access to whatever else it needs.</p> |
353 | 98 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
99 <h3 heading><a name="error">Error Handling</a></h3> |
353 | 100 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
101 <p>Luan has the functions <code>error</code> and <code>pcall</code> but does not have <code>xpcall</code>. Luan adds the function <code>try</code> which looks and acts like try-catch blocks in other languages. Luan errors are implemented as an error table, not as a message object.</p> |
353 | 102 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
103 <h3 heading><a name="meta">Metatables and Metamethods</a></h3> |
353 | 104 |
465 | 105 <p>Luan only has metatable for tables, not for other types.</p> |
353 | 106 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
107 <h3 heading><a name="gc">Garbage Collection</a></h3> |
353 | 108 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
109 <p>Luan uses Java garbage collection. Luan has no special garbage collection methods.</p> |
353 | 110 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
111 <p>Luan does not yet have weak tables but this will be added.</p> |
353 | 112 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
113 <h3 heading><a name="coroutines">Coroutines</a></h3> |
353 | 114 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
115 <p>Luan does not have coroutines. Coroutines is a complex concept that isn't needed in a simple language, so it was left out.</p> |
353 | 116 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
117 <h2 heading><a name="lang">The Language</a></h2> |
353 | 118 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
119 <h3 heading><a name="lex">Lexical Conventions</a></h3> |
353 | 120 |
604
b73f005f3735
table constructor now uses end_of_line as a delimiter
Franklin Schmidt <fschmidt@gmail.com>
parents:
562
diff
changeset
|
121 <p>Unlike Lua, Luan generally considers the end of a line to be the end of a statement. This catches errors and encourages readability. The exception to this is in paranthesis <em>(...)</em> where the end of line is treated as white space.</p> |
353 | 122 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
123 <p>Luan has exactly the same set of keywords as Lua and has the same other lexical conventions.</p> |
353 | 124 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
125 <h3 heading><a name="vars">Variables</a></h3> |
512
d96944467ffc
update documentation for luan changes
Franklin Schmidt <fschmidt@gmail.com>
parents:
505
diff
changeset
|
126 |
d96944467ffc
update documentation for luan changes
Franklin Schmidt <fschmidt@gmail.com>
parents:
505
diff
changeset
|
127 <p> |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
128 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. |
512
d96944467ffc
update documentation for luan changes
Franklin Schmidt <fschmidt@gmail.com>
parents:
505
diff
changeset
|
129 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
130 <h3 heading><a name="stmt">Statements</a></h3> |
353 | 131 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
132 <p>Most statements in Luan are the same as Lua. Only those statements that differ will be listed here.</p> |
353 | 133 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
134 <h4 heading><a name="control">Control Structures</a></h4> |
353 | 135 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
136 <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> |
353 | 137 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
138 <p>Luan does not have a <b>goto</b> statement.</p> |
353 | 139 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
140 <h4 heading><a name="for">For Statement</a></h4> |
353 | 141 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
142 <p>Luan has no numeric <b>for</b> statement. Luan only has generic <b>for</b> statement. Instead of the numeric <b>for</b> statement, Luan uses the <code>range</code> function in a generic <b>for</b> statement like this:</p> |
353 | 143 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
144 <pre> |
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
145 for i in range(from,to,step) do <em>block</em> end |
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
146 </pre> |
353 | 147 |
468 | 148 <p>The Luan generic <b>for</b> statement is simpler than the Lua version because Luan only uses an expression, not an explist. So a <b>for</b> statement like:</p> |
353 | 149 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
150 <pre> |
390 | 151 for var_1, ···, var_n in exp do block end |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
152 </pre> |
353 | 153 |
389 | 154 <p>is equivalent to the code:</p> |
353 | 155 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
156 <pre> |
353 | 157 do |
158 local f = exp | |
159 while true do | |
390 | 160 local var_1, ···, var_n = f() |
353 | 161 if var_1 == nil then break end |
162 block | |
163 end | |
164 end | |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
165 </pre> |
353 | 166 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
167 <h4 heading><a name="logical">Logical Statements</a></h4> |
353 | 168 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
169 <p>Unlike Lua, Luan allows <b>or</b> and <b>and</b> expressions to be stand-alone statements. This is useful in cases like this:</p> |
353 | 170 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
171 <pre> |
353 | 172 x==5 or error "x should be 5" |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
173 </pre> |
353 | 174 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
175 <h4 heading><a name="template_stmt">Template Statements</a></h4> |
367 | 176 |
465 | 177 <p>Template statements are a Luan addition that don't exist in Lua. See <a href="manual.html#template_stmt">Template Statements</a> in the Luan Reference Manual.</p> |
367 | 178 |
179 | |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
180 <h3 heading><a name="expr">Expressions</a></h3> |
367 | 181 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
182 <h4 heading><a name="conversions">Coercions and Conversions</a></h4> |
465 | 183 |
184 <p>Unlike Lua, Luan does not do automatic conversions of strings to numbers.</p> | |
185 | |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
186 <h4 heading><a name="bit">Bitwise Operators</a></h4> |
367 | 187 |
465 | 188 <p>Bitwise operators appear to be a new addition to Lua 5.3 and didn't exist in Lua 5.2. Luan does not support bitwise operators, but these can be added if there is a need.</p> |
367 | 189 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
190 <h4 heading><a name="logical_ops">Logical Operators</a></h4> |
367 | 191 |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
192 <p>The only change in Luan is that <b>not</b> must take a boolean argument. This helps catch errors and makes code more readable.</p> |
367 | 193 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
194 <h4 heading><a name="concatenation">Concatenation</a></h4> |
465 | 195 |
196 <p>Unlike Lua, Luan converts all concatenation operands to strings. | |
197 | |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
198 <h4 heading><a name="fn_calls">Function Calls</a></h4> |
367 | 199 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
200 <p>Luan does not support Lua's <code>v:name(args)</code> style object-oriented function call. Object oriented programming is done in Luan using closures, so this feature is not needed.</p> |
367 | 201 |
562
7cc9d4a53d3b
remove SimplyHTML from documentation
Franklin Schmidt <fschmidt@gmail.com>
parents:
513
diff
changeset
|
202 <h4 heading><a name="template_expr">Template Expressions</a></h4> |
367 | 203 |
465 | 204 <p>Template expressions are a Luan addition that don't exist in Lua. See <a href="manual.html#template_expr">Template Expressions</a> in the Luan Reference Manual.</p> |
353 | 205 |
391
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
206 </body> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
207 </html> |
2f5cc9c2cbf0
replace Html.simply_html_page with simply_html_head and simply_html_body_bottom
Franklin Schmidt <fschmidt@gmail.com>
parents:
390
diff
changeset
|
208 <% |
386
db23f654f87d
make all of website use luan
Franklin Schmidt <fschmidt@gmail.com>
parents:
372
diff
changeset
|
209 end |