Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!zaphod.mps.ohio-state.edu!swrinde!ucsd!hub.ucsb.edu!eiffel!bertrand From: bertrand@eiffel.UUCP (Bertrand Meyer) Newsgroups: comp.object Subject: Re: value semantic versus reference semantic Message-ID: <575@eiffel.UUCP> Date: 18 May 91 19:21:45 GMT References: <68780001@hpcupt1.cup.hp.com> <1991May14.093053.3017@jyu.fi> Organization: Interactive Software Engineering, Santa Barbara CA Lines: 18 From <1991May14.093053.3017@jyu.fi> by sakkinen@jyu.fi (Markku Sakkinen): > note that almost all OOPL's offer only reference semantics > for objects. C++ is one of the refreshing exceptions. There are two categories of Eiffel types: reference types and expanded types. For assignment as well as argument passing (collectively called ``reattachment operations''), the former follow reference semantics, the latter follow copy semantics. Predefined expanded types include the arithmetic types INTEGER etc.; but given a class C, you can define the new expanded type `expanded C', or `expanded C [T, ...]' if C is generic. In other words, programmers get to control the exact semantics of reattachment - reference assignment or copy. -- -- Bertrand Meyer Interactive Software Engineering Inc., Santa Barbara bertrand@eiffel.uucp