Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!orion.oac.uci.edu!ucivax!ucla-cs!elroy.jpl.nasa.gov!sdd.hp.com!spool.mu.edu!uwm.edu!lll-winken!aunro!alberta!mts.ucs.UAlberta.CA!Al_Dunbar From: userAKDU@mts.ucs.UAlberta.CA (Al Dunbar) Newsgroups: comp.lang.fortran Subject: Re: Fortran 90 status Message-ID: Date: 3 May 91 03:20:50 GMT References: <1991Apr24.202115.16119@dragon.wpd.sgi.com> Organization: MTS Univ of Alberta Lines: 44 In article , maine@altair.dfrf.nasa.gov (Richard Maine) writes: >On 29 Apr 91 14:02:41 GMT, campbell@dev8n.mdcbbs.com (Tim Campbell) said: > >Tim> I do have one little thing I absolutely drives me nuts about >Tim> Fortran 77 and I hope it's been addressed: Prototyping! The fact >Tim> that any procedure can be called with any arguments (even if >Tim> they're wrong) and no errors are generated. > > ... > >Tim> Are you "in the know" on this one? Will Fortran 90 tell me if I >Tim> try to pass arguments to a subroutine which doesn't match the >Tim> type of arguments expected? > >Yep. Well, more properly the answer is "it depends." A number of others have already responded with comments about the Fortran 90 INTERFACE declarations, and how they will help ensure a match between your actual and dummy parameters. Fortran 90 also allows for optional parameters, and keyword parameters, a couple of related features that can help keep your code neat and clean. I can still recall using subroutines with way too many parameters, many of which were only used in certain cases. Now (well, actually at some time in the future) we will be able to leave out the optional parameters in the call statement or function reference instead of having to make up a bunch of phony variables and constants just to hold places Actual parameter lists will also be more self documenting if given in keyword form, i.e.: call drawvec(type='2d', xbgn=wl, ybgn=wb, & xend=wr, yend=wt) call drawvec(type='3d', xbgn=zx1, xend=zx2, & ybgn=zy1, yend=zy2, & zbgn=zz1, zend=zz2) Note that the order in which parameters appear is not fixed, so you can use any order that makes sense. -------------------+------------------------------------------- Al Dunbar | Edmonton, Alberta | Disclaimer: "I disclaim disclaimers" CANADA | -------------------+-------------------------------------------