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: a07f3367d7,4ce5890331a5b529 X-Google-Attributes: gida07f3367d7,public,usenet X-Google-NewGroupId: yes X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!feeder.news-service.com!newsfeed.straub-nv.de!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: "J-P. Rosen" Newsgroups: comp.lang.ada Subject: Re: Discriminants of tagged types Date: Wed, 27 Oct 2010 15:54:17 +0200 Organization: Adalog Message-ID: References: <14314714-e92c-4036-9cbb-da8e72489261@h7g2000yqn.googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit Injection-Date: Wed, 27 Oct 2010 13:54:19 +0000 (UTC) Injection-Info: mx01.eternal-september.org; posting-host="O1RkH+WVNUV47UyqsXe2BA"; logging-data="13162"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1+d7b6NcrnweiM+HTho+FZi" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; fr; rv:1.9.2.11) Gecko/20101013 Thunderbird/3.1.5 In-Reply-To: <14314714-e92c-4036-9cbb-da8e72489261@h7g2000yqn.googlegroups.com> Cancel-Lock: sha1:wPFZo6qNACMnabNs/zpVGIjIOG8= Xref: g2news1.google.com comp.lang.ada:14831 Date: 2010-10-27T15:54:17+02:00 List-Id: Le 27/10/2010 14:16, Maciej Sobczak a �crit : [...] > GNAT says that discriminants of tagged types cannot have default > values. and it is right. > I find it disturbing and artificial, but perhaps I don't see the big > picture. What is the rationale for this limitation? Default values of discriminants are not "just" default values: they define another form of record, the polymorphic record. Tagged types define a different kind of polymorphism, through inheritance. Having two orthogonal kinds of polymorphism in the same data structure would be difficult to manage, both from a design and an implementation point of view. -- --------------------------------------------------------- J-P. Rosen (rosen@adalog.fr) Adalog a d�m�nag� / Adalog has moved: 2 rue du Docteur Lombard, 92441 Issy-les-Moulineaux CEDEX Tel: +33 1 45 29 21 52, Fax: +33 1 45 29 25 00