Log In  


Cart #knutil_ttable-2 | 2023-07-28 | Code ▽ | Embed ▽ | No License
1

Feature Overview

TTABLE() returns the table if the argument is a table.

  • Returns FALSE if not a table.
  • Use when table or string determination is required.
    • e.g., when using a string for initialization and replacing it with a table
    • Simultaneously check the type and reference the contents inline, as in type(tbl)=='table' and tbl.
  • This function consumes 10 Token.
tbl = '1 5 10' -- Default value.

tbl = ttable(tbl) or split(tbl, ' ') -- tbl = {1, 5, 10}

----
----

-- Thereafter, the tbl is not initialized even if there are changes to the elements of the tbl.
tbl = ttable(tbl) or split(tbl, ' ')

This function is included in the KNUTIL library.

release note


v0.2

  • table checking with count.
    v0.1
  • first release.
1


I have updated TTABLE() to v0.2!

  • table checking with count.


[Please log in to post a comment]