Re: What's the purpose of explicit interfaces? (Pun intended?)
- From: "N. Shamsundar" <shamsundar_at_@xxxxxx>
- Date: Sun, 19 Mar 2006 12:32:57 -0600
Michael Metcalf wrote:
"Joe Krahn" <jkrahn@xxxxxxxxx> wrote in message news:yMXSf.39900$915.37925@xxxxxxxxxxxxxxxxxxx^^^^^^^An explicit interface seems useful, but it makes sense to put it in an include file and allow the described routines to include the definitions to verify them, as in C. It seems that the usual idea is to use modules instead of definition headers. So, what is the use of writing out an explicit interface? If it is sometimes useful, why not allow the described routine to include and validate the accuracy of that definition?
Usually, an explicit interface is defined by placing the procedure in question within a module or using it as an internal procedure. No further work is necessary. The only time that it should be spelled out is when it defines the interface of a procedure argument (MR&C, Section 5.12), or when dealing with external procedures from legacy Fortran 77. Even there, an eternal statement would suffice but allows no checks to be made.
Now _there_ is a new statement that could be considered for inclusion in the next revision of Fortran 2xxx ! The declaration
ETERNAL <subname> (<arguments)
would put the compiler on notice that it should compile the code that follows in such a way that subsequent linking to `eternal' (= F77 ? F64 ? F II ?) legacy code should work correctly; this would be somewhat analogous to the C++ declaration
extern "C" {...}
Regards,
MikecMetcalf
N. Shamsundar
University of Houston
.
- Follow-Ups:
- Re: What's the purpose of explicit interfaces? (Pun intended?)
- From: Ben Hetland
- Re: What's the purpose of explicit interfaces? (Pun intended?)
- From: James Giles
- Re: What's the purpose of explicit interfaces? (Pun intended?)
- References:
- What's the purpose of explicit interfaces?
- From: Joe Krahn
- Re: What's the purpose of explicit interfaces?
- From: Michael Metcalf
- What's the purpose of explicit interfaces?
- Prev by Date: Re: What's the purpose of explicit interfaces?
- Next by Date: Re: What's the purpose of explicit interfaces?
- Previous by thread: Re: What's the purpose of explicit interfaces?
- Next by thread: Re: What's the purpose of explicit interfaces? (Pun intended?)
- Index(es):
Relevant Pages
|
|