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-Language: ENGLISH,ASCII X-Google-Thread: 103376,eec794b4d2e98e43,start X-Google-Attributes: gid103376,public X-Google-ArrivalTime: 2001-11-26 07:15:18 PST Path: archiver1.google.com!news2.google.com!news1.google.com!newsfeed.stanford.edu!newsfeeds.belnet.be!news.belnet.be!news1.ebone.net!news.ebone.net!news.net.uni-c.dk!not-for-mail From: Jacob Sparre Andersen Newsgroups: comp.lang.ada Subject: Problematic type definition in Interfaces.Fortran Date: Mon, 26 Nov 2001 16:15:14 +0100 Organization: Centre for Chaos and Turbulence Studies, Niels Bohr Institute Message-ID: <3C025C82.55727A37@nbi.dk> NNTP-Posting-Host: alf.nbi.dk Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.net.uni-c.dk 1006787715 15580 130.225.212.55 (26 Nov 2001 15:15:15 GMT) X-Complaints-To: usenet@news.net.uni-c.dk NNTP-Posting-Date: Mon, 26 Nov 2001 15:15:15 +0000 (UTC) X-Mailer: Mozilla 4.78 [en] (X11; U; OSF1 V4.0 alpha) X-Accept-Language: fo,da,no,sv,is,de,fr,en Xref: archiver1.google.com comp.lang.ada:16982 Date: 2001-11-26T16:15:14+01:00 List-Id: I have noticed what I consider a rather problematic type definition in package Interfaces.Fortran. RM B.5(9): type Complex is new Single_Precision_Complex_Types.Complex; Since package Ada.Numerics.Generic_Complex_Elementary_Functions is instantiated using an instantiation of package Ada.Numerics.Generic_Complex_Types, it is not possible to instantiate it for type Interfaces.Fortran.Complex. And authors of Fortran bindings (such as "lapada") have a habit of using type Interfaces.Fortran.Complex. :-( Here is a code example that illustrates the problem: ---------- with Ada.Numerics.Generic_Complex_Elementary_Functions; with Interfaces.Fortran; use Interfaces.Fortran; procedure Hack_Virker is package KomplekseFunktioner is new Ada.Numerics.Generic_Complex_Elementary_Functions (Interfaces.Fortran.Single_Precision_Complex_Types); use KomplekseFunktioner; Psi : Interfaces.Fortran.Single_Precision_Complex_Types.Complex; II : constant Interfaces.Fortran.Single_Precision_Complex_Types.Complex := (0.0, 1.0); begin -- Hack_Virker Psi := Exp(II); end Hack_Virker; ---------- The problem is that since "Interfaces.Fortran.Complex" is derived from "Interfaces.Fortran.Single_Precision_Complex_Types.Complex", and not just a subtype of "Interfaces.Fortran.Single_Precision_Complex_Types.Complex", there is no package to use for instantiating package Ada.Numerics.Generic_Complex_Elementary_Functions. Is there a very good reason for not making "Interfaces.Fortran.Complex" a subtype of "Interfaces.Fortran.Single_Precision_Complex_Types.Complex"? Jacob -- Sk�ne Sj�lland Linux User Group - http://www.sslug.dk/ N�ste m�de: IT-lovgivning. Tirsdag den 27. november 2001 i Symbion, Fruebjergvej 3.