Comments on IR2099

From: Peter Ashenden <peter_at_.....>
Date: Thu Feb 01 2007 - 16:20:02 PST
Chuck,

As always, a great job of exposing and analyzing the issues. I've just got
some minor comments on the corner cases...

I don't think we need to invent the new term "alias-equivalent". The LRM
defines the term "denote" in the Clause 4 preamble. We can just use refer to
two decarations denoting the same named entity. Thus, the first two changes
to 10.3 could be:


Clause 10.3 Visibility

Change:

"-- The visibility rules determine more than one possible meaning. In
such a case, the occurrence of the identifier is legal at this point if
and only if exactly one visible declaration is acceptable for the
overloading rules in the given context."

To:

"-- The visibility rules determine more than one possible meaning. In
such a case, the occurrence of the identifier is legal at this point if
and only if either exactly one visible declaration is acceptable for the
overloading rules in the given context or all visible declarations denote
the same named entity."


Add to:

"If overloading is allowed for both declarations, then each of the two
is a homograph of the other if they have the same identifier, operator
symbol, or character literal, as well as the same parameter and result
type profile (see 3.1.1)"

",except that declarations that denote the same named entity are not
homographs."

--

Next, a couple of comments on the further change in 10.3:

Replace:

"Two declarations that occur immediately within the same declarative
region, ..., must not be homographs, unless exactly one of them is the
implicit declaration of a predefined operation."

with

"Two declarations that occur immediately within the same declarative
region, ..., must not be homographs, unless exactly one of them is the
implicit declaration of a predefined operation or is an implicit alias of
such
an implicit declaration."


First, I suggest saying the that permitted alias be an implicit alias, not
an explicit alias. For example, you don't want to allow

  type T is (a, b, c);
  function "=" (L, R : T) return boolean;
  alias "=" is "="[T, T return boolean];

and have the explicit function operator declaration hide the explicit alias
of the operator.

Second, the wording permits the denoted declaration of the alias to be in
another region, and that is ok. For example

  package p is
    type T is (a, b, c);
  end package p;

  package q is
    function "="(L, R : work.p.T) return boolean;
    alias my_T is work.p.T;
  end package q;

Here, the implicit alias of "=" is declared in q, and denotes an implicit
declaration in p. The explicit declaration of "=" is a homograph of the
implicit alias, but hides it.

--

Suggest changing in that same paragraph:

"In such cases, a predefined operation is always hidden by the other
homograph."

To

"In such cases, a predefined operation or alias thereof is always hidden by
the other
homograph."

--

Regarding the change to 10.4: List item a) deals with the case of an
explicit declaration preventing direct visibility of a potentially visible
implicit declaration. List item b) deals with the case of an explicit
declaration preventing direct visibility of a potentially visible explicit
declaration. The proposed wording change to a) does not mention whether the
potentially visible alias is explicitly or implicitly declared. I think it
needs to refer only to an implicit alias, since the explicit case is dealt
with in item b). Thus the change shoulc be

Replace

"a) A potentially visible implicit declaration of a predefined
operation is not mode directly visible if the place considered is
within the scope of an explicitly declared homograph of that implicit
declaration."

with

"a) A potentially visible implicit declaration of a predefined
operation or an implicit alias of such a declaration is not made directly
visible if the place considered is within the scope of an explicitly
declared homograph of that implicit declaration or the implicit alias."


Cheers,

PA
--
Dr. Peter J. Ashenden         peter@ashenden.com.au
Ashenden Designs Pty. Ltd.    www.ashenden.com.au
PO Box 640                    VoIP: sip://0871270078@sip.internode.on.net
Stirling, SA 5152             Phone (mobile):  +61 414 70 9106
Australia



-- 
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Received on Thu Feb 1 16:21:47 2007

This archive was generated by hypermail 2.1.8 : Thu Feb 01 2007 - 16:21:47 PST