Skip to Content
Lua Quick Start Guide
book

Lua Quick Start Guide

by Gabor Szauer
July 2018
Beginner
202 pages
5h 42m
English
Packt Publishing
Content preview from Lua Quick Start Guide

Other operators

There are a few miscellaneous meta methods that might be useful. These misc meta methods are mainly focused around string-like operations:

  • __tostring: Expected to return a string representation of a table. Takes a single argument, the table being converted to a string.
  • __len: Expected to return the length of the table when writing #table. Takes a single argument, the table whose length we are trying to find.
  • __concat: Expected to concatenate two tables when writing table1 .. table2. This function does not have to return a string, but for the sake of consistency it probably should. This function takes two arguments, the tables being concatenated.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Beginning Lua Programming

Beginning Lua Programming

Kurt Jung, Aaron Brown
Vim Masterclass

Vim Masterclass

Jason Cannon

Publisher Resources

ISBN: 9781789343229Supplemental Content