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.2 required=5.0 tests=BAYES_00,INVALID_MSGID, REPLYTO_WITHOUT_TO_CC 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: ncohen@watson.ibm.com (Norman H. Cohen) Subject: Re: Ada83 equivalents for Ada95 Date: 1996/05/29 Message-ID: <4ohivu$jsh@watnews1.watson.ibm.com>#1/1 X-Deja-AN: 157348243 distribution: world references: <31A66DAA.7418@sud.ed.ray.com> organization: IBM T.J. Watson Research Center reply-to: ncohen@watson.ibm.com newsgroups: comp.lang.ada Date: 1996-05-29T00:00:00+00:00 List-Id: In article , bobduff@world.std.com (Robert A Duff) writes: |> And as Brad says, there aren't many problems. The two *worst* problems |> are probably: (1) There are now 256 Characters, instead of 128, and (2) |> generic formals need a (<>) to accept an unconstrained array. A third problem right up there with those is that package bodies that are not required are now forbidden: package Data is Table: array (1 .. 100 ) of Float; ... end Data; package body Data is -- legal but dangerous in Ada 83, illegal in Ada 95 begin for I in Table'Range loop Table(I) := ...; end loop; end Data; There are simple tricks that can be used in Ada 83 to make the package body required, and hence legal. Here's one that was posted here recently: package Data is Table: array (1 .. 100 ) of Float; ... private type Package_Body_Needed; end Data; package body Data is -- legal but dangerous in Ada 83, illegal in Ada 95 type Package_Body_Needed is record null; end record; begin for I in Table'Range loop Table(I) := ...; end loop; end Data; (One can also use a dummy subprogram rather than a dummy type.) This should be done even in Ada-83 code that will never be ported to Ada 95. Otherwise, it's too easy to accidently build a system that includes the declaration but not the body of package Data, meaning that Data.Table never gets initialized. -- Norman H. Cohen ncohen@watson.ibm.com