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,ea4f04ec8d41f5b7 X-Google-Attributes: gid103376,public From: bobduff@world.std.com (Robert A Duff) Subject: Re: Ada83 equivalents for Ada95 Date: 1996/05/10 Message-ID: #1/1 X-Deja-AN: 154124132 references: <31927190.35AA@csehp3.mdc.com> organization: The World Public Access UNIX, Brookline, MA newsgroups: comp.lang.ada Date: 1996-05-10T00:00:00+00:00 List-Id: In article <31927190.35AA@csehp3.mdc.com>, James A. Squire wrote: >Has anybody gone to the trouble of translating code that uses features >new to Ada95 back into its Ada83 equivalent? If anyone knows of such >examples that are available on the Internet, please let me know (email >or comp.lang.ada). I don't know of any such effort. I'm curious as to why you want this. Do you want to develop Ada 95 code, but then run it on a system where Ada 95 does not yet exist, but Ada 83 compilers do exist? It seems pretty difficult, to me. For example, how do you translate access-to-subprogram types into Ada 83? It could be done. Represent an access-to-subprogram value as an integer number. Generate a single subprogram for each access-type-subtype type. This subprogram does a case statement on the integer, and has one branch for every possible subprogram that might have been called. The translation tool would have to do a global analysis of the entire program, to track down every 'Access. For every subprogram P, if somebody wrote P'Access anywhere in the program, assign a unique integer to P, and put a call to P in that case statement mentioned above. Every such P would have to be declared in the visible part of its package, even if in the original source, P is declared in the body. I'm not sure how you would preserve elaboration order, since that case-statement subprogram will need extra with-clauses to be added. In any case, such a tool would be approximately as complex as an Ada compiler -- the same order of magnitude anyway. If you've gone that far, why not just write an Ada 95 compiler? Also, efficiency would suffer. - Bob