lua-users home
lua-l archive

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


+1 for each one of those.

So, while we're going wild, I'll add a few of my own:

One I found out about today (thinking that it should work, but it didn't) is when you use a function returned table to define a new function in that table directly. Example,

 local t = getmetatable('')
 function t:__add(s) return self..s end

works, but it cannot be written like:

function getmetatable(''):__add(s) return self..s end

One more, why not be able to do:
... = 1,2,3
or
"abc"[2]

and, an implied iterator for strings, so that this is possible:
for char in str do ... end

(All of these I think make the language more appealing. Of course, lack of any of these does in any way limit the current abilities of the language, but having them adds a greater level of expressiveness, in my view.)

-----Original Message----- From: Soni L.
Sent: Wednesday, May 06, 2015 8:14 PM

What about table constructors as in `return {init = function(self, ...)
return self end}:init()`? (I also wish we could `{...}[3]` and `#...`
(and `...[3]`?), but that's a different thing)