Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rutgers!caip.rutgers.edu!segall From: segall@caip.rutgers.edu (Ed Segall) Newsgroups: comp.lang.smalltalk Subject: Re: Data Hiding... Message-ID: Date: 24 Jan 90 19:43:09 GMT References: <20@<4820c7e4> <80500086@p.cs.uiuc.edu> Organization: Rutgers Univ., New Brunswick, N.J. Lines: 22 I agree as well that returning a reference to an object is often used when it is more appropriate to return a copy of the object. This is not an issue for things like SmallIntegers, for which references and copies are the same. It is, however, an issue for instances of most other classes. People who are used to programming in Lisp (for example) don't usually confuse references with copies, but people more used to numeric programming often do. I think the important think to remember is that in Smalltalk, just about everything is a reference (pointer), and that when programming (or writing programming manuals), it is important to keep that straight. It is especially important to be aware of this when writing code that returns some object. I always ask myself: "Do I want to return THIS object, or a copy of it?". --Ed Segall -- uucp: {...}!rutgers!caip.rutgers.edu!segall arpa: segall@caip.rutgers.edu