Path: utzoo!attcan!utgpu!watserv1!maytag!watstat.waterloo.edu!dmurdoch From: dmurdoch@watstat.waterloo.edu (Duncan Murdoch) Newsgroups: comp.lang.pascal Subject: Re: Why does this work in TP ? Message-ID: <1990Dec20.140626.25353@maytag.waterloo.edu> Date: 20 Dec 90 14:06:26 GMT References: <25295@adm.brl.mil> <1990Dec18.200336.13056@ux1.cso.uiuc.edu> <1990Dec20.023514.6325@ux1.cso.uiuc.edu> Sender: daemon@maytag.waterloo.edu (Admin) Organization: University of Waterloo Lines: 32 I was thinking about the example of the nested procedure with the same name as a method, and came up with the following code to test my understanding of the situation. type myobj = object constructor init(proc:word); { proc is an arg here } procedure proc; { and a method here } end; constructor myobj.init; begin { the error is here! } end; procedure myobj.proc; begin end; begin end. To be consistent with the previous error, this should signal a syntax error: the argument proc and the method proc are in the same scope. It does signal the error (in TP 6.0, at least), but not until the begin of the constructor. Could someone with TP 5.5 try this, and see if it finds an error? I'm coming to think that the design of objects in TP is wrong: a procedure and its dummy arguments shouldn't be in the same scope. Can anyone comment on whether this code will compile in different object Pascals? Duncan Murdoch