lua-users home
lua-l archive

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


On 18/04/2011, at 8:00 PM, Francesco Abbate wrote:

> The problem here is that for the arithmetic operators I need to know
> if the operands are real or complex number or real or complex
> matrices. The problem is that if I use the 'type' function I get can
> obtain just 'number' or 'cdata' and I have no means to discriminate
> between, for example, a complex number and a matrix because both are
> cdata.

Can you give your cdata metatables (you must be doing that already given that they support math operators) and compare the metatables?

Cheers,
Geoff