[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Newbie - why doesnt a[1] = 1 work?
- From: "Markus Heukelom" <Markus.Heukelom@...>
- Date: Wed, 23 May 2007 10:27:38 +0200
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