Mercurial Hosting > luan
comparison core/src/luan/LuanMeta.java @ 429:e3a6d9dbd694
rename __tostring to __to_string
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sat, 02 May 2015 20:13:24 -0600 |
parents | df95199ca4c0 |
children | f28320fd671d |
comparison
equal
deleted
inserted
replaced
428:df95199ca4c0 | 429:e3a6d9dbd694 |
---|---|
45 throw new UnsupportedOperationException(); | 45 throw new UnsupportedOperationException(); |
46 } | 46 } |
47 | 47 |
48 protected abstract String type(LuanTable tbl); | 48 protected abstract String type(LuanTable tbl); |
49 | 49 |
50 public String __tostring(LuanState luan,LuanTable tbl) throws LuanException { | 50 public String __to_string(LuanState luan,LuanTable tbl) throws LuanException { |
51 return type(tbl) + "-" + tbl; | 51 return type(tbl) + "-" + tbl; |
52 } | 52 } |
53 | 53 |
54 public LuanTable newMetatable() { | 54 public LuanTable newMetatable() { |
55 LuanTable mt = new LuanTable(); | 55 LuanTable mt = new LuanTable(); |
56 mt.rawPut( "__index", this ); | 56 mt.rawPut( "__index", this ); |
57 mt.rawPut( "__pairs", this ); | 57 mt.rawPut( "__pairs", this ); |
58 mt.rawPut( "__tostring", this ); | 58 mt.rawPut( "__to_string", this ); |
59 if( canNewindex() ) | 59 if( canNewindex() ) |
60 mt.rawPut( "__new_index", this ); | 60 mt.rawPut( "__new_index", this ); |
61 return mt; | 61 return mt; |
62 } | 62 } |
63 | 63 |