Folks,
I've just been looking over IR2058 before today's meeting, and want to note
some comments in advance...
The submitter draws attention to the phrase "the identifier and the named
entity (if any) are also said to be visible from that point," and asks
whether this also refers to the operators and literals associated with the
identifier.
I think the answer to this becomes clear if you look at the context
surrounding the phrase. It is part of 10.3, and is preceded by an extended
description of when a declaration is visible. The complete paragraph
containing the phrase is:
Whenever a declaration with a certain identifier is visible from a given
point, the identifier and the named entity (if any) are also said to be
visible from that point. Direct visibility and visibility by selection are
likewise defined for character literals and operator symbols. An operator
is
directly visible if and only if the corresponding operator declaration is
directly visible.
The first sentence simply defines terminology. It ascribes meaning to
saying that an identifier is visible and that a named entity is visible, as
distinct from saying that a declaration is visible. The second sentence
similarly ascribes meaning to saying that a character literal or an operator
symbol is visible, since they are defined by declarations. The third
sentence describes conditions for an operator to be visible.
Another key specification is in 10.4:
If the suffix of the selected name is a simple name, character literal, or
operator symbol, then the selected name identifies only the declaration(s)
of that simple name, character literal, or operator symbol contained
within
the package or library denoted by the prefix of the selected name.
This makes it clear that other names associated with the identified simple
name, character literal or operator symbol are not identified by the
selected name in the use clause. Only the identified declarations are made
potentially visible.
So my interpretation of the LRM is that, when you identify the name of a
type or subtype in a use clause, you only get that name made visible, and
not any literals or operators defined either implicitly or explicitly.
I guess the obvious follow-on question is whether the LRM should be changed
to make other declarations visible. However, I suspect this would be to
open a can of worms. For example, should only predefined operations come
along for the ride? What about overloads of predefined operations. What
about overloads of operators that aren't predefined for the type? Should it
just be operators, or other predefined operations? And so on...
That's enough from me for now. Plenty to talks about in the telecon.
Cheers,
PA
-- Dr. Peter J. Ashenden peter@ashenden.com.au Ashenden Designs Pty. Ltd. www.ashenden.com.au PO Box 640 Ph: +61 8 8339 7532 Stirling, SA 5152 Fax: +61 8 8339 2616 Australia Mobile: +61 414 70 9106Received on Thu Feb 3 16:56:21 2005
This archive was generated by hypermail 2.1.8 : Thu Feb 03 2005 - 16:56:23 PST