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.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,c35edbbda4c7f58f X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news3.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!rz.uni-karlsruhe.de!news.uni-stuttgart.de!carbon.eu.sun.com!btnet-feed5!btnet!news.btopenworld.com!not-for-mail From: "Martin Dowie" Newsgroups: comp.lang.ada Subject: Re: Conditional compilation in Ada? Date: Thu, 18 Nov 2004 06:49:07 +0000 (UTC) Organization: BT Openworld Message-ID: References: NNTP-Posting-Host: host81-152-56-142.range81-152.btcentralplus.com X-Trace: sparta.btinternet.com 1100760547 17403 81.152.56.142 (18 Nov 2004 06:49:07 GMT) X-Complaints-To: news-complaints@lists.btinternet.com NNTP-Posting-Date: Thu, 18 Nov 2004 06:49:07 +0000 (UTC) X-RFC2646: Format=Flowed; Original X-Newsreader: Microsoft Outlook Express 6.00.2900.2180 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Xref: g2news1.google.com comp.lang.ada:6262 Date: 2004-11-18T06:49:07+00:00 List-Id: "Steve" wrote in message news:CfVmd.110500$R05.57670@attbi_s53... > Using variant records means explicitly checking for the variant type and > taking different action based on the variant. Creating a new variation of > the record means modifying the original record (modifying proven code is > never a good thing when it is easily avoided) and chasing each part of the > code that takes different action based on the variants. But the compiler will help you, so long as you use a 'case' with no 'others' branch. And the check on the variant can be done at compile time not run-time if it is known and assigned to a constant. > Using objects means deriving a new object and overloading specific > operations for that object. The base object isn't touched. > > Also: If the object is declared statically, the dispatching may happen > statically. I've seen compilers that do this for the variant record method (most seem to in my experience) - is this true for the OO method? Cheers -- Martin