lua-users home
lua-l archive

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


$ lua
Lua 5.3.4  Copyright (C) 1994-2017 Lua.org, PUC-Rio
> =1
1
>  =1
stdin:1: unexpected symbol near '='

The fix is to allow an = to be used as `return` in the parser, if it's the first statement in a function. This'll be a huge improvement for Lua data files:

= {
  nick = "Soni|Bot",
  network = "irc.freenode.net",
  port = 6667,
}

while also fixing the bug in the interpreter.

Side effects include `local function swap(a,b) = b,a end`, `s:gsub("[A-Z]", function(k) = tostring(k:byte()) end)`, etc. But I think those are nice.

--
Disclaimer: these emails may be made public at any given time, with or without reason. If you don't agree with this, DO NOT REPLY.