lua-users home
lua-l archive

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


I'm curious, is there some reason why the two types of table field
initialization lists can't be merged?

This would become legal syntax:

  t = { 42, name = "bob", 45, color = "blue" }

and would be equivalent to:

  t = { 42, 45 }
  t.name = "bob"
  t.color = "blue"

It seems like this syntax could be added without breaking backward
compatibility...?

ashley