Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!elroy.jpl.nasa.gov!decwrl!pa.dec.com!src.dec.com!kalsow From: kalsow (Bill Kalsow) Newsgroups: comp.lang.modula3 Subject: Re: names of methods and instance variables of OBJECTs Message-ID: <9104221550.AA03978@jumbo.pa.dec.com> Date: 22 Apr 91 15:50:52 GMT Lines: 35 In-Reply-To: Message of 20 Apr 91 19:16:44 GMT from buschman@tubsibr.uucp (Andreas Buschmann) <1991Apr20.191644.11028@tubsibr.uucp> To: m3 Cc: buschman@tubsibr.uucp (Andreas Buschmann), kalsow > 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? Yes, the following is legal: TYPE A = OBJECT x: INTEGER METHODS y () END; TYPE B = A OBJECT y: INTEGER METHODS x () END; > 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. > so does (1) include the names used in the super classes or not? And > why? No, "FieldList" and "MethodList" are names for syntactic pieces of an object declaration. They are not the set of all field or method names in the object. > The following example compiles ok, but terminates while running with: > fatal error: can't open display '' Usually, "can't open display" indicates that your program cannot contact an X server. I doubt it's a Modula-3 problem. - Bill Kalsow