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=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Thread: 103376,d3da40ad8c16665,start X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news2.google.com!news3.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!news.tele.dk!small.news.tele.dk!news.astraweb.com!newsrouter-eu.astraweb.com!proxad.net!cleanfeed1-b.proxad.net!nnrp7-2.free.fr!not-for-mail Return-Path: Date: Tue, 16 Jan 2007 12:06:30 +0100 From: "Grein, Christoph (Fa. ESG)" Subject: WG: Structured exception information To: comp.lang.ada@ada-france.org MIME-version: 1.0 X-MIMEOLE: Produced By Microsoft Exchange V6.5 Content-Type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-class: urn:content-classes:message Thread-topic: Structured exception information Thread-index: Acc5TkIcT0ZJIx+pTeWNxsrSDi+e7QADZRcwAACRNrA= X-MS-Has-Attach: X-MS-TNEF-Correlator: X-OriginalArrivalTime: 16 Jan 2007 11:07:17.0231 (UTC) FILETIME=[7BEEDFF0:01C7395E] X-Virus-Scanned: amavisd-new at ada-france.org X-BeenThere: comp.lang.ada@ada-france.org X-Mailman-Version: 2.1.9rc1 Precedence: list List-Id: "Gateway to the comp.lang.ada Usenet newsgroup" List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.ada Message-ID: X-Leafnode-NNTP-Posting-Host: 88.191.17.134 Organization: Guest of ProXad - France NNTP-Posting-Date: 16 Jan 2007 12:10:02 MET NNTP-Posting-Host: 88.191.14.223 X-Trace: 1168945802 news-3.free.fr 22780 88.191.14.223:40924 X-Complaints-To: abuse@proxad.net Xref: g2news2.google.com comp.lang.ada:8162 Date: 2007-01-16T12:10:02+01:00 Note that the full type need not have a discriminant: package P is type T (<>) is private; function Constructor (S: String) return T; private type T is record null; end record; end P; Your program seems correct with a little change, however return of limited types is not yet implemented in Gnat: private with Ada.Finalization; package P is type T (<>) is limited private; function Constructor (S: String) return T; private type T (I: Integer) is new Ada.Finalization.Limited_Controlled with record null; end record; end P; package body P is function Constructor (S: String) return T is begin return (Ada.Finalization.Limited_Controlled with I => 0); end Constructor; end P; with P; procedure Hello is X: P.T := P.Constructor ("some params"); begin null; end Hello;