Stu, There are a number of open mantis issues on this - 2385,2451, and most implementations are allowing something different than what is in the LRM. Users don't want to specify the default twice and it usually the case that the identifiers used in the default expressions are from within the scope of where the prototype is declared. As soon as you make defaults "optional" in the body, it's no longer clear if the default specification is replacing are adding to the existing defaults. Virtual methods are another case. But there, you are overriding and existing definition, and the compiler does need to know statically which arguments are required. Dave > -----Original Message----- > From: owner-sv-ec@server.eda.org [mailto:owner-sv-ec@server.eda.org] On > Behalf Of Neil Korpusik > Sent: Friday, October 03, 2008 11:22 AM > To: SV_EC List > Cc: Stuart Sutherland > Subject: [sv-ec] extern methods with default arg values > > <forwarding email from stuart@sutherland-hdl.com -- the reflector ate it > the first time through> > > Note that sub clause 8.23 of draft 7 states: > "The out-of-block method declaration shall match the prototype declaration > exactly" > > Does this mean that if a method argument has a default value assignment, > the > default needs to be given in both the prototype and the full definition? > Does the default value have to be exactly the same in both places? > > I'm asking because a method prototype in an interface appears to have a > different set of rules. Subclause 25.7 states: > "If a default argument value is needed in a subrou-tine call, it shall be > specified in the prototype. If an argument has default values specified in > both the prototype and the declaration, the specified values need not be > the > same, but the default value used shall be the one specified in the > prototype." > > In an interface it is clear that the default arg value is in the prototype, > and is optional in the full definition, and that the value in the full > definition is ignored. > > Stu > ~~~~~~~~~~~~~~~~~~~~~~~~~ > Stuart Sutherland > stuart@sutherland-hdl.com > +1-503-692-0898 > www.sutherland-hdl.com > > > -- > This message has been scanned for viruses and > dangerous content by MailScanner, and is > believed to be clean. -- This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.Received on Fri Oct 3 15:22:52 2008
This archive was generated by hypermail 2.1.8 : Fri Oct 03 2008 - 15:23:36 PDT