[luatex] variable arguments in luatex

Axel Kittenberger axel.kittenberger at univie.ac.at
Mon May 4 09:04:04 CEST 2020


I'm sorry (the power of complaining) this is some Lua version 
differences. This works anyway:

function myfunc( ... )
   local args = {...}
   for _,v in ipairs(args) do
      something( v )
   end
end

- Axel

On 5/4/20 8:50 AM, Axel Kittenberger wrote:
> As long time Lua coder I recently started with luatex.
>
> I just wanted to use some Lua core functionality like this
>
> https://www.lua.org/pil/5.2.html
>
> function myfunc( ... )
>   for _,v in ipairs(arg) do
>     dosomething( v )
>   end
> end
>
> to discover "arg" seems to be overwritten by the command line 
> arguments instead of the function call arguments.
>
> So how do vararg functions work in luatex and why is a Lua language 
> core variable being overwritten?
>
> PS: Has someone already written a tikz wrapper in Lua? I like tikz, 
> but pgf stuff when doing non trivial math gets me crazy, thats why I 
> want to move this tu Lua space.
>
> Kind regards, Axel
>


More information about the luatex mailing list.