Xref: utzoo comp.lang.eiffel:1662 comp.object:3717 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!tut.cis.ohio-state.edu!seal.cis.ohio-state.edu!ogden From: ogden@seal.cis.ohio-state.edu (William F Ogden) Newsgroups: comp.lang.eiffel,comp.object Subject: Re: Reference Semantics Message-ID: <134315@tut.cis.ohio-state.edu> Date: 14 Jun 91 20:27:32 GMT References: <1991Jun12.072557.7282@jyu.fi> <133644@tut.cis.ohio-state.edu> <1991Jun14.073249.1469@jyu.fi> Sender: news@tut.cis.ohio-state.edu Followup-To: comp.lang.eiffel Organization: The Ohio State University, Department of Computer and Information Science Lines: 39 In article <1991Jun14.073249.1469@jyu.fi> sakkinen@jyu.fi (Markku Sakkinen) writes: ... >> A good example or two showing where references are fundamentally >>necessary could perhaps expose the deficiencies of the proposed [dangerous?] >>analogy. >class person > export ... inherit ... > feature > mother: person; > heart: human_heart; > ... end >It is essential that several persons can have the same mother. >On the opposite, a heart cannot be shared. I consider it a deficiency >of languages such as Lisp, Smalltalk, and Eiffel that this important >semantic difference cannot be expressed; and the main reason is that >references are used for "everything". An amusing note on this example is that Markku's earlier warning about how dubious analogies might lead our thinking astray is applicable to so many of the prototypical examples used to develop the designs for various object oriented programming systems. In this case, the intended analogy is to a familiar world filled with people having mothers and hearts. What one would want to do (e.g. what operations) in the imperative world of computing which is related to the this everyday world is, of course, central to deciding how the computational objects should be structured but is left unspecified (as is traditional in such examples). Depending upon what we're really supposed to do in this example, some sort of structure which supports finding mothers efficiently is probably needed. However,if there are going to be operations on individuals that modify their mothers, then it's not clear that we're looking at the cleanest possible design here. Without more detail, the example just doesn't make a compelling case for using reference semantics routinely. -- /Bill