home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / lang / fortran / 4715 < prev    next >
Encoding:
Internet Message Format  |  1992-12-15  |  3.0 KB

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