lua-users home
lua-l archive

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


On Sun, Jan 31, 2010 at 11:14 AM, Kuang Chen <kchenphy@gmail.com> wrote:
> Hi,
>
>      I am encountering this error "attempt to concatenate a userdata
> value" when I am trying to write a tostring metamethod for userdata
> "realvector". This is what the function looks like:

The code you posted didn't have any calls to the concatenate operator
(..), so probably isn't the source of the problem.

I suspect you are using .. in your lua code, somewhere, and thinking
that __tostring() will automatically be called on your userdata prior
to concatenation, but it won't be.

Cheers,
Sam