Mercurial Hosting > luan
changeset 1704:19df8abc9805
add Table.is_list
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 Jul 2022 15:53:03 -0600 |
parents | 3a61451f8130 |
children | a6e27c8e7ef4 |
files | src/luan/modules/Table.luan src/luan/modules/TableLuan.java website/src/manual.html.luan |
diffstat | 3 files changed, 12 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
diff -r 3a61451f8130 -r 19df8abc9805 src/luan/modules/Table.luan --- a/src/luan/modules/Table.luan Fri Jul 01 00:12:05 2022 -0600 +++ b/src/luan/modules/Table.luan Fri Jul 01 15:53:03 2022 -0600 @@ -9,6 +9,7 @@ Table.hash_value = TableLuan.hash_value Table.insert = TableLuan.insert Table.is_empty = TableLuan.is_empty +Table.is_list = TableLuan.is_list Table.pack = TableLuan.pack Table.remove = TableLuan.remove Table.size = TableLuan.size
diff -r 3a61451f8130 -r 19df8abc9805 src/luan/modules/TableLuan.java --- a/src/luan/modules/TableLuan.java Fri Jul 01 00:12:05 2022 -0600 +++ b/src/luan/modules/TableLuan.java Fri Jul 01 15:53:03 2022 -0600 @@ -132,4 +132,8 @@ return luan.toTable(obj); } + public static boolean is_list(LuanTable tbl) throws LuanException { + return tbl.isList(); + } + }
diff -r 3a61451f8130 -r 19df8abc9805 website/src/manual.html.luan --- a/website/src/manual.html.luan Fri Jul 01 00:12:05 2022 -0600 +++ b/website/src/manual.html.luan Fri Jul 01 15:53:03 2022 -0600 @@ -2912,6 +2912,13 @@ <% end } + ["Table.is_list"] = { + title = "<code>Table.is_list (tbl)</code>" + content = function() +%> +<% + end + } ["Table.pack"] = { title = "<code>Table.pack (···)</code>" content = function()