Re: [luabind] tostring issues
Brought to you by:
arvidn,
daniel_wallin
From: Korval <Ko...@co...> - 2006-06-27 04:49:33
|
I have to wonder why you're trying to bind legacy objects directly to Lua without some kind of wrapper class. If you don't have direct control over a piece of code, it's better to operate through a layer than to talk directly to something you may need to mutate. -----Original Message----- From: lua...@li... [mailto:lua...@li...]On Behalf Of Alexander Gladysh Sent: Monday, June 26, 2006 8:52 AM To: lua...@li... Subject: [luabind] tostring issues Hi, all! As far as I understand, to be able to do tostring() operation in Lua on Luabind user-type, one have to write std::ostream& operator<<(std::ostream&, type&); for that type in C++. But what if I already have that operator (as legacy and unchangeable code), and want to get completely different text representation for Lua (say, to convert to Lua code on tostring() to allow deserialization)? I'd like to be able to specify custom function to .tostring() binding function. Is it possible? There is one more issue. If I call tostring() in Lua on any of Luabind objects, which do not have bound tostring operator in C++, I get a crash like "no such operator defined". This is inconsistent with behaviour of tostring() for other types and leads to writing extra type checks. It would be *MUCH* more convenient to have something like "luabind: HEXADRESS" as a result, like for tables and functions. Thanks in advance, Alexander. Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642 _______________________________________________ luabind-user mailing list lua...@li... https://lists.sourceforge.net/lists/listinfo/luabind-user |