Lua from Other Languages: Difference between revisions

no edit summary
>Ozzypig
No edit summary
>TheDarkFireDragon
No edit summary
 
(10 intermediate revisions by 4 users not shown)
Line 14: Line 14:
===Differences===
===Differences===
* '''null''' is known as '''nil'''.
* '''null''' is known as '''nil'''.
* '''else if''' is combined into one keyword '''elseif'''
* Lua is dynamically typed (rather than statically), so you do not need to declare the type of variable before you can use it. You can change variables from being tables to numbers.
* Lua is dynamically typed (rather than statically), so you do not need to declare the type of variable before you can use it. You can change variables from being tables to numbers.
* Lua uses different arrays that are known as tables. Tables have numerical, string and table indexes. Strings in Lua are not tables.
* Lua uses different arrays that are known as tables. Tables have numerical, string and table indexes. Strings in Lua are not tables.
Line 20: Line 21:
* Lua does not use braces for opening and closing blocks of code. It uses the '''end''' statement.
* Lua does not use braces for opening and closing blocks of code. It uses the '''end''' statement.


<!--
==Lua from Python==
==Lua from Python==
===Similarities===
===Similarities===
===Differences===
===Differences===
 
More info at http://lua-users.org/wiki/LuaVersusPython
-->
==Lua from Haskell==
==Lua from Haskell==
===Similarities===
===Similarities===
Anonymous user