comp.lang.ada
 help / color / mirror / Atom feed
* Disambiguation
@ 2005-06-24 12:00 Alex R. Mosteo
  2005-06-24 12:12 ` Disambiguation Duncan Sands
  2005-06-25  5:56 ` Disambiguation Jeffrey Carter
  0 siblings, 2 replies; 5+ messages in thread
From: Alex R. Mosteo @ 2005-06-24 12:00 UTC (permalink / raw)


Hello, see this test program:

procedure Test_Ambig is

    type X is (Data, Meta);

    procedure Foo (Data : in Natural) is
       Z : constant X := Meta;
    begin
       case Z is
--         when Data     => null;
--         when X'(Data) => null;
--         when X.Data   => null;
--         when X (Data) => null;
          when Meta       => null;
       end case;
    end Foo;

begin
    null;
end Test_Ambig;

-----

I've tried the four commented lines (though I'm pretty sure three of 
them don't make sense) to get this to compile with Gnat for linux (3.4.2 
and all GAP releases). I think this is one of these cases where the 
answer is obvious but you need the eyes of other person. Is there some 
way to qualify "Data" as the enumeration type instead of the procedure 
parameter? Or is this simply a no-no caused by hiding? Thanks!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Disambiguation
  2005-06-24 12:00 Disambiguation Alex R. Mosteo
@ 2005-06-24 12:12 ` Duncan Sands
  2005-06-24 12:48   ` Disambiguation Alex R. Mosteo
  2005-06-24 18:19   ` Disambiguation Martin Dowie
  2005-06-25  5:56 ` Disambiguation Jeffrey Carter
  1 sibling, 2 replies; 5+ messages in thread
From: Duncan Sands @ 2005-06-24 12:12 UTC (permalink / raw)
  To: comp.lang.ada; +Cc: Alex R. Mosteo

Use Test_Ambig.X



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Disambiguation
  2005-06-24 12:12 ` Disambiguation Duncan Sands
@ 2005-06-24 12:48   ` Alex R. Mosteo
  2005-06-24 18:19   ` Disambiguation Martin Dowie
  1 sibling, 0 replies; 5+ messages in thread
From: Alex R. Mosteo @ 2005-06-24 12:48 UTC (permalink / raw)


Duncan Sands wrote:
> Use Test_Ambig.X

Arrrrr. Thanks!



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Disambiguation
  2005-06-24 12:12 ` Disambiguation Duncan Sands
  2005-06-24 12:48   ` Disambiguation Alex R. Mosteo
@ 2005-06-24 18:19   ` Martin Dowie
  1 sibling, 0 replies; 5+ messages in thread
From: Martin Dowie @ 2005-06-24 18:19 UTC (permalink / raw)


Duncan Sands wrote:
> Use Test_Ambig.X

Test_Ambig.Data surely?

Cheers

-- Martin



^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Disambiguation
  2005-06-24 12:00 Disambiguation Alex R. Mosteo
  2005-06-24 12:12 ` Disambiguation Duncan Sands
@ 2005-06-25  5:56 ` Jeffrey Carter
  1 sibling, 0 replies; 5+ messages in thread
From: Jeffrey Carter @ 2005-06-25  5:56 UTC (permalink / raw)


Alex R. Mosteo wrote:
> Hello, see this test program:

Everything in Ada has a complete name starting with Standard.

> 
> procedure Test_Ambig is

this is Standard.Test_Ambig.

> 
>    type X is (Data, Meta);

These are Standard.Test_Ambig.X, Standard.Test_Ambig.Data, & 
Standard.Test_Ambig.Meta.

> 
>    procedure Foo (Data : in Natural) is

These are Standard.Test_Ambig.Foo and Standard.Test_Ambig.Foo.Data.

>       Z : constant X := Meta;

This is Standard.Test_Ambig.Foo.Z.

Generally, you can leave off the "Standard." :)

-- 
Jeff Carter
"No one is to stone anyone until I blow this whistle,
do you understand? Even--and I want to make this
absolutely clear--even if they do say, 'Jehovah.'"
Monty Python's Life of Brian
74



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-06-25  5:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-24 12:00 Disambiguation Alex R. Mosteo
2005-06-24 12:12 ` Disambiguation Duncan Sands
2005-06-24 12:48   ` Disambiguation Alex R. Mosteo
2005-06-24 18:19   ` Disambiguation Martin Dowie
2005-06-25  5:56 ` Disambiguation Jeffrey Carter

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