If I have a reference to another object, and I'd like to make that reference a weak reference (from within a CMOD, or from Pike), what is the best way to change it?
set_weak_flag() appears not to operate on object references.
set_weak_flag operates on a reference container, not the reference itself.
What you ask for is a weak modifier. The only thing that keeps that from happening is that with the current parser it'd have to be a keyword, and we are (or at least I am) reluctant to make it one.
Perhaps there's a middle ground: Java supports weak references in varying strength by providing a set of classes that implement the ability to forget the (single, usually) object contained within. If you had something like this, you could combine it with accessors to get the desired result (though I suppose you could do that with accessors and a weak mapping, too.
It could be a potentially useful addition, though, without requiring the keyword.
Bill
On Sep 6, 2008, at 2:45 PM, Martin Stjernholm, Roxen IS @ Pike developers forum wrote:
What you ask for is a weak modifier. The only thing that keeps that from happening is that with the current parser it'd have to be a keyword, and we are (or at least I am) reluctant to make it one.
Well, if one settles for having an extra container in between then a single element array or mapping will work just fine, I think.
pike-devel@lists.lysator.liu.se