Mercurial Hosting > luan
comparison core/src/luan/LuanBit.java @ 429:e3a6d9dbd694
rename __tostring to __to_string
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2015 20:13:24 -0600 |
parents | 1eafb11a150d |
children | f28320fd671d |
comparison
equal
deleted
inserted
replaced
428:df95199ca4c0 | 429:e3a6d9dbd694 |
---|---|
88 } | 88 } |
89 | 89 |
90 public String toString(Object obj) throws LuanException { | 90 public String toString(Object obj) throws LuanException { |
91 if( obj instanceof LuanTable ) { | 91 if( obj instanceof LuanTable ) { |
92 LuanTable tbl = (LuanTable)obj; | 92 LuanTable tbl = (LuanTable)obj; |
93 Object h = tbl.getHandler("__tostring"); | 93 Object h = tbl.getHandler("__to_string"); |
94 if( h instanceof LuanMeta ) { | 94 if( h instanceof LuanMeta ) { |
95 LuanMeta meta = (LuanMeta)h; | 95 LuanMeta meta = (LuanMeta)h; |
96 return meta.__tostring(luan,tbl); | 96 return meta.__to_string(luan,tbl); |
97 } | 97 } |
98 if( h != null ) { | 98 if( h != null ) { |
99 LuanFunction fn = checkFunction(h); | 99 LuanFunction fn = checkFunction(h); |
100 if( fn != null ) | 100 if( fn != null ) |
101 return checkString( Luan.first( call(fn,"__tostring",new Object[]{obj}) ) ); | 101 return checkString( Luan.first( call(fn,"__to_string",new Object[]{obj}) ) ); |
102 } | 102 } |
103 } | 103 } |
104 return Luan.toString(obj); | 104 return Luan.toString(obj); |
105 } | 105 } |
106 | 106 |