On 5/4/07, Bradley Smith <[EMAIL PROTECTED]> wrote:
> Why are the results different for the following script when I run it
> using wxLuaEditor versus running it with the stand-alone Lua.
>
> Thanks,
> Bradley
>
> ---- test.lua ----
> A = {date = os.time()}
>
> function A:new(o)
> o = o or {}
> setmetatable(o, A)
> self.__index = self
> self.__tostring = self.tostring
> return o
> end
>
> function A:tostring()
> return os.date("%Y/%m/%d", self.date)
> end
>
> a = A:new()
> print(a) -- Why does this print "table:01AA6048"
> print(tostring(a)) -- this prints "2007/05/03"
Fixed in CVS, we had our own print function, but we didn't respect the
metatable __tostring function. It should work now.
Regards,
John Labenski
ps. See my next message about the new release.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
wxlua-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wxlua-users