lua-users home
lua-l archive

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

PA wrote:

> For instance, there is no apparent rational reason to
> allow print "hello" but not print true.  Therefore a
> function call should always require parentheses. No wacky
> exceptions.

This special case exists for literal strings and table
constructors to make Lua more flexible as a data-description

  local CeeStr = c"Hello"
  local FourthChar = CeeStr[4]
  local RectObj = r{x = 20, y = 20, height = 20, width = 20}

> There seems to be an inflation of sugary syntactical
> additions lately. Colons, dots, what not.

> [...] the colon notation should go the way of the Dodo.

As mentioned before, the colon has its advantages.  Whether
those advantages are worth the extra complexity is a
judgement call, one on which I agree with the Lua authors.
(I don't think Lua is in much danger of becoming bloated.)

> For example, there is a glaring inconsistency in Lua's
> core libraries. All of them use the dot notation except
> io.

All of the libraries, including io, use the dot notation.
The io library (the only library that deals with handles)
also uses the colon notation when a handle is involved.