Mercurial Hosting > luan
comparison core/src/luan/modules/TableLuan.java @ 427:dae264ad6a7b
fix LuanTable.put() to use metatables
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Fri, 01 May 2015 19:29:07 -0600 |
parents | 23a93c118042 |
children | 3ffe8ba5b297 |
comparison
equal
deleted
inserted
replaced
426:23a93c118042 | 427:dae264ad6a7b |
---|---|
88 if( v==null ) { | 88 if( v==null ) { |
89 hasNull = true; | 89 hasNull = true; |
90 } else if( !hasNull ) { | 90 } else if( !hasNull ) { |
91 tbl.add(v); | 91 tbl.add(v); |
92 } else { | 92 } else { |
93 tbl.put(i+1,v); | 93 tbl.rawPut(i+1,v); |
94 } | 94 } |
95 } | 95 } |
96 tbl.put( "n", args.length ); | 96 tbl.rawPut( "n", args.length ); |
97 return tbl; | 97 return tbl; |
98 } | 98 } |
99 | 99 |
100 @LuanMethod public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) { | 100 @LuanMethod public static Object[] unpack(LuanTable tbl,Integer iFrom,Integer iTo) { |
101 int from = iFrom!=null ? iFrom : 1; | 101 int from = iFrom!=null ? iFrom : 1; |