lua-users home
lua-l archive

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


On Thu, Nov 30, 2017 at 2:37 PM, Dirk Laurie wrote:
Does a patch that allows the clumsy idiom

    function(a,b,c)
      a = a or 0
      c = c or 1

to be replaced by

    function(a=0,b,c=1)

already exist?



At what moment of time those "default expressions" would be evaluated?
At the moment of definition or at the moment of function invocation?

function pretty_print_time(unix_time=os.time())


Are they allowed to refer to each other?

function string.byte(str, from_pos=1, to_pos=from_pos)