lua-users home
lua-l archive

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


Eric Ries wrote:

2) a, b, foo are globals - or there are no variables in the segment. This is
most useful in config file scenarios. Here is why. Let's take this as a
config file:

{
 "key1" = 25,
 "key2" = function (a,b) ... end
...
}

Right, I'm doing something similar to build "components". I can get around it with
an explicit return:

 return {
  "key1" = 25,
  "key2" = function (a,b) ... end
 }

...but that return is a sticking point with the script coders, as it's easy to
forget and doesn't make sense in a config file.

Jason
379