lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: new "empty" value/type in Lua?
From
: Michal Kottman <michal.kottman@
...
>
Date
: Fri, 28 Jun 2013 10:36:59 +0200
On 28 June 2013 10:03, Michal Kolodziejczyk
<
miko@wp.pl
>
wrote:
type=function(o)
if getmetatable(o)==_EMPTYMT then
return 'empty'
else
return type(o)
end
end
This of course would have to be:
do
local oldtype=type
type=function(o)
if getmetatable(o)==_EMPTYMT then
return 'empty'
else
return oldtype(o)
end
end
end
Otherwise you end up in an infinite tail-call loop :)
Follow-Ups
:
Re: new "empty" value/type in Lua?
,
Tim Hill
References
:
new "empty" value/type in Lua?
,
Tim Hill
Re: new "empty" value/type in Lua?
,
Michal Kolodziejczyk
Prev by Date:
Re: new "empty" value/type in Lua?
Next by Date:
Re: new "empty" value/type in Lua?
Previous by thread:
Re: new "empty" value/type in Lua?
Next by thread:
Re: new "empty" value/type in Lua?
Index(es):
Date
Thread