File utils/tableutil.lua

Functions

tableutil.clone (table) Performs a deep/recursive clone on the given table.
tableutil.swapped_reindex2d (data, new_x, new_y) Reindexes the given 2d array/table, swapping the two dimensions.
tableutil.swapped_reindex3d (data, new_x, new_y, new_z) Reindexes the given 3d array/table, swapping the two dimensions.
tableutil.to_string (table, indent) Returns the string representation of the given table.


Functions

tableutil.clone (table)
Performs a deep/recursive clone on the given table.

Parameters

  • table: The table to deep clone.

Return value:

The clone of the table.
tableutil.swapped_reindex2d (data, new_x, new_y)
Reindexes the given 2d array/table, swapping the two dimensions.

Parameters

  • data: The array/table to reindex.
  • new_x: The new startpoint for the first dimension.
  • new_y: The new startpoint for the second dimension.

Return value:

The reindexed data.
tableutil.swapped_reindex3d (data, new_x, new_y, new_z)
Reindexes the given 3d array/table, swapping the two dimensions.

Parameters

  • data: The array/table to reindex.
  • new_x: The new startpoint for the first dimension.
  • new_y: The new startpoint for the second dimension.
  • new_z: The new startpoint for the third dimension.

Return value:

The reindexed data.
tableutil.to_string (table, indent)
Returns the string representation of the given table.

Parameters

  • table: The table.
  • indent: Optional. The number of spaces of indentation.

Return value:

The string representation of the given table.

Valid XHTML 1.0!