lua-users home
lua-l archive

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


local season = 's'
...
local text =
   ({
       s = 'summer term',
       w = 'winter term'
   })[ season ]

Why do I need brackets around the curly brackets?

Why is

local text =
   {
       s = 'summer term',
       w = 'winter term'
   }[ season ]  

not valid?

Its no deal breaker, so I do brackets. But I just wonder...

Kind regards, Axel