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-16 08:16:45 PST Path: archiver1.google.com!news2.google.com!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!news-FFM2.ecrc.net!uio.no!ntnu.no!not-for-mail From: Preben Randhol Newsgroups: comp.lang.ada Subject: Re: Variant records.. Date: Mon, 16 Feb 2004 16:16:44 +0000 (UTC) Organization: PVV Message-ID: References: NNTP-Posting-Host: k-083152.nt.ntnu.no X-Trace: tyfon.itea.ntnu.no 1076948204 21525 129.241.83.152 (16 Feb 2004 16:16:44 GMT) X-Complaints-To: usenet@itea.ntnu.no NNTP-Posting-Date: Mon, 16 Feb 2004 16:16:44 +0000 (UTC) User-Agent: slrn/0.9.8.0 (Linux) Xref: archiver1.google.com comp.lang.ada:5602 Date: 2004-02-16T16:16:44+00:00 List-Id: 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. -- "Saving keystrokes is the job of the text editor, not the programming language."