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, WEIRD_PORT autolearn=unavailable autolearn_force=no version=3.4.4 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 103376,1ea92c0e5255811d X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2003-03-01 02:01:45 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!logbridge.uoregon.edu!fr.usenet-edu.net!usenet-edu.net!enst.fr!not-for-mail From: Zheng Long Gen Newsgroups: comp.lang.ada Subject: A question relating to package interfaces.fortran Date: Sat, 1 Mar 2003 18:02:23 +0800 Organization: ENST, France Message-ID: References: <5d6fdb61.0302250317.c49d71a@posting.google.com> Reply-To: "comp.lang.ada mail to news gateway" NNTP-Posting-Host: marvin.enst.fr Mime-Version: 1.0 Content-Type: text/plain; charset="gb18030" Content-Transfer-Encoding: quoted-printable X-Trace: avanie.enst.fr 1046512905 16554 137.194.161.2 (1 Mar 2003 10:01:44 GMT) X-Complaints-To: usenet@enst.fr NNTP-Posting-Date: Sat, 1 Mar 2003 10:01:44 +0000 (UTC) To: "comp.lang.ada mail to news gateway" Return-Path: User-Agent: KMail/1.4.1 In-Reply-To: X-BeenThere: comp.lang.ada@ada.eu.org X-Mailman-Version: 2.1 Precedence: list List-Id: comp.lang.ada mail to news gateway List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Xref: archiver1.google.com comp.lang.ada:34761 Date: 2003-03-01T18:02:23+08:00 Hi, all, Forgive my ignorance, if this is a repeated post. In the following code, one tries to do math calculation on values of=20 complex types defined in interfaces.fortran.=20 ----------------------------------------------------------------------- with Interfaces.Fortran; use Interfaces.Fortran; with Ada.Numerics.Generic_Complex_Elementary_Functions; procedure Complex_Type is package Complex_Elementary_Functions is=20 new Ada.Numerics.Generic_Complex_Elementary_Functions (Single_Precision_Complex_Types); use Complex_Elementary_Functions; C1,c2:Complex:=3D(0.5,0.0); begin C2:=3DSin(C1); end; ------------------------------------------------------------------------ Compiling this piece of code(gnat 3.13p, Redhat 7.3.2) will result in th= e=20 following message: gnatgcc -c -g -gnatq complex_type.adb complex_type.adb:10:12: expected type=20 "Ada.Numerics.Generic_Complex_Types.Complex" from instance at i-fortra.ad= s:37 complex_type.adb:10:12: found type "Interfaces.Fortran.Complex" package interfaces.fortran defines types to interface with fortran=20 subprograms. The complex type is defined in the following way: (from RM= =20 B.5) -------------------------------------------------------------------------= -- package Single_Precision_Complex_Types is new Ada.Numerics.Generic_Complex_Types (Real); type Complex is new Single_Precision_Complex_Types.Complex; subtype Imaginary is Single_Precision_Complex_Types.Imaginary; -------------------------------------------------------------------------= --- The problem is :=20 Type complex is a new type. It is different from its ancester defined= in=20 single_precision_complex_types. It should be a subtype of=20 single_precision_complex_types.complex , just like the definition of "sub= type=20 Imaginary". Otherwise, it is totally useless. What do you think of it? Many thanks in advance. zhenggen 20020301