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,dad94612ff745427 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news1.google.com!news2.google.com!news4.google.com!news.glorb.com!newsfeed00.sul.t-online.de!t-online.de!tiscali!newsfeed1.ip.tiscali.net!fi.sn.net!newsfeed2.fi.sn.net!newsfeed3.funet.fi!newsfeeds.funet.fi!newsfeed.kolumbus.fi!feeder2.news.jippii.net!feeder1.news.jippii.net!nntp.inet.fi!inet.fi!newsfeed1.nokia.com!news1.nokia.com!not-for-mail From: rick H Subject: Re: Instantiating private types with discriminants? Newsgroups: comp.lang.ada References: <4460B32B.FA67A35F@raytheon.com> Organization: home User-Agent: tin/1.8.1-20060215 ("Mealasta") (UNIX) (CYGWIN_NT-5.1/1.5.19(0.150/4/2) (i686)) Message-ID: <7M28g.28781$Nb2.522209@news1.nokia.com> Date: Tue, 09 May 2006 15:42:59 GMT NNTP-Posting-Host: 172.26.210.110 X-Complaints-To: newsmaster@nokia.com X-Trace: news1.nokia.com 1147189379 172.26.210.110 (Tue, 09 May 2006 18:42:59 EET DST) NNTP-Posting-Date: Tue, 09 May 2006 18:42:59 EET DST Xref: g2news2.google.com comp.lang.ada:4160 Date: 2006-05-09T15:42:59+00:00 List-Id: Jerry Petrey wrote: > > You could use function notation for the correct "=" as follows: > > if Ada.Tags."=" (Var_A'Tag, Type_A'Tag) then > Ada.Integer_Text_IO.Put ( Type_A (Var_A.all).Data); > elsif Ada.Tags."=" (Var_A'Tag, Type_B'Tag) then > Ada.Float_Text_IO.Put ( Type_B (Var_A.all).Data); > end if; > Thanks, Jerry - that makes sense. I recall ploughing (plowing) through John Barne's book a few weeks ago where he referred to the function notation...and I had a quiet chuckle when I realised that in Ada you can express C := A + B; as C := Standard."+" (Left => A, Right => B); if you really want to! Rick