[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: Features you would like to see
- From: David Manura <dm.lua@...>
- Date: Fri, 17 Aug 2007 05:41:23 +0000 (UTC)
Patrick Donnelly writes:
> I'm curious what features people would like to see added to Lua.
See http://lua-users.org/wiki/FeatureProposals .
Some of my own favorites include
(RAII or scope guards to more effectively solve some cleanup problems)
(modules should not touch global variables)
(e.g. the "let" syntax)
(e.g. __len, __pairs, and other metamethods on tables)
Possibly also: macros (in the LISP sense).
> I'd like to see some sort of "default" value for function arguments
> added. Something along the lines of:
> function foo(a or 5)
> ..... a = a or 5; ... end;. Syntactic sugar maybe?
Function argument processing involves a lot of things, including type and range
checking for named and positional elements. I think the above might add more
complexity to the language but only address one special case.
> I'd like to see some sort of table.hole value for table arrays.
I think the more fundamental issue is in the limited expressibility of varargs
in the absence of tables -- http://lua-users.org/wiki/VarargTheSecondClassCitizen