home *** CD-ROM | disk | FTP | other *** search
- Newsgroups: comp.lang.modula2
- Path: sparky!uunet!usc!sol.ctr.columbia.edu!ira.uka.de!chx400!owf.ch!jw
- From: jw@owf.uu.ch (Juerg Wanner)
- Subject: Re: Oberon-2: Type Bound Proc question
- Message-ID: <1992Aug27.074023.6449@owf.uu.ch>
- Sender: news@owf.uu.ch
- Organization: OWF AG Zurich, Switzerland
- References: <9208240802.aa18279@thama1.apgea.army.mil> <1992Aug24.181819.6832@aero.org> <1992Aug25.124659.25394@titan.tsd.arlut.utexas.edu>
- Date: Thu, 27 Aug 1992 07:40:23 GMT
- Lines: 22
-
- In article <1992Aug25.124659.25394@titan.tsd.arlut.utexas.edu> larry@tsd.arlut.utexas.edu (Larry Maturo) writes:
- >
- >I think I am finally able to understand what is going on. You don't want to
- >pass an object by value since you could not change it's state, which makes no
- >sense since changing it's state is one of the primary things you do with an
- >object. Espically since in Oberon-2 you can already mark fields as read only
- >so there should never be a case where you have a type bound procedure that
- >does not change an objects state. This being the case the only way you can
- >pass it is as a pointer or a VAR parameter.
-
- I think you get something wrong here. As a type-bound procedure has to be
- defined in the same module as the type it's bound to, it always has write
- access to all fields of that (record-)type (except of course the fields that
- are inherited from its supertype and that are not exported or exported as
- read-only). I also don't see why you don't want an object's method to be
- able to change the object?
-
- Juerg Wanner jw@owf.ch
- OWF AG
- Asylstr. 125
- 8032 Zuerich
- Switzerland
-