[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Tables of Functions
- From: "Ken Smith" <kgsmith@...>
- Date: Mon, 25 Sep 2006 16:38:27 -0700
I would like to make an array of functions. I tried the following syntax.
function steps[1] (a,b)
print("steps[1]",a,b)
end
This yields the error message:
lua: test.lua:1: '(' expected near '['
If I write this instead, it works.
steps[1] = function (a,b)
print("steps[1]",a,b)
end
Am I justified in expecting the first flavor to work?
Thank you,
Ken Smith