comparison src/luan/modules/Table.luan @ 1267:9fa8b8389578

add LuanTable.luan; support metatable __gc(); add luan.sql;
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 12 Nov 2018 02:10:41 -0700
parents 81d3a01fbd09
children 8d95711f6615
comparison
equal deleted inserted replaced
1266:05934fbf635a 1267:9fa8b8389578
18 18
19 local Luan = require "luan:Luan.luan" 19 local Luan = require "luan:Luan.luan"
20 local error = Luan.error 20 local error = Luan.error
21 local type = Luan.type or error() 21 local type = Luan.type or error()
22 local pairs = Luan.pairs or error() 22 local pairs = Luan.pairs or error()
23 local LuanJava = require "java:luan.Luan" 23 local toTable = TableLuan.toTable or error()
24 local toTable = LuanJava.toTable or error()
25 24
26 function Table.java_to_table_shallow(obj) 25 function Table.java_to_table_shallow(obj)
27 local rtn = toTable(obj) 26 local rtn = toTable(obj)
28 if rtn ~= nil then 27 if rtn ~= nil then
29 return rtn 28 return rtn