Re: Did they mean "." or ":"?
[
Date Prev][
Date Next][
Thread Prev][
Thread Next]
[
Date Index]
[
Thread Index]
- Subject: Re: Did they mean "." or ":"?
- From: "Alex Davies" <alex.mania@...>
- Date: 2010年2月17日 09:48:26 +0800
Peter Cawley wrote:
In plain Lua, it might be done like:
function how(s, x) return debug.getinfo(1).namewhat == "method" and
":" or "." end
t = {how = how}
print(t.how()) --> .
print(t:how()) --> :
Except that then breaks legitimate uses, ie when caching the function lookup
for a tight inner loop.
local setAngle = bot.setAngle
for angle = 0,math.pi,0.0001 do
setAngle(bot, angle)
end