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.7 required=5.0 tests=BAYES_00,INVALID_DATE, MSGID_SHORT,REPLYTO_WITHOUT_TO_CC autolearn=no autolearn_force=no version=3.4.4 Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!clyde.concordia.ca!uunet!ncrlnk!ncrcae!hubcap!billwolf%hazel.cs.clemson.edu From: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu (William Thomas Wolfe, 2847 ) Newsgroups: comp.lang.ada Subject: Re: "limitations" of conditional compilation Message-ID: <7398@hubcap.clemson.edu> Date: 11 Dec 89 15:58:45 GMT References: <8912110202.AA11909@mbunix.mitre.org> Sender: news@hubcap.clemson.edu Reply-To: billwolf%hazel.cs.clemson.edu@hubcap.clemson.edu List-Id: >From emery@MBUNIX.MITRE.ORG (Emery): > Armin points out that it is perfectly legal to do conditional > compilation of statements based on some (constant) boolean value. [...] > Where this approach fails, though, is in non-statements such as type > declarations. It would be nice to have support for this: > type foo_bar is record > x : integer; > #ifdef VAX > y : float_64; > #elsif IBM_PC_WITH_8087 [...] > > Using these ("constant type") variant records would probably make the > program harder to read, because it wouldn't be clear to the maintainer > if this was a variant record object (or subtype) based on some 'real > variant) or based on some conditional compilation feature. Amazingly enough, the standard SYSTEM package provides precisely the constant that we need to do this... it's SYSTEM.SYSTEM_NAME. 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; The floating-point type definitions are taken from your example, despite the fact that they do not conform to the standard protocol for the naming of any additional compiler-supplied floating-point subtypes (Short_Float, Long_Float, Long_Long_Float, etc.). Bill Wolfe, wtwolfe@hubcap.clemson.edu