comp.lang.ada
 help / color / mirror / Atom feed
From: mendal@SIERRA.STANFORD.EDU (Geoffrey O. Mendal)
Subject: Nasty Expanded Names Semantics
Date: 20 Jun 88 01:20:38 GMT	[thread overview]
Message-ID: <8806200116.AA02895@ajpo.sei.cmu.edu> (raw)

Dear Ada Fans-

After a long Spring of not asking any silly questions, we're back!
We've run the following code through the Verdix VADS and DEC-Ada
compilers with different results.  At issue is what is meant by
the following sentence found in 4.1.3(17):

  In the case of an accept statement, the prefix must be either the
  simple name of the entry or entry family, or an expanded name
  ending with such a simple name (that is, no index is allowed).

Here's our test case:

  procedure Nested_Accepts is
    task T is
      entry X (I : in out Integer);
      entry Y (I : in out Integer);
      entry Z (I : in out Integer);
    end T;

    task body T is
    begin
      accept X (I : in out Integer) do
        accept Y (I : in out Integer) do
          accept Z (I : in out Integer) do
            I := X.Y.I;                    -- 1.
            I := Z.I;                      -- 2.
	    I := X.I;                      -- 3.
            I := T.Y.I;                    -- 4.
            I := Nested_Accepts.T.X.I;     -- 5.
          end Z;
        end Y;
      end X;
    end T;
  begin
    null;  -- No illegality here! :-)
  end Nested_Accepts;

Specifically, what does the phrase "ending with such a simple name" mean?
Does it mean the last simple name of the entire prefix or does it mean
the "tail" of the entire prefix (strip off the first name of the prefix)?

Clearly, statement #1 above is illegal by any interpretation of 4.1.3(17).
Also, statements #2 and #3 would seem to be clearly legal.  The problem
of interpretation comes in with statements #4 and #5.  Are they both
legal or illegal?  Different compilers give different answers.

The Compiler Implementors Guide and Ada Rapporteur Group Notes do not
seem to tackle this issue, so we're asking you.

Thanks in advance for any (correct) answers.

Geoff and Doug

             reply	other threads:[~1988-06-20  1:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1988-06-20  1:20 Geoffrey O. Mendal [this message]
1988-06-24 12:54 ` Nasty Expanded Names Semantics Arny B. Engelson
  -- strict thread matches above, loose matches on Subject: below --
1988-06-21 17:39 rracine
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox