home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!stanford.edu!snorkelwacker.mit.edu!ai-lab!life.ai.mit.edu!burley
- From: burley@apple-gunkies.gnu.ai.mit.edu (Craig Burley)
- Newsgroups: comp.lang.fortran
- Subject: Re: function name as an argument
- Date: 15 Dec 92 03:17:25
- Organization: Free Software Foundation 545 Tech Square Cambridge, MA 02139
- Lines: 46
- Message-ID: <BURLEY.92Dec15031725@apple-gunkies.gnu.ai.mit.edu>
- References: <1992Dec8.051134.5968@news.Hawaii.Edu>
- <ADK.92Dec12114449@ds2.sun13.SCRI.FSU.EDU>
- <1992Dec14.150347.17156@e2big.mko.dec.com>
- <1992Dec15.015958.26192@draco.macsch.com>
- NNTP-Posting-Host: apple-gunkies.gnu.ai.mit.edu
- In-reply-to: dnl@convex.is.macsch.com's message of Tue, 15 Dec 92 01:59:58 GMT
-
- In article <1992Dec15.015958.26192@draco.macsch.com> dnl@convex.is.macsch.com (David Lombard) writes:
-
- In article <1992Dec14.150347.17156@e2big.mko.dec.com> lionel@quark.enet.dec.com (Steve Lionel) writes:
-
- >Absolutely true. But even if you compiled all the routines together, what if
- >you added another caller of SUB which passed FUNC declared as a different
- >length? Unless you additionally require procedure inlining, there is no way
- >that SUB can know which routine called it and which length to statically
- >allocate. This is why the standard requires the length of a character
- >function to be declared as an integer constant expression in the program
- >unit which calls the function. And this is why an implementation (such as
- >VAX FORTRAN), which does allow the (*) in the referencing unit, passes the
- >length along with the routine address, so that it may do run-time allocation
- >for the function result.
- >
- NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO NO!
- [useless repetitions of above line deleted]
-
- PLEASE, read sections 8.4.2 and 15.9.3.1 of the standard. They explain why
- all implementations of the language must maintain and pass around the
- length of each character variable. All implementations must allow the (*)
- in subprograms. This is not some mystical example of the great god VMS.
- If an implementation does not support (*), then it is simply non-conforming.
-
- This is a case of _your_ not reading the subject heading. The discussion
- is about passing character _functions_, not _variables_. It _is_
- standard-conforming for an implementation to not support CHARACTER*(*) CFUNC
- if the program unit does CFUNC(...) anywhere.
-
- A word to the wise, the standard is not a document one can casually read.
-
- Neither, apparently, is a USENET posting. :-)
-
- The information is `scattered' throughout the document. One must `swim'
- in the standard to understand it. This is not meant as an impeachment of
- the standard, just a statement of fact.
-
- Or, one could read the subject heading if one is unwilling to read through
- earlier portions of the thread. :-)
-
- Admittedly, this kind of confusion is one of the reasons we all love
- Fortran so much. :-)
- --
-
- James Craig Burley, Software Craftsperson burley@gnu.ai.mit.edu
- Member of the League for Programming Freedom (LPF) lpf@uunet.uu.net
-