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-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,499373c5a06cccc1 X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2004-02-17 06:37:26 PST Path: archiver1.google.com!postnews1.google.com!not-for-mail From: ganesh.ramasivan@gdcanada.com (Ganesh Ramasivan) Newsgroups: comp.lang.ada Subject: Re: Variant records.. Date: 17 Feb 2004 06:37:26 -0800 Organization: http://groups.google.com Message-ID: References: NNTP-Posting-Host: 209.47.1.92 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: posting.google.com 1077028646 23160 127.0.0.1 (17 Feb 2004 14:37:26 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 17 Feb 2004 14:37:26 +0000 (UTC) Xref: archiver1.google.com comp.lang.ada:5634 Date: 2004-02-17T06:37:26-08:00 List-Id: Preben Randhol wrote in message news:... > On 2004-02-16, Ganesh Ramasivan wrote: > > Preben Randhol wrote in message news:... > >> On 2004-02-15, Ganesh Ramasivan wrote: > >> > In the following example, how would i forbid the user of data type Foo > >> > from specifying the following: > >> > > >> > John : Foo(Vehicle => MAN, Power => AUTOMATIC); > >> > > >> > ie. is there a way to restrict the user from specifying certain types > >> > as variants? > >> > >> I guess this is homework? If it is why don't you simply try to do this > >> and see what happens? > > > > This is just a simple example I am working with as I am an ada newbie. > > > > I tried and it compiles. What I am trying to do is to prevent the user > > from creating types that do not make sense. > > If you put > > Audio : Foo(Vehicle => MAN, Power => AUTOMATIC); > > it won't compile, so I do not really understand your question. Sorry, but I don't see why you think this won't compile. I tried it and it does compile.