lua-users home
lua-l archive

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


> Speaking of which, is there a reason why number literals can't be passed as
> function arguments without parentheses, as is allowed for table and string
> literals?

The idea of those sugars is not to "simplify" function calls, but to
emulate other constructs. For instance,

  require "mod"
  newPoint{x = 10, y = 20}

may be seen as new constructs in the language. Of course nothing prevents
you from using

  print "hi"

but that is not the motivation for that syntax. We do not see numerals
being used in this same way.

-- Roberto