lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello,

I'd like to request that a rawtostring() function be included in
a future version of Lua.  Otherwise my root object's default
tostring method looks something like this : :)

local function base_TOSTRING(self)
   local old_tostring;
   old_tostring = getmetatable(self).__tostring;
   getmetatable(self).__tostring = nil;
   local rtn = "Object("..tostring(self)..")";
   getmetatable(self).__tostring = old_tostring;
   return rtn;
end

I'd be willing to create and submit a patch if it's something
that the Lua authors agree with.

--Adam
--
Adam D. Moss   . ,,^^   adam@gimp.org   http://www.foxbox.org/   co:3
"At this point the rocket becomes engorged with astronauts."