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,FREEMAIL_FROM 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!news4.google.com!news.glorb.com!wns14feed!worldnet.att.net!attbi_s53.POSTED!53ab2750!not-for-mail From: "Steve" Newsgroups: comp.lang.ada References: Subject: Re: Conditional compilation in Ada? X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 Message-ID: NNTP-Posting-Host: 24.22.63.157 X-Complaints-To: abuse@comcast.net X-Trace: attbi_s53 1100750946 24.22.63.157 (Thu, 18 Nov 2004 04:09:06 GMT) NNTP-Posting-Date: Thu, 18 Nov 2004 04:09:06 GMT Organization: Comcast Online Date: Thu, 18 Nov 2004 04:09:20 GMT Xref: g2news1.google.com comp.lang.ada:6261 Date: 2004-11-18T04:09:20+00:00 List-Id: I disagree with your argument. Dynamic dispatching is fairly efficient, and may simplify coding. Dispatching generally means getting the address of a function from a vtab rather than calling the function directly. 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. 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. Steve (The Duck) "Jeffrey Carter" wrote in message news:xxOmd.1541$Tq6.592@newsread3.news.pas.earthlink.net... > Steve wrote: > > > Without knowing more details, this sounds like a good place to use > > OOP. > > > > Instead of directly manipulating the data structure, use procedures > > to manipulate the data structure, and dispatch to the appropriate > > instance type for your target. > > I would disagree. Using OOP and dispatching means that the decision > making is dynamic and occurs at run time. Using variant records and case > statements allows everything to be static and determined at compile time. > > -- > Jeff Carter > "I'm a kike, a yid, a heebie, a hook nose! I'm Kosher, > Mum! I'm a Red Sea pedestrian, and proud of it!" > Monty Python's Life of Brian > 77 >