lua-users home
lua-l archive

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


I'm trying to get the following code to work but I get "error: attempt to call a table value". The commented line works fine but I don't want to use it because I have to specify the table index.

function a(t) -- table constructor a
	return t 
b = { a{x=1, y=1}, a{x=2, y=2} } -- error
-- b = { [1]=a{x=1, y=1}, [2]=a{x=2, y=2} } -- ok

By accident I found that if 'return t' was instead 'return a', it segfaulted.