[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: Lua language question
- From: "Adam D. Moss" <adam@...>
- Date: Wed, 16 Jun 2004 09:03:06 +0100
Virgil Smith wrote:
ShallowCopy(tbl, vec)
I prefer to use:
vec1 = vec2:copy();
in my object system. Thus the default copy() method does a
shallow-copy but can be overridden by a particular class that
knows better.
Ideally I'd love:
vec1 = *vec2;
to indicate a value-copy instead of a reference-copy. This would
be very easy to implement if Lua had a unary-multiply. :) (I've
done it this way before with unary-minus, but obviously unary-minus
is actually useful to use as intended for some classes such as e.g.
vectors).
--Adam
--
Adam D. Moss . ,,^^ adam@gimp.org http://www.foxbox.org/ co:3