Changes between Version 2 and Version 3 of documentation/LuaManual/PythonDifferences

Show
Ignore:
Author:
gambini (IP: 75.131.38.166)
Timestamp:
06/09/12 06:47:55 (5 years ago)
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • documentation/LuaManual/PythonDifferences

    v2 v3  
    88 
    99== Semantics/Syntax == 
    10 Of course, Lua is going to look different from Python because of how the language is written. Where Python  uses the 'dot' notation for both calling functions and property access, it is different for Lua. Method calls in Lua use the 'colon' notation, and property access is done with the 'dot' notation. When looking at the [wiki:documentation/LuaManual/APIReference API reference], almost everything is called from an actual object. Exceptions to that rule are constructors (''new''), ''Element.As'', ''Log'', ''DocumentFocus'', and the ''rocket'' table
     10Of course, Lua is going to look different from Python because of how the language is written. Where Python  uses the 'dot' notation for both calling functions and property access, it is different for Lua. Method calls in Lua use the 'colon' notation, and property access is done with the 'dot' notation. When looking at the [wiki:documentation/LuaManual/APIReference API reference], almost everything is called from an actual object. Exceptions to that rule are constructors (''new''), ''Element.As'', ''Log'', and ''DocumentFocus''
    1111 
    1212Again, referencing the [wiki:documentation/LuaManual/APIReference API reference], anything with a type to the left is a method and is called with the 'colon' notation from an object. Example, defining an inline event: `onclick="document:Focus()"`. Anything in the API reference with NO type to the left, and a type in parenthesis to the right is a property and will be called with the 'dot' notation from an object. Building on the previous example defining an inline event: `onclick="document:Focus() print(element.id)"`