lua-users home
lua-l archive

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


Hi,

> I had started down the road of creating temporary userdata(s?) as well.
> It occurred to me today that the "__index" and "__newindex" methods
> could probably be tricked into accepting "myarray[1][2]" without the
> temporaries being created by manipulating an extra field in the original
> userdata ("row" in the following example).

Seems to work fine. I didn't think about this when I answered your
question. Just make it clear to your users that they can't try to
be smart and play with several rows at the same time.

> (Dumb C question: is there a shorter way to initialize matrix->xform?)

Not automatically, but you could declare a static matrix with
an initializer, then use a "for" to copy the values from the static
matrix to the dynamically allocated.

[]s,
Diego.