comp.lang.ada
 help / color / mirror / Atom feed
From: bbalfour@std.caci.com (Brad Balfour)
Subject: Re: Ada Java question  => clarification
Date: 1997/02/28
Date: 1997-02-28T00:00:00+00:00	[thread overview]
Message-ID: <bbalfour-2802971019510001@stmac0088.std.caci.com> (raw)
In-Reply-To: E6BGyu.Ip6.0.-s@inmet.camb.inmet.com


In article <E6BGyu.Ip6.0.-s@inmet.camb.inmet.com>,
stt@houdini.camb.inmet.com (Tucker Taft) wrote:

>Kendal Van Dyke (kendal@fn3.freenet.tlh.fl.us) wrote:
>
>: Ok, to provide more specific details as to my problem, here are the with
>: and use clauses that accompany the package that contains this function.
>: Again, when I try to compile it I get the error "Direct name, event, is
>: not visible".
[snip]
>...You can
>do any of the following:
>  1) use the full name "java.awt.event" instead of "event";
>  2) drop the use of "event" in "event.UP" and say simply "UP";
>  3) add a "use" clause for "java.awt" which will make the package
>     names "event", "component", "color", and "graphics" directly visible.

However, once you follow #1, you will get the following error for each
case choice:

      WHEN java.awt.event.UP => return true;
keydown.ada: Error: line 30 col 27 LRM:3.8.1(8) & 5.4(5), The expression
in the discrete choice must be static

Despite the two RM95 references quoted above, the real reason is found in
4.9(24) which let's us know that a static constant must be a full constant
declaration or a renaming. java.awt.event.UP is a constant integer whose
value is supplied via a pragma Import. This means that it is constant, but
*not* a static constant.

So, unfortunately, you need to change the case statement into an if statement.

Brad


>:     .                |/                       .
>:     .                |\ENDAL                  .
>:     . WWW   => http://www.cs.fsu.edu/~vandyke .
>:     . EMail => vandyke@cs.fsu.edu             .
>:     . Pager => (904) 297-6658                 .
>-Tucker Taft   stt@inmet.com   http://www.inmet.com/~stt/
>Intermetrics, Inc.  Burlington, MA  USA

-- 
Brad Balfour                            SIGAda WWW Server
CACI, Inc.                                http://www.acm.org/sigada/
(703) 277-6767                          and also try:
bbalfour@std.caci.com                     http://www.adahome.com/
3930 Pender Drive     Fairfax, VA 22030
   "...they even have rules for exceptions" -- Dewar and Schonberg




  reply	other threads:[~1997-02-28  0:00 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1997-02-26  0:00 Ada Java question Kendal Van Dyke
1997-02-27  0:00 ` Tucker Taft
1997-02-28  0:00   ` Ada Java question => clarification Kendal Van Dyke
1997-02-28  0:00     ` Tucker Taft
1997-02-28  0:00       ` Brad Balfour [this message]
1997-02-28  0:00         ` Kendal Van Dyke
1997-02-28  0:00           ` Norman H. Cohen
1997-03-01  0:00             ` David Taylor
1997-03-02  0:00               ` Robert Dewar
1997-03-06  0:00                 ` David Taylor
1997-03-08  0:00                   ` tagged type auto-"Use", was " Tom Moran
1997-03-10  0:00                     ` Dennis Reimer
1997-03-09  0:00                   ` Robert Dewar
1997-03-09  0:00                     ` Larry Kilgallen
1997-03-09  0:00                       ` Robert Dewar
1997-03-15  0:00                         ` Matthew Heaney
1997-03-01  0:00           ` Fergus Henderson
1997-02-28  0:00         ` Ada Java question => oops!! Kendal Van Dyke
1997-03-02  0:00         ` Ada Java question => clarification Robert Dewar
1997-03-03  0:00           ` Brad Balfour
1997-03-05  0:00             ` Robert Dewar
1997-03-05  0:00               ` Brad Balfour
1997-02-28  0:00 ` Ada Java question Tom Halliley
replies disabled

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