comp.lang.ada
 help / color / mirror / Atom feed
From: "John R. Strohm" <strohm@airmail.net>
Subject: Re: casecrash: language lawyers: C'mon!
Date: Tue, 17 Jul 2001 22:43:51 -0500
Date: 2001-07-17T22:43:51-05:00	[thread overview]
Message-ID: <AF90BB90E03E608D.447DE4CBCE9D9148.37FD9A43DA8A1090@lp.airnews.net> (raw)
In-Reply-To: 9j1cpn$bis$1@infosun2.rus.uni-stuttgart.de

Without digging out my long-buried LRM, I seem to recall that Ada is NOT, I
say again NOT, case-sensitive.

That being the case,

    H : Header;

hides the enumeration literal H where you defined record_type, and your
"when H =>" clause tried to resolve against the instance of Header, which is
obviously bogus.

You MIGHT try changing that to

    when record_type'(H) =>

and see what happens.  I would not bet on it working.

Peter Hermann <ica2ph@iris16.csv.ica.uni-stuttgart.de> wrote in message
news:9j1cpn$bis$1@infosun2.rus.uni-stuttgart.de...
>                       with ada.text_io;use ada.text_io;
> procedure casecrash is
>  type record_type is (A,B,C,D,E,F,G,H,I,J,K,L,unknown);
>  type header is record
>     id_letter : record_type := unknown;
>  end record;
>  H : Header;
> begin
>  case h.id_letter is
>   when A => put("a");
>   when H => put("h"); -- H conflict, name clash?
>                       -- no context resolution?
>   when others => put("*");
>  end case;
> end casecrash;--20010717ph+frehrmann
>
> LRM:8.3(26), illegal homograph of H
> LRM:8.6(28)
>
> Why on earth should I accept this rule in this case?
> Topic for Ada2005?
>
>
> --
> Peter Hermann Tel+49-711-685-3611 Fax3758 ica2ph@csv.ica.uni-stuttgart.de
> Pfaffenwaldring 27 Raum 114, D-70569 Stuttgart Uni Computeranwendungen
> http://www.csv.ica.uni-stuttgart.de/homes/ph/
> Team Ada: "C'mon people let the world begin" (Paul McCartney)





  reply	other threads:[~2001-07-18  3:43 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-17 12:58 casecrash: language lawyers: C'mon! Peter Hermann
2001-07-18  3:43 ` John R. Strohm [this message]
2001-07-18  7:18   ` Martin Dowie
2001-07-18  9:36     ` Philip Anderson
2001-07-19 21:39   ` Robert Dewar
2001-07-19 21:37 ` Robert Dewar
  -- strict thread matches above, loose matches on Subject: below --
2001-07-18  9:09 Peter Hermann
2001-07-18 20:57 ` Tucker Taft
2001-07-19  8:57   ` Peter Hermann
replies disabled

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