lua-users home
lua-l archive

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


>>>>> "Ryan" == Ryan Ford <ryan@ryanfordwebdev.com> writes:

 Ryan> I want to say first I like the feature list, mostly. I'm a little
 Ryan> confused about the need/usecase for warn() over print or
 Ryan> protected calls etc.

So I'm guessing that the warning system was added primarily to have a
way to report errors in GC rather than throwing them out to a random
caller, and that providing a warn() function at Lua level is more out of
completeness than anything else.

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.

That said, why have the "tocont" argument rather than doing it
printf-style? i.e. make the signature of the user-supplied warning
function take a va_list, a la vfprintf.

-- 
Andrew.