Re: Templating by type
From: Richard Maine (nospam_at_see.signature)
Date: 12/31/03
- Next message: Richard Maine: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- Previous message: Athanasios Migdalas: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- In reply to: David Frank: "Re: Templating by type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 08:00:22 -0800
"David Frank" <dave_frank@hotmail.com> writes:
> Perhaps this demo of CVF's sortqq I posted in another newsgroup
> today provides a SEMI-generic solution.
Of course, that illustrates *CALLING* procedure provided by the compiler,
while the OP wanted to know how to write such a procedure. I don't see
how this tells anyone much about how to write such a thing.
It also uses a nonstandard feature (the loc function), but that's
secondary for current purposes...and it is a useful feature not too
different from the c_loc in f2003. But even with loc or c_loc, the
code to implement the procedure ends up with a very similar problem to
the OP's original question. Somewhere in sortqq (likely a level down
from it) is almost bound to be the equivalent of a Fortran SELECT
CASE, where there is a separate copy of the code for each type.
The general question has been discussed here several times. The
include facility can sometimes be used as illustrated by the OP
(and by Metcalf). In F2003 (draft) you can do things along this line
with type extension, though whether that fits with the particular
problem at hand would take more details (and there are no full
f2003 compilers out yet; NAG's latest release does have type
extension, but doesn't have all the other "goodies" that you'd
likely want to make full use of the feature.) Several people
have discussed proposals on other features along this line,
but none of them are currently in the language (or in the F2003
draft).
-- Richard Maine | Good judgment comes from experience; email: my first.last at org.domain | experience comes from bad judgment. org: nasa, domain: gov | -- Mark Twain
- Next message: Richard Maine: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- Previous message: Athanasios Migdalas: "Re: Lahey 6.2 vs Intel 5.0 module compilation: Who is right?"
- In reply to: David Frank: "Re: Templating by type"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|