MOO-cows Mailing List Archive


Re: Operators

--- "Robert J. Brown" wrote:
C++ has the idea of a "copy constructor" and uses it to instantiate
temporary objects on the stack frame of the currently active
procedure.  These objects have their destructor invoked when that
procedure exits, since that is the end of the lifespan of the
temporary object.
--- end of quoted material ---
Hmm.  I was thinking of using x:_plus(y,temp), passing temp (a copy of x) to
the function to use as a return value, and it would be recycled if unneeded. 
This would be cool, but what if a real object got returned?  Would it be
recycled, or would a temporary flag exist?  If a temporary flag existed, what
if it got assigned to a property.  Would the temp flag disappear?  What if it
were removed from the prop.  It should be recycled, right?  Should a reference
count be kept, which recycles the object when references = 0?  It has to
interface with some sort of recycler, as having invalid object numbers is
considered bad form.  After carefully considering this, I got scared and ran
away :)  I'll consider it after all the other stuff I have already planned out
is done.


Home | Subject Index | Thread Index