Please use my MessageTally trick above and you'll unfortunately see that intersect: is just one producer of empty Rectangle among many... So I think that the ifNone: protection is quite vain given the flow of empty rectangles, user is not in control at all, it's an illusion, and that a reasonnable decision is to enforce the invariant. It's not ideal, but it's a wiser decision in the short term. Nicolas 2013/2/13 Igor Stasenko <siguctua@gmail.com>:
On 14 February 2013 00:01, Nicolas Cellier <nicolas.cellier.aka.nice@gmail.com> wrote:
So here is what I did: .....
My feeling is that you are not thru with degenerated rectangles :) You'd better enforce the invariant in http://code.google.com/p/pharo/issues/detail?id=2601 rathert than remove it as requested in http://code.google.com/p/pharo/issues/detail?id=2441
After replacement of intersect: with intersect:ifNone: there is no need to enforcing invariants in #intersect: anymore, because users can decide by themselves what to do if two rects are not intersecting..
the behavior of #intersect: for non-intersecting rects is totally absurd and changing it to answer empty rect (like with all zeroes) is not a good solution either, comparing to providing a closure to handle it.
Nicolas
-- Best regards, Igor Stasenko.