Re: defining an arbitrary type in your newer Fortrans
- From: Reinhold Bader <Bader@xxxxxx>
- Date: Tue, 28 Nov 2006 19:09:16 +0100
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Issue (1) below is covered by doing
REAL(kind=rk)
and exchanging the module defining rk. Well, as long as you
don't wish to change over to INTEGER, or COMPLEX ...
Regards
Ancient_Hacker wrote:
Jan Vorbrüggen wrote:
P.S. I dont consider "derived types" a good substitute.Why not?
The textual edits, in C, that #define something for something else are a hack
to paste over C's inadequate type system. There is no need for such in
Fortran. Everything is nicely handled by derived types.
Jan
Jan, I'm no fan of C, but "typedef" is (slightly) more than a #define,
there is a little bit of compiler intelligence. Not much, but enough
to (barely) do the job.
I don't see anything directly comparable in Fortran.
maybe I miss something about derived types, but are they:
(1) NOT direct substitutes for built-in types. For example, it would
be nice to take a program sprinkled with "REAL" variable declarations,
and change some of the "REAL"s to "HighPrecisionFloatingType" and
others not so dainty to "UtilityFloatingType".
(2) derived types are really what we call structs or records, so you
cant have a simple scalar of that type without having to make up a
dummy member name that you have to keep repeating.
Maybe I'm missing something, but IMHO this is one of the first things
I'd want in Fortran, and no find it so far.
Just to confuse things some more, one CAN kludge it in a lot of
Fortrans that have a macro preprocessor option, but IMHO it's best to
avoid that if at all possible. Plus the preprocessor in CVF is mighty
smelly.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org
iD8DBQFFbHtMzwkB8vcRvCoRAnqjAKCBt3f0s0H7K29S7XfN8o684ot0gACeN4RK
VcArO+O+b/0jfclTZjPVPu4=
=MrpG
-----END PGP SIGNATURE-----
.
- References:
- defining an arbitrary type in your newer Fortrans
- From: Ancient_Hacker
- Re: defining an arbitrary type in your newer Fortrans
- From: Jan Vorbrüggen
- Re: defining an arbitrary type in your newer Fortrans
- From: Ancient_Hacker
- defining an arbitrary type in your newer Fortrans
- Prev by Date: Re: defining an arbitrary type in your newer Fortrans
- Next by Date: Re: defining an arbitrary type in your newer Fortrans
- Previous by thread: Re: defining an arbitrary type in your newer Fortrans
- Next by thread: Re: defining an arbitrary type in your newer Fortrans
- Index(es):
Relevant Pages
|