comparison core/src/luan/impl/LuanImpl.java @ 662:ee00a619eec1

minor
author Franklin Schmidt <fschmidt@gmail.com>
date Wed, 06 Apr 2016 21:47:45 -0600
parents e064377994b2
children b438a47196bc
comparison
equal deleted inserted replaced
661:1bbb08c0d8f1 662:ee00a619eec1
220 } 220 }
221 if( t != null && luan.hasJava() ) 221 if( t != null && luan.hasJava() )
222 JavaLuan.__new_index(luan,t,key,value); 222 JavaLuan.__new_index(luan,t,key,value);
223 else 223 else
224 throw new LuanException( "attempt to index a " + Luan.type(t) + " value" ); 224 throw new LuanException( "attempt to index a " + Luan.type(t) + " value" );
225 }
226
227 public static Object pick(Object o,int i) {
228 if( i < 1 )
229 throw new RuntimeException();
230 if( !(o instanceof Object[]) )
231 return null;
232 Object[] a = (Object[])o;
233 return i<a.length ? a[i] : null;
225 } 234 }
226 235
227 public static Object[] concatArgs(Object o1,Object o2) { 236 public static Object[] concatArgs(Object o1,Object o2) {
228 if( o1 instanceof Object[] ) { 237 if( o1 instanceof Object[] ) {
229 Object[] a1 = (Object[])o1; 238 Object[] a1 = (Object[])o1;