comparison core/src/luan/LuanBit.java @ 443:bf5e62a9090c

remove toBoolean() and to_boolean()
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 04 May 2015 14:55:51 -0600
parents 93e6e67768d7
children bbad2d06f728
comparison
equal deleted inserted replaced
442:75ccb4da803f 443:bf5e62a9090c
131 String s2 = (String)o2; 131 String s2 = (String)o2;
132 return s1.compareTo(s2) < 0; 132 return s1.compareTo(s2) < 0;
133 } 133 }
134 LuanFunction fn = getBinHandler("__lt",o1,o2); 134 LuanFunction fn = getBinHandler("__lt",o1,o2);
135 if( fn != null ) 135 if( fn != null )
136 return Luan.toBoolean( Luan.first(call(fn,"__lt",new Object[]{o1,o2})) ); 136 return checkBoolean( Luan.first(call(fn,"__lt",new Object[]{o1,o2})) );
137 throw exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); 137 throw exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) );
138 } 138 }
139 139
140 public Object arithmetic(String op,Object o1,Object o2) throws LuanException { 140 public Object arithmetic(String op,Object o1,Object o2) throws LuanException {
141 LuanFunction fn = getBinHandler(op,o1,o2); 141 LuanFunction fn = getBinHandler(op,o1,o2);