comp.lang.ada
 help / color / mirror / Atom feed
From: "Grein, Christoph (Fa. ESG)" <Christoph.Grein@eurocopter.com>
To: comp.lang.ada@ada-france.org
Subject: WG: Structured exception information
Date: Tue, 16 Jan 2007 12:06:30 +0100
Date: 2007-01-16T12:10:02+01:00	[thread overview]
Message-ID: <mailman.24.1168945740.18371.comp.lang.ada@ada-france.org> (raw)

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;



                 reply	other threads:[~2007-01-16 11:06 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox