How can I shorten this multiple assignment in Lua?

Is there any better way to golf this (other than removing newlines/indentation)?

function(a,b,...)
local c=s(a,b)
local d=c
for i,v in ipairs{...} do d=d:push(v) end
return c
end


I'm particularly bothered by the double local usage, but as Lua does not have multiple assignment, and I cannot use function parameters to declare the locals, I can't see a way to remove them.

For those who care, this is the implementation of the __call metamethod in my quick hack of a linked-list ~class used in this answer.

• Lua does have multiple assignment: lua.org/manual/5.1/manual.html#2.4.3 – nolan Aug 26 '16 at 23:39
• That's parallel, assignment, though. See this question. You cannot use it to share values. – Phrogz Aug 26 '16 at 23:40
• Could you perhaps declare both variables in the same line and then do assignment later? Like local c,d=s({v=b},a),0 d=c? That takes out one of the local keywords. I don't know anything about Lua, though. – Value Ink Aug 26 '16 at 23:45
• Yes that can be done. – nolan Aug 26 '16 at 23:49
• @ValueInk Post that as an answer! Note that you don't need the ,0. – Phrogz Aug 27 '16 at 0:55

local c,d=s(a,b)  -- d is nil

This saves you one local declaration, should give you -5 bytes.