如何在title
中使用shortdesc
?
这失败了:
function descriptor()
return {
title = "This";
shortdesc = title .. " is my text."
}
end
答案 0 :(得分:4)
你不能;你可以使用局部变量:
function descriptor()
local title = "This"
return {
title = title;
shortdesc = title .. " is my text."
}
end
答案 1 :(得分:4)
function descriptor()
local t = {}
t.title = "This";
t.shortdesc = t.title .. " is my text."
return t
end