Cheat for newbies learning Lua

November 26, 2014

  1. Double brackets start and end multi-line strings.
  2. No
    1
    ++
    
    or
    1
    --
    
    type operators.
  3. 1
    ~=
    
    is not equals.
  4. Variables are global by default; call
    1
    local var
    
    to make a variable local.
  5. String concatenation uses
    1
    ..
    
    .
  6. Only
    1
    nil
    
    and
    1
    false
    
    are falsy.
    1
    0
    
    and ‘empty’
    1
    {}, ''
    
    are not false.
  7. Function is a return type.
  8. List is devided by
    1
    ,
    
    like
    1
    a, b, c
    
    .
  9. Assignment between lists mismatched in length is available; the sender fits into the reciever.
  10. Indices start at
    1
    1
    
    !!!!!
  11. A list can be seen as table with numeric index as the key.
  12. Oh my classes…