home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!sun-barr!ames!agate!darkstar.UCSC.EDU!fast!sla
- From: sla@fast.ucsc.edu (Steve Allen)
- Newsgroups: comp.lang.fortran
- Subject: summary (was Fortran 90: Pointers to Functions?)
- Date: 18 Aug 1992 06:46:05 GMT
- Organization: UCO/Lick Observatory
- Lines: 31
- Message-ID: <16q6bdINNpqh@darkstar.UCSC.EDU>
- NNTP-Posting-Host: fast.ucsc.edu
- Summary: like I said
-
- This is the final summary of all gleaned wisdom on the topic of
- Pointers to Functions in Fortran 90.
-
- Fortran 90 does not have anything which matches the concept of pointers
- to functions as in the C language. It does have the ability to pass
- single functions into another function using the EXTERNAL declaration;
- this is the same as in the Fortran 77 syntax.
-
- This means that it is not possible to have "arrays of functions" or
- "structures containing an element which is a function" as in C.
-
- It is also not clear just what the meaning of a "pointer to a function"
- would be on some kinds of multi-processor systems.
-
- klassen@sol.UVic.CA (Melvin Klassen) points out that with some Fortran 77s it
- is possible to fake this functionality by making use of argument mismatch.
- This might be accomplished by passing a function into some other routine
- using EXTERNAL and withing the receiving routine declaring that dummy
- argument to be an INTEGER which stores the received value. With some
- Fortran compilers this may require a non-Fortran intermediary because
- the EXTERNAL may be passed "by value" rather than "by reference".
-
- It is not clear whether this kind of cheating will actually work with
- the new "vector-valued functions" of Fortran 90.
-
- Overall this subject has provoked remarkably little response, and I'm
- gonna shut up and keep working on the (Fortran 77) code for my thesis.
- _______________________________________________________________________________
- Steve Allen | That was the equation! | sla@helios.ucsc.edu
- UCO/Lick Observatory | Existence!...Survival must | If the UC were opining,
- Santa Cruz, CA 95064 | cancel out programming! -- Ruk | it wouldn't tell me.
-