NICE-ESG-Libs Digest        Thu, 22 Feb 96       Volume 2 : Issue  17 

Today's Topics:
fwd: [jacob@blackbox.enmu.edu] Re: strip and ARRAY[ANY] (NICE-ESG-Libs Digest V2 #16)


NICE Eiffel Standards Group -- Library Committee Mailing List To post to list: NICE-ESG-Libs@atlanta.twr.com To send mail to the Chairman of the committee: NICE-ESG-Libs-chair@atlanta.twr.com Administrative matters (sign up, unsubscribe, mail problems, etc): NICE-ESG-Libs-request@atlanta.twr.com
Date: Thu, 22 Feb 96 16:43:49 EST From: tynor (Steve Tynor) Subject: fwd: [jacob@blackbox.enmu.edu] Re: strip and ARRAY[ANY] (NICE-ESG-Libs Digest V2 #16) To: nice-esg-libs Clearly, sometimes one will want a stronger (or weaker) condition, in which case Jacob's `deep_equal', or more selective use if deep equality on some fields, and shallow equality on others, or might be appropriate. I was not attempting to propose that my proposed `items_are_equal' function was a "one size fits all" solution to all cases where one wants to use strip -- mearly a necessary one for implementing the semantics (which I believe are) intended in the ETL examples. If these semantics are regarded as unimportant, then the need for this new function is of course diminished. Steve ------- start of forwarded message (RFC 934 encapsulation) ------- From: "Jacob Gore" To: tynor@atlanta.twr.com (Steve Tynor) Subject: Re: strip and ARRAY[ANY] (NICE-ESG-Libs Digest V2 #16) Date: Thu, 22 Feb 1996 14:25:49 MST Hi, Steve. I've thought about the "nothing else changes" postcondition (and wrote about it in a couple sections of my book), and your solution promising, though I have a different motivation than the expanded to nonexpanded field promotion. Suppose that none of the attributes were expanded. There is still a problem with p1: strip(x).is_equal(old strip(x)) The problem is that it is NOT the "nothing else changes" postcondition: For example, the routine could contain the code y.change and p1 would still hold, since y's identity didn't change. My solution was to use instead p2: strip(x).is_deep_equal(old strip(x)) but a couple of the reviewers pointed out that this may be too restrictive, as in the case when one of the other fields z refers to the same object as x (directly or indirectly). Your solution, p3: strip(x).items_are_equal(old strip(x)) is halfway between p1 and p2. It will often compute a lot faster, and it eliminates the concern about the case where z indirectly refers to the same object as x, but it is still overly restrictive if z and x refer to the same object. Finally, both p2 and p3 will miss the following change to the object: y := clone(y) Jacob P.S. Feel free to forward some or all of this message to the list if you feel it will help the discussion. ------- end -------