At 9:55 PM -0500 12/12/02, James Mastros wrote:
On 12/12/2002 5:24 PM, Dan Sugalski wrote:
At 2:17 PM -0800 12/12/02, Michael Lazzaro wrote:
On Thursday, December 12, 2002, at 01:41  PM, Dave Whipp wrote:
I might want to write code such as:
  $remembered_id = $obj.id;
 ... [ time passes ] ...
  if $an_object.id == $remembered_id { ... }
I think if you do this, you're probably in a world of hurt. We'd have to assure that no object id's are *ever* reused -- so mem addresses are out, since the same address may be used for different things at different points in time.
There'll definitely be memory address reuse. If .id returns the current object's memory address, it shouldn't be cached any place, as otherwise you'll find things going bang with some regularity.
And I'd say (but who asked me -- IMHO, of course) that it should be perfectly valid to write code like the above.
As long as valid!=correct, sure.

(That IDs should be unique across a process over all time.) If that'd require that an object's ID be a combination of the header address and a generation counter, that's OK. It means a serilization point in the allocator, but I think we'd need one no matter what (Dan?).
That's going to be expensive, and that's a bad idea. If you want an expensive and long-lived variable tracking facility, build one and add it on later. The base version should be fast, and sufficient for the common case.
--
Dan

--------------------------------------"it's like this"-------------------
Dan Sugalski even samurai
[EMAIL PROTECTED] have teddy bears and even
teddy bears get drunk

Reply via email to