From: why the lucky stiff Date: 2003-06-21T05:52:36+09:00 Subject: Re: Copying RVALUE Tanaka Akira (akr@m17n.org) wrote: > > One idea is creating empty array just after the anchor. > This is an idea, though I'd like something more general. The anchor could be an array, a hash, an object, a struct, anything with depth. Using that technique, everytime I want to support some new kind of RVALUE, I have to change my implementation. What I'm asking for is the equivalent of a pointer-pointer in the symbol table, which I think could be valuable to extension writers. Either access to copy RVALUEs _or_ a reference struct, which could allow me to use a VALUE as a pointer to another VALUE. I have looked at WeakRef, but it won't allow me to reassign the reference. Plus, WeakRef would throw off roundtripping of circular references. struct RRef { struct RBasic basic; VALUE ptr; } In the extensions, you would pass around the VALUE to the RRef, but Ruby would always call the RRef.ptr. Similar to Delegator, WeakRef, but simpler implementation. Although this is a major change, especially for those who serialize data. I'd prefer it if I could copy an RVALUE. _why