From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,INVALID_MSGID autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,4e180de737833224 X-Google-Attributes: gid103376,public From: dewar@merv.cs.nyu.edu (Robert Dewar) Subject: Re: Ada Java question => clarification Date: 1997/03/02 Message-ID: #1/1 X-Deja-AN: 222532454 References: <33167E7E.4351@fn3.freenet.tlh.fl.us> Organization: New York University Newsgroups: comp.lang.ada Date: 1997-03-02T00:00:00+00:00 List-Id: Brad said <> Two comments. First, it is always hard to guess why someone may not understand something. Whether Brad's *real* reference is any more correct than the RM references given depends on what you do and do not understand. If your problem was that you did not realize that case statements required static constants, then the original reference was fine. if you knew that, but did not know what a static constant is, then some other RM reference is right, if you know what a static constant is, but had forgotten that a pragma Import does not make a constant static, then some other reference is right, if you want to know WHY a pragma Import does not make a constant static ("Hey, look at my Java code, it is obviously a static constant there"), then some other RM reference is appropriate. That's the trouble with giving an RM reference. You will never know which is the right one, and if you give a wrong one, you waste the programmer's time on a wild goose chase. Second, I don't see what is so unfortunate about this, it seems, if you think about it, a natural restriction. I guess you could say it is unfortunate that we do not have a kind of combined Ada-Java standard, with combined semantics, and a combined compiler, but that would be asking a lot :-) Generally, you cannot expect an Ada compiler to understand anything about a foreign language unit that would require looking inside the unit and understanding it in foreign language terms. Yes one can imagine an Ada-to-Java compiler that would have this capability, but it is certainly not something you are likely to encounter. Such a compiler could have given a more informative message, something like: "static constant required in case statement" "constant "xxx" is static in Java, but not considered static on the Ada side" or somesuch. I am not sure that any specific RM refernce is particularly helpful here. There is no specific statement in the RM that a constant completed by pragma Import is not-constant, it is the absence of a statement to the contrary that is significant, and it is hard to give negative references to the RM :-)