Difference between revisions of "Category:Standard Library"

From Inspired-Lua Wiki
Jump to navigation Jump to search
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
 
( This has been taken from [http://www.wowwiki.com/Lua_functions a WoWWiki page] - See the full, official documentation [http://www.lua.org/manual/5.1/manual.html here] )
 
( This has been taken from [http://www.wowwiki.com/Lua_functions a WoWWiki page] - See the full, official documentation [http://www.lua.org/manual/5.1/manual.html here] )
  
*'''_G''' - Global Variable - A global variable (not a function) that holds the global environment (that is, _G._G = _G). Lua itself does not use this variable; changing its value does not affect any environment, nor vice-versa. (Use setfenv to change environments.)  - taken from Lua docs
+
*'''[[_G]]''' - Global Variable - A global variable (not a function) that holds the global environment (that is, _G._G = _G). Lua itself does not use this variable; changing its value does not affect any environment, nor vice-versa. (Use setfenv to change environments.)  - taken from Lua docs
  
*'''assert'''(value[, errormsg]) - asserts a value evaluates to true. If it is, returns value, otherwise causes a Lua error to be thrown.
+
*'''[[assert]]'''(value[, errormsg]) - asserts a value evaluates to true. If it is, returns value, otherwise causes a Lua error to be thrown.
  
*'''getfenv'''(function or integer) - Returns the table representing the stack frame of the given function or stack level.
+
*'''[[getfenv]]'''(function or integer) - Returns the table representing the stack frame of the given function or stack level.
  
*'''getmetatable'''(obj, mtable) - Returns the metatable of the given table or userdata object.
+
*'''[[getmetatable]]'''(obj, mtable) - Returns the metatable of the given table or userdata object.
  
*'''next'''(table, index) - Returns the next key, value pair of the table, allowing you to walk over the table.
+
*'''[[next]]'''(table, index) - Returns the next key, value pair of the table, allowing you to walk over the table.
  
*'''newproxy'''(boolean or proxy) - Creates a userdata with a sharable metatable.
+
*'''[[newproxy]]'''(boolean or proxy) - Creates a userdata with a sharable metatable.
  
*'''print''' - print (···) - Receives any number of arguments, and prints their values to stdout, using the tostring function to convert them to strings. print is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted output, use string.format.  - taken from Lua Docs
+
*'''[[print]]''' - print (···) - Receives any number of arguments, and prints their values to stdout, using the tostring function to convert them to strings. print is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted output, use string.format.  - taken from Lua Docs
  
*'''select'''(index, list) - Returns the number of items in list or the value of the item in list at index.
+
*'''[[select]]'''(index, list) - Returns the number of items in list or the value of the item in list at index.
  
*'''setfenv'''(function or integer, table) - Sets the table representing the stack frame of the given function or stack level.
+
*'''[[setfenv]]'''(function or integer, table) - Sets the table representing the stack frame of the given function or stack level.
  
*'''setmetatable'''(obj, mtable) - Sets the metatable of the given table or userdata object.
+
*'''[[setmetatable]]'''(obj, mtable) - Sets the metatable of the given table or userdata object.
  
*'''tostring''' - tostring (e) - Receives an argument of any type and converts it to a string in a reasonable format. For complete control of how numbers are converted, use string.format. If the metatable of e has a "__tostring" field, then tostring calls the corresponding value with e as argument, and uses the result of the call as its result. - taken from Lua Docs.
+
*'''[[tostring]]''' - tostring (e) - Receives an argument of any type and converts it to a string in a reasonable format. For complete control of how numbers are converted, use string.format. If the metatable of e has a "__tostring" field, then tostring calls the corresponding value with e as argument, and uses the result of the call as its result. - taken from Lua Docs.
  
*'''type'''(var) - Returns the type of variable as a string, "number", "string", "table", "function" or "userdata".
+
*'''[[type]]'''(var) - Returns the type of variable as a string, "number", "string", "table", "function" or "userdata".
  
*'''unpack'''(table[, start][, end]) - Returns the contents of its argument as separate values.
+
*'''[[unpack]]'''(table[, start][, end]) - Returns the contents of its argument as separate values.
  
*'''xpcall'''(func, err) - Returns a boolean indicating successful execution of func and calls err on failure, additionally returning func's or err's results.
+
*'''[[xpcall]]'''(func, err) - Returns a boolean indicating successful execution of func and calls err on failure, additionally returning func's or err's results.

Latest revision as of 12:14, 24 May 2011

( This has been taken from a WoWWiki page - See the full, official documentation here )

  • _G - Global Variable - A global variable (not a function) that holds the global environment (that is, _G._G = _G). Lua itself does not use this variable; changing its value does not affect any environment, nor vice-versa. (Use setfenv to change environments.) - taken from Lua docs
  • assert(value[, errormsg]) - asserts a value evaluates to true. If it is, returns value, otherwise causes a Lua error to be thrown.
  • getfenv(function or integer) - Returns the table representing the stack frame of the given function or stack level.
  • getmetatable(obj, mtable) - Returns the metatable of the given table or userdata object.
  • next(table, index) - Returns the next key, value pair of the table, allowing you to walk over the table.
  • newproxy(boolean or proxy) - Creates a userdata with a sharable metatable.
  • print - print (···) - Receives any number of arguments, and prints their values to stdout, using the tostring function to convert them to strings. print is not intended for formatted output, but only as a quick way to show a value, typically for debugging. For formatted output, use string.format. - taken from Lua Docs
  • select(index, list) - Returns the number of items in list or the value of the item in list at index.
  • setfenv(function or integer, table) - Sets the table representing the stack frame of the given function or stack level.
  • setmetatable(obj, mtable) - Sets the metatable of the given table or userdata object.
  • tostring - tostring (e) - Receives an argument of any type and converts it to a string in a reasonable format. For complete control of how numbers are converted, use string.format. If the metatable of e has a "__tostring" field, then tostring calls the corresponding value with e as argument, and uses the result of the call as its result. - taken from Lua Docs.
  • type(var) - Returns the type of variable as a string, "number", "string", "table", "function" or "userdata".
  • unpack(table[, start][, end]) - Returns the contents of its argument as separate values.
  • xpcall(func, err) - Returns a boolean indicating successful execution of func and calls err on failure, additionally returning func's or err's results.

This category currently contains no pages or media.