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.4 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00 autolearn=no autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,e429176c9adb07b X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-02-20 04:52:30 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!cyclone.bc.net!sjc70.webusenet.com!news.webusenet.com!newsfeed2.earthlink.net!newsfeed.earthlink.net!stamper.news.pas.earthlink.net!stamper.news.atl.earthlink.net!harp.news.atl.earthlink.net!not-for-mail From: "Marin David Condic" Newsgroups: comp.lang.ada Subject: Re: [OT] Best way to isolate a GUI? Date: Thu, 20 Feb 2003 07:51:12 -0500 Organization: MindSpring Enterprises Message-ID: References: NNTP-Posting-Host: d1.56.a0.36 X-Server-Date: 20 Feb 2003 12:52:26 GMT X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2314.1300 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Xref: archiver1.google.com comp.lang.ada:34270 Date: 2003-02-20T12:52:26+00:00 List-Id: Oh, there may be cases here and there. And its always easy to construct an artificial scenario where variant records look better. Just that in practice, the places where I've used variant records have usually turned out to be more elegantly and less painfully dealt with by tagged records. I've got Ada83 code where its been used - usually for some sort of message and occasionally for some sort of parser thing - and in all the cases where I've seen it & used it, I'd rather have substituted a base class with dispatching operations. Its a personal judgement call and based on field usage rather than a language rule or academic concern. I'd never tell anyone they *couldn't* use variant records and I wouldn't suggest removing them from the language. I've just found them to be a big pain in comparison to tagged records in most of the uses I've come across. MDC -- ====================================================================== Marin David Condic I work for: http://www.belcan.com/ My project is: http://www.jsf.mil/ Send Replies To: m c o n d i c @ a c m . o r g "Going cold turkey isn't as delicious as it sounds." -- H. Simpson ====================================================================== wrote in message news:Ri05a.173335$tq4.4827@sccrnsc01... > >Short of possibly efficiency concerns or representation issues, I just don't > >see much excuse for variant records when we've got tagged types. > Whoa there! If you have default discriminants, you can have > Transport : Vehicle(Kind=>Car, Horsepower=>100); > and later > Transport := (Kind=>Truck, Axle_Count=>3, Capacity => Tons'(0.5)); > and the compiler will even warn you if you forget and try: > Transport := (Kind=>Truck, Capacity => Tons'(0.5)); > That's a lot simpler than futzing with > Transport : Vehicle_Ptr := new Car'(Horsepower=>100); > etc