Yes, it's so unambiguous that even though you seem to be quite
intelligent, you're interpreting it completely incorrectly.
Not so fast! Plaudit and brickbat both delivered
much too hastily here
The standard does not say that only that name is made visible -- it
says that the _declaration_ is made visible.
[by a use clause such as "use lib.pkg.typename;"]
Correct.
An enumeration
declaration, however, can create more than one name: specifically, it
creates the name of the enumeration type itself, AND it can also create
an arbitrary number of enumeration literals.
Incorrect. The enumeration literals are "created" [sic] by their
own declarations. See section 3.1.1, describing what's going on
in an "enumeration type definition", i.e. the parenthesised list
of enumeration literals that forms part of an enumeration type
declaration:
Each enumeration literal is the declaration of the
corresponding enumeration literal
In other words, when you write something like
type T is (A,B,C,D);
you have in fact written several distinct declarations - one
for the type name and one for each literal name.
If your interpretation was taken as correct, then even within the scope
of the enumeration declaration, the names of the enumeration literals
would not be visible -- the standard seems to use the same terms to
decribe the visibility of a declaration whether because it is in scope
or because it has been use'd.
You had me very worried when you wrote this, because it seems so
reasonable. But once again, on *very* close reading of the LRM
we find that its authors were extremely careful to tie everything
together. They were, arguably, less successful in making it easy
to find the answer to a single specific question by a
straightforward reading of the apparently relevant section; you
generally have to read stuff from all over the LRM because each
section of the manual does so much work in providing definitions
and context for subsequent sections. So I can't claim I have
a complete definitive solution here.
Not long after 1076-1987 was published, an additional document
of "Interpretations" was also released to clarify some tricky
issues in the LRM. I am fairly sure that this issue was one
of those raised in that interpretations document, but I can't
track down a copy right now. Maybe someone else can recall
whether it addressed this problem?
--
Jonathan Bromley, Consultant
DOULOS - Developing Design Know-how
VHDL, Verilog, SystemC, Perl, Tcl/Tk, Verification, Project Services
Doulos Ltd. Church Hatch, 22 Market Place, Ringwood, BH24 1AW, UK
Tel: +44 (0)1425 471223 mail:
[email protected]
Fax: +44 (0)1425 471573 Web:
http://www.doulos.com
The contents of this message may contain personal views which
are not the views of Doulos Ltd., unless specifically stated.