lua-users home
lua-l archive

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


On Fri, Jan 28, 2011 at 11:08 AM, David Kastrup <dak@gnu.org> wrote:
>> and it wouldn't break any
>> existing code, since a string literal can't legally follow 'do' or
>> 'break' in Lua today.
>
> do 'not?':format() end
>
> Surprisingly, it works only with parens around the string in Lua 5.1,
> but shouldn't it work in 5.2?

This has been discussed from time to time already, and it's not
immediately clear that allowing this is desirable.  See:

http://lua-users.org/lists/lua-l/2008-12/msg00164.html

In any event, even if Lua 5.2 were to adopt "x":y() as valid syntax,
my original statement that this proposal "wouldn't break any existing
code" still stands.  (I admit that literals as labels might be less
desirable in such a world, however.)

Greg F