[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Overriding assignment to do userdata copy instead of reference
- From: Geoff Richards <Ni1phahs@...>
- Date: Tue, 23 Sep 2008 09:44:15 +0100
On Mon, Sep 22, 2008 at 02:18:15PM -0700, Matthew Armstrong wrote:
> Let me add some more information. Classes A and B are bound with the tolua++
> binding library, and are dealt with as userdata.
In that situation I add a :clone() method (or have a constructor which
can take another object and copy it), written in C. That makes the
copying behaviour explicit in the Lua code. You don't want assignment
to suddenly start behaving differently, even if it were possible.
--
--- Geoff Richards -------------><-------------- http://ungwe.org/ ---
"I tried to fling my shadow at the moon,
The while my blood leapt with a wordless song." -- Theodore Roethke