Austin Hastings wrote:
So if $$ref gives the 'all the way down' behavior, how do I get "just
one layer down" dereferencing?
How about:
my XMLnode $x = parseXML( "file.xml" );
do_something( $x.down.down.down.item[17].up.up.body.down.down );
Details of class XMLnode and friends left as an excercise ;)
BTW, with Parrot doing COW, value semantics is as efficient as
explicit referencing while reading and with GC you don't have to
care while writing. So go ahead and think about what your algorithm
shall do instead of struggling with low level details.
Only if the creation of new values and eventual GC of orphaned ones
is really too expensive you need to add methods that handle in-place
modification, or actually hand it down to COW/GC of more lightweight
elements of your Sumo object :)
--
TSa (Thomas Sandlaß)