lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, 31 May 2019 at 14:08, Andrew Gierth <andrew@tao11.riddles.org.uk> wrote:
>

> I would like to suggest that the Lua-level warn() function should not
> expose the second argument at all, and should be changed to just be
> warn(message). The message continuation stuff is obviously there to
> allow messages to be generated in parts without allocating memory,
> but in my environment I would need to reassemble the message anyway,
> and exposing a warn() function that relies on the user correctly
> indicating the end of a message would be a problem.

I agree that `tocont` is a bit annoying (for the warn handler). In our
case we would probably want to collect into a single string and emit
it as a single log message. I am happy to trust that Lua itself would
always do a final call without tocont, but I would worry about an
accidental mistake in a script (ranging from an error occuring before
a call without tocont, to someone forgetting string.gsub's second
result - tocont happily accepts numbers).

Regards,
Matthew