Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!caen!ox.com!math.fu-berlin.de!unidui!unido!infbs!tubsibr!buschman From: buschman@tubsibr.uucp (Andreas Buschmann) Newsgroups: comp.lang.modula3 Subject: OBJECTs and their default methods Keywords: default methods Message-ID: <1991Apr24.192015.13327@tubsibr.uucp> Date: 24 Apr 91 19:20:15 GMT Sender: buschman@tubsibr.uucp (Andreas Buschmann) Organization: TU Braunschweig, Informatik (Bueltenweg), Germany Lines: 34 Hello, here is another question about OBJECTs. suppose we have the following declarations: TYPE O1 = OBJECT METHODS m () : INTEGER := zehn END; TYPE O2 = O1 OBJECT m : INTEGER := 2 END; PROCEDURE zehn (self : O1): INTEGER = BEGIN RETURN 10; END zehn; what is the meaning of O2.m in the following block? a) O1's default method m (zehn) b) O2's default value for m (2) c) this is illegal d) something else in the report on page 39 there is the sentence r.f, o.f, I.x, T.m, E.id ... If T is an object type and m is the name of one of T's methods, then T.m denotes T's default m method. the SRC compiler v1.6 says types not assignable if i try to assign the value of this to an integer or a procedure variable. Tschuess Andreas