Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ukma!psuvm.bitnet!psuvmxa!cunyvm!byuvax!hallidayd From: hallidayd@yvax.byu.edu Newsgroups: comp.lang.fortran Subject: Re: Pointer examples and 8x Message-ID: <684hallidayd@yvax.byu.edu> Date: 8 Jul 89 05:23:23 GMT Lines: 77 Jim Giles (jlg@lanl.gov), concerning your desire for optional commas in declaration statements (message <13971@lanl.gov>): >From article <673hallidayd@yvax.byu.edu>, by hallidayd@yvax.byu.edu: >> Are we allowed to use (note the double colon) >> >> TYPE (NODE), POINTER :: FUNCTION ... > >Since FUNCTION is an attribute of the thing being declared and not part >of the thing being declared, the only consistent way to allow double colon >on function declarations would be: > > TYPE (NODE), POINTER, FUNCTION :: ... > Actually, the declaration is giving the TYPE of an entity which is a FUNCTION. While this is not much different from declaring an entity that has the FUNCTION attribute, when (an if), in the future, we are able to declare, for instance, arrays of functions (something that could be very helpful in programming multi-program multi-processor type parallel machines, as opposed to single-program multi-processor type machines for which the present Fortran proposal is well suited), the distinction will be significant. >By the way, I think the commas in the above ought to be optional. After >all, in Fortran 77, the following declaration is legal (in fact commas >_aren't_ allowed): > > INTEGER FUNCTION TEST (A... > >With the double colon this becomes: > > INTEGER FUNCTION :: TEST (A... > >I think commas should be optional before the double colon in _all_ >declarations. > >> [...] (A further >> note here concerning ambiguities, when the double colon form of declaration >> is used let's allow the user defined type to be used without the >> TYPE(user_type_name) construct---in fact, I would not mind if user defined >> type names are only allowed to be used in the double colon form of >> declaration statement.) > >I completely agree here. I would much prefer to see the following >differrences from the proposed syntax: > >>>> TYPE (NODE), POINTER :: HEAD, NEWNODE > NODE POINTER :: HEAD, NEWNODE >>>> TYPE (NODE), POINTER :: PTR > NODE POINTER :: PTR >etc. You can't have both the ability to use user defined types without the TYPE(user_type_name) construct, and optional commas, unless we have significant blanks (so they are not allowed in the middle of identifiers, like type names, and so the user is required to use the blank as a separator). While I have no objection to this, and such a source form is allowed in the proposed standard, we must maintain compatibility with the old fixed source form of FORTRAN 77 (and before) which allows blanks to be invisible. We could allow commas to be optional and the TYPE(user_type_name) construct dropped in "free" source form, while requiring commas for the older "fixed" source form, but this is an added complication that requires the programmer to use different rules for different source forms. Another possibility, if the Fortran 8x standards committee, and we as users, are truly sold on the idea that the "free" source form is the way of the future (I think some such form is indeed the way of the future) then we could restrict the more descriptive declaration statements to only be used in "free" source form, thus allowing for backward compatibility with _old_ FORTRAN, while moving to the future with the _new_ Fortran. (However, the _old_ FORTRAN community may not be willing to live with such a restriction.) _____________________________________ / David Halliday \ | | | Internet: hallidayd@yvax.byu.edu | | BITNET: hallidayd@byuvax | | Us Mail: BYU Physics Department | | 296 ESC | | Provo, UT 84602 | \_____________________________________/