OK, putting this all together, I believe I now understand what next() and prev() do, which is pretty much the way I originally interpreted it. The problem is with the phrase, "If the given value is not a member of the enumeration". While it is correct (though it would be clearer to say "current value" instead of "given value"), it is an exceptional case which is not obvious. Yes, 4.10.3 describes how you can do it, but you normally don't come across that case, so I did not correlate between the two sections. But what did Dave Rich mean, "In regard to the next() method, when the enumerated values are not in ascending numerical order, it's not just a trivial matter to bump up the values to the Nth member."? Probably, 4.10 should explicitly remind you that the default initial value of an enum 4-state variable is X, which is in most cases probably not a member of the enumeration set. See additional comment after the following quotation: >>By the way, I can declare a net as an enum, can't I? In that >case, its >>default initial value would be Z, not X, right? > >You can if it is a 4-state enum. And if you don't drive the >net, then >it will come out Z. But the "default initial value" for the >enum type is >still X. The "default initial value" of the enum type is a >property of >the type, and is defined in a table in the LRM. The next() >method will >return the same result for a given input value of a given enum >type, >regardless of where the value came from. > >The term "default initial value" is somewhat misleading, since >an >undriven net will come out Z regardless of the "default initial >value." >It is less verbose than saying "the same value that would be >used as the >default initial value if you declare a variable of this type" >or "the >value defined for this type in Table XX, which is used for >default initial >values of variables as well as out-of-range indexing and other >things." > >Note that you can also declare a net of integer type, and the >default >initial value for an integer is X, but an undriven net of >integer type >will have a value of Z. [Shalom: ] This is not clear to me. You seem to be referring to Table 6-1 in clause 6.4. A similar table is Table 5-1 in 5.9.6, referring specifically to associative arrays. However, this table seems to be describing specifically initial values of variables, not generally of data types. The reference to "invalid index" in 5.4.1 refers specifically to queues. (BTW, the reference there to "Table 4-1" should be "Table 5-1"). It is not at all clear that a data type has a default initial value which is independent of whether it is a variable or a net. I don't see that this is clearly implied from Table 6-1. ShalomReceived on Wed Nov 2 06:16:27 2005
This archive was generated by hypermail 2.1.8 : Wed Nov 02 2005 - 06:17:41 PST