Lua from Other Languages: Difference between revisions

no edit summary
>Myrkos
No edit summary
>TheDarkFireDragon
No edit summary
 
(7 intermediate revisions by 3 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.
* Lua has no headers, and there is no function to start the code. It all begins from the top and ends at the bottom.
* Lua has no headers, and there is no function to start the code. It all begins from the top and ends at the bottom.
* Lua is embedded into host/parent applications. The compilation process is done on-the-fly, and you cannot get stand-alone executables from Lua.
* Lua is embedded into host/parent applications. The compilation process is done on-the-fly, and you cannot get stand-alone executables from Lua.
* Lua does not use braces for opening and closing blocks of code. It uses the '''do''' and '''end''' (loops) or '''then''' and '''end''' (if) statements.
* 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