Path: utzoo!utgpu!news-server.csri.toronto.edu!bonnie.concordia.ca!thunder.mcrcim.mcgill.edu!snorkelwacker.mit.edu!mintaka!olivea!samsung!sdd.hp.com!caen!ox.com!math.fu-berlin.de!fauern!unido!infbs!tubsibr!buschman From: buschman@tubsibr.uucp (Andreas Buschmann) Newsgroups: comp.lang.modula3 Subject: names of methods and instance variables of OBJECTs Keywords: OBJECT names methods Message-ID: <1991Apr20.191644.11028@tubsibr.uucp> Date: 20 Apr 91 19:16:44 GMT Sender: buschman@tubsibr.uucp (Andreas Buschmann) Organization: TU Braunschweig, Informatik (Bueltenweg), Germany Lines: 54 Hello, If I declare a type A beeing an OBJECT with a field named x and a method named y, am I allowed to declare B beeing A OBJECT with a field named y and a method named x, or only one of them? In the report I find: The names introduced in FieldList and MethodList must be (1) distinct. ... A field or method in a subtype masks any field or method with (2) the same name in the supertype. To access such a masked field, use NARROW to view the subtype variable as a member of the supertype. The following example compiles ok, but terminates while running with: fatal error: can't open display '' MODULE Main; TYPE O1 = OBJECT i : INTEGER; METHODS m () := p; END; TYPE O2 = O1 OBJECT m : INTEGER; END; TYPE O3 = O1 OBJECT METHODS i (); END; PROCEDURE p (self : O1) = BEGIN END p; BEGIN EVAL NEW (O2, m := 2); EVAL NEW (O3, i := p); END Main. this is SRC Modula-3 v1.5 running on a SUN3 on a SUN4 running v1.6 ther is no error message, it just runs. so does (1) include the names used in the super classes or not? And why? Tschuess Andreas /|) Andreas Buschmann /-|) TU Braunschweig, Germany (West) ^^^^ was bitnet: buschman%tubsibr@dbsinf6.bitnet uucp: buschman@tubsibr.uucp