lua-users home
lua-l archive

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


Hello Lua world :)

I've read (most of) the Pil and the ref manual, and may just overlook
something...

Q: Why

a = {}
a[1] = 1

works as expected, but just writing

a[1]=1

does result is a compilation error? 

What is the reason this? For all other types (well, at least numbers and
strings, didn't look at others yet) you don't have to 'declare' before
usage, such as b = ""; b = "lua".

My guess is it is to avoid ambiguities in the syntax, but which are they? 

Kind regards, 


Markus Heukelom