Good points in both above posts. As to Clone::PP, glancing at the docs it says it'll call clone_self to do cloning for the object in question and/or clone_init after the clone's done. Of course you'd also want to look into STORABLE_thaw for Storable and Thaw for FreezeThaw for completeness.
As for forests, Ruby also provides something similar where you can do ObjectSpace.each( MyClass ) { |instance| ... }.
In reply to Re: Stashing references (Re: looping over class instances)
by Fletch
in thread looping over class instances
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |