"Sean M. Burke" wrote:
> 1) not everyone has 5.6 yet.  For many, it will be a long time coming.

I was initially thinking that this could be a conditional -- i.e., use
weak references if you happen to be using a particular version of perl
or better. But then I realized that the downstream ramifications could
be complicated -- ie, programs that use your module would have to check
the version of perl before deciding to delete(), at which point you
might as well have just deleted() to begin with.

However, if it's a private application or as an author you aren't too
concerned with having the dependency on a higher version of perl, then
it's just fine.

I really see this helping in an arena that has been somewhat vexing for
me: mod_perl applications involving trees.

> 2) it subtly changes the behaviour of trees -- currently, you can pass
> a tree around just by passing around a reference to any of its nodes.
> With a switch to weak references, you're guaranteed only that node and
> its subtree.  I'd want /ample/ time to warn everyone, in the docs,
> well ahead of time, before making this change.

Yes it does. I would consider the use of weak references tantamount to a
contract: if you use weak references, then you do it knowing and
accepting the responsibility to maintain well-managed trees.

All in all, I think ensuring well-managed trees is an easier task than
chasing down the cyclic references.

Anyway, it's just an interesting thought. It will be fun to see how this
develops in Perldom.

Matt

Reply via email to