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 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!purdue!decwrl!ucbvax!MBUNIX.MITRE.ORG!emery From: emery@MBUNIX.MITRE.ORG (Emery) Newsgroups: comp.lang.ada Subject: re: conditional compilation Message-ID: <8912120008.AA19332@mbunix.mitre.org> Date: 12 Dec 89 00:08:33 GMT Sender: usenet@ucbvax.BERKELEY.EDU Organization: The Internet List-Id: Bill Wolfe writes: > Now are you REALLY contending that any competent maintainer is > going to fail to understand the following? > type foo_bar (MACHINE : SYSTEM{NAME := SYSTEM.SYSTEM_NAME) is record > X : Integer; > case MACHINE is > when VAX => Y : Float_64; > when IBM_PC_WITH_8087 => Y : IEEE_Float; > end case; > end record; I contend that any competent compiler will REJECT this code for (at least) two reasons: 1. There is no guarantee that an arbitrary compiler will have either of the two enumeration values "VAX" or "IBM_PC_WITH_8087" in the type SYSTEM.NAME. Furthermore, the declaration is ILLEGAL if the (enumeration type) SYSTEM.NAME has additional values besides the two mentioned (although the addition of "when others => null;" would at least fix this problem.) 2. Even if these two exist, the program is still semantically ILLEGAL, as you would have two components both named Y, which is not permitted. Furthermore, there are many reasons besides host machine name for doing separate compilation. One that comes immediately to mind occurs when a specific feature is present or absent from the version of the operating system generated for a given machine. I've seen this rather frequently in Unix. L.T.F.L. dave emery emery@aries.mitre.org