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.
P#60009 2022-08-28 06:03 ( Edited 2023-07-28 13:32)

I have updated TTABLE() to v0.2!

  • table checking with count.
P#132499 2023-07-28 13:33

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 14:53:43 | 0.011s | Q:12