Lua Programming/How to Lua/operator

      The lua programming language provides a series of operators that allow values and variables to be compared, evaluated or manipulated. These operators can combined together with values and variables to make expressions. The operators may take unary, dyadic or ternary form, depending on the number of operands that they utilize.

      Assignment Operator

      As within most other programming languages, the equals sign acts as a dyadic operator, assigning the value of the expression of the right hand operand to the variable named by the left operand.

      ↑Jump back a section

      Arithmetic operators

      • arithmetic operators

      The lua programming language provides a standard set of arithmetic operators for manipulating integer and floating point numbers.

      ↑Jump back a section

      String operators

      • string operators
      ↑Jump back a section

      Logical operators

      • logical operators

      The logical operators are used to perform boolean operations, returning either true or false.

      ↑Jump back a section

      Bitwise operators

      • bitwise operators

      The bitwise operators are used to perform manipulation of binary numbers.

      ↑Jump back a section

      Nudge operators

      The lua programming language does not support the plusplus or dashdash increment or decrement operators. The dashdash symbol is interpreted as a comment marker in lua.

      ↑Jump back a section

      Comparative operators

      • comparative operators
      ↑Jump back a section

      Regular expression operators

      • regular expression operators
      ↑Jump back a section

      Numeric operators

      • numeric operator
      ↑Jump back a section

      Comma operator

      • comma
      ↑Jump back a section

      Relationship operators

      • relationship operators
      ↑Jump back a section

      Reference operators

      • reference operator
      ↑Jump back a section

      Dereference operators

      • dereference operator
      ↑Jump back a section

      Arrow operator

      • arrow operator
      ↑Jump back a section

      Length operator

      In lua, the hash symbol acts as a length operator.

      ↑Jump back a section

      Combination assignment operators

      The lua programming language does not support the combination assignment operators.

      ↑Jump back a section

      Ternary operators

      • ternary operator
      ↑Jump back a section

      Scope resolution

      The percent symbol can be used as a prefix operator enabling a variable within the scope of a function to be referenced from its containing outer function.


      precedence

      brackets

      ↑Jump back a section
      Last modified on 11 February 2011, at 00:28