lua-users home
lua-l archive

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


On Mon, Dec 22, 1997 at 02:02:42AM -0200, Alan Watson wrote:
> >    table = { {"filename1.boo" , 10, 10, 20, 20 },
> >              {"filename2.boo" , 10, 10, 20, 20 },
> >              list_type = "image"
> >            };
> 
> I'm not disputing that the restrictions on table construction seem a
> little odd, but if your problem is restricted to this kind of example, 
> how about:
> 
>     function image(table)
>         table.list_type = "image"
>         return table
>     end
>     
>     image{
>         {"filename1.boo" , 10, 10, 20, 20 },
>         {"filename2.boo" , 10, 10, 20, 20 },
>     }

The whole point of using the table construction syntax (IMO) is to free
yourself from having to do programmatic setup of data. In fact this
"image" table is nested deep within a tree of tables, and it would be VERY
cumbersome to have to do something like above for every single instance.

-- 
David Jeske (N9LCA) + http://www.chat.net/~jeske/ + jeske@chat.net