From: Dan North Date: 2003-08-29T22:02:01+09:00 Subject: Re: #collect with block modifying receiver So it's undefined behaviour, but "Don't modify the receiver while you are iterating over it." :) Can I suggest the solution that Java uses, which is to fail fast in that situation (ConcurrentModificationException). You would not believe how much debugging time that one tiny feature has saved me! Cheers, Dan Yukihiro Matsumoto wrote: >Hi, > >In message "Re: #collect with block modifying receiver" > on 03/08/29, Hal Fulton writes: > >|OK, so this *really* makes me wonder what the "theoretically correct" >|behavior is. > >|Matz, are you listening?? Enlighten us, please... > >Ah, listen, it's undefined behavior. ;-) > >To be serious, I don't want to slow down performance by defining any >exact behavior. Don't modify the receiver while you are iterating >over it. > > matz. > > > -- Dan North http://www.thoughtworks.com