> Behalf Of Gordon Vreugdenhil > I addressed that aspect earlier -- "this" is special in that > it is the "object on which the method is invoked". The fact > is that "this.x" is (normally) just a pseudonym for "x" if > "x" is a member of the class. The interpretation that you > and Arturo are suggesting changes that natural expectation > but ONLY in the context of an inline constraint -- which is > also the only place in which "this" could conceivably have > two meanings. > Since "x" can go either way, I believe that it would be much > more surprising to find that it can't. I am surprised at this. I thought your original issue was that you wanted to make name binding more deterministic. In this case you are arguing for less deterministic name binding. Consider this pathological example: class A; int x, y; endclass class B; int x; endclass class C #(type TP); function void doRand(TP v); v.randomize with { this.x < this.y; }; endfunction int x, y; endclass C #(A) c1 = new; C #(b) c2 = new; A a = new; B b = new; initial begin c1.doRand(a); // In c1, 'this.y' binds to field 'y' of class 'A' c2.doRand(b); // In c2, 'this.y' binds to field 'y' of class 'C' end Is this the type of non-deterministic binding you really want? -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Sat Dec 15 18:32:34 2007
This archive was generated by hypermail 2.1.8 : Sat Dec 15 2007 - 18:33:07 PST