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=-0.8 required=5.0 tests=BAYES_00,INVALID_DATE autolearn=no autolearn_force=no version=3.4.4 Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.3 4.3bsd-beta 6/6/85; site ucbvax.BERKELEY.EDU Path: utzoo!watmath!clyde!burl!ulysses!ucbvax!engvax.UUCP!GORDON From: GORDON@ENGVAX.UUCP (Misty Dragon E.) Newsgroups: net.lang.ada Subject: re: Mixing VAX Ada and Pascal Message-ID: <8603180741.AA14249@csvax.caltech.edu> Date: Mon, 17-Mar-86 18:37:33 EST Article-I.D.: csvax.8603180741.AA14249 Posted: Mon Mar 17 18:37:33 1986 Date-Received: Wed, 19-Mar-86 04:01:53 EST Sender: uucp@ucbvax.BERKELEY.EDU Organization: The ARPA Internet List-Id: [this is a second submission. Sorry if you already got it...] > We are currently transfering programs from Pascal to Ada. Some of the Pascal >programs are moderate size, and extend over several source files. So, we have >replaced the source files one by one - being in the VAX environment, one is >supposed to be able to do things such as that (makes up for using VMS :-). > > However, there seems to be a problem using access types (pointers) and >discriminant records (variant records). The access type variables don't >point to the proper places. Has anyone else tried this?? Any suggestions?? I have responded in detail to the originator of this question. In summary: * Discriminant records * Pascal lays out the discriminant where it occurs in the elaboration. Ada puts the discriminant at the beginning of the record (after any representation clauses). The solution is to use a proper rep. clause in Ada. * Pointers * Work just fine. Both are 32 bit longwords. Remember to pass them by reference to Pascal routines (get Pragmas and Pascal declarations right) Also pay attention to data type representations. I do mixed-language programming in Pascal and Ada all the time under VMS. I find it much more efficient to write Ada packages that properly interface the Pascal routines rather than convert code from Pascal to Ada. After all, this approach seems to me to be more in the "Ada spirit". If anyone is interested in more detail, I will forward (or post) details. However, everything is very well explained in The VAX ADA Runtime Reference Manual and the Pascal User's Guide. [Incidentally, as an old Pascal user, new to Ada, I would like to plug the book "Ada For Experienced Programmers" by Habermann and Perry from CMU. Published by Addison Wesley. It lays out a familar Pascal operation and "how to" in Ada right next to it.] Gordon Howell (Misty Dragon E.) engvax!gordon@csvax.caltech.edu