lua-users home
lua-l archive

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


I'm in fact using Lua as configuration language. Having config files set global varialbles proofed to be a bad idea, since there is not spell checking and cause lots of issue reports filled in, because people misspelled one key and then complain that the application didn't complain at all and silently ignored the setting. Been there, done that.

From this experience I advice to have config files look more like this, which I'm doing now:

set {
  window_height = 800,
  user_name = "Sally"
}

This way previously exported set function can thus check if the keys are typed correctly and understood by the main program and copies them to to hidden settings table.

Alternatively one could change the metatable of _G but that might have unwanted consequences / incompatibilities.