Re: Cross-type comparison meta-methods
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Cross-type comparison meta-methods
- From: Vyacheslav Egorov <mraleph@...>
- Date: 2007年1月03日 12:27:35 +0600
Alexander Gladysh wrote:
2. Something really weird: I also need something (an __eq
meta-method?) which would catch implicit comparison with nil (or
false) like this:
if t then
print "t is not nil"
else
print "t is nil"
end
I need to be able to simulate nil (or false) value here when t is a
meta-tabled table.
Are you trying to implement some kind of proxy for objects that can be
collected/destroyed outside of Lua?
If so, I would recommend you explicit check here:
if not t.isAlive then
...
end
Happy New Year!