From: Christoph Rippel Date: 2001-03-17T14:13:23+09:00 Subject: [ruby-talk:12762] Re: Status of (un)freeze? > From: Yukihiro Matsumoto [mailto:matz@zetabits.com] > Sent: Friday, March 16, 2001 01:09 AM > To: ruby-talk ML > Subject: [ruby-talk:12736] Re: Status of (un)freeze? > > > Hi, > > In message "[ruby-talk:12730] Status of (un)freeze?" > on 01/03/16, "Christoph Rippel" writes: > > |I am currently in desperate need for a freeze/unfreeze facility for untangle > |package which (supposedly) can handle arbitrarily tangled (self-referential) > |data structures. > > Uh, do you need it to be an extension? > > Ruby itself uses temporary lock facility in array.c, for example. > Plus, I'd like to support tangled data structure anyway. > > So that if you're willing, why don't you try modifying the core. > In case you succeed to make something works, I'd be happy to merge it. Well, since Guy and me are working on this together it seems fairly likely that we will get (at least something) to work ... I am not sure if Ruby really needs infinite recursion protection for #egl?,#== etc. (#hash is trivial btw.) in the core. It won't be free in terms of running speed but it can be done relatively cheaply. On the other hand it certainly helps if we were allowed to put some hooks for our stuff into the core. In general it seem to me that we might want to introduce a #tangle?, #untangle(!) as Array,Hash and Struct instance methods and put recursion protected #==, #eql? into a standard extension. I would also like add stuff like #deep|eql?-cloning and some other stuff to this extension. Coming back to my original question would it be okay then too introduce a general method like #tmp_freeze (or Freeze objects) into the core for this - this seems much cleaner to me? Christoph