Module clopwh.util

Module with several utilities that could not fit in a specific module

Functions

array_to_table (array) Convert given array into a table.
contain_from (item, table, idx) Check whether given item is included in the part of given table(array) begins with idx-th index.
copy_table (table) Clone given table.
copy_table_of_tables (seqs) Clone given "table(array) of tables(arrays)".
get_nonempty_seqs (seqs) Extract only non-empty tables(arrays) from the table(array) of tables.
merge (class_id, seqs) do C3 Linearization to get proper Method Resolution Order.


Functions

array_to_table (array)
Convert given array into a table. Table contains all elements in given array as Key, and all values associated with any Keys are simply "true".

Parameters

  • array: table(array)

Return value:

table, whose key is values in given array. All values are true.
contain_from (item, table, idx)
Check whether given item is included in the part of given table(array) begins with idx-th index.

Parameters

  • item: item to examine
  • table: table to examine
  • idx: index to start examine

Return value:

index of table which given item first occurs. Otherwise nil.
copy_table (table)
Clone given table.

Parameters

  • table: table to be copied

Return value:

copied table
copy_table_of_tables (seqs)
Clone given "table(array) of tables(arrays)".

Parameters

  • seqs: table(array) of tables(arrays) to be clonned

Return value:

clonned table(array) of tables(arrays)

See also:

get_nonempty_seqs (seqs)
Extract only non-empty tables(arrays) from the table(array) of tables.

Parameters

  • seqs: table(array) of tables(arrays)

Return value:

table(array) of tables(arrays) which empty arrays are excluded
merge (class_id, seqs)
do C3 Linearization to get proper Method Resolution Order.

Parameters

  • class_id: current class' id
  • seqs: table(array) of table(array) contains all inheritance

Return value:

linearized inheritance table(array)

Valid XHTML 1.0!