6.1 – Basic Functions

The basic library provides core functions to Lua. If you do not include this library in your application, you should check carefully whether you need to provide implementations for some of its facilities.

getmetatable()
  • References/Lua/Lua/Standard Libraries/Basic Functions

getmetatable (object) If object does not have a metatable, returns nil. Otherwise, if the object's metatable has a __metatable field, returns

2025-01-10 15:47:30
tonumber()
  • References/Lua/Lua/Standard Libraries/Basic Functions

tonumber (e [, base]) When called with no base, tonumber tries to convert its argument to a number. If the argument is already a number or a string convertible

2025-01-10 15:47:30
dofile()
  • References/Lua/Lua/Standard Libraries/Basic Functions

dofile ([filename])dofilestdindofiledofile

2025-01-10 15:47:30
_VERSION
  • References/Lua/Lua/Standard Libraries/Basic Functions

_VERSION A global variable (not a function) that holds a string containing the running Lua version. The current value of this variable is "Lua 5.3".

2025-01-10 15:47:30
next()
  • References/Lua/Lua/Standard Libraries/Basic Functions

next (table [, index]) Allows a program to traverse all fields of a table. Its first argument is a table and its second argument is an index in this table. next returns

2025-01-10 15:47:30
rawget()
  • References/Lua/Lua/Standard Libraries/Basic Functions

rawget (table, index)table[index]__indextableindex

2025-01-10 15:47:30
pcall()
  • References/Lua/Lua/Standard Libraries/Basic Functions

pcall (f [, arg1, ···]) Calls function f with the given arguments in protected mode. This means that any error inside f is not propagated; instead

2025-01-10 15:47:30
print()
  • References/Lua/Lua/Standard Libraries/Basic Functions

print (···)stdouttostringprint

2025-01-10 15:47:30
rawlen()
  • References/Lua/Lua/Standard Libraries/Basic Functions

rawlen (v)v__len

2025-01-10 15:47:30
_G
  • References/Lua/Lua/Standard Libraries/Basic Functions

_G§2.2

2025-01-10 15:47:30