lua-users home
lua-l archive

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


On Thu, Jan 24, 2019 at 9:51 AM Жаботинский Евгений wrote:

I think allowing to omit parentheses around string literals for method calls on them would be nice.


 
+1
 
It would be useful:
   "%02X":format(n)
   s = " ":rep(10-#s)..s
   n = n*10 + digit:byte() - "0":byte()
   n = n*16 + "0123456789ABCDEF":find(hex_digit:upper()) - 1
   x = "<d":unpack("<I4I4":pack(n1,n2))
 
I'd also like indexing literal tables:
   {...}[i]
   RGB = {red=0xFF0000, green=0x00FF00}[color_name]
   if not {["Lua 5.2"]=1, ["Lua 5.3"]=1}[_VERSION] then error"Not supported" end