lua-users home
lua-l archive

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


On Feb 19, 2008 8:37 PM, Jean-Claude Wippler <jcw@equi4.com> wrote:
> The following can be made to work:
>
>         vertex_vector(20, 'x').value = 2.5
>
> by having the call return a table or userdata with a suitable
> __newindex.

This is exactly the problem I'm trying to avoid.  The problem is when
you call this millions of times you get millions of temporary objects.
 It's slow (lots of memory allocation) and causes garbage collector
thrashing.

Technically with that same approach it can look "proper":

   vertex_vector[20].x = 2.5

It's the same problem though with needing temporary objects.

CR