From: Zheng Long Gen <zhenggen@public1.ptt.js.cn>
To: "comp.lang.ada mail to news gateway" <comp.lang.ada@ada.eu.org>
Subject: A question relating to package interfaces.fortran
Date: Sat, 1 Mar 2003 18:02:23 +0800
Date: 2003-03-01T18:02:23+08:00 [thread overview]
Message-ID: <mailman.14.1046512903.1343.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: <slrnb5rvks.3nb.randhol+news@kiuk0152.chembio.ntnu.no>
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="gb18030", Size: 1954 bytes --]
Hi, all,
Forgive my ignorance, if this is a repeated post.
In the following code, one tries to do math calculation on values of
complex types defined in interfaces.fortran.
-----------------------------------------------------------------------
with Interfaces.Fortran;
use Interfaces.Fortran;
with Ada.Numerics.Generic_Complex_Elementary_Functions;
procedure Complex_Type is
package Complex_Elementary_Functions is
new Ada.Numerics.Generic_Complex_Elementary_Functions
(Single_Precision_Complex_Types);
use Complex_Elementary_Functions;
C1,c2:Complex:=(0.5,0.0);
begin
C2:=Sin(C1);
end;
------------------------------------------------------------------------
Compiling this piece of code(gnat 3.13p, Redhat 7.3.2) will result in the
following message:
gnatgcc -c -g -gnatq complex_type.adb
complex_type.adb:10:12: expected type
"Ada.Numerics.Generic_Complex_Types.Complex" from instance at i-fortra.ads:37
complex_type.adb:10:12: found type "Interfaces.Fortran.Complex"
package interfaces.fortran defines types to interface with fortran
subprograms. The complex type is defined in the following way: (from RM
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 :
Type complex is a new type. It is different from its ancester defined in
single_precision_complex_types. It should be a subtype of
single_precision_complex_types.complex , just like the definition of "subtype
Imaginary". Otherwise, it is totally useless. What do you think of it?
Many thanks in advance.
zhenggen
20020301
next prev parent reply other threads:[~2003-03-01 10:02 UTC|newest]
Thread overview: 166+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-02-25 11:17 Container libraries Jano
2003-02-25 15:48 ` Preben Randhol
2003-02-25 19:26 ` Jano
2003-02-26 17:51 ` Jean-Pierre Rosen
2003-02-27 12:04 ` Preben Randhol
2003-02-28 7:27 ` Jean-Pierre Rosen
2003-03-01 12:29 ` Marin David Condic
2003-03-01 18:20 ` tmoran
2003-03-03 12:56 ` Marin David Condic
2003-03-03 15:53 ` Way OT: Adam Smith and Software Markets Frank J. Lhota
2003-03-03 18:16 ` Marin David Condic
2003-03-03 18:46 ` Preben Randhol
2003-03-03 21:03 ` Robert C. Leif
2003-03-04 12:59 ` Marin David Condic
2003-03-04 13:32 ` Larry Kilgallen
2003-03-05 12:46 ` Marin David Condic
2003-03-04 13:42 ` Preben Randhol
2003-03-04 15:32 ` Frank J. Lhota
2003-03-04 16:05 ` Preben Randhol
2003-03-05 1:59 ` Frank J. Lhota
2003-03-05 7:54 ` Pascal Obry
2003-03-05 13:25 ` Preben Randhol
2003-03-05 16:21 ` Pascal Obry
2003-03-05 16:28 ` Preben Randhol
2003-03-05 21:43 ` Pascal Obry
2003-03-06 7:12 ` Preben Randhol
2003-03-05 15:46 ` Frank J. Lhota
2003-03-05 13:24 ` Preben Randhol
2003-03-05 17:09 ` Way OT: Email/Browser clients Warren W. Gay VE3WWG
2003-03-05 20:34 ` Georg Bauhaus
2003-03-06 7:10 ` Preben Randhol
2003-03-06 17:48 ` Warren W. Gay VE3WWG
2003-03-05 13:01 ` Way OT: Adam Smith and Software Markets Marin David Condic
2003-03-05 13:37 ` Preben Randhol
2003-03-06 12:34 ` Marin David Condic
2003-03-06 13:28 ` Ludovic Brenta
2003-03-06 17:20 ` Robert C. Leif
2003-03-06 16:48 ` Preben Randhol
2003-03-11 22:57 ` Faust
2003-03-11 22:55 ` Faust
2003-03-12 7:44 ` Preben Randhol
2003-03-12 8:40 ` Samuel Tardieu
2003-03-12 8:57 ` Preben Randhol
2003-03-04 19:02 ` Robert C. Leif
2003-03-05 17:36 ` Warren W. Gay VE3WWG
2003-03-04 19:44 ` Georg Bauhaus
2003-03-05 13:13 ` Marin David Condic
2003-03-05 19:11 ` tmoran
2003-03-05 20:31 ` Georg Bauhaus
2003-03-06 12:51 ` Marin David Condic
2003-03-04 23:41 ` Robert C. Leif
2003-03-04 10:10 ` Dmitry A. Kazakov
2003-03-04 15:40 ` Frank J. Lhota
2003-03-04 15:58 ` Preben Randhol
2003-03-04 16:35 ` Frank J. Lhota
2003-03-04 16:59 ` Preben Randhol
2003-03-04 19:47 ` Georg Bauhaus
2003-03-04 20:14 ` Samuel Tardieu
2003-03-04 22:36 ` Georg Bauhaus
2003-03-04 18:39 ` tmoran
2003-03-05 15:47 ` Ted Dennison
2003-03-06 11:34 ` Samuel Tardieu
2003-03-05 11:18 ` Dmitry A. Kazakov
2003-03-05 15:39 ` Ted Dennison
2003-03-06 8:50 ` Dmitry A. Kazakov
2003-03-04 16:44 ` Richard Riehle
2003-03-04 18:04 ` Frank J. Lhota
2003-03-04 19:53 ` Way OT: Adam Smith and Software Markets/Word Processing Georg Bauhaus
2003-03-04 21:22 ` Simon Wright
2003-03-04 22:43 ` Georg Bauhaus
2003-03-05 13:12 ` Way OT: Adam Smith and Software Markets Preben Randhol
2003-03-04 19:02 ` Robert C. Leif
2003-03-04 19:59 ` Georg Bauhaus
2003-03-05 3:07 ` Document Engineering was " Robert C. Leif
2003-03-06 22:08 ` Georg Bauhaus
2003-03-07 3:19 ` Document Engineering was RE: Way OT: Adam Smith and SoftwareMarkets Robert C. Leif
2003-03-07 15:12 ` Georg Bauhaus
2003-03-06 22:41 ` Document Engineering was RE: Way OT: Adam Smith and Software Markets Georg Bauhaus
2003-03-07 3:19 ` Document Engineering was RE: Way OT: Adam Smith and SoftwareMarkets Robert C. Leif
2003-03-06 18:02 ` Way OT: Adam Smith and Software Markets Jason
2003-03-07 3:19 ` Robert C. Leif
2003-03-07 8:00 ` Preben Randhol
2003-03-07 8:09 ` Preben Randhol
2003-03-07 13:32 ` Hyman Rosen
2003-03-07 14:06 ` Samuel Tardieu
2003-03-07 14:51 ` Hyman Rosen
2003-03-08 5:31 ` tmoran
2003-03-08 13:26 ` Larry Kilgallen
2003-03-08 17:57 ` tmoran
2003-03-09 4:06 ` Frank J. Lhota
2003-03-10 3:22 ` tmoran
2003-03-09 7:35 ` Hyman Rosen
2003-03-09 13:56 ` Marin David Condic
2003-03-09 18:29 ` Richard Riehle
2003-03-09 18:29 ` Jeffrey Creem
2003-03-09 19:08 ` Robert C. Leif
2003-03-10 0:35 ` Richard Riehle
2003-03-09 23:48 ` Marin David Condic
2003-03-11 11:07 ` Georg Bauhaus
2003-03-11 18:08 ` Hyman Rosen
2003-03-11 18:40 ` Preben Randhol
2003-03-12 16:44 ` Georg Bauhaus
2003-03-07 15:22 ` Stanley R. Allen
2003-03-07 15:32 ` Samuel Tardieu
2003-03-07 16:01 ` Hyman Rosen
2003-03-07 18:34 ` Jason
2003-03-07 19:35 ` Hyman Rosen
2003-03-11 12:22 ` Georg Bauhaus
2003-03-11 16:22 ` Richard Riehle
2003-03-11 18:03 ` Preben Randhol
2003-03-11 18:14 ` Hyman Rosen
2003-03-17 7:00 ` David Thompson
2003-03-12 8:07 ` tmoran
2003-03-12 15:41 ` Frank J. Lhota
2003-03-12 16:09 ` Hyman Rosen
2003-03-12 18:37 ` tmoran
2003-03-12 19:13 ` Hyman Rosen
2003-03-13 18:21 ` Jason
2003-03-13 19:04 ` Hyman Rosen
2003-03-07 23:44 ` Robert C. Leif
2003-03-09 7:37 ` Hyman Rosen
2003-03-07 19:24 ` Frank J. Lhota
2003-03-07 19:48 ` Advertisment for Ada (was Re: Way OT: Adam Smith and Software Markets) Preben Randhol
2003-03-08 16:02 ` Marin David Condic
2003-03-08 18:58 ` Larry Kilgallen
2003-03-10 11:03 ` Peter Hermann
2003-03-10 18:43 ` Adam Ruth
2003-03-11 8:33 ` Preben Randhol
2003-03-11 8:58 ` Advertisment for Ada Lutz Donnerhacke
2003-03-11 9:05 ` Preben Randhol
2003-03-11 10:10 ` Lutz Donnerhacke
2003-03-11 12:26 ` Georg Bauhaus
2003-03-11 16:27 ` Richard Riehle
2003-03-11 18:07 ` Preben Randhol
2003-03-11 23:19 ` Faust
2003-03-12 5:55 ` Hide Ada's DOD/military connection (Re: Advertisment for Ada) Faust
2003-03-12 16:21 ` Hyman Rosen
2003-03-12 20:16 ` Mike Silva
2003-03-12 21:30 ` Larry Kilgallen
2003-03-12 17:59 ` Advertisment for Ada Steve
2003-03-13 23:36 ` Faust
2003-03-12 10:24 ` Victor Porton
2003-03-08 16:22 ` Way OT: Adam Smith and Software Markets Stanley R. Allen
2003-03-09 7:30 ` Hyman Rosen
2003-03-02 18:04 ` Container libraries Georg Bauhaus
2003-03-01 13:43 ` Preben Randhol
2003-03-03 8:38 ` Dmitry A. Kazakov
2003-03-01 10:02 ` Zheng Long Gen [this message]
2003-02-27 12:47 ` Marin David Condic
2003-02-25 22:07 ` Simon Wright
2003-02-25 23:09 ` Hyman Rosen
2003-02-26 2:21 ` Chad R. Meiners
2003-03-02 9:06 ` steve_H
2003-03-02 12:06 ` Hyman Rosen
2003-03-02 20:17 ` Simon Wright
2003-02-26 18:17 ` Jano
2003-02-26 19:27 ` Simon Wright
2003-02-26 23:10 ` Jeffrey Carter
2003-02-27 8:13 ` Dmitry A. Kazakov
2003-02-26 1:51 ` Jeffrey Carter
2003-02-26 18:17 ` Jano
2003-02-26 8:25 ` Dmitry A. Kazakov
2003-02-26 18:51 ` Stephen Leake
2003-02-26 19:39 ` Martin Krischik
2003-02-27 17:19 ` Matthew Heaney
2003-02-28 18:28 ` Martin Krischik
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox