lua-users home
lua-l archive

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


On 08/16/2017 04:15 AM, Stephen Irons wrote:
> The program 'lua' prints error message that contain contextual data from
> the user, presumably to help debug the problem.
>
> In my opinion, the program 'lua' should not make any assumptions about
> the value of this user data, and should ensure that it does not affect
> the channel that the error message is sent over:

But program lua knows nothing about channel. So it can't filter it's
error output text accordingly. (But I agree, ('%q'):format(s) would be
handy for most cases.)

Current case with ANSI escape sequences is that they are interpreted by
terminal emulator. Quoting escape \x1B character will help. But what if
output goes to web browser? Should HTML brackets be filtered also?

I think output representation is not zone of responsibility of lua
interpreter. It is just a relatively small C program:

  https://github.com/lua/lua/blob/master/lua.c

-- Martin