Mercurial Hosting > luan
comparison core/src/luan/impl/LeExpr.java @ 443:bf5e62a9090c
remove toBoolean() and to_boolean()
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Mon, 04 May 2015 14:55:51 -0600 |
parents | f2c6c22cddc0 |
children | b48cfa14ba60 |
comparison
equal
deleted
inserted
replaced
442:75ccb4da803f | 443:bf5e62a9090c |
---|---|
31 return s1.compareTo(s2) <= 0; | 31 return s1.compareTo(s2) <= 0; |
32 } | 32 } |
33 LuanBit bit = luan.bit(se); | 33 LuanBit bit = luan.bit(se); |
34 LuanFunction fn = bit.getBinHandler("__le",o1,o2); | 34 LuanFunction fn = bit.getBinHandler("__le",o1,o2); |
35 if( fn != null ) | 35 if( fn != null ) |
36 return Luan.toBoolean( Luan.first(bit.call(fn,"__le",new Object[]{o1,o2})) ); | 36 return bit.checkBoolean( Luan.first(bit.call(fn,"__le",new Object[]{o1,o2})) ); |
37 fn = bit.getBinHandler("__lt",o1,o2); | 37 fn = bit.getBinHandler("__lt",o1,o2); |
38 if( fn != null ) | 38 if( fn != null ) |
39 return !Luan.toBoolean( Luan.first(bit.call(fn,"__lt",new Object[]{o2,o1})) ); | 39 return !bit.checkBoolean( Luan.first(bit.call(fn,"__lt",new Object[]{o2,o1})) ); |
40 throw bit.exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); | 40 throw bit.exception( "attempt to compare " + Luan.type(o1) + " with " + Luan.type(o2) ); |
41 } | 41 } |
42 } | 42 } |