> From: Yukihiro Matsumoto [mailto:matz / zetabits.com] [...] > Sent: Saturday, March 17, 2001 06:41 AM > To: ruby-talk ML > Subject: [ruby-talk:12773] Re: Status of (un)freeze? > > > Hi, > > In message "[ruby-talk:12762] Re: Status of (un)freeze?" > on 01/03/17, "Christoph Rippel" <crippel / primenet.com> writes: > > |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. > > If you are going to make recursion error, I don't think it's worthy to > have in the core. It's detected by stack level check anyway. But if > you can compare tangled structure safely, it's worth it. I whole heartedly agree with your comment about the stack-level check ... There are many ways of comparing tangled structures and my opinion on what's the right thing to-do (as the default) changes about every two hours - so we better wait and see ... The identity problem silently effects many destructive methods - uniq!, & etc. but seeminly unrelated methods like #flatten! are also effected - the ladder is currently very seriously broke even for untangled array's - but hopefully we can repair it. > |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? > > Well, it makes me feel like implementation issue leaking outside. The point is that recursion creeps beyond class boundaries and if we wanted to be really carefully some of our destructive methods would require that put the whole data-structure into a tmp_look(freeze) (we have not decided on a finial strategy about this) - but I can understand that you want to shield the user from the complexity of having two different freeze methods our the even more complex notion of Freeze Objects around - i.e. we can do without tmp_freeze. Christoph