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,437103ff8a92c0df X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!news1.google.com!proxad.net!proxad.net!newsfeed.arcor.de!news.arcor.de!not-for-mail Date: Tue, 01 Mar 2005 20:47:24 +0100 From: Georg Bauhaus Organization: future apps GmbH User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5) Gecko/20050105 Debian/1.7.5-1 X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: generics and records References: <1109532840.857126.234720@z14g2000cwz.googlegroups.com> <8065486.gdOUxkNXWZ@linux1.krischik.com> In-Reply-To: <8065486.gdOUxkNXWZ@linux1.krischik.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <4224c698$0$24941$9b4e6d93@newsread2.arcor-online.net> NNTP-Posting-Date: 01 Mar 2005 20:46:32 MET NNTP-Posting-Host: c04d9746.newsread2.arcor-online.net X-Trace: DXC=Y3^ngR9L]2;_78OXD477\?Q5U85hF6f;4jW\KbG]kaM8ea\9g\;7Nm5WcD6oTfb^48UUng9_FXZ=3>:=P9Ihe`B8@Z?dZ]MOid5 X-Complaints-To: abuse@arcor.de Xref: g2news1.google.com comp.lang.ada:8574 Date: 2005-03-01T20:46:32+01:00 List-Id: Martin Krischik wrote: >>generic >> type x is private; > > > You need a common ancestor class for this construct to work: > > type x is new y with private; > > >>package ... >>private >> type xx is new x; >>end ... Yes and no. The actual parameter is not a record in the following example (Natural), but it could be one. procedure P is generic type X is private; package G is type Y is new X; -- disallow multiplication and division in type Y function "*"(a, b: Y) return Y is abstract; function "/"(a, b: Y) return Y is abstract; end G; package I is new G(Natural); use I; v: Y := 1; begin v := v + 1; end P;