Module table.extra

Table manipulation and transformation functions.

Info:

  • Release: $Id: extra.lua,v 1.16 2017/02/22 18:37:20 tomas Exp $

Functions

fullconcat (tab, kvsep, pairssep, kfilter, vfilter) Builds a list of pairs field=value, separated by commas.
pfullconcat (tab, kvsep, pairssep, kfilter, vfilter) Produces the same result as fullconcat, but it checks the arguments' types.


Functions

fullconcat (tab, kvsep, pairssep, kfilter, vfilter)
Builds a list of pairs field=value, separated by commas. The '=' sign could be changed by the kvsep argument. The ',' could also be changed by the pairssep argument. Both the field and the value could be filtered by the kfilter and vfilter respectivelly.

Parameters:

  • tab Table of field=value pairs.
  • kvsep String with key-value separator (default = '=').
  • pairssep String with pairs separator (default = ',').
  • kfilter Function to filter the keys (optional).
  • vfilter Function to filter the values (optional).

Returns:

    String with field=value pairs separated by ','.
pfullconcat (tab, kvsep, pairssep, kfilter, vfilter)
Produces the same result as fullconcat, but it checks the arguments' types.

Parameters:

  • tab Table of field=value pairs.
  • kvsep String with key-value separator (default = '=').
  • pairssep String with pairs separator (default = ',').
  • kfilter Function to filter the keys (optional).
  • vfilter Function to filter the values (optional).

Returns:

    String with field=value pairs separated by ','.

See also:

generated by LDoc 1.4.6 Last updated 2017-02-22 15:49:53