2012/1/23 Herbert Voss <[email protected]>
> this works with Lua
>
> table.foreach(os.date("!*t"),**print)
>
> but when I replace print with tex.print I'll get
> an error because tex.print doesn't know how to
> handle the last boolean value of the date table.
>
> \directlua{table.foreach(os.**date("!*t"),tex.print)}
> \bye
>
> ! LuaTeX error no string to print
> stack traceback:
> [C]: ?
> [C]: in function 'foreach'
> <\directlua >:1: in main chunk.
> l.1 ...ua{table.foreach(os.date("!***t"),tex.print)}
>
>
> I can handle the last table entry as a special case, no problem.
> But is there an easy way to catch a boolean value?
>
> Herbert
>
\directlua{table.foreach(os.date("!*t"),function(...)
tex.print(tostring(...) end)}
\bye
untested
--
luigi