Lambda the Ultimate

inactiveTopic Copying and Comparing: Problems and Solutions
started 4/1/2003; 6:42:12 AM - last post 4/2/2003; 4:04:26 AM
Ehud Lamm - Copying and Comparing: Problems and Solutions  blueArrow
4/1/2003; 6:42:12 AM (reads: 1824, responses: 1)
Copying and Comparing: Problems and Solutions
Grogono, P., and Sakkinen, M. Copying and comparing: Problems and solutions. In ECOOP'00, E. Bertino, Ed. Springer-Verlag, Cannes, France, June 2000.

Saw this paper mentioned on the ll1 mailing list.

This is an important issue, and the paper makes for ok reading.

Section 5.2 gives language design guidelines that are worthy of consideration.

Ada isn't discussed in the paper, which is a shame. Ada makes a basic distinction between limited and non-limited types. Limited types (which include types the user marks as limited as well as things like tasks and protected types) don't provide equality and assignment operations. For non-limited types deafult assignment and equality operations are defined. The equality function can be overloaded, where as the semantics of assignment can be changed by supplying an appropriate procedure (called Adjust).


Posted to OOP by Ehud Lamm on 4/1/03; 6:48:04 AM

Ehud Lamm - Re: Copying and Comparing: Problems and Solutions  blueArrow
4/2/2003; 4:04:26 AM (reads: 459, responses: 0)
An historical observation: Ada83 supported the overloading of the equality operator, but changing the semantics of assignment only became possible in Ada95. In order to proivde your own assignment operation you must inherit from a type known as Ada.Finalization.Controlled. Inheritance was introduce to Ada only in Ada95.