Lib

A utility table, holding miscellaneous functions and structures.

Summary
LibA utility table, holding miscellaneous functions and structures.
Functions
OrderedTableCreates a table that preserves order of key->value pairs as they’re entered.
do_errorA local function to output uniform error messages.
CheckInputDoes some input checking for sanity’s sake.

Functions

OrderedTable

function Lib.OrderedTable ()

Creates a table that preserves order of key->value pairs as they’re entered.  __call metamethod acts as iterator factory for purposes of traversing values.

Returns

A proxy table.

do_error

local function do_error (kind,
depth,
obj,
pos)

A local function to output uniform error messages.

Parameters

kindThe types that failed to match.
depthThe depth of the CheckInput call.
objThe object or property that received the bad input.
posIf this was an argument to a constructor, this is the argument’s position.

CheckInput

function Lib.CheckInput (check,
value,
kind,
depth,
obj,
pos)

Does some input checking for sanity’s sake.

Parameters

checkThe type of check to be done.
valueThe thing to check.
kindWhat said thing needs to be.
depthWhere in the stack the error is being called.
objThe object or function name receiving the input.
posIf this is a multiple argument call, this is the position of the argument.
function Lib.OrderedTable ()
Creates a table that preserves order of key->value pairs as they’re entered.
local function do_error (kind,
depth,
obj,
pos)
A local function to output uniform error messages.
function Lib.CheckInput (check,
value,
kind,
depth,
obj,
pos)
Does some input checking for sanity’s sake.
Close