lua-users home
lua-l archive

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


On Fri, Nov 26, 2010 at 6:54 PM, phlnc8 <phlnc8@gmail.com> wrote:
How about
  [ x : x > 3 ]
  [ x, y : x+y, compute_something_else(x,y) ]

Syntax (reusing Lua syntax terms):
  '['  parlist ':'  explist ']'


It's hard to parse. For example:

{ [ x : x > 3 ] = 0 }

The meaning of "[ x : x > 3 ]" cannot be determined until the '='. It needs arbitrarily large lookahead.