>From: "danielm" <danielm@aldec.com.pl> >>I would also assume that you could reference without an object, >>with something like "disable C::t", even for a task that is not a static >method. > >LRM clearly defines that you can refernce by "::" operator only to static >properties and static methods. It should be explicitly defined in LRM if >there are any exeptions You have a valid point. I was not considering the actual wording of the restriction in the LRM. I was considering the reason for the restriction, which does not apply here, and therefore assuming that the restriction did not apply. But if we are going strictly by what the LRM says, then I don't think you can disable a non-static method at all. The disable statement takes a hierarchical path. I don't believe that a class-select qualifies as a hierarchical path. If that is true, then you cannot use a class-select as the target of a disable. I guess you could still disable a non-static method from inside any non-static method of the class. From there it is legal to reference a non-static method, and the reference is not explicitly a class-select. Normally a reference is allowed because it is implicitly using the same object as the current method, i.e. it is an implicit class reference. In the case of a disable, no object is needed. So the fact that a disable can only be performed from there is an artificial restriction. For a static method, it could be debated whether C::t is considered to be a hierarchical name of a task. If so, then static methods can be disabled that way. Otherwise they could only be disabled from inside the class. I don't see any reason why C::t would not be considered a hierarchical name of a task for this purpose. >> The actual type of the object might determine which implementation of the >task would get disabled (i.e. the task declared in which base class). >> This is so strange that I would support making it illegal. > >If so then this also should be explicitly defined by LRM If you accept my argument that class-selects cannot be the target of a disable, then there is no way to specify an object to select a virtual method implementation. You could only specify a particular static method in a particular class. This would be a little strange for a disable of a virtual method from inside a class method. If this were a call to the virtual method, then the 'this' object would determine which implementation is called. But a disable of the method is not a reference through a class object. It is a static hierarchical path. As such, it would always refer to the implementation in the same class definition where the disable appears. This is somewhat irregular. Steven Sharp sharp@cadence.com -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Thu Jul 19 17:22:53 2007
This archive was generated by hypermail 2.1.8 : Thu Jul 19 2007 - 17:23:30 PDT