lua-users home
lua-l archive

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


mark gossage wrote:
function printargs(...) table.foreach({...},print) end
clss={}
mt={__unm=printargs}
setmetatable(clss,mt)
a=-clss

The test was modified to allow running with Lua 5.0:
  a = -(setmetatable ({}, {__unm=print}))

Output for Lua 5.1:
>  table: 003DA2F8	table: 003DA2F8
(not consistent with the Manual)

Output for Lua 5.0:
>  table: 0032E078	nil
(consistent with the Manual)

--
Shmuel